public function __construct(EntityManager $em, $name = null, $options = array())
 {
     $this->em = $em;
     parent::__construct('BankDetailsForm');
     $this->setAttribute('method', 'post');
     $this->setAttribute('class', 'form-horizontal');
     $city = new Element\Select('cityId');
     $city->setLabel('city');
     $city->setValueOptions($this->getOptionCity());
     $city->setAttribute("class", "dropDnInput");
     $city->setAttribute("id", "cityId");
     $city->setDisableInArrayValidator(true);
     $this->add($city);
     $bankName = new Element\Select('bankName');
     $bankName->setLabel('Bank Name');
     $bankName->setValueOptions($this->getOptionBankNames());
     $bankName->setAttribute("class", "dropDnInput");
     $this->add($bankName);
     $this->add(array('name' => 'branchName', 'attributes' => array('type' => 'text', 'placeholder' => 'Branch Name', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'ifscCode', 'attributes' => array('type' => 'text', 'placeholder' => 'IFSC code', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'save', 'attributes' => array('type' => 'submit', 'value' => 'Submit', 'class' => "btn-blue")));
     //        $this->add(array(
     //    		'name' => 'cancel',
     //    		'attributes' => array(
     //				'type' => 'cancel',
     //				'value' => 'Cancel',
     //				'class' => 'btn btn-primary',
     //    		),
     //    		'options' => array(
     //				'label' => 'Cancel'
     //    		),
     //        ));
 }
Beispiel #2
0
 public function __construct()
 {
     parent::__construct('add');
     $hydrator = new AggregateHydrator();
     $hydrator->add(new PostHydrator());
     $hydrator->add(new CategoryHydrator());
     $this->setHydrator($hydrator);
     $title = new Element\Text('title');
     $title->setLabel('Title');
     $title->setAttribute('class', 'form-control');
     $slug = new Element\Text('slug');
     $slug->setLabel('Slug');
     $slug->setAttribute('class', 'form-control');
     $content = new Element\Textarea('content');
     $content->setLabel('Content');
     $content->setAttribute('class', 'form-control');
     $category = new Element\Select('category_id');
     $category->setLabel('Category');
     $category->setAttribute('class', 'form-control');
     $category->setValueOptions(array(1 => 'WIN', 2 => 'BUILD', 3 => 'SEND', 4 => 'GENERAL'));
     $submit = new Element\Submit('submit');
     $submit->setValue('Add News');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($title);
     $this->add($slug);
     $this->add($content);
     $this->add($category);
     $this->add($submit);
 }
Beispiel #3
0
 /**
  * Init Module form
  *
  * @return void
  */
 public function init()
 {
     $this->setAttribute('class', 'relative');
     $fileInfo = new Info();
     $modulesInfos = array();
     $options = array('' => 'Select an option');
     foreach ($this->getServiceLocator()->get('ModulesList') as $path => $dir) {
         $options[$dir] = $dir;
         $configFile = $path . '/module.info';
         if ($fileInfo->fromFile($configFile) === true) {
             $modulesInfos[$dir] = $fileInfo->render();
         }
     }
     $collection = new ModuleCollection();
     $modules = $collection->getModules();
     foreach ($modules as $module) {
         if (in_array($module->getName(), $options)) {
             unset($options[$module->getName()]);
             unset($modulesInfos[$module->getName()]);
         }
     }
     $module = new Element\Select('module');
     $module->setLabel('Module')->setLabelAttributes(array('class' => 'required'));
     $module->setAttribute('id', 'module')->setAttribute('class', 'form-control')->setAttribute('modules_info', $modulesInfos)->setValueOptions($options);
     $this->add($module);
     $inputFilterFactory = new InputFilterFactory();
     $inputFilter = $inputFilterFactory->createInputFilter(array('module' => array('name' => 'module', 'required' => true, 'validators' => array(array('name' => 'not_empty')))));
     $this->setInputFilter($inputFilter);
 }
Beispiel #4
0
 public function __construct()
 {
     parent::__construct('page');
     //Méthode d'envoie (GET,POST)
     $this->setAttribute('method', 'post');
     //Définition des champs
     //Menu Page
     //        $idField = new Element\Select('menu_id');
     //        $idField->setAttribute('class', 'browser-default');
     //        $idField->setLabel('Menu');
     //        $this->add($idField);
     $idField = new Element\Hidden('structure');
     $idField->setAttribute('id', 'structureform');
     $this->add($idField);
     $idField = new Element\Hidden('block_element');
     $idField->setAttribute('id', 'block-element');
     $this->add($idField);
     //Page Category
     $idField = new Element\Select('ctgr_id');
     $idField->setAttribute('class', 'browser-default');
     $idField->setLabel('Category');
     $this->add($idField);
     //Page Title
     $titleField = new Element\Text('title');
     $titleField->setLabel('Titre');
     $this->add($titleField);
     //Page Content
     $contentField = new Element\Textarea('content');
     $contentField->setLabel('Description');
     $this->add($contentField);
     $submitField = new Element\Submit('submit');
     $submitField->setValue('Envoyer');
     $submitField->setAttributes(array('id' => 'submitbutton', 'class' => 'btn waves-effect waves-light btn-submit-form-page'));
     $this->add($submitField);
 }
Beispiel #5
0
 public function init()
 {
     $uom = new Select('uom');
     $uom->setAttribute('id', 'uom');
     $uom->setAttribute('title', $this->translator->translate('web.form.article.uom.title'));
     $uom->setAttribute('class', 'form-control');
     $uom->setEmptyOption($this->translator->translate('web.form.article.uom.emptyOption'));
     $uom->setValueOptions($this->getUomValues());
     $uom->setLabel($this->translator->translate('web.form.article.uom.label'));
     $this->add($uom);
     $name = new Text('name');
     $name->setAttribute('id', 'name');
     $name->setAttribute('title', $this->translator->translate('web.form.article.name.title'));
     $name->setAttribute('class', 'form-control');
     $name->setAttribute('placeholder', $this->translator->translate('web.form.article.name.placeholder'));
     $name->setLabel($this->translator->translate('web.form.article.name.label'));
     $this->add($name);
     $code = new Text('code');
     $code->setAttribute('id', 'code');
     $code->setAttribute('title', $this->translator->translate('web.form.article.code.title'));
     $code->setAttribute('class', 'form-control');
     $code->setAttribute('placeholder', $this->translator->translate('web.form.article.code.placeholder'));
     $code->setLabel($this->translator->translate('web.form.article.code.label'));
     $this->add($code);
     $salesPrice = new Text('salesPrice');
     $salesPrice->setAttribute('id', 'salesPrice');
     $salesPrice->setAttribute('class', 'form-control');
     $salesPrice->setAttribute('title', $this->translator->translate('web.form.article.salesPrice.title'));
     $salesPrice->setAttribute('placeholder', $this->translator->translate('web.form.article.salesPrice.placeholder'));
     $salesPrice->setLabel($this->translator->translate('web.form.article.salesPrice.label'));
     $this->add($salesPrice);
     $qty = new Text('qty');
     $qty->setAttribute('id', 'qty');
     $qty->setAttribute('class', 'form-control');
     $qty->setAttribute('title', $this->translator->translate('web.form.article.qty.title'));
     $qty->setAttribute('placeholder', $this->translator->translate('web.form.article.qty.placeholder'));
     $qty->setLabel($this->translator->translate('web.form.article.qty.label'));
     $this->add($qty);
     $description = new Text('description');
     $description->setAttribute('id', 'description');
     $description->setAttribute('title', $this->translator->translate('web.form.article.description.title'));
     $description->setAttribute('class', 'form-control');
     $description->setAttribute('placeholder', $this->translator->translate('web.form.article.description.placeholder'));
     $description->setLabel($this->translator->translate('web.form.article.description.label'));
     $this->add($description);
     return $this;
 }
Beispiel #6
0
 /**
  * Language form
  *
  * @param array $config Configuration
  *
  * @return void
  */
 public function lang($config)
 {
     $lang = new Element\Select('lang');
     $lang->setAttribute('size', 10)->setValueOptions($config['locales'])->setValue('en_GB')->setAttribute('class', 'form-control');
     $inputFilter = $this->getInputFilter();
     $inputFilter->add(array('name' => 'lang', 'required' => true, 'validators' => array(array('name' => 'not_empty'))), 'lang');
     $this->add($lang);
 }
Beispiel #7
0
 public function __invoke($id)
 {
     $html = "";
     $auth = $this->sm->get('ZfcRbac\\Service\\AuthorizationService');
     $zfcuserauth = $this->sm->get('zfcuser_auth_service');
     $objectmanager = $this->sm->get('Doctrine\\ORM\\EntityManager');
     $type = $objectmanager->getRepository('Application\\Entity\\OpSupType')->find($id);
     if ($zfcuserauth->hasIdentity()) {
         $criteria = array();
         $criteria['organisation'] = $zfcuserauth->getIdentity()->getOrganisation()->getId();
         $criteria['type'] = $id;
         $query = $objectmanager->createQueryBuilder();
         $query->select('o')->from('Application\\Entity\\OperationalSupervisor', 'o')->where('o.type = ?1')->groupBy('o.zone')->setParameter(1, $id);
         if ($zfcuserauth->getIdentity()->getZone()) {
             $query->andWhere($query->expr()->eq('o.zone', '?2'))->setParameter(2, $zfcuserauth->getIdentity()->getZone()->getId());
         }
         $zones = $query->getQuery()->getResult();
         foreach ($zones as $result) {
             $criteria['zone'] = $result->getZone()->getId();
             $zoneid = $result->getZone()->getId();
             $opsups = $objectmanager->getRepository('Application\\Entity\\OperationalSupervisor')->findBy($criteria, array('name' => 'asc'));
             $currentopsup = $objectmanager->getRepository('Application\\Entity\\OperationalSupervisor')->findOneBy(array('organisation' => $zfcuserauth->getIdentity()->getOrganisation()->getId(), 'zone' => $result->getZone()->getId(), 'type' => $id, 'current' => true));
             if ($auth->isGranted('events.mod-opsup')) {
                 $form = new Form();
                 $selectOpSup = new Select('nameopsup');
                 $opsupArray = array();
                 $opsupArray['-1'] = "Choisir Op Sup";
                 foreach ($opsups as $opsup) {
                     $opsupArray[$opsup->getId()] = $opsup->getName();
                 }
                 $selectOpSup->setValueOptions($opsupArray);
                 if ($currentopsup) {
                     $selectOpSup->setAttribute('value', $currentopsup->getId());
                 }
                 $form->add($selectOpSup);
                 $formView = $this->view->form();
                 $form->setAttributes(array('class' => 'navbar-form navbar-left opsup-form type-' . $id . ' zone-' . $zoneid, 'data-typeid' => $id, 'data-zoneid' => $zoneid));
                 $html .= $formView->openTag($form);
                 $html .= '<div class="form-group">';
                 $html .= '<label for="nameopsup">';
                 $html .= ' <span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span> <b>' . $type->getName() . (count($zones) > 1 ? ' (' . $result->getZone()->getShortname() . ')' : '') . ' : </b>';
                 $html .= '<b class="caret"></b></label>';
                 $html .= $this->view->formSelect($form->get('nameopsup')->setAttribute('class', 'form-control'));
                 $html .= '</div>';
                 $html .= $formView->closeTag();
             } else {
                 if ($currentopsup) {
                     $html .= '<p class="navbar-text navbar-left opsup-name type-' . $id . ' zone-' . $zoneid . '" style="margin-left: 0px"' . ' data-typeid="' . $id . '" data-zoneid="' . $zoneid . '">' . '<span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span> <b>' . $type->getName() . (count($zones) > 1 ? ' (' . $result->getZone()->getShortname() . ')' : '') . ' : </b>' . '<span class="opsupname">' . $currentopsup->getName() . '</span><b class="caret"></b></p>';
                 } else {
                     $html .= '<p class="navbar-text navbar-left" style="margin-left: 0px"><em>Aucun Op Sup configuré</em></p>';
                 }
             }
         }
     } else {
         $html .= '<p class="navbar-text navbar-left"><em>Connexion nécessaire</em></p>';
     }
     return $html;
 }
Beispiel #8
0
 /**
  * Initially loaded to display the list page's template
  * @return ViewModel
  */
 public function listAction()
 {
     $categoryTree = $this->getServiceLocator()->get('category-tree');
     $selectCategoryElement = new Select('filter_category');
     $selectCategoryElement->setAttribute('id', 'filter_category');
     $selectCategoryElement->setEmptyOption($this->translator->translate('All categories'));
     $selectCategoryElement->setValueOptions($categoryTree->getSelectOptions());
     return new ViewModel(['selectCategory' => $selectCategoryElement, 'locale' => $this->translator->getLocale()]);
 }
 public function saveBookAction()
 {
     if ($this->getAdmin()->getId()) {
         $request = $this->getRequest();
         if ($request->isPost()) {
             $data = $request->getPost()->toArray();
             if ($id = intval($this->params()->fromRoute("id", false))) {
                 $form = new EditBookForm();
             } else {
                 $form = new AddBookForm();
             }
             // get authors form DB
             $authors = array();
             foreach ($this->getAuthorTable()->fetchAll() as $author) {
                 $authors[$author->getId()] = $author->getName();
             }
             $select = new Select('book_author_id');
             $select->setOptions(array('options' => $authors));
             $form->add($select);
             // get genres form DB
             $genres = array();
             foreach ($this->getGenreTable()->fetchAll() as $genre) {
                 $genres[$genre->getId()] = $genre->getName();
             }
             $select = new Select('book_genre_ids');
             $select->setAttribute("multiple", "multiple");
             $select->setOptions(array('options' => $genres));
             $form->add($select);
             if ($id) {
                 $book = $this->getBookTable()->find($id);
             } else {
                 $book = $this->getBookTable()->createNew();
             }
             $form->setInputFilter($book->getInputFilterBookSave(array_keys($authors)));
             $form->setData($data);
             if ($form->isValid()) {
                 $book->exchangeArray($data);
                 $book = $this->getBookTable()->save($book);
                 $result = array("redirectTo" => $this->url()->fromRoute("admin", array("action" => "edit-book", "id" => $book->getId())));
                 if ($id) {
                     $this->getBookTable()->removeGenresFromBook($book->getId());
                     $result = false;
                 }
                 foreach ($data['book_genre_ids'] as $genreId) {
                     $this->getBookTable()->addGenreToBook($genreId, $book->getId());
                 }
                 return new JsonModel(array("returnCode" => 101, "result" => $result, "msg" => "Book Has Been Saved."));
             } else {
                 return new JsonModel(array("returnCode" => 202, "msg" => $form->getMessages()));
             }
         }
         return new JsonModel(array("returnCode" => 201, "msg" => "Wrong request."));
     } else {
         return new JsonModel(array("returnCode" => 201, "msg" => $this->getErrorMsgZendFormat("Your are logged in")));
     }
 }
Beispiel #10
0
 public function __construct($name = null)
 {
     parent::__construct('selectAccountForm');
     $this->setAttribute('method', 'post');
     $selectTipo = new Element\Select('TIPO');
     $selectTipo->setLabel('Seleccionar tipo de usuario: ');
     $selectTipo->setAttribute('id', 'selectAccountType');
     $this->add($selectTipo);
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Go', 'id' => 'submitbutton', 'class' => 'btn btn-inverse')));
 }
Beispiel #11
0
 public function __construct(EntityManager $em, $name = null, $options = array())
 {
     $this->em = $em;
     parent::__construct('CityForm');
     $this->setAttribute('method', 'post');
     $this->setAttribute('enctype', 'multipart/form-data');
     $this->setAttribute('class', 'form-horizontal');
     $this->add(array('name' => 'ctname', 'attributes' => array('type' => 'text', 'placeholder' => 'City name', 'class' => 'commonDropDnInput')));
     $stid = new Element\Select('stid');
     $stid->setLabel('State name');
     $stid->setAttributes(array('id' => 'stid'));
     $stid->setValueOptions($this->getOptionState());
     $stid->setAttribute("class", "dropDnInput");
     $this->add($stid);
     $ctcatid = new Element\Select('ctcatid');
     $ctcatid->setLabel('City category');
     $ctcatid->setValueOptions($this->getOptionCityCat());
     $ctcatid->setAttribute("class", "dropDnInput");
     $this->add($ctcatid);
     $ctdescription = new Element\Textarea('ctdescription');
     $ctdescription->setLabel('City Description');
     $ctdescription->setAttribute("class", "selectAreaInput");
     $ctdescription->setAttribute("rows", "4");
     $ctdescription->setAttribute("cols", "50");
     $this->add($ctdescription);
     $ctspecialInstructions = new Element\Textarea('ctspecialInstructions');
     $ctspecialInstructions->setLabel('City Special Instruction Description');
     $ctspecialInstructions->setAttribute("class", "selectAreaInput");
     $ctspecialInstructions->setAttribute("rows", "4");
     $ctspecialInstructions->setAttribute("cols", "33");
     $this->add($ctspecialInstructions);
     $ctbestSeasonToVisit = new Element\Textarea('ctbestSeasonToVisit');
     $ctbestSeasonToVisit->setLabel('City Best Season to visit');
     $ctbestSeasonToVisit->setAttribute("class", "selectAreaInput");
     $ctbestSeasonToVisit->setAttribute("rows", "4");
     $ctbestSeasonToVisit->setAttribute("cols", "43");
     $this->add($ctbestSeasonToVisit);
     $this->add(array('name' => 'ctlatitude', 'attributes' => array('type' => 'text', 'placeholder' => 'City Lattitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'ctlongitude', 'attributes' => array('type' => 'text', 'placeholder' => 'City Longitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'cityPhoto', 'attributes' => array('type' => 'file'), 'options' => array('label' => 'File Upload')));
     $this->add(array('name' => 'save', 'attributes' => array('type' => 'submit', 'value' => 'Submit', 'class' => "btn-blue")));
     //        $this->add(array(
     //    		'name' => 'cancel',
     //    		'attributes' => array(
     //				'type' => 'cancel',
     //				'value' => 'Cancel',
     //				'class' => 'btn btn-primary',
     //    		),
     //    		'options' => array(
     //				'label' => 'Cancel'
     //    		),
     //        ));
 }
Beispiel #12
0
 public function __construct($name = NULL)
 {
     parent::__construct($name);
     $this->setAttribute('method', 'post');
     $this->setAttribute('class', 'form-signin');
     $this->add(array('name' => 'search', 'options' => array('label' => ''), 'attributes' => array('type' => 'text', 'placeholder' => 'Ejem: Restaurantes', 'class' => 'search-query')));
     $this->add(array('name' => 'ciudad', 'options' => array('label' => ''), 'attributes' => array('type' => 'text', 'placeholder' => 'Ejem: Xalapa', 'class' => 'search-query')));
     $ciudad = new Element\Select('ciudad2');
     $ciudad->setLabel("Ciudad:");
     $ciudad->setAttribute('class', 'search-query');
     $this->add($ciudad);
 }
Beispiel #13
0
 public function testProvidesInputSpecificationForSingleSelect()
 {
     $element = new SelectElement();
     $element->setAttribute('options', array('Option 1' => 'option1', 'Option 2' => 'option2', 'Option 3' => 'option3'));
     $inputSpec = $element->getInputSpecification();
     $this->assertArrayHasKey('validators', $inputSpec);
     $this->assertInternalType('array', $inputSpec['validators']);
     $expectedClasses = array('Zend\\Validator\\InArray');
     foreach ($inputSpec['validators'] as $validator) {
         $class = get_class($validator);
         $this->assertTrue(in_array($class, $expectedClasses), $class);
     }
 }
Beispiel #14
0
 protected function addSelect($name, $label, array $values)
 {
     $select = new Element\Select($name);
     $select->setLabel($label);
     $select->setLabelAttributes(array('class' => "col-sm-{$this->labelWidth}"));
     $select->setOption('column-size', "sm-{$this->controlWidth}");
     $select->setValueOptions($values);
     if ($this->compact) {
         $select->setAttribute('class', 'input-sm');
     }
     $this->add($select);
     return $this;
 }
Beispiel #15
0
 public function __construct(EntityManager $em, $name = null, $options = array())
 {
     $this->em = $em;
     parent::__construct('StateForm');
     $this->setAttribute('method', 'post');
     $this->setAttribute('enctype', 'multipart/form-data');
     $this->setAttribute('class', 'form-horizontal');
     $country = new Element\Select('cntryId');
     $country->setLabel('Country name');
     $country->setValueOptions($this->getOptionCountry());
     $country->setAttribute("class", "dropDnInput");
     $this->add($country);
     $this->add(array('name' => 'stname', 'attributes' => array('type' => 'text', 'placeholder' => 'State name', 'class' => 'commonDropDnInput')));
     $cntrydescription = new Element\Textarea('statedescription');
     $cntrydescription->setLabel('State Description');
     $cntrydescription->setAttribute("class", "selectAreaInput");
     $cntrydescription->setAttribute("rows", "4");
     $cntrydescription->setAttribute("cols", "50");
     $this->add($cntrydescription);
     $cntryspecialInstructions = new Element\Textarea('statespecialInstructions');
     $cntryspecialInstructions->setLabel('State Special Instruction Description');
     $cntryspecialInstructions->setAttribute("class", "selectAreaInput");
     $cntryspecialInstructions->setAttribute("rows", "4");
     $cntryspecialInstructions->setAttribute("cols", "50");
     $this->add($cntryspecialInstructions);
     $cntrybestSeasonToVisit = new Element\Textarea('statebestSeasonToVisit');
     $cntrybestSeasonToVisit->setLabel('State Best Season to visit');
     $cntrybestSeasonToVisit->setAttribute("class", "selectAreaInput");
     $cntrybestSeasonToVisit->setAttribute("rows", "4");
     $cntrybestSeasonToVisit->setAttribute("cols", "50");
     $this->add($cntrybestSeasonToVisit);
     $this->add(array('name' => 'latitude', 'attributes' => array('type' => 'text', 'placeholder' => 'State Lattitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'longitude', 'attributes' => array('type' => 'text', 'placeholder' => 'State Longitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'statePhoto', 'attributes' => array('type' => 'file', 'allowEmpty' => False), 'options' => array('label' => 'File Upload')));
     //
     // File Input
     $this->add(array('name' => 'save', 'attributes' => array('type' => 'submit', 'value' => 'Submit', 'class' => "btn-blue")));
     //        $this->add(array(
     //    		'name' => 'cancel',
     //    		'attributes' => array(
     //				'type' => 'cancel',
     //				'value' => 'Cancel',
     //				'class' => 'btn btn-primary',
     //    		),
     //    		'options' => array(
     //				'label' => 'Cancel'
     //    		),
     //        ));
 }
Beispiel #16
0
 public function __invoke()
 {
     $html = "";
     $auth = $this->sm->get('ZfcRbac\\Service\\AuthorizationService');
     $zfcuserauth = $this->sm->get('zfcuser_auth_service');
     $objectmanager = $this->sm->get('Doctrine\\ORM\\EntityManager');
     if ($zfcuserauth->hasIdentity()) {
         $criteria = array();
         $criteria['organisation'] = $zfcuserauth->getIdentity()->getOrganisation()->getId();
         if ($zfcuserauth->getIdentity()->getZone()) {
             $criteria['zone'] = $zfcuserauth->getIdentity()->getZone()->getId();
         }
         $opsups = $objectmanager->getRepository('Application\\Entity\\OperationalSupervisor')->findBy($criteria, array('name' => 'asc'));
         $currentopsup = $objectmanager->getRepository('Application\\Entity\\OperationalSupervisor')->findOneBy(array('organisation' => $zfcuserauth->getIdentity()->getOrganisation()->getId(), 'zone' => $zfcuserauth->getIdentity()->getZone()->getId(), 'current' => true));
         if ($auth->isGranted('events.mod-opsup')) {
             $form = new Form('opsup');
             $selectOpSup = new Select('nameopsup');
             $opsupArray = array();
             $opsupArray['-1'] = "Choisir Op Sup";
             foreach ($opsups as $opsup) {
                 $opsupArray[$opsup->getId()] = $opsup->getName();
             }
             $selectOpSup->setValueOptions($opsupArray);
             if ($currentopsup) {
                 $selectOpSup->setAttribute('value', $currentopsup->getId());
             }
             $form->add($selectOpSup);
             $formView = $this->view->form();
             $form->setAttributes(array('class' => 'navbar-form navbar-left'));
             $html .= $formView->openTag($form);
             $html .= '<div class="form-group">';
             $html .= $this->view->formSelect($form->get('nameopsup')->setAttribute('class', 'form-control'));
             $html .= '</div>';
             $html .= $formView->closeTag();
         } else {
             if ($currentopsup) {
                 $html .= '<p class="navbar-text navbar-left" style="margin-left: 0px">' . $currentopsup->getName() . '</p>';
             } else {
                 $html .= '<p class="navbar-text navbar-left" style="margin-left: 0px"><em>Aucun Op Sup configuré</em></p>';
             }
         }
     } else {
         $html .= '<p class="navbar-text navbar-left"><em>Connexion nécessaire</em></p>';
     }
     return $html;
 }
Beispiel #17
0
 public function __invoke($iponumber = null)
 {
     $html = "";
     $auth = $this->sm->get('ZfcRbac\\Service\\AuthorizationService');
     $zfcuserauth = $this->sm->get('zfcuser_auth_service');
     $objectmanager = $this->sm->get('Doctrine\\ORM\\EntityManager');
     if ($zfcuserauth->hasIdentity()) {
         $ipos = $objectmanager->getRepository('Application\\Entity\\IPO')->findBy(array('organisation' => $zfcuserauth->getIdentity()->getOrganisation()->getId()), array('name' => 'asc'));
         $currentipo = $objectmanager->getRepository('Application\\Entity\\IPO')->findOneBy(array('organisation' => $zfcuserauth->getIdentity()->getOrganisation()->getId(), 'current' => true));
         if ($auth->isGranted('events.mod-ipo')) {
             $form = new Form('ipo');
             $selectIPO = new Select('nameipo');
             $ipoArray = array();
             $ipoArray['-1'] = "Choisir IPO";
             foreach ($ipos as $ipo) {
                 $ipoArray[$ipo->getId()] = $ipo->getName();
             }
             $selectIPO->setValueOptions($ipoArray);
             if ($currentipo) {
                 $selectIPO->setAttribute('value', $currentipo->getId());
             }
             $form->add($selectIPO);
             $formView = $this->view->form();
             $form->setAttributes(array('class' => 'navbar-form navbar-left visible-xs-block visible-md-block visible-lg-block'));
             $html .= $formView->openTag($form);
             $html .= '<div class="form-group visible-xs-block visible-md-block visible-lg-block">';
             $html .= '<label>' . '<span class="glyphicon glyphicon-warning-sign"></span><b> IPO ' . ($iponumber !== null ? $iponumber : '') . ' : </b>';
             $html .= $this->view->formSelect($form->get('nameipo')->setAttribute('class', 'form-control'));
             $html .= '</div>';
             $html .= $formView->closeTag();
         } else {
             if ($currentipo) {
                 $html .= '<p class="navbar-text navbar-left visible-xs-block visible-md-block visible-lg-block"><span class="glyphicon glyphicon-warning-sign"></span><b> IPO ' . ($iponumber !== null ? $iponumber : '') . ' : </b><span id="iponame">' . $currentipo->getName() . '</span></p>';
             } else {
                 $html .= '<p class="navbar-text navbar-left visible-xs-block visible-md-block visible-lg-block"><span class="glyphicon glyphicon-warning-sign"></span><b> IPO ' . ($iponumber !== null ? $iponumber : '') . ' : </b><em>Aucun IPO configuré</em></p>';
             }
         }
     } else {
         $html .= '<p class="navbar-text navbar-left visible-xs-block visible-md-block visible-lg-block"><em>Connexion nécessaire</em></p>';
     }
     return $html;
 }
 public function __invoke()
 {
     $serviceManager = $this->getServiceLocator()->getServiceLocator()->get('UthandoServiceManager');
     /* @var $menuItemMapper \UthandoNavigation\Service\MenuItem */
     $menuItemMapper = $serviceManager->get('UthandoNavigationMenuItem');
     $menuItems = $menuItemMapper->fetchAll();
     /* @var $menuMapper \UthandoNavigation\Service\Menu */
     $menuMapper = $serviceManager->get('UthandoNavigationMenu');
     $menus = $menuMapper->fetchAll();
     $select = new Element\Select('position');
     $menuItemsOptions = [];
     $menuArray = [];
     foreach ($menus as $menu) {
         $menuArray[$menu->getMenuId()] = $menu->getMenu();
         $menuItemsOptions[$menu->getMenuId()]['options'][$menu->getMenuId() . '-' . '0'] = 'At top of this menu';
         $menuItemsOptions[$menu->getMenuId()]['empty_option'] = '---Please Select a page---';
         $menuItemsOptions[$menu->getMenuId()]['label'] = $menu->getMenu();
     }
     /* @var $page \UthandoNavigation\Model\MenuItem */
     foreach ($menuItems as $menuItem) {
         $ident = $menuItem->getDepth() > 0 ? str_repeat('%space%%space%', $menuItem->getDepth()) . '%bull%%space%' : '';
         $menuItemsOptions[$menuItem->getMenuId()]['options'][$menuItem->getMenuId() . '-' . $menuItem->getMenuItemId()] = $ident . $menuItem->getLabel();
     }
     $select = new Element\Select('position');
     $select->setLabel('Location In Menu:');
     $select->setValueOptions($menuItemsOptions);
     $select->setEmptyOption('Please select a Position');
     $select->setAttribute('class', 'form-control');
     $element = $this->view->plugin('formElement');
     $errors = $this->view->plugin('formElementErrors');
     $html = $element($select);
     $html = str_replace('%space%', '&nbsp;', $html);
     $html = str_replace('%bull%', '&bull;', $html);
     $html = '<div class="form-group">
                  <label class="col-sm-4 control-label" for="position">' . $select->getLabel() . '</label>
                  <div class="col-sm-8">' . $html . '
                      <span class="help-block">' . $errors($select, ["class" => "unstyled"]) . '
                      </span>
                  </div>
              </div>';
     return $html;
 }
 public function getForm(array $tableList, array $typeList, array $moduleList)
 {
     if (!$this->form) {
         $cboTable = new Select('tbl_name');
         $cboTable->setAttribute('class', 'form-control')->setValueOptions($tableList)->setEmptyOption("-- Choose Table --");
         $cboGenerate = new Select('type');
         $cboGenerate->setAttribute('class', 'form-control')->setValueOptions($typeList)->setEmptyOption('-- Choose Type --');
         $cboModule = new Select('module');
         $cboModule->setAttribute('class', 'form-control')->setValueOptions($moduleList)->setEmptyOption('-- Choose Module --');
         $txtGenerate = new Textarea('txtGenerate');
         $form = new Form();
         $form->setAttributes(array('role' => 'form', 'id' => 'frmGenerate', 'method' => 'post'));
         $form->add($txtGenerate);
         $form->add($cboTable);
         $form->add($cboGenerate);
         $form->add($cboModule);
         $this->form = $form;
     }
     return $this->form;
 }
Beispiel #20
0
 public function testProvidesInputSpecificationThatIncludesValidatorsBasedOnAttributes()
 {
     $element = new SelectElement();
     $element->setAttribute('options', array('Option 1' => 'option1', 'Option 2' => 'option2', 'Option 3' => 'option3'));
     $inputSpec = $element->getInputSpecification();
     $this->assertArrayHasKey('validators', $inputSpec);
     $this->assertInternalType('array', $inputSpec['validators']);
     $expectedClasses = array('Zend\\Validator\\InArray');
     foreach ($inputSpec['validators'] as $validator) {
         $class = get_class($validator);
         $this->assertTrue(in_array($class, $expectedClasses), $class);
         switch ($class) {
             case 'Zend\\Validator\\InArray':
                 $this->assertEquals($element->getAttribute('options'), $validator->getHaystack());
                 break;
             default:
                 break;
         }
     }
 }
 function __construct(LicenseInterface $license)
 {
     parent::__construct('course-page');
     $this->setAttribute('method', 'post');
     $this->setAttribute('class', 'clearfix');
     $this->add((new Text('title'))->setAttribute('id', 'title')->setLabel('Title:'));
     $select = new Select('icon');
     $select->setLabel('Select an icon');
     $select->setAttribute('id', 'icon');
     $select->setValueOptions(array('book-open' => 'Open book', 'book' => 'Closed book', 'bookmark' => 'Bookmark', 'play-button' => 'Play', 'google-maps' => 'Marker', 'film' => 'Film', 'circle-question-mark' => 'Question mark (circle)', 'circle-exclamation-mark' => 'Exclamation mark (circle)', 'circle-info' => 'Info (circle)', 'pencil' => 'Pencil', 'file' => 'File', 'notes' => 'Notes', 'stats' => 'Stats', 'compass' => 'Compass', 'lightbulb' => 'Lightbulb'));
     $this->add($select);
     $this->add((new Textarea('content'))->setAttribute('id', 'content')->setLabel('Content:'));
     $this->add((new Textarea('changes'))->setAttribute('id', 'changes')->setLabel('Changes:')->setAttribute('class', 'plain'));
     $this->add(new AgreementFieldset($license));
     $this->add(new Controls());
     $inputFilter = new InputFilter('course-page');
     $inputFilter->add(['name' => 'title', 'required' => true, 'filters' => [['name' => 'StripTags']]]);
     $inputFilter->add(['name' => 'content', 'required' => true]);
     $inputFilter->add(['name' => 'changes', 'required' => false, 'filters' => [['name' => 'StripTags']]]);
     $this->setInputFilter($inputFilter);
 }
Beispiel #22
0
 public function initSharedUsersSelect($uploadId)
 {
     $upload = $this->uploadTable->getById($uploadId);
     $sharedUsers = $this->uploadTable->getSharedUsers($uploadId);
     foreach ($sharedUsers as $sharedUser) {
         $userSelected[] = $sharedUser->user_id;
     }
     //        \Zend\Debug\Debug::dump($sharedUsers);
     $users = $this->userTable->fetchAll();
     foreach ($users as $user) {
         if ($user->getId() != $upload->getUserId()) {
             $usersOptions[$user->getId()] = $user->getEmail();
         }
     }
     $options = array('label' => 'Пользователи', 'value_options' => $usersOptions, 'disable_inarray_validator' => true, "attributes" => array("value" => 0));
     $select = new Element\Select('shared_user_ids');
     $select->setOptions($options);
     $select->setValue($userSelected);
     $select->setAttribute('multiple', 'multiple');
     $this->add($select);
 }
 public function __construct()
 {
     parent::__construct();
     $this->setAttribute('method', 'POST');
     // from the form factory:
     // initially populated with a list of countries
     $countrySelect = new Element\Select('countrySelect');
     $countrySelect->setLabel('Country')->setAttribute('id', 'countrySelect')->setAttribute('placeholder', 'Please enter a country name');
     $this->add($countrySelect);
     // from the form factory:
     // initially populated with a list of cities from the 1st country on the list
     $cityName = new Element\Select('cityName');
     $cityName->setAttribute('id', 'cityName')->setLabel('City Name');
     $this->add($cityName);
     // NOTE:
     // 1. must set DOCTYPE to HTML5: <!DOCTYPE html>
     // 2. not consistently supported by all browsers
     // 3. need to run isValid() to see any results
     $range = new Element\Range('range');
     $range->setLabel('Range')->setAttributes(array('min' => '0', 'max' => '100', 'step' => '1', 'required' => 'required', 'onClick' => 'displayNumber(this.value)', 'onBlur' => 'displayNumber(this.value)', 'style' => 'width: 100px'));
     $this->add($range);
     $rangeText = new Element\Text('rangeText');
     $rangeText->setAttribute('id', 'rangeText')->setAttribute('style', 'width: 30px; background-color: gray; color: white')->setAttribute('value', 50);
     $this->add($rangeText);
     $phone = new Element\Text('phone');
     $phone->setLabel('Phone')->setAttribute('id', 'phone')->setAttribute('type', 'text')->setAttribute('pattern', '^[0-9-()]+$')->setAttribute('title', 'Phone number')->setAttribute('placeholder', 'Enter phone numbers');
     $this->add($phone);
     $required = new Element\Text('required');
     $required->setLabel('Type Something')->setAttribute('id', 'required')->setAttribute('required', 'required')->setAttribute('pattern', '[0-9A-Z ]+')->setAttribute('title', 'Must enter letters, numbers or spaces only')->setAttribute('placeholder', 'required field');
     $this->add($required);
     $citySelect = new Element\Text('citySelect');
     $citySelect->setLabel('Search City')->setAttribute('id', 'citySelect')->setAttribute('placeholder', 'Please enter a city name');
     $this->add($citySelect);
     $submit = new Element\Submit('submit');
     $submit->setAttribute('value', 'Choose');
     $this->add($submit);
 }
 public function getForm(array $staffList, array $statusList, array $leaveList, $formType = 'W')
 {
     if (!$this->form) {
         $leaveId = new Element\Hidden('leaveId');
         $staff = new Element\Select();
         $staff->setName('staffId')->setEmptyOption('-- Choose Staff --')->setLabel('Staff')->setAttribute('class', 'form-control')->setValueOptions($staffList);
         $leaveType = new Element\Select();
         $leaveType->setName('leaveType')->setLabel('Type')->setAttribute('class', 'form-control')->setValueOptions($leaveList);
         $date = new Element\Date();
         $date->setName('date')->setLabel('Date')->setAttributes(array('allowPastDates' => true, 'momentConfig' => array('format' => 'YYYY-MM-DD')));
         $description = new Element\Textarea('description');
         $description->setLabel('Description')->setAttribute('class', 'form-control');
         $status = new Element\Select();
         $status->setName('status')->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($statusList);
         if ($formType == 'R' || $formType == 'V') {
             $staff->setAttribute('disabled', 'disabled');
             $leaveType->setAttribute('disabled', 'disabled');
             $description->setAttribute('readonly', 'readonly');
         }
         if ($formType == 'V') {
             $status->setAttribute('disabled', 'disabled');
             $date = new Element\Text();
             $date->setName('date')->setLabel('Date')->setattributes(array('class' => 'form-control', 'disabled' => 'disabled'));
         }
         $form = new Form();
         $form->setAttribute('class', 'form-horizontal');
         $form->add($leaveId);
         $form->add($staff);
         $form->add($leaveType);
         $form->add($date);
         $form->add($description);
         $form->add($status);
         $this->form = $form;
     }
     return $this->form;
 }
Beispiel #25
0
 public function addElements($id)
 {
     // File Input
     $this->data = $id;
     $file = new Element\File('seriecode');
     $file->setLabel('Video Mp4 Upload: ')->setAttribute('id', 'seriecode')->setAttribute('class', 'form-control')->setAttribute('title', 'File Upload')->setAttribute('multiple', true);
     // That's it
     $this->add($file);
     $title = new Element\Text('title');
     $title->setLabel('Title')->setAttribute('class', 'form-control')->setAttribute('id', 'title');
     $this->add($title);
     $cata = new Element\Select('catelog');
     $cata->setLabel('Catelog: ');
     $cata->setAttribute('class', 'form-control');
     $cata->setValueOptions($this->data);
     $this->add($cata);
     $tags = new Element\Text('tags');
     $tags->setLabel('Tags: ')->setAttribute('id', 'tag')->setAttribute('class', 'form-control')->setAttribute('class', 'form-control');
     $this->add($tags);
     $des = new Element\Textarea('description');
     $des->setLabel('Description: ');
     $des->setAttribute('class', 'form-control');
     $this->add($des);
 }
Beispiel #26
0
 public function __construct(array $roles)
 {
     parent::__construct();
     $this->setAttribute('method', 'post');
     $this->setAttribute('class', 'panel-body');
     $username = new Text('username');
     $username->setLabel('username');
     $username->setAttribute('class', 'form-control');
     $username->setAttribute('data-urr', '/isusernameinuse');
     $this->add($username);
     $mail = new Email('email');
     $mail->setLabel('email');
     $mail->setAttribute('class', 'form-control');
     $this->add($mail);
     $role = new Select('role');
     $role->setLabel('role');
     $role->setAttribute('class', 'form-control');
     $role->setValueOptions($roles);
     $this->add($role);
     $submit = new Submit('save');
     $submit->setValue('save');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($submit);
 }
 public function __construct()
 {
     parent::__construct();
     $this->setAttribute('method', 'post');
     $this->setAttribute('class', 'panel-body');
     $name = new Text('name');
     $name->setLabel('name');
     $name->setAttribute('class', 'form-control');
     $this->add($name);
     $type = new Select('inputType');
     $type->setAttribute('class', 'form-control');
     $type->setLabel('input.type');
     $type->setValueOptions([self::INPUT_TYPE_TEXT, self::INPUT_TYPE_TEXTAREA, self::INPUT_TYPE_DATE, self::INPUT_TYPE_TIME, self::INPUT_TYPE_DATETIME, self::INPUT_TYPE_PICTURE_UPLOAD]);
     $this->add($type);
     $orderPriority = new Text('orderPriority');
     $orderPriority->setLabel('order.priority');
     $orderPriority->setAttribute('class', 'form-control');
     $orderPriority->setValue(0);
     $this->add($orderPriority);
     $submit = new Submit('save');
     $submit->setValue('save');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($submit);
 }
Beispiel #28
0
 public function __construct(ObjectManager $objectManager)
 {
     parent::__construct('register');
     $this->filter = new InputFilter();
     $primary = new Element\Hidden('primary');
     $this->add($primary);
     $callName = new Element\Text('callName');
     $callName->setAttribute('required', true);
     $callName->setAttribute('placeholder', 'Call Name');
     $this->add($callName);
     $callNameFilter = new Input('callName');
     $callNameFilter->setRequired(true);
     $callNameFilter->getFilterChain()->attach(new AppFilter\TitleCase());
     $callNameFilter->getFilterChain()->attach(new Filter\StringTrim());
     $callNameFilter->getFilterChain()->attach(new Filter\StripTags());
     $callNameFilter->getValidatorChain()->attach(new Validator\StringLength(array('max' => 15)));
     $callNameFilter->getValidatorChain()->attach(new LocaleValidator\Alpha(array('allowWhiteSpace' => true)));
     $this->filter->add($callNameFilter);
     $regName = new Element\Text('regName');
     $regName->setAttribute('placeholder', 'Registered Name');
     $this->add($regName);
     $regNameFilter = new Input('regName');
     $regNameFilter->setRequired(false);
     $regNameFilter->getFilterChain()->attach(new AppFilter\TitleCase());
     $regNameFilter->getFilterChain()->attach(new Filter\StringTrim());
     $regNameFilter->getFilterChain()->attach(new Filter\StripTags());
     $regNameFilter->getValidatorChain()->attach(new Validator\StringLength(array('max' => 50)));
     $regNameFilter->getValidatorChain()->attach(new Validator\Regex("/^[a-z][a-z\\'\\- ]*\$/i"));
     $this->filter->add($regNameFilter);
     $sex = new Element\Select('sex');
     $sex->setAttribute('required', true);
     $sex->setValueOptions(array(1 => 'Male', 2 => 'Female'));
     $sex->setEmptyOption('Select a Sex');
     $this->add($sex);
     $sexFilter = new Input('sex');
     $sexFilter->setRequired(true);
     $this->filter->add($sexFilter);
     $breed = new AppElement\ObjectLiveSearch('breed');
     $breed->setOption('object_manager', $objectManager);
     $breed->setOption('target_class', 'Application\\Entity\\Breed');
     $breed->setOption('find_method', array('name' => 'findBy', 'params' => array('criteria' => array(), 'orderBy' => array('name' => 'ASC'))));
     $breed->setEmptyOption('Select a Breed');
     $this->add($breed);
     $breedFilter = new Input('breed');
     $breedFilter->setRequired(true);
     $this->filter->add($breedFilter);
     $dateOfBirth = new Element\Date('dateOfBirth');
     $dateOfBirth->setAttribute('required', true);
     $dateOfBirth->setAttribute('data-placeholder', 'Date of Birth');
     // placeholder attr is invalid for date input
     $dateOfBirth->setAttribute('data-mask', '0000-00-00');
     $dateOfBirth->setAttribute('class', 'datepicker');
     $this->add($dateOfBirth);
     $dateOfBirthFilter = new Input('dateOfBirth');
     $dateOfBirthFilter->setRequired(true);
     $dateOfBirthFilter->getValidatorChain()->attach(new Validator\Date());
     $this->filter->add($dateOfBirthFilter);
     $height = new Element\Number('height');
     $height->setAttribute('required', true);
     $height->setAttribute('placeholder', 'Height (Inches)');
     $this->add($height);
     $heightFilter = new Input('height');
     $heightFilter->setRequired(true);
     $heightFilter->getValidatorChain()->attach(new Validator\Between(array('min' => 6, 'max' => 30)));
     $this->filter->add($heightFilter);
     $champion = new Element\Checkbox('champion');
     $champion->setLabel('Dog is a champion of record.');
     $this->add($champion);
     $championFilter = new Input('champion');
     $championFilter->setRequired(false);
     $this->filter->add($championFilter);
     $rescue = new Element\Checkbox('rescue');
     $rescue->setLabel('Dog is a rescue.');
     $this->add($rescue);
     $rescueFilter = new Input('rescue');
     $rescueFilter->setRequired(false);
     $this->filter->add($rescueFilter);
     $buttons = new Form('buttons');
     $buttons->setOption('twb-layout', 'inline');
     $buttons->setAttribute('class', 'form-group');
     $submit = new Element\Submit('submit');
     $submit->setAttribute('class', 'btn-primary pull-right');
     $submit->setOption('glyphicon', 'circle-arrow-up');
     $submit->setLabel('Register');
     $buttons->add($submit);
     $cancel = new Element\Submit('cancel');
     $cancel->setAttribute('formnovalidate', true);
     $cancel->setAttribute('class', 'btn-warning pull-right');
     $cancel->setOption('glyphicon', 'ban-circle');
     $cancel->setLabel('Cancel');
     $buttons->add($cancel);
     $this->add($buttons);
 }
Beispiel #29
0
 public function __construct(EntityManager $em, $name = null, $options = array())
 {
     $this->em = $em;
     parent::__construct('LocationForm');
     $this->setAttribute('method', 'post');
     $this->setAttribute('enctype', 'multipart/form-data');
     $this->setAttribute('class', 'form-horizontal');
     $this->add(array('name' => 'locname', 'attributes' => array('type' => 'text', 'placeholder' => 'Location name', 'class' => 'commonDropDnInput')));
     $stid = new Element\Select('stid');
     $stid->setLabel('State');
     $stid->setValueOptions(array('' => 'State'));
     $stid->setValueOptions($this->getOptionState());
     $stid->setAttributes(array('id' => 'state'));
     $stid->setAttribute("class", "dropDnInput");
     $stid->setDisableInArrayValidator(true);
     $this->add($stid);
     $ctid = new Element\Select('ctid');
     $ctid->setLabel('City');
     $ctid->setAttributes(array('id' => 'city'));
     $ctid->setValueOptions(array('' => 'City'));
     $ctid->setAttribute("class", "dropDnInput");
     $ctid->setDisableInArrayValidator(true);
     $this->add($ctid);
     $locationtype = new Element\Select('loctypeid');
     $locationtype->setLabel('Location Type');
     $locationtype->setValueOptions($this->getOptionLocationType());
     $locationtype->setAttribute("class", "dropDnInput");
     $this->add($locationtype);
     $bestSeasonToVisit = new Element\Textarea('bestSeasonToVisit');
     $bestSeasonToVisit->setLabel('Best Season to visit');
     $bestSeasonToVisit->setAttribute("class", "selectAreaInput");
     $bestSeasonToVisit->setAttribute("rows", "4");
     $bestSeasonToVisit->setAttribute("cols", "50");
     $this->add($bestSeasonToVisit);
     $entry = new Element\Select('entry');
     $entry->setLabel('Entry');
     $entry->setValueOptions(array('' => 'Entry', '1' => 'Yes', '2' => 'No'));
     $entry->setAttribute("class", "dropDnInput");
     $this->add($entry);
     $timingOpeningNClosing = new Element\Textarea('timingOpeningNClosing');
     $timingOpeningNClosing->setLabel('Opening and closing timing');
     $timingOpeningNClosing->setAttribute("class", "selectAreaInput");
     $timingOpeningNClosing->setAttribute("rows", "4");
     $timingOpeningNClosing->setAttribute("cols", "50");
     $this->add($timingOpeningNClosing);
     $description = new Element\Textarea('description');
     $description->setLabel('Description');
     $description->setAttribute("class", "selectAreaInput");
     $description->setAttribute("rows", "4");
     $description->setAttribute("cols", "50");
     $this->add($description);
     $specialInstructions = new Element\Textarea('specialInstructions');
     $specialInstructions->setLabel('Special Instruction Description');
     $specialInstructions->setAttribute("class", "selectAreaInput");
     $specialInstructions->setAttribute("rows", "4");
     $specialInstructions->setAttribute("cols", "50");
     $this->add($specialInstructions);
     $notAllowed = new Element\Textarea('notAllowed');
     $notAllowed->setLabel('Not allowed reason');
     $notAllowed->setAttribute("class", "selectAreaInput");
     $notAllowed->setAttribute("rows", "4");
     $notAllowed->setAttribute("cols", "50");
     $this->add($notAllowed);
     $airportRailwayStatus = new Element\Select('airportRailwayStatus');
     $airportRailwayStatus->setLabel('Airport/Railway');
     $airportRailwayStatus->setValueOptions(array('' => 'Select', '1' => 'Yes', '2' => 'No'));
     $airportRailwayStatus->setAttribute("class", "dropDnInput");
     $this->add($airportRailwayStatus);
     $this->add(array('name' => 'citytemp', 'attributes' => array('type' => 'hidden', 'placeholder' => 'citytemp', 'class' => 'commonDropDnInput', 'id' => 'citytemp')));
     $this->add(array('name' => 'latitude', 'attributes' => array('type' => 'text', 'placeholder' => 'City Lattitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'longitude', 'attributes' => array('type' => 'text', 'placeholder' => 'City Longitude', 'class' => 'commonDropDnInput')));
     $this->add(array('name' => 'locationPhoto', 'attributes' => array('type' => 'file'), 'options' => array('label' => 'File Upload')));
     $this->add(array('name' => 'save', 'attributes' => array('type' => 'submit', 'value' => 'Submit', 'class' => "btn-blue")));
     //        $this->add(array(
     //    		'name' => 'cancel',
     //    		'attributes' => array(
     //				'type' => 'cancel',
     //				'value' => 'Cancel',
     //				'class' => 'btn btn-primary',
     //    		),
     //    		'options' => array(
     //				'label' => 'Cancel'
     //    		),
     //        ));
 }
Beispiel #30
0
 /**
  * 
  * @param ReportParameter $parameter
  * @return \Zend\Form\Element\Select
  */
 protected function buildSelect(ReportParameter $parameter)
 {
     $element = new Select($parameter->name);
     if ($parameter->isMultiValue()) {
         $element->setAttribute('multiple', true);
     }
     $multiOptions = array();
     foreach ($parameter->getValidValues() as $value) {
         $multiOptions[$value->Value] = $value->Label;
     }
     $element->setValueOptions($multiOptions);
     return $element;
 }