Beispiel #1
0
 /**
  * Inicjalizacja formularza
  */
 public function baseInit()
 {
     $this->_atModel = $atModel = new AddonType();
     $this->_bModel = $bModel = new Branch();
     $rows = $atModel->fetchAll('not ghost', 'name asc');
     $addons = array();
     foreach ($rows as $row) {
         $addons[Base_Convert::strToHex($row->id)] = $row->name;
     }
     $this->addElement('MultiCheckbox', 'addons', array('label' => 'Uzwględnij następujące dodatki:', 'MultiOptions' => $addons, 'value' => array_keys($addons), 'required' => true));
     $this->addons->getDecorator('row')->setOption('class', 'row widerow');
     $rows = $bModel->fetchAll('not ghost', 'web_name asc');
     $branches = array();
     foreach ($rows as $row) {
         $branches[Base_Convert::strToHex($row->id)] = $row->branch_name;
     }
     $this->addElement('MultiCheckbox', 'branches', array('label' => 'Uwzględnij następujące brandy:', 'MultiOptions' => $branches, 'value' => array_keys($branches), 'required' => true));
     $dic = new Logic_Dictionary();
     $cTypes = array();
     $this->_cDic = $cDic = $dic->getDictionaryEntriesByCode('client_type');
     foreach ($cDic as $ct) {
         $cTypes[Base_Convert::strToHex($ct->id)] = ucfirst($ct->entry);
     }
     $rows = $bModel->fetchAll('not ghost', 'web_name asc');
     $branches = array();
     foreach ($rows as $row) {
         $branches[Base_Convert::strToHex($row->id)] = $row->branch_name;
     }
     $this->addElement('MultiCheckbox', 'clients', array('label' => 'Uwzględnij nastepujących klientów:', 'MultiOptions' => $cTypes, 'value' => array_keys($cTypes), 'required' => true));
     $this->addElement('Select', 'timepoint', array('label' => 'Wyeksportuj wartości:', 'MultiOptions' => array('now' => 'Aktualne', 'archive' => 'Archiwalne'), 'required' => true));
     $this->datee(false, 'date', 'Data:', true, array('value' => date('Y-m-d'), 'required' => true));
     $this->addElement('text', 'time', array('label' => 'Godzina:', 'class' => 'timeentry', 'required' => true, 'value' => date('H:00:00'), 'validators' => array(array('validator' => 'Date', 'options' => array('format' => 'H:i:s')))));
     $this->submit(false, 'submitbtn', 'Eksportuj');
 }