/** * @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'); }
public function __construct($type, $options = null) { $this->type = $type; if ($this->type === Logic_Ws_ServiceSet_ServiceSet::SHIPPING_TYPE_API) { unset($this->namespace['sset']); } $sms = new WsServiceSmsGroup(); $this->sms = $sms->fetchAll(array('ghost = false'), array('name ASC'))->toArray(); $mail = new WsServiceMailGroup(); $this->mail = $mail->fetchAll(array('ghost = false'), array('name ASC'))->toArray(); $sset = new WsServiceSet(); $this->sset = $sset->fetchAll(array('ghost = false', 'status = ' . Logic_Ws_ServiceSet_ServiceSet::STATE_ACTIVE), array('code_name ASC'))->toArray(); parent::__construct($options); }
public function baseInit() { $config = Zend_Registry::get('config'); $WsServiceSetModel = new WsServiceSet(); $dictionary = new Base_Dictionary(); $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', 'ws_service_set_id', array('required' => true, 'label' => 'Nazwa wysyłki:', 'multioptions' => $this->addClearStart($WsServiceSets))); $this->addElement('select', 'file_type', array('required' => true, 'label' => 'Rodzaj pliku:', 'multioptions' => $this->addClearStart($dictionary->setSource('service_import_file_type')->getDictionary()))); $this->addElement('file', 'service_import_csv', array('decorators' => array('File', array('ViewScript', array('viewScript' => '_form/file.phtml', 'placement' => false))), 'label' => 'CSV z listą smsów do zaimportowania', 'required' => true, 'maxfilesize' => $config['uploads']['maxfilesize'], 'Destination' => $config['uploads']['destination'], 'validators' => array(array('Extension', false, 'csv'), array('Size', false, $config['uploads']['maxfilesize'])))); $this->submit(); $this->cancel(); }
/** * @return void */ public function baseInit() { $dictionary = new Base_Dictionary(); $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))); $this->datee(false, 'date_for', 'Data od:', false); $this->datee(false, 'date_to', 'Data do:', false); $this->date_for->class = $this->date_to->class = 'datepicker-present'; $this->addElement('text', 'author_name', array('label' => 'Osoba wczytująca plik')); $this->search(); $this->cancel(false, 'cancel', 'Clear'); }