public function __construct($options = null)
 {
     parent::__construct($options);
     $roles = new Roles();
     $role_options = $roles->getRoles();
     $inst = new Institutions();
     $inst_options = $inst->getInsts();
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     $this->setName('emailsearch');
     ZendX_JQuery::enableForm($this);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $message = new Zend_Form_Element_Textarea('messageToUser');
     $message->setLabel('Message to user: '******'StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph'))->setAttribs(array('rows' => 10))->addFilter('BasicHtml')->addErrorMessage('You must enter a message to your recipient.');
     $fullname = new Zend_Form_Element_Text('fullname');
     $fullname->setLabel('Send this to: ')->addFilters(array('StringTrim', 'StripTags'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setAttrib('size', 30)->setDecorators($decorators);
     $email = $this->addElement('text', 'email', array('label' => 'Their email Address', 'size' => '30'))->email;
     $email->addValidator('EmailAddress')->addFilters(array('StringTrim', 'StripTags', 'StringToLower'))->setRequired(true)->addErrorMessage('Please enter a valid address!');
     $email->setDecorators($decorators);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->setLabel('Send to a friend');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $this->addElements(array($fullname, $submit, $message));
     $this->addDisplayGroup(array('fullname', 'email', 'messageToUser'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->details->setLegend('Details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setName('research');
     $investigator = new Zend_Form_Element_Text('investigator');
     $investigator->setLabel('Principal work conducted by: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a lead for this project.');
     $level = new Zend_Form_Element_Select('level');
     $level->setLabel('Level of research: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => null, 'Choose type of research' => $projectype_list))->addValidator('inArray', false, array(array_keys($projectype_list)));
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Project title: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->setAttrib('size', 60)->addErrorMessage('Choose title for the project.');
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Short description of project: ')->setRequired(false)->setAttribs(array('cols' => 80, 'rows' => 10))->addFilters(array('BasicHtml', 'StringTrim', 'EmptyParagraph'));
     $startDate = new ZendX_JQuery_Form_Element_DatePicker('startDate');
     $startDate->setLabel('Start date of project')->setAttrib('size', 20)->setJQueryParam('dateFormat', 'yy-mm-dd')->setRequired(false)->addErrorMessage('You must enter a start date for this project');
     $endDate = new ZendX_JQuery_Form_Element_DatePicker('endDate');
     $endDate->setLabel('End date of project')->setAttrib('size', 20)->setJQueryParam('dateFormat', 'yy-mm-dd')->setRequired(false)->addErrorMessage('You must enter an end date for this project');
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Make public: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($title, $description, $level, $startDate, $endDate, $valid, $investigator, $submit));
     $this->addDisplayGroup(array('title', 'investigator', 'level', 'description', 'startDate', 'endDate', 'valid'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
 public function __construct($options = null)
 {
     $curators = new Peoples();
     $assigned = $curators->getValuers();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('provisionalvaluations');
     $valuerID = new Zend_Form_Element_Select('valuerID');
     $valuerID->setLabel('Valuation provided by: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 25))->addValidator('InArray', false, array(array_keys($assigned)))->addMultiOptions($assigned)->setDecorators($decorators);
     $value = new Zend_Form_Element_Text('value');
     $value->setLabel('Estimated market value: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Float')->setDecorators($decorators);
     $comments = new Pas_Form_Element_RTE('comments');
     $comments->setLabel('Valuation comments: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $dateOfValuation = new ZendX_JQuery_Form_Element_DatePicker('dateOfValuation');
     $dateOfValuation->setLabel('Valuation provided on: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addValidator('Date')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($valuerID, $value, $dateOfValuation, $comments, $submit));
     $this->addDisplayGroup(array('valuerID', 'value', 'dateOfValuation', 'comments'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
 /** The constructor 
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $roles = new Roles();
     $role_options = $roles->getRoles();
     $inst = new Institutions();
     $inst_options = $inst->getInsts();
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     $this->setName('emailsearch');
     ZendX_JQuery::enableForm($this);
     $message = new Zend_Form_Element_Textarea('messageToUser');
     $message->setLabel('Message to user: '******'StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph'))->setAttribs(array('rows' => 10))->addFilter('BasicHtml')->addErrorMessage('You must enter a message to your recipient.');
     $fullname = new Zend_Form_Element_Text('fullname');
     $fullname->setLabel('Send this to: ')->addFilters(array('StringTrim', 'StripTags', 'Purifier'))->setAttrib('size', 30);
     $email = $this->addElement('text', 'email', array('label' => 'Their email Address', 'size' => '30'))->email;
     $email->addValidator('EmailAddress')->addFilters(array('StringTrim', 'StripTags', 'StringToLower'))->setRequired(true)->addErrorMessage('Please enter a valid address!');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(60);
     $this->addElement($hash);
     $this->addElements(array($fullname, $submit, $message));
     $this->addDisplayGroup(array('fullname', 'email', 'messageToUser'), 'details');
     $this->details->setLegend('Details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
 public function __construct($options = null)
 {
     parent::__construct($options);
     $levels = new ProjectTypes();
     $levelsListed = $levels->getDegrees();
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'apppend', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('education');
     ZendX_JQuery::enableForm($this);
     $school = new Zend_Form_Element_Text('school');
     $school->setLabel('Institution name: ')->setRequired(true)->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 30)->addErrorMessage('Please enter a valid institutional name!')->setDecorators($decorators);
     $schoolUrl = new Zend_Form_Element_Text('schoolUrl');
     $schoolUrl->setLabel('Institution web address: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('Uri')->setAttrib('size', 30)->addErrorMessage('Please enter a valid url!')->setDecorators($decorators);
     $subject = new Zend_Form_Element_Text('subject');
     $subject->setLabel('Subject studied: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setAttrib('size', 30)->addErrorMessage('Please enter a valid string!')->setDecorators($decorators);
     $level = new Zend_Form_Element_Select('level');
     $level->setLabel('Adademic level of study: ')->addMultiOptions(array(NULL => 'Choose an academic level', 'Valid levels' => $levelsListed))->setDecorators($decorators);
     $dateFrom = new ZendX_JQuery_Form_Element_DatePicker('dateFrom');
     $dateFrom->setLabel('Commenced programme: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Date')->addValidator('NotEmpty')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->setJQueryParams(array('yearRange' => '-20:+10'));
     $dateTo = new ZendX_JQuery_Form_Element_DatePicker('dateTo');
     $dateTo->setLabel('Finished programme: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Date')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper')->setJQueryParams(array('yearRange' => '-20:+10'));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($school, $schoolUrl, $subject, $level, $dateFrom, $dateTo, $submit));
     $this->addDisplayGroup(array('school', 'schoolUrl', 'subject', 'level', 'dateFrom', 'dateTo'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->details->setLegend('Educational background');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
Exemple #6
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $staffregions = new StaffRegions();
     $staffregions_options = $staffregions->getOptions();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setName('vacancies');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Role title: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a title for this vacancy.')->setAttrib('size', 60);
     $salary = new Zend_Form_Element_Text('salary');
     $salary->setLabel('Salary: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('size', 20)->addErrorMessage('You must enter a salary.');
     $specification = new Pas_Form_Element_CKEditor('specification');
     $specification->setLabel('Job specification: ')->setRequired(true)->addFilters(array('BasicHtml', 'StringTrim'))->setAttribs(array('cols' => 50, 'rows' => 10, 'Height' => 400))->addErrorMessage('You must enter a job description.');
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('Location of role: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addValidator('InArray', false, array(array_keys($staffregions_options)))->addMultiOptions(array(null => 'Choose region', 'Available regions' => $staffregions_options))->addErrorMessage('You must choose a region');
     $live = new ZendX_JQuery_Form_Element_DatePicker('live');
     $live->setLabel('Date for advert to go live: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->setJQueryParam('maxDate', '+1y')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20);
     $expire = new ZendX_JQuery_Form_Element_DatePicker('expire');
     $expire->setLabel('Date for advert to expire: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->setJQueryParam('maxDate', '+1y')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20);
     $status = new Zend_Form_Element_Select('status');
     $status->SetLabel('Publish status: ')->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a status', 2 => 'Publish', 1 => 'Draft'))->setValue(2)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must choose a status');
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($title, $salary, $specification, $regionID, $live, $expire, $status, $submit, $hash));
     $this->addDisplayGroup(array('title', 'salary', 'specification', 'regionID'), 'details');
     $this->details->setLegend('Vacancy details');
     $this->addDisplayGroup(array('live', 'expire', 'status'), 'dates');
     $this->dates->setLegend('Publication details');
     $this->setLegend('Vacancy details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
 public function __construct($options = null)
 {
     $curators = new Peoples();
     $assigned = $curators->getCurators();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('actionsForTreasure');
     $curatorID = new Zend_Form_Element_Select('curatorID');
     $curatorID->setLabel('Curator assigned: ')->setRequired(true)->addValidator('InArray', false, array(array_keys($assigned)))->addMultiOptions($assigned)->setDecorators($decorators);
     $chaseDate = new ZendX_JQuery_Form_Element_DatePicker('chaseDate');
     $chaseDate->setLabel('Chase date assigned: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a chase date')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($curatorID, $chaseDate, $submit, $hash));
     $this->addDisplayGroup(array('curatorID', 'chaseDate'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
 public function __construct($options = null)
 {
     $actionTypes = new TreasureActionTypes();
     $actionlist = $actionTypes->getList();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('actionsForTreasure');
     $actionDescription = new Pas_Form_Element_RTE('actionTaken');
     $actionDescription->setLabel('Action summary: ')->setRequired(true)->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400, 'ToolbarSet' => 'Basic'))->addFilters(array('StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph'));
     $action = new Zend_Form_Element_Select('actionID');
     $action->setLabel('Type of action taken: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addValidator('InArray', false, array(array_keys($actionlist)))->addMultiOptions($actionlist)->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElements(array($action, $actionDescription, $submit, $hash));
     $this->addDisplayGroup(array('actionID', 'actionTaken'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
 public function __construct($options = null)
 {
     $staff = new Contacts();
     $flos = $staff->getAttending();
     parent::__construct($options);
     ZendX_JQuery::enableForm($this);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'apppend', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('addFlo');
     $flo = new Zend_Form_Element_Select('staffID');
     $flo->setLabel('Finds officer present: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addValidator('Int')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose attending officer', 'Our staff members' => $flos));
     $dateFrom = new ZendX_JQuery_Form_Element_DatePicker('dateFrom');
     $dateFrom->setLabel('Attended from: ')->setRequired(true)->addValidator('Date')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $dateTo = new ZendX_JQuery_Form_Element_DatePicker('dateTo');
     $dateTo->setLabel('Attended to: ')->setRequired(true)->addValidator('Date')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $this->addElements(array($flo, $dateFrom, $dateTo, $submit));
     $this->addDisplayGroup(array('staffID', 'dateFrom', 'dateTo'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->details->setLegend('Attending Finds Officers');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
 public function __construct($options = null)
 {
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setName('research');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $investigator = new Zend_Form_Element_Text('investigator');
     $investigator->setLabel('Principal work conducted by: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a lead for this project.')->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $level = new Zend_Form_Element_Select('level');
     $level->setLabel('Level of research: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose type of research' => $projectype_list))->addValidator('inArray', false, array(array_keys($projectype_list)))->setDecorators($decorators);
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Project title: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Choose title for the project.')->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $description = $this->addElement('RTE', 'description', array('label' => 'Short description of project: '));
     $description = $this->getElement('description')->setRequired(false)->addFilter('stringTrim')->setAttribs(array('cols' => 80, 'rows' => 10))->addFilters(array('BasicHtml', 'StringTrim', 'EmptyParagraph'))->addDecorator('HtmlTag', array('tag' => 'li'));
     $startDate = new ZendX_JQuery_Form_Element_DatePicker('startDate');
     $startDate->setLabel('Start date of project')->setAttrib('size', 20)->setJQueryParam('dateFormat', 'yy-mm-dd')->addValidator('Date')->setRequired(false)->addErrorMessage('You must enter a start date for this project')->setDecorators($decorators);
     $endDate = new ZendX_JQuery_Form_Element_DatePicker('endDate');
     $endDate->setLabel('End date of project')->setAttrib('size', 20)->setJQueryParam('dateFormat', 'yy-mm-dd')->setRequired(false)->addValidator('Date')->addErrorMessage('You must enter an end date for this project')->setDecorators($decorators);
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Make public: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->removeDecorator('label')->setAttrib('class', 'large')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElements(array($title, $description, $level, $startDate, $endDate, $valid, $investigator, $submit, $hash));
     $this->addDisplayGroup(array('title', 'investigator', 'level', 'description', 'startDate', 'endDate', 'valid'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
 public function __construct($options = null)
 {
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $crimes = new CrimeTypes();
     $crimeoptions = $crimes->getTypes();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('rally');
     $crimeType = new Zend_Form_Element_Select('crimeType');
     $crimeType->setLabel('Crime type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must set crime type or no point entering it!')->addMultiOptions(array(NULL => 'Choose a crime type', 'Valid types' => $crimeoptions))->addValidator('inArray', false, array(array_keys($crimeoptions)))->setDecorators($decorators);
     $subject = new Zend_Form_Element_Text('subject');
     $subject->setLabel('Title: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators)->setAttrib('size', 50)->addErrorMessage('You must enter a subject for this crime');
     $reporterID = new Zend_Form_Element_Hidden('reporterID');
     $reporterID->removeDecorator('Label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You do not appear to have chosen a reporter');
     $reporter = new Zend_Form_Element_Text('reporter');
     $reporter->setLabel('Source: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->setDescription('Name and address of person providing intelligence.')->addErrorMessage('You must enter a reporter name');
     $reportingPerson = new Zend_Form_Element_Text('reportingPerson');
     $reportingPerson->setLabel('Person making the report: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->setDescription('Name of person providing intelligence.')->addErrorMessage('You must enter a reporter name');
     $reportSubject = new Zend_Form_Element_Text('reportSubject');
     $reportSubject->setLabel('Subject of report: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators)->setDescription('Name of suspect if known.')->addErrorMessage('You must enter a reporter name');
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a county', 'Valid counties' => $county_options))->addValidator('inArray', false, array(array_keys($county_options)))->setDecorators($decorators);
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose district after county'));
     $reliability = new Zend_Form_Element_Select('reliability');
     $reliability->setLabel('Source Evaluation: ')->addMultiOptions(array('1' => 'Always reliable', '2' => 'Mostly reliable', '3' => 'Sometimes reliable', '4' => 'Unreliable', '5' => 'Don\'t know'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->setDecorators($decorators);
     $intellEvaluation = new Zend_Form_Element_Select('intellEvaluation');
     $intellEvaluation->setLabel('Intelligence Evaluation: ')->addMultiOptions(array('1' => 'Known to be true', '2' => 'Known to be true by the source, but not by the person making the report', '3' => 'Not known, but is corroborated', '4' => 'Cannot be judged', '5' => 'Suspected to be false!'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setDescription('What you know about the intelligence itself.')->setOptions(array('separator' => ''))->setDecorators($decorators);
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose parish after district'))->addFilters(array('StripTags', 'StringTrim'));
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Associated NGR: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'ValidGridRef'))->setAttrib('maxlength', 16)->setDecorators($decorators);
     $description = new Pas_Form_Element_RTE('description');
     $description->setLabel('Description of crime - Main report: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $subjectDetails = new Pas_Form_Element_RTE('subjectDetails');
     $subjectDetails->setLabel('Subject details: ')->setRequired(false)->setDescription('DOB,address,description,etc if known.')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $evaluation = new Pas_Form_Element_RTE('evaluation');
     $evaluation->setLabel('Offences: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $incidentDate = new ZendX_JQuery_Form_Element_DatePicker('incidentDate');
     $incidentDate->setLabel('Date of incident: ')->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Date'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $sam = new Zend_Form_Element_Text('sam');
     $sam->setLabel('Associated with scheduled monument: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->setAttrib('size', 35);
     $samID = new Zend_Form_Element_Hidden('samID');
     $samID->removeDecorator('Label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($crimeType, $incidentDate, $samID, $sam, $reporter, $reporterID, $county, $district, $parish, $gridref, $description, $reliability, $evaluation, $subject, $reliability, $intellEvaluation, $subjectDetails, $reportSubject, $reportingPerson, $submit));
     $this->addDisplayGroup(array('subject', 'crimeType', 'description', 'incidentDate', 'evaluation', 'reportingPerson', 'reporter', 'reporterID', 'reliability', 'intellEvaluation', 'reportSubject', 'subjectDetails', 'sam', 'samID', 'gridref', 'county', 'district', 'parish'), 'details');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Crime details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
 public function __construct($options = null)
 {
     parent::__construct($options);
     $roles = new Roles();
     $role_options = $roles->getRoles();
     $inst = new Institutions();
     $inst_options = $inst->getInsts();
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     $this->setName('acceptupgrades');
     ZendX_JQuery::enableForm($this);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $level = new Zend_Form_Element_Select('level');
     $level->setLabel('Level of research: ')->setRequired(true)->addMultiOptions(array(NULL => NULL, 'Choose type of research' => $projectype_list))->setDecorators($decorators)->addFilter('StripTags')->addFilter('StringTrim')->addErrorMessage('You must set the level of research');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Project title: ')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('size', 60)->addErrorMessage('This project needs a title.')->setDecorators($decorators);
     $researchOutline = new Pas_Form_Element_RTE('researchOutline');
     $researchOutline->setLabel('Research outline: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilter('StringTrim')->addFilter('BasicHtml')->addFilter('EmptyParagraph')->addFilter('WordChars')->addErrorMessage('Outline must be present.');
     $reference = new Zend_Form_Element_Text('reference');
     $reference->setLabel('Referee\'s name: ')->setAttrib('size', 30)->addFilter('StringTrim')->addFilter('StripTags')->setDecorators($decorators);
     $referenceEmail = new Zend_Form_Element_Text('referenceEmail');
     $referenceEmail->setLabel('Referee\'s email address: ')->setAttrib('size', 30)->addValidator('EmailAddress')->addFilter('StringToLower')->addFilter('StringTrim')->addFilter('StripTags')->setDecorators($decorators);
     $message = new Pas_Form_Element_RTE('message');
     $message->setLabel('Message to user: '******'rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilter('StringTrim')->addFilter('BasicHtml')->addFilter('EmptyParagraph')->addFilter('WordChars')->addErrorMessage('You must enter a message for the user to know they have been approved.');
     $fullname = new Zend_Form_Element_Text('fullname');
     $fullname->setLabel('Fullname: ')->setAttrib('size', 30)->addFilter('StringTrim')->addFilter('StripTags')->setDecorators($decorators);
     $institution = $this->addElement('select', 'institution', array('label' => 'Recording institution: '))->institution;
     $institution->setDecorators($decorators)->addMultiOptions(array(NULL => NULL, 'Choose institution' => $inst_options));
     $role = $this->addElement('select', 'role', array('label' => 'Site role: '))->role;
     $role->setDecorators($decorators);
     $role->addMultiOptions(array(NULL => NULL, 'Choose role' => $role_options));
     $role->removeMultiOption('admin');
     $startDate = new ZendX_JQuery_Form_Element_DatePicker('startDate');
     $startDate->setLabel('Start date of project: ')->setAttrib('size', 12)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilter('StringTrim')->addFilter('StripTags')->addValidator('Date')->setRequired(false)->addErrorMessage('You must enter a valid start date for this project');
     $endDate = new ZendX_JQuery_Form_Element_DatePicker('endDate');
     $endDate->setLabel('End date of project: ')->addValidator('Date')->addFilter('StringTrim')->addFilter('StripTags')->setJQueryParam('dateFormat', 'yy-mm-dd')->setAttrib('size', 12)->setRequired(false)->addErrorMessage('You must enter a valid end date for this project');
     $email = $this->addElement('text', 'email', array('label' => 'Email Address', 'size' => '30'))->email;
     $email->addValidator('emailAddress')->setRequired(true)->addFilter('StringToLower')->addErrorMessage('Please enter a valid address!')->setDecorators($decorators);
     $already = new Zend_Form_Element_Radio('already');
     $already->setLabel('Is your topic already listed on our research register?: ')->addMultiOptions(array(1 => 'Yes it is', 0 => 'No it isn\'t'))->setRequired(true)->setOptions(array('separator' => ''))->setDecorators($decorators);
     $insert = new Zend_Form_Element_Checkbox('insert');
     $insert->setLabel('Insert details into research register: ')->setCheckedValue(1)->setDecorators($decorators);
     $valid = new Zend_Form_Element_Radio('higherLevel');
     $valid->setLabel('Approve?: ')->addMultiOptions(array(1 => 'Unauthorised', 0 => 'Authorised'))->setRequired(true)->setOptions(array('separator' => ''))->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($reference, $referenceEmail, $researchOutline, $startDate, $endDate, $fullname, $valid, $level, $title, $submit, $already, $insert, $message));
     $this->addDisplayGroup(array('fullname', 'username', 'email', 'institution', 'level', 'role', 'reference', 'referenceEmail', 'message', 'researchOutline', 'title', 'startDate', 'endDate', 'already', 'higherLevel', 'insert'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->details->setLegend('Details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
Exemple #13
0
 public function __construct($options = null)
 {
     $staffregions = new StaffRegions();
     $staffregions_options = $staffregions->getOptions();
     $eventtypes = new EventTypes();
     $event_options = $eventtypes->getTypes();
     $orgs = array('PAS' => 'The Portable Antiquities Scheme', 'BM' => 'The British Museum', 'MLA' => 'MLA', 'HLF' => 'Heritage Lottery Fund', 'IFA' => 'Institute of Archaeology', 'CBA' => 'Council for British Archaeology', 'ARCH' => 'Current Archaeology', 'AF' => 'The Art Fund', 'LOC' => 'Local museum', 'NADFAS' => 'NADFAS', 'CASPAR' => 'CASPAR');
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('event');
     $eventTitle = new Zend_Form_Element_Text('eventTitle');
     $eventTitle->setLabel('Event title: ')->setRequired(true)->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 70)->setDecorators($decorators);
     $eventDescription = new Pas_Form_Element_RTE('eventDescription');
     $eventDescription->setLabel('Event description: ')->setRequired(true)->addFilters('StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds');
     $address = new Zend_Form_Element_Text('eventLocation');
     $address->setLabel('Address: ')->setRequired(true)->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setAttrib('size', 70)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $eventStartTime = new Zend_Form_Element_Text('eventStartTime');
     $eventStartTime->setLabel('Event start time: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator(new Zend_Validate_Date('H:i:s'))->setDecorators($decorators);
     $eventEndTime = new Zend_Form_Element_Text('eventEndTime');
     $eventEndTime->setLabel('Event end time: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator(new Zend_Validate_Date('H:i:s'))->setDecorators($decorators);
     $eventStartDate = new ZendX_JQuery_Form_Element_DatePicker('eventStartDate');
     $eventStartDate->setLabel('Event start date: ')->setRequired(false)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Date')->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $eventEndDate = new ZendX_JQuery_Form_Element_DatePicker('eventEndDate');
     $eventEndDate->setLabel('Event end date: ')->setRequired(false)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Date')->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $eventRegion = new Zend_Form_Element_Select('eventRegion');
     $eventRegion->setLabel('Organising section: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 10))->addValidator('inArray', false, array(array_keys($staffregions_options)))->addMultiOptions($staffregions_options)->setDecorators($decorators);
     $eventType = new Zend_Form_Element_Select('eventType');
     $eventType->setLabel('Type of event: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 10))->addValidator('inArray', false, array(array_keys($event_options)))->addMultiOptions($event_options)->setDecorators($decorators);
     $adultsAttend = new Zend_Form_Element_Text('adultsAttend');
     $adultsAttend->setLabel('Adults attending: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setDecorators($decorators);
     $childrenAttend = new Zend_Form_Element_Text('childrenAttend');
     $childrenAttend->setLabel('Children attending: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setDecorators($decorators);
     $organisation = new Zend_Form_Element_Select('organisation');
     $organisation->setLabel('Organised by: ')->setRequired(false)->setValue('PAS')->addFilters(array('StripTags', 'StringTrim'))->addMultioptions(array(NULL => 'Choose an organisation', 'Available institutions' => array($orgs)))->addValidator('InArray', false, array(array_keys($orgs)))->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $this->addElements(array($eventTitle, $eventDescription, $eventStartTime, $eventEndTime, $eventStartDate, $eventEndDate, $organisation, $childrenAttend, $eventRegion, $adultsAttend, $address, $eventType, $submit));
     $this->addDisplayGroup(array('eventTitle', 'eventDescription', 'eventLocation', 'eventStartTime', 'eventEndTime', 'eventStartDate', 'eventEndDate', 'eventRegion', 'organisation', 'childrenAttend', 'adultsAttend', 'eventType'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
Exemple #14
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setName('tvcdates');
     $date = new ZendX_JQuery_Form_Element_DatePicker('date');
     $date->setLabel('Date of TVC: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a chase date')->setAttrib('size', 20);
     $location = new Zend_Form_Element_Text('location');
     $location->setLabel('Location of meeting: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a location')->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($date, $location, $submit, $hash));
     $this->addDisplayGroup(array('date', 'location'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $institutions = new Institutions();
     $inst_options = $institutions->getInsts();
     $rulers = new Rulers();
     $ruler_options = $rulers->getRulersByzantine();
     $denominations = new Denominations();
     $denomination_options = $denominations->getDenomsByzantine();
     $mints = new Mints();
     $mint_options = $mints->getMintsByzantine();
     $periods = new Periods();
     $periodword_options = $periods->getPeriodsHoards();
     parent::__construct($options);
     $this->setName('coinsummary-search');
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Broad period: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $periodword_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(1);
     ###
     ##Numismatic data
     ###
     //Denomination
     $denomination = new Zend_Form_Element_Select('denominationID');
     $denomination->setLabel('Denomination: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->addMultiOptions(array(null => 'Choose denomination type', 'Available denominations' => $denomination_options))->setOrder(2);
     //Primary ruler
     $ruler = new Zend_Form_Element_Select('rulerID');
     $ruler->setLabel('Ruler / issuer: ')->setRegisterInArrayValidator(false)->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose primary ruler', 'Available rulers' => $ruler_options))->setOrder(3);
     //Mint
     $mint = new Zend_Form_Element_Select('mintID');
     $mint->setLabel('Issuing mint: ')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose denomination type', 'Available mints' => $mint_options))->setOrder(4);
     $institution = new Zend_Form_Element_Select('institution');
     $institution->setLabel('Recording institution: ')->setRequired(false)->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose institution', 'Choose institution' => $inst_options))->setOrder(5);
     $quantity = new ZendX_JQuery_Form_Element_Spinner('quantity');
     $quantity->setLabel('Quantity in hoard')->setJQueryParams(array('defaultValue' => 1, 'min' => 1, 'max' => 50000))->setAttribs(array('class' => 'input-large'))->addValidators(array('Int'))->setOrder(6);
     $fromDate = new Zend_Form_Element_Text('fromDate');
     $fromDate->setLabel('Date from: ')->setValidators(array('Int'))->setAttribs(array('placeholder' => 'YYYY', 'class' => 'input-small'))->setOrder(7);
     $toDate = new Zend_Form_Element_Text('toDate');
     $toDate->setLabel('Date to: ')->setValidators(array('Int'))->setAttribs(array('placeholder' => 'YYYY', 'class' => 'input-small'))->setOrder(8);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Search summaries');
     $this->addElements(array($broadperiod, $denomination, $mint, $institution, $ruler, $quantity, $fromDate, $toDate, $submit));
     $this->addDisplayGroup(array('broadperiod', 'denominationID', 'rulerID', 'mintID', 'fromDate', 'toDate', 'quantity', 'institution'), 'numismatics');
     $this->numismatics->setLegend('Summary details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     ZendX_JQuery::enableForm($this);
     parent::init();
 }
 public function __construct($options = null)
 {
     parent::__construct($options);
     ZendX_JQuery::enableForm($this);
     $this->setName('newsstory');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'apppend', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $date = Zend_Date::now()->toString('yyyy-MM-dd');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('News story title: ')->setRequired(false)->setAttrib('size', 60)->addErrorMessage('Please enter a title for this story.')->setDecorators($decorators);
     $summary = new Zend_Form_Element_Textarea('summary');
     $summary->setLabel('Short summary: ')->setRequired(true)->setAttrib('rows', 5)->setAttrib('cols', 70)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $contents = new Pas_Form_Element_RTE('contents');
     $contents->setLabel('News story content: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $address = new Zend_Form_Element_Text('primaryNewsLocation');
     $address->setLabel('News address (puts it on map): ')->setRequired(true)->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $author = new Zend_Form_Element_Text('author');
     $author->setLabel('Principal author: ')->setRequired(true)->setAttrib('size', 60)->addErrorMessage('Please enter a title for this story.')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $contactEmail = new Zend_Form_Element_Text('contactEmail');
     $contactEmail->setLabel('Contact email address: ')->setRequired(false)->setAttrib('size', 50)->addErrorMessage('Please enter a valid email.')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('EmailAddress')->setDecorators($decorators);
     $contactName = new Zend_Form_Element_Text('contactName');
     $contactName->setLabel('Contact name: ')->setRequired(false)->setAttrib('size', 50)->addErrorMessage('Please enter a title for this story.')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $contactTel = new Zend_Form_Element_Text('contactTel');
     $contactTel->setLabel('Contact telephone number: ')->addFilters(array('StripTags', 'StringTrim'))->setRequired(false)->addErrorMessage('Please enter a valid telephone number.')->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $keywords = new Zend_Form_Element_Text('keywords');
     $keywords->setLabel('Keywords for the story: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 50)->addErrorMessage('Please enter a valid tags.')->setDecorators($decorators);
     $golive = new ZendX_JQuery_Form_Element_DatePicker('golive');
     $golive->setLabel('News story to go live: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->removeDecorator('DtDdWrapper')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'));
     $publishstate = new Zend_Form_Element_Radio('publish_state');
     $publishstate->setLabel('Publication state: ')->addMultiOptions(array('0' => 'Draft', '1' => 'Publish'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($title, $summary, $contents, $author, $contactEmail, $contactTel, $contactName, $keywords, $address, $golive, $publishstate, $submit));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElement($hash);
     $this->addDisplayGroup(array('title', 'summary', 'contents', 'author', 'contactName', 'contactTel', 'contactEmail', 'primaryNewsLocation', 'keywords', 'golive', 'publish_state'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->details->setLegend('Story details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
Exemple #17
0
 public function __construct($options = null)
 {
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     ZendX_JQuery::enableForm($this);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('rally');
     $rally_name = new Zend_Form_Element_Text('rally_name');
     $rally_name->setLabel('Rally name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setAttrib('size', 60)->addErrorMessage('Come on it\'s not that hard, enter a name for the rally!')->setDecorators($decorators);
     $organisername = new Zend_Form_Element_Text('organisername');
     $organisername->setLabel('Rally Organiser: ')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $organiser = new Zend_Form_Element_Hidden('organiser');
     $organiser->removeDecorator('Label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addFilters(array('StripTags', 'StringTrim'));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addMultiOptions(array(NULL => 'Choose a county', 'Valid counties' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha', false, array('allowWhiteSpace' => true));
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose district after county'))->addValidator('Alpha', false, array('allowWhiteSpace' => true));
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose parish after district'))->addValidator('Alpha', false, array('allowWhiteSpace' => true));
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Centred on field at NGR: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('maxlength', 16)->setDecorators($decorators)->addValidators(array('NotEmpty', 'ValidGridRef'));
     $record_method = new Pas_Form_Element_RTE('record_method');
     $record_method->setLabel('Recording methodology employed: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 80)->addFilters(array('BasicHtml', 'EmptyParagraph', 'StringTrim'));
     $comments = new Zend_Form_Element_Textarea('comments');
     $comments->setLabel('Comments on rally: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 80)->addFilters(array('BasicHtml', 'EmptyParagraph', 'StringTrim'));
     //Date found from
     $date_from = new ZendX_JQuery_Form_Element_DatePicker('date_from');
     $date_from->setLabel('Start date of rally: ')->setRequired(false)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Date')->setDecorators($decorators);
     //Date found to
     $date_to = new ZendX_JQuery_Form_Element_DatePicker('date_to');
     $date_to->setLabel('End date of rally: ')->setRequired(false)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Date')->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($rally_name, $date_from, $date_to, $organiser, $organisername, $county, $district, $parish, $gridref, $comments, $record_method, $submit));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElement($hash);
     $this->addDisplayGroup(array('rally_name', 'comments', 'record_method', 'date_from', 'date_to', 'organiser', 'organisername', 'county', 'district', 'parish', 'gridref'), 'details');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Rally details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $actionTypes = new TreasureActionTypes();
     $actionlist = $actionTypes->getList();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setName('actionsForTreasure');
     $actionDescription = new Pas_Form_Element_CKEditor('actionTaken');
     $actionDescription->setLabel('Action summary: ')->setRequired(true)->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400, 'ToolbarSet' => 'Basic'))->addFilters(array('StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph'));
     $action = new Zend_Form_Element_Select('actionID');
     $action->setLabel('Type of action taken: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($actionlist)))->addMultiOptions($actionlist);
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($action, $actionDescription, $submit, $hash));
     $this->addDisplayGroup(array('actionID', 'actionTaken'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setName('finalvaluation');
     $value = new Zend_Form_Element_Text('value');
     $value->setLabel('Estimated market value: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Currency');
     $comments = new Pas_Form_Element_CKEditor('comments');
     $comments->setLabel('Valuation comments: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'EmptyParagraph'));
     $dateOfValuation = new ZendX_JQuery_Form_Element_DatePicker('dateOfValuation');
     $dateOfValuation->setLabel('Valuation provided on: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a chase date')->setAttrib('size', 20);
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(60);
     $this->addElements(array($value, $dateOfValuation, $comments, $submit, $hash));
     $this->addDisplayGroup(array('value', 'dateOfValuation', 'comments'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemple #20
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $staffregions = new StaffRegions();
     $staffregions_options = $staffregions->getOptions();
     $eventtypes = new EventTypes();
     $event_options = $eventtypes->getTypes();
     $orgs = array('PAS' => 'The Portable Antiquities Scheme', 'BM' => 'The British Museum', 'MLA' => 'MLA', 'HLF' => 'Heritage Lottery Fund', 'IFA' => 'Institute of Archaeology', 'CBA' => 'Council for British Archaeology', 'ARCH' => 'Current Archaeology', 'AF' => 'The Art Fund', 'LOC' => 'Local museum', 'NADFAS' => 'NADFAS', 'CASPAR' => 'CASPAR');
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setName('event');
     $eventTitle = new Zend_Form_Element_Text('eventTitle');
     $eventTitle->setLabel('Event title: ')->setRequired(true)->addErrorMessage('You must enter an event title')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->setAttrib('size', 70);
     $eventDescription = new Pas_Form_Element_CKEditor('eventDescription');
     $eventDescription->setLabel('Event description: ')->setRequired(true)->addFilters(array('StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph'))->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds');
     $address = new Zend_Form_Element_Text('eventLocation');
     $address->setLabel('Address: ')->setRequired(true)->addErrorMessage('You must enter an address')->setAttrib('size', 70)->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     $eventStartTime = new Zend_Form_Element_Text('eventStartTime');
     $eventStartTime->setLabel('Event start time: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator(new Zend_Validate_Date('H:i:s'))->setDescription('Enter in 24 hour clock format');
     $eventEndTime = new Zend_Form_Element_Text('eventEndTime');
     $eventEndTime->setLabel('Event end time: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator(new Zend_Validate_Date('H:i:s'))->setDescription('Enter in 24 hour clock format');
     $eventStartDate = new ZendX_JQuery_Form_Element_DatePicker('eventStartDate');
     $eventStartDate->setLabel('Event start date: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You need a start date')->setAttrib('size', 20);
     $eventEndDate = new ZendX_JQuery_Form_Element_DatePicker('eventEndDate');
     $eventEndDate->setLabel('Event end date: ')->setRequired(false)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You need an end date')->setAttrib('size', 20);
     $eventRegion = new Zend_Form_Element_Select('eventRegion');
     $eventRegion->setLabel('Organising section: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('stringLength', false, array(1, 10))->addValidator('inArray', false, array(array_keys($staffregions_options)))->addMultiOptions(array(null => 'Please choose a region', 'Valid regions' => $staffregions_options));
     $eventType = new Zend_Form_Element_Select('eventType');
     $eventType->setLabel('Type of event: ')->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 10))->addValidator('inArray', false, array(array_keys($event_options)))->addMultiOptions($event_options);
     $adultsAttend = new Zend_Form_Element_Text('adultsAttend');
     $adultsAttend->setLabel('Adults attending: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $childrenAttend = new Zend_Form_Element_Text('childrenAttend');
     $childrenAttend->setLabel('Children attending: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $organisation = new Zend_Form_Element_Select('organisation');
     $organisation->setLabel('Organised by: ')->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setValue('PAS')->addFilters(array('StripTags', 'StringTrim'))->addMultioptions(array(null => 'Choose an organisation', 'Available institutions' => $orgs))->addValidator('InArray', false, array(array_keys($orgs)));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($eventTitle, $eventDescription, $eventStartTime, $eventEndTime, $eventStartDate, $eventEndDate, $organisation, $childrenAttend, $eventRegion, $adultsAttend, $address, $eventType, $submit, $hash));
     $this->addDisplayGroup(array('eventTitle', 'eventDescription', 'eventLocation', 'eventStartTime', 'eventEndTime', 'eventStartDate', 'eventEndDate', 'eventRegion', 'organisation', 'childrenAttend', 'adultsAttend', 'eventType'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $staff = new Contacts();
     $flos = $staff->getAttending();
     parent::__construct($options);
     ZendX_JQuery::enableForm($this);
     $this->setName('addFlo');
     $flo = new Zend_Form_Element_Select('staffID');
     $flo->setLabel('Finds officer present: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addValidator('Int')->addMultiOptions(array(null => 'Choose attending officer', 'Our staff members' => $flos))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $dateFrom = new ZendX_JQuery_Form_Element_DatePicker('dateFrom');
     $dateFrom->setLabel('Attended from: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty')->setAttrib('size', 20);
     $dateTo = new ZendX_JQuery_Form_Element_DatePicker('dateTo');
     $dateTo->setLabel('Attended to: ')->setRequired(false)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20);
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($flo, $dateFrom, $dateTo, $submit));
     $this->addDisplayGroup(array('staffID', 'dateFrom', 'dateTo'), 'details');
     $this->details->setLegend('Attending Finds Officers');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
 public function __construct($options = null)
 {
     parent::__construct($options);
     $roles = new Roles();
     $role_options = $roles->getRoles();
     $inst = new Institutions();
     $inst_options = $inst->getInsts();
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     $this->setName('acceptupgrades');
     ZendX_JQuery::enableForm($this);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $researchOutline = new Zend_Form_Element_Textarea('researchOutline');
     $researchOutline->setLabel('Research outline: ')->setRequired(true)->addFilters(array('StringTrim', 'BasicHtml'))->setAttribs(array('rows' => 10))->addErrorMessage('Outline must be present.');
     $message = new Zend_Form_Element_Textarea('messageToUser');
     $message->setLabel('Message to user: '******'StringTrim', 'BasicHtml', 'EmptyParagraph'))->setAttribs(array('rows' => 10))->addErrorMessage('You must enter a message for the user to know they have been approved.');
     $reference = new Zend_Form_Element_Text('reference');
     $reference->setLabel('Referee\'s name: ')->setAttrib('size', 30)->addFilters(array('StringTrim', 'StripTags'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators);
     $referenceEmail = new Zend_Form_Element_Text('referenceEmail');
     $referenceEmail->setLabel('Referee\'s email address: ')->setAttrib('size', 30)->addFilters(array('StringTrim', 'StripTags', 'StringToLower'))->addValidator('EmailAddress', false, array('mx' => true))->setDecorators($decorators);
     $fullname = new Zend_Form_Element_Text('fullname');
     $fullname->setLabel('Fullname: ')->setAttrib('size', 30)->addFilters(array('StringTrim', 'StripTags'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators);
     $email = $this->addElement('text', 'email', array('label' => 'Email Address', 'size' => '30'))->email;
     $email->setRequired(true)->addFilters(array('StringTrim', 'StripTags', 'StringToLower'))->addValidator('EmailAddress', false, array('mx' => true))->addErrorMessage('Please enter a valid address!');
     $email->setDecorators($decorators);
     $already = new Zend_Form_Element_Radio('already');
     $already->setLabel('Is your topic already listed on our research register?: ')->addMultiOptions(array(1 => 'Yes it is', 0 => 'No it isn\'t'))->setRequired(true)->setOptions(array('separator' => ''))->setDecorators($decorators);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->setLabel('Reject application');
     $this->addElements(array($researchOutline, $fullname, $reference, $referenceEmail, $submit, $message));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElement($hash);
     $this->addDisplayGroup(array('fullname', 'email', 'messageToUser', 'reference', 'referenceEmail', 'researchOutline'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->details->setLegend('Details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
Exemple #23
0
 public function __construct($options = null)
 {
     $staffregions = new StaffRegions();
     $staffregions_options = $staffregions->getOptions();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $decorator = array('SimpleInput');
     $decoratorSelect = array('SelectInput');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('vacancies');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Role title: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addErrorMessage('You must enter a title for this vacancy.')->setAttrib('size', 60)->setDecorators($decorators);
     $salary = new Zend_Form_Element_Text('salary');
     $salary->setLabel('Salary: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('size', 20)->addValidator('Currency')->addErrorMessage('You must enter a salary.')->setDecorators($decorators);
     $specification = new Pas_Form_Element_RTE('specification');
     $specification->setLabel('Job specification: ')->setRequired(true)->addFilters(array('BasicHtml', 'StringTrim'))->setAttribs(array('cols' => 50, 'rows' => 10, 'Height' => 400))->setAttrib('ToolbarSet', 'Basic')->addErrorMessage('You must enter a job description.');
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('Location of role: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addValidator('InArray', false, array(array_keys($staffregions_options)))->addMultiOptions(array(NULL => NULL, 'Choose region' => $staffregions_options))->setDecorators($decorators)->addErrorMessage('You must choose a region');
     $live = new ZendX_JQuery_Form_Element_DatePicker('live');
     $live->setLabel('Date for advert to go live: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->setJQueryParam('maxDate', '+1y')->addFilters(array('StringTrim', 'StripTags'))->addValidator('Date')->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $expire = new ZendX_JQuery_Form_Element_DatePicker('expire');
     $expire->setLabel('Date for advert to expire: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->setJQueryParam('maxDate', '+1y')->addFilters(array('StringTrim', 'StripTags'))->addValidator('Date')->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $status = new Zend_Form_Element_Select('status');
     $status->SetLabel('Publish status: ')->setRequired(true)->addMultiOptions(array(NULL => 'Choose a status', '2' => 'Publish', '1' => 'Draft'))->setValue(2)->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorators)->addErrorMessage('You must choose a status');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->setAttrib('class', 'large');
     $this->addElements(array($title, $salary, $specification, $regionID, $live, $expire, $status, $submit));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElement($hash);
     $this->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('title', 'salary', 'specification', 'regionID'), 'details');
     $this->details->setLegend('Vacancy details');
     $this->details->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('live', 'expire', 'status'), 'dates');
     $this->dates->setLegend('Publication details');
     $this->dates->removeDecorator('DtDdWrapper');
     $this->setLegend('Vacancy details');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $curators = new People();
     $assigned = $curators->getValuers();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setName('provisionalvaluations');
     $valuerID = new Zend_Form_Element_Select('valuerID');
     $valuerID->setLabel('Valuation provided by: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('StringLength', false, array(1, 25))->addValidator('InArray', false, array(array_keys($assigned)))->addMultiOptions($assigned);
     $value = new Zend_Form_Element_Text('value');
     $value->setLabel('Estimated market value: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Float');
     $comments = new Pas_Form_Element_CKEditor('comments');
     $comments->setLabel('Valuation comments: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $dateOfValuation = new ZendX_JQuery_Form_Element_DatePicker('dateOfValuation');
     $dateOfValuation->setLabel('Valuation provided on: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20);
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($valuerID, $value, $dateOfValuation, $comments, $submit));
     $this->addDisplayGroup(array('valuerID', 'value', 'dateOfValuation', 'comments'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemple #25
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $eventtypes = new EventTypes();
     $event_options = $eventtypes->getTypesWords();
     $event_options['Leave'] = 'Leave';
     $event_options['Celebration'] = 'Celebration';
     $event_options['Demonstration'] = 'Demonstration';
     $event_options['Workshop'] = 'Workshop';
     $event_options['TVC'] = 'TVC';
     $event_options['Project meeting'] = 'Project meeting';
     $event_options['Hack day'] = 'Hack day';
     $event_options['Regional Meeting'] = 'Regional Meeting';
     $event_options['National Meeting'] = 'National Meeting';
     $event_options['Celebration'] = 'Celebration/Party';
     $event_options['Training course'] = 'Training course';
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setName('event');
     $eventTitle = new Zend_Form_Element_Text('title');
     $eventTitle->setLabel('Event title: ')->setRequired(true)->addErrorMessage('You must enter an event title')->addFilters(array('StripTags', 'StringTrim', 'BasicHtml'))->setAttrib('size', 70)->setAttrib('class', 'span8');
     $eventDescription = new Pas_Form_Element_CKEditor('content');
     $eventDescription->setLabel('Event description: ')->setRequired(true)->addFilters(array('StringTrim', 'WordChars'))->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('class', 'span8')->addErrorMessage('You must enter a description');
     $address = new Zend_Form_Element_Text('location');
     $address->setLabel('Address: ')->setRequired(true)->addErrorMessage('You must enter an address/location')->setAttrib('class', 'span8')->addFilters(array('StripTags', 'StringTrim', 'BasicHtml'));
     $eventStartTime = new Zend_Form_Element_Text('startTime');
     $eventStartTime->setLabel('Event start time: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator(new Zend_Validate_Date('H:i:s'))->addErrorMessage('You must enter a time for the start of the event')->setAttribs(array('placeholder' => 'Enter in 24 hour clock format ' . 'eg 11:00 not 1100 or 11.00', 'class' => 'span8'));
     $eventEndTime = new Zend_Form_Element_Text('endTime');
     $eventEndTime->setLabel('Event end time: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator(new Zend_Validate_Date('H:i:s'))->addErrorMessage('You must enter a time for the end of the event')->setAttribs(array('placeholder' => 'Enter in 24 hour clock ' . 'format eg 11:00 not 1100 or 11.00', 'class' => 'span8'));
     $eventStartDate = new ZendX_JQuery_Form_Element_DatePicker('startDate');
     $eventStartDate->setLabel('Event start date: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('placeholder', 'Format of YYYY-mm-dd')->addErrorMessage('You must enter a date')->setAttrib('size', 20);
     $eventEndDate = new ZendX_JQuery_Form_Element_DatePicker('endDate');
     $eventEndDate->setLabel('Event end date: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('placeholder', 'Format of YYYY-mm-dd')->addErrorMessage('You must enter a date')->setAttrib('size', 20);
     $eventType = new Zend_Form_Element_Select('eventType');
     $eventType->setLabel('Type of event: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('stringLength', false, array(1, 50))->addValidator('inArray', false, array(array_keys($event_options)))->addMultiOptions(array(null => 'Choose type of event', 'Available options' => $event_options));
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($eventTitle, $eventDescription, $eventStartTime, $eventEndTime, $eventStartDate, $eventEndDate, $address, $eventType, $submit));
     $this->addDisplayGroup(array('title', 'content', 'location', 'startTime', 'endTime', 'startDate', 'endDate', 'eventType'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemple #26
0
 public function __construct($options = null)
 {
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('tvcdates');
     $date = new ZendX_JQuery_Form_Element_DatePicker('date');
     $date->setLabel('Date of TVC: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a chase date')->addValidator('Date')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $location = new Zend_Form_Element_Text('location');
     $location->setLabel('Location of meeting: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a location')->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($date, $location, $submit));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElement($hash);
     $this->addDisplayGroup(array('date', 'location'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
Exemple #27
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $counties = new OsCounties();
     $county_options = $counties->getCountiesID();
     parent::__construct($options);
     ZendX_JQuery::enableForm($this);
     $this->setName('rally');
     $rally_name = new Zend_Form_Element_Text('rally_name');
     $rally_name->setLabel('Rally name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->setAttrib('class', 'span6')->addErrorMessage('You must enter a rally name');
     $organisername = new Zend_Form_Element_Text('organisername');
     $organisername->setLabel('Rally Organiser: ')->addFilters(array('StripTags', 'StringTrim'));
     $organiser = new Zend_Form_Element_Hidden('organiser');
     $organiser->addFilters(array('StripTags', 'StringTrim'));
     $county = new Zend_Form_Element_Select('countyID');
     $county->setLabel('County: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a county', 'Valid counties' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $district = new Zend_Form_Element_Select('districtID');
     $district->setLabel('District: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose district after county'))->addValidator('Int');
     $parish = new Zend_Form_Element_Select('parishID');
     $parish->setLabel('Parish: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose parish after district'))->addValidator('Int');
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Centred on field at NGR: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('maxlength', 16)->addValidators(array('NotEmpty', 'ValidGridRef'));
     $record_method = new Zend_Form_Element_Textarea('record_method');
     $record_method->setLabel('Recording methodology employed: ')->setAttribs(array('class' => 'span6'))->addFilters(array('StripTags', 'BasicHtml', 'EmptyParagraph', 'StringTrim'));
     $comments = new Zend_Form_Element_Textarea('comments');
     $comments->setLabel('Comments on rally: ')->setAttribs(array('class' => 'span6'))->addFilters(array('StripTags', 'BasicHtml', 'EmptyParagraph', 'StringTrim'));
     //Date found from
     $date_from = new ZendX_JQuery_Form_Element_DatePicker('date_from');
     $date_from->setLabel('Start date of rally: ')->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'));
     //Date found to
     $date_to = new ZendX_JQuery_Form_Element_DatePicker('date_to');
     $date_to->setLabel('End date of rally: ')->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'));
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($rally_name, $date_from, $date_to, $organiser, $organisername, $county, $district, $parish, $gridref, $comments, $record_method, $submit));
     $this->addDisplayGroup(array('rally_name', 'comments', 'record_method', 'date_from', 'date_to', 'organiser', 'organisername', 'countyID', 'districtID', 'parishID', 'gridref'), 'details');
     $this->details->setLegend('Rally details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     ZendX_JQuery::enableForm($this);
     $this->setName('newsstory');
     $date = Zend_Date::now()->toString('yyyy-MM-dd');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('News story title: ')->setRequired(false)->setAttrib('size', 60)->addErrorMessage('Please enter a title for this story.');
     $summary = new Zend_Form_Element_Textarea('summary');
     $summary->setLabel('Short summary: ')->setRequired(true)->setAttrib('rows', 5)->setAttrib('cols', 70)->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     $contents = new Pas_Form_Element_CKEditor('contents');
     $contents->setLabel('News story content: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->addFilters(array('StringTrim', 'HtmlBody', 'EmptyParagraph', 'WordChars'));
     $address = new Zend_Form_Element_Text('primaryNewsLocation');
     $address->setLabel('News address (puts it on map): ')->setRequired(true)->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     $author = new Zend_Form_Element_Text('author');
     $author->setLabel('Principal author: ')->setRequired(true)->setAttrib('size', 60)->addErrorMessage('Please enter a title for this story.')->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     $contactEmail = new Zend_Form_Element_Text('contactEmail');
     $contactEmail->setLabel('Contact email address: ')->setRequired(false)->setAttrib('size', 50)->addErrorMessage('Please enter a valid email.')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('EmailAddress');
     $contactName = new Zend_Form_Element_Text('contactName');
     $contactName->setLabel('Contact name: ')->setRequired(true)->setAttrib('size', 50)->addErrorMessage('Please enter a contact for this story.')->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     $contactTel = new Zend_Form_Element_Text('contactTel');
     $contactTel->setLabel('Contact telephone number: ')->addFilters(array('StripTags', 'StringTrim'))->setRequired(false)->addErrorMessage('Please enter a valid telephone number.');
     $keywords = new Zend_Form_Element_Text('keywords');
     $keywords->setLabel('Keywords for the story: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 50)->addErrorMessage('Please enter a valid tags.');
     $golive = new ZendX_JQuery_Form_Element_DatePicker('golive');
     $golive->setLabel('News story to go live: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20);
     $publishstate = new Zend_Form_Element_Radio('publish_state');
     $publishstate->setLabel('Publication state: ')->addMultiOptions(array('0' => 'Draft', '1' => 'Publish'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'));
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($title, $summary, $contents, $author, $contactEmail, $contactTel, $contactName, $keywords, $address, $golive, $publishstate, $submit, $hash));
     $this->addDisplayGroup(array('title', 'summary', 'contents', 'author', 'contactName', 'contactTel', 'contactEmail', 'primaryNewsLocation', 'keywords', 'golive', 'publish_state'), 'details');
     $this->details->setLegend('Story details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemple #29
0
 /**
  * действие edit
  */
 public function editAction()
 {
     $request = $this->getRequest();
     $params = $request->getParams();
     $form = new Application_Form_NewsEdit();
     ZendX_JQuery::enableForm($form);
     $model = new Application_Model_NewsTopic();
     //подключаем модель новости
     if ($this->getRequest()->isPost()) {
         $data = $request->getPost();
         if ($form->isValid($data)) {
             $model->setTopic($data);
             $model->save();
             return $this->_helper->redirector('index');
         }
     } elseif (isset($params['id'])) {
         // если не сохранение, и передан id новости, выводим заполненную форму
         $model->fillTopicById($params['id']);
         $data = $model->getTopic();
         $form->populate($data);
         //заполняем форму значениями
     }
     $this->view->form = $form;
 }
 public function testFormEnableShouldIncludeElementsOnRender()
 {
     $view = new Zend_View();
     $form = new Zend_Form();
     $element = new ZendX_JQuery_Form_Element_Spinner("spinner1");
     $form->setView($view);
     $form->addElement($element);
     ZendX_JQuery::enableForm($form);
     $this->assertFalse($form->getElement('spinner1')->getView() instanceof Zend_View);
     $form->render();
     $this->assertTrue($form->getElement('spinner1')->getView() instanceof Zend_View);
     $this->assertTrue(false !== $form->getElement('spinner1')->getView()->getPluginLoader('helper')->getPaths('ZendX_JQuery_View_Helper'));
 }