getFieldValue('DAYS_DONT_AUTH'); if(!is_numeric($daysDontAuth)) $daysDontAuth = 90; $dateFrom = new \Bitrix\Main\Type\DateTime; $dateTo = new \Bitrix\Main\Type\DateTime; $dateFrom->setTime(0, 0, 0)->add('-' . $daysDontAuth . ' days'); $dateTo->setTime(0, 0, 0)->add('1 days')->add('-' . $daysDontAuth . ' days'); if($this->isRunForOldData()) { $filter = array( '!LAST_LOGIN' => null, ' $dateTo, ); } else { $filter = array( '>LAST_LOGIN' => $dateFrom, ' $dateTo, ); } $filter['=ACTIVE'] = true; $userListDb = \Bitrix\Main\UserTable::getList(array( 'select' => array('EMAIL', 'ID', 'NAME'), 'filter' => $filter, 'order' => array('ID' => 'ASC') )); if($userListDb->getSelectedRowsCount() > 0) { $userListDb->addFetchDataModifier(array($this, 'getFetchDataModifier')); $this->recipient = $userListDb; return true; } else return false; } public function getRecipient() { return $this->recipient; } public function getForm() { $daysDontAuth = ' '; return '
'.Loc::getMessage('sender_trigger_user_dontauth_days').' '.$daysDontAuth.'
'; } public function getFetchDataModifier($fields) { if(isset($fields['ID'])) { $fields['USER_ID'] = $fields['ID']; unset($fields['ID']); } return $fields; } }