/** * @return void */ public function baseInit() { $this->setAttrib('id', 'mail_tester_form'); $this->addElement('select', 'env_type', array('label' => 'Tryb pracy', 'multioptions' => array(0 => 'Testy', 1 => 'Produkcja'))); $this->addElement('select', 'confidental_type', array('label' => 'Poufność', 'multioptions' => array('off' => 'off', 'on' => 'on'))); $model = new Wsservice(); $servicesRaw = $model->getServicesByGroupHash('mail'); $services = array(); foreach ($servicesRaw as $val) { $services[$val->service_hash] = $val->service_name; } $this->addElement('select', 'mail_account', array('label' => 'Konto pocztowe', 'multioptions' => $services)); $this->addElement('select', 'mail_mode', array('label' => 'Usługi', 'multioptions' => array('text' => 'e-mail', 'template' => 'e-mail (szablon)', 'package' => 'Wyslanie serii wiadomości e-mail'))); $this->addElement('text', 'recipient_mail', array('label' => 'Adres odbiorcy', 'validators' => array(new Zend_Validate_EmailAddress()))); $priorities = array(); for ($x = 32; $x > -33; $x--) { $priorities[strval($x)] = $x; } $this->addElement('select', 'priority', array('label' => 'Priorytet wiadomości', 'multioptions' => $priorities)); $this->getElement('priority')->setValue(0); $this->addElement('text', 'mail_subject', array('label' => 'Temat')); $this->addElement('text', 'template_name', array('label' => 'Nazwa szablonu')); $this->addElement('select', 'template_mode', array('label' => 'Tryb użycia szablonu', 'multioptions' => array(0 => 'Użycie istniejącego szablonu', 1 => 'Wprowadzenie nowego szablonu', 2 => 'Siłowe wprowadzenie nowego szablonu'))); $this->addElement('select', 'content_format', array('label' => 'Format wiadomości', 'multiOptions' => array(0 => 'Tekst', 1 => 'HTML'))); $this->addElement('textarea', 'mail_content', array('label' => 'Treść wiadomości')); $this->addElement('textarea', 'package_recipients', array('label' => 'Odbiorcy (format: NUMER=INDYWIDUALNA WIADOMOŚĆ\\n)')); $this->addElement('textarea', 'template_params', array('label' => 'Parametry (format: KEY=VALUE\\n)')); $this->addElement('textarea', 'template_params_conf', array('label' => 'Parametry poufne (format: KEY=VALUE\\n)')); $this->submit(false, 'submit', 'Wyślij'); $this->reset(); }
/** * @return void */ public function baseInit() { $this->setAttrib('id', 'sms_tester_form'); $this->addElement('select', 'env_type', array('label' => 'Tryb pracy', 'multioptions' => array(0 => 'Testy', 1 => 'Produkcja'))); $this->addElement('select', 'confidental_type', array('label' => 'Poufność', 'multioptions' => array('off' => 'off', 'on' => 'on'))); $model = new Wsservice(); $accounts = array(); $accountsRaw = $model->getServicesByGroupHash('sms'); foreach ($accountsRaw as $val) { $accounts[$val->service_hash] = $val->service_name; } $this->addElement('select', 'sms_account', array('label' => 'Konto SMS', 'multiOptions' => $accounts)); $this->addElement('select', 'sms_mode', array('label' => 'Usługi', 'multioptions' => array('text' => 'SMS', 'template' => 'SMS (szablon)', 'infomany' => 'Informacja o wysłanych SMS', 'package' => 'Wyslanie serii SMS', 'packageinfo' => 'Informacja o rozsyłce'))); $this->addElement('text', 'recipient_number', array('label' => 'Numer odbiorcy')); $this->addElement('text', 'template_name', array('label' => 'Nazwa szablonu')); $this->addElement('select', 'template_mode', array('label' => 'Tryb użycia szablonu', 'multioptions' => array(0 => 'Użycie istniejącego szablonu', 1 => 'Wprowadzenie nowego szablonu', 2 => 'Siłowe wprowadzenie nowego szablonu'))); $this->addElement('textarea', 'sms_content', array('label' => 'Treść wiadomości')); $this->addElement('textarea', 'package_recipients', array('label' => 'Odbiorcy (format: NUMER=INDYWIDUALNA WIADOMOŚĆ\\n)')); $this->addElement('textarea', 'template_params', array('label' => 'Parametry (format: KEY=VALUE\\n)')); $this->addElement('textarea', 'template_params_conf', array('label' => 'Parametry poufne (format: KEY=VALUE\\n)')); $this->addElement('text', 'sms_id', array('label' => 'ID sms do odpytania')); $this->addElement('textarea', 'sms_ids', array('label' => 'ID sms do odpytania, separator: ;')); $this->addElement('text', 'package_id', array('label' => 'ID rozsyłki do odpytania')); $this->submit(false, 'submit', 'Wyślij'); $this->reset(); }
/** * @return void */ public function baseInit() { $this->phone(); $this->getElement("phone")->setRequired(false); $this->datee(false, 'send_start', 'Data od', false); $this->datee(false, 'send_end', 'Data do', false); $this->send_start->class = $this->send_end->class = 'datepicker-present'; $this->addElement('text', 'author_name', array('label' => 'Użytkownik')); if ($this->_isShipment) { $WsServiceSetModel = new WsServiceSet(); $WsServiceSetArray = $WsServiceSetModel->fetchAll(array('ghost = false', 'status = ' . Logic_Ws_ServiceSet_ServiceSet::STATE_ACTIVE))->toArray(); foreach ($WsServiceSetArray as $set) { $WsServiceSets[$set['id']] = $set['name'] . ' (' . $set['hash'] . ')'; } $this->addElement('select', 'name', array('label' => 'Nazwa wysyłki', 'MultiOptions' => $this->addClearStart($WsServiceSets))); } else { $WsServiceModel = new Wsservice(); $WsServiceArray = $WsServiceModel->getServicesByGroupHash('sms')->toArray(); foreach ($WsServiceArray as $set) { $WsService[$set['id']] = $set['service_name']; } $this->addElement('select', 'name', array('label' => 'Nazwa usługi', 'MultiOptions' => $this->addClearStart($WsService))); } $this->search(); $this->cancel(false, 'cancel', 'Clear'); }
/** * @return void */ public function baseInit() { $model = new Wsclient(); $result = $model->fetchAll($model->select()->order('client_name'))->toArray(); $clients = array(0 => ''); foreach ($result as $val) { $clients[$val['id']] = $val['client_name']; } $this->addElement('select', 'public_ws_client_id', array('label' => 'Klient', 'multiOptions' => $clients)); $model = new Wsservice(); $result = $model->fetchAll($model->select()->order('service_name'))->toArray(); $services = array(0 => ''); foreach ($result as $val) { $services[$val['id']] = $val['service_name']; } $this->addElement('select', 'public_ws_service_id', array('label' => 'Usługa', 'multiOptions' => $services)); $this->addElement('text', 'ip', array('label' => 'Adres IP')); $this->addElement('text', 'function_name', array('label' => 'Funkcja')); $this->addElement('text', 'function_revision', array('label' => 'Rewizja')); $this->addElement('select', 'priority', array('label' => 'Kody odpowiedzi', 'multiOptions' => $this->addClearStart(array(200, 401, 402, 405, 406, 407, 410, 415, 416, 420, 421, 422, 423, 424, 425, 430, 431, 432, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 450, 451, 452, 453, 501, 510, 511, 512, 520)))); $this->datetimee(false, 'created_at_from', 'Data od', false); $this->datetimee(false, 'created_at_to', 'Data do', false); $this->search(); $this->reset(); }
/** * @return void */ public function baseInit() { $this->addElement('text', 'email', array('label' => 'Adres e-mail')); $model = new Wsservice(); $resultsRaw = $model->getServicesByGroupHash('sms')->toArray(); $services = array(0 => ''); foreach ($resultsRaw as $val) { $services[$val['id']] = $val['service_name']; } $this->addElement('select', 'service_id', array('label' => 'Usługa', 'multiOptions' => $services)); $this->search(); $this->reset(); }
public function selfTest() { $errors = array(); $cfg = Zend_Registry::get('config'); $model = new Wsservice(); $accounts = $model->getServicesByGroupHash('sms'); foreach ($accounts as $account) { $return = $this->doTest($account->id); if ($return) { if (array_key_exists($return['errorCode'], $this->_errors)) { $return['errorMessage'] = $this->_errors[$return['errorCode']]; } $errors[] = array('service_type' => 'sms', 'errorMessage' => $return['errorMessage'], 'errorCode' => $return['errorCode'], 'errorType' => $return['errorType'], 'id' => $this->_service->getParams()->id, 'special_id' => $this->_service->getParams()->special_id, 'service_name' => $this->_service->getParams()->service_name, 'service_hash' => $this->_service->getParams()->service_hash, 'service_login' => $this->_service->getParams()->service_login); } } return $errors; }
public function selfTest() { $errors = array(); $cfg = Zend_Registry::get('config'); $model = new Wsservice(); $accounts = $model->getServicesByGroupHash('mail'); $accounts = $accounts->toArray(); $rand = array_rand($accounts, 1); foreach ($accounts as $n => $account) { if ($n === $rand) { $this->_sendMail = true; } $return = $this->doTest($account['id']); if ($return) { $errors[] = array('service_type' => 'mail', 'errorMessage' => $return['errorMessage'], 'errorCode' => $return['errorCode'], 'errorType' => 'critical', 'id' => $this->_service->getParams()->id, 'special_id' => $this->_service->getParams()->special_id, 'service_name' => $this->_service->getParams()->service_name, 'service_hash' => $this->_service->getParams()->service_hash, 'service_login' => $this->_service->getParams()->service_login); } } return $errors; }