Example #1
0
 /** Initialise the form
  * @access public
  * @return void
  */
 public function init()
 {
     $roles = new Roles();
     $role_options = $roles->getRoles();
     $inst = new Institutions();
     $inst_options = $inst->getInsts();
     $username = $this->addElement('text', 'username', array('label' => 'Username: '******'StripTags', 'StringTrim'))->setRequired(true);
     $firstName = $this->addElement('text', 'first_name', array('label' => 'First Name', 'size' => '30'))->first_name;
     $firstName->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('You must enter a firstname');
     $lastName = $this->addElement('text', 'last_name', array('label' => 'Last Name', 'size' => '30'))->last_name;
     $lastName->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('You must enter a surname');
     $preferred_name = $this->addElement('text', 'preferred_name', array('label' => 'Preferred Name: ', 'size' => '30'))->preferred_name;
     $preferred_name->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('You must enter your preferred name');
     $fullname = $this->addElement('text', 'fullname', array('label' => 'Full name: ', 'size' => '30'))->fullname;
     $fullname->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('You must enter your preferred name');
     $email = $this->addElement('text', 'email', array('label' => 'Email Address', 'size' => '30'))->email;
     $email->addValidator('EmailAddress')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setRequired(true)->addErrorMessage('Please enter a valid address!');
     $password = $this->addElement('password', 'password', array('label' => 'Change password: '******'size' => '30'))->password;
     $password->setRequired(false);
     $institution = $this->addElement('select', 'institution', array('label' => 'Recording institution: '))->institution;
     $institution->addMultiOptions(array(null => 'Choose institution', 'Available institutions' => $inst_options))->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     $canRecord = $this->addElement('checkbox', 'canRecord', array('label' => 'Allowed to record: '))->canRecord;
     $role = $this->addElement('select', 'role', array('label' => 'Site role: '))->role;
     $role->addMultiOptions(array(null => 'Choose a role', 'Available roles' => $role_options))->setAttrib('class', 'input-medium selectpicker show-menu-arrow');
     $person = $this->addElement('text', 'person', array('label' => 'Personal details attached: '))->person;
     $peopleID = $this->addElement('hidden', 'peopleID', array())->peopleID;
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElement($submit);
     $this->addDisplayGroup(array('username', 'first_name', 'last_name', 'fullname', 'preferred_name', 'email', 'institution', 'role', 'password', 'person', 'peopleID', 'canRecord'), 'userdetails');
     $this->addDisplayGroup(array('submit'), 'buttons');
     $this->setLegend('Edit account details: ');
     parent::init();
 }
Example #2
0
 public function __construct($options = null)
 {
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     parent::__construct($options);
     $this->setName('suggested');
     $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('Please choose a level' => NULL, 'Research levels' => $projectype_list))->addValidator('InArray', false, array(array_keys($projectype_list)))->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorators);
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Broad research period: ')->setRequired(true)->addMultiOptions(array('Please choose a period' => NULL, 'Periods available' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorators);
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Project title: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Choose title for the project.')->setDecorators($decorators);
     $description = $this->addElement('Textarea', 'description', array('label' => 'Short description of project: '));
     $description = $this->getElement('description')->setRequired(false)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->setAttribs(array('cols' => 80, 'rows' => 10))->addDecorator('HtmlTag', array('tag' => 'li'));
     $valid = new Zend_Form_Element_Checkbox('taken');
     $valid->setLabel('Is the topic taken: ')->setRequired(true)->setDecorators($decorators)->addValidator('Int');
     $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', 'submit')->removeDecorator('label')->removeDecorator('HtmlTag')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper');
     $this->addElements(array($title, $level, $period, $description, $valid, $submit, $hash));
     $this->addDisplayGroup(array('title', 'level', 'period', 'description', 'taken'), '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');
 }
Example #3
0
 /** the constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $periods = new Periods();
     $period_options = $periods->getCoinsPeriod();
     parent::__construct($options);
     $this->setName('moneyers');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Moneyer\'s name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('Enter a moneyer\'s name');
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Broad period: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a period for this type')->addMultioptions(array(null => 'Choose a period', 'Available Options' => $period_options));
     $date_1 = new Zend_Form_Element_Text('date_1');
     $date_1->setLabel('Issued coins from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a date for the start of moneyer period');
     $date_2 = new Zend_Form_Element_Text('date_2');
     $date_2->setLabel('Issued coins until: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a date for the end of moneyer period');
     $appear = new Zend_Form_Element_Text('appear');
     $appear->setLabel('Appearance on coins: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'));
     $RRC = new Zend_Form_Element_Text('RRC');
     $RRC->setLabel('RRC ID number: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'));
     $bio = new Pas_Form_Element_CKEditor('bio');
     $bio->setLabel('Biography: ')->setRequired(true)->addFilters(array('StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph'))->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400))->setAttrib('ToolbarSet', 'Finds')->addErrorMessage('You must enter a biography');
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Is this term valid?: ');
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($period, $name, $date_1, $date_2, $bio, $appear, $RRC, $valid, $submit));
     $this->addDisplayGroup(array('name', 'period', 'date_1', 'date_2', 'appear', 'RRC', 'bio', 'valid', 'submit'), 'details');
     parent::init();
 }
 /** Construct the form
  * @access public
  * @param type $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $cats = new CategoriesCoins();
     $cat_options = $cats->getCategoriesAll();
     $rulers = new Rulers();
     $ruler_options = $rulers->getAllMedRulers();
     parent::__construct($options);
     $this->setName('MedievalType');
     $type = new Zend_Form_Element_Text('type');
     $type->setLabel('Medieval type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('class' => 'textInput', 'class' => 'span8'));
     $broadperiod = new Zend_Form_Element_Select('periodID');
     $broadperiod->setLabel('Broadperiod for type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->addMultioptions(array(null => 'Choose broadperiod', 'Available options' => array(47 => 'Early Medieval', 29 => 'Medieval', 36 => 'Post Medieval')));
     $category = new Zend_Form_Element_Select('categoryID');
     $category->setLabel('Coin category: ')->setAttribs(array('class' => 'textInput'))->addFilter('StringTrim')->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->addMultioptions(array(null => 'Choose a category', 'Available options' => $cat_options))->addValidator('InArray', false, array(array_keys($cat_options)));
     $ruler = new Zend_Form_Element_Select('rulerID');
     $ruler->setLabel('Ruler assigned to: ')->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->addFilter('StringTrim')->addMultioptions(array(null => 'Choose a ruler', 'Available options' => $ruler_options))->addValidator('inArray', false, array(array_keys($ruler_options)));
     $datefrom = new Zend_Form_Element_Text('datefrom');
     $datefrom->setLabel('Date type in use from: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'));
     $dateto = new Zend_Form_Element_Text('dateto');
     $dateto->setLabel('Date type in use until: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Submit details for medieval coin type');
     $this->addElements(array($type, $broadperiod, $category, $ruler, $datefrom, $dateto, $submit))->setLegend('Add an active type of Medieval coin')->setMethod('post');
     parent::init();
 }
Example #5
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $this->setName('Decmethods');
     $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')));
     $term = new Zend_Form_Element_Text('term');
     $term->setLabel('Decoration style term: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid title for this decorative method!')->setDecorators($decorators);
     $termdesc = new Pas_Form_Element_RTE('termdesc');
     $termdesc->setLabel('Description of decoration style: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('BasicHtml', 'EmptyParagraph'))->addFilter('WordChars');
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Is this term valid?: ')->setRequired(true)->setDecorators($decorators);
     $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', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($term, $termdesc, $valid, $submit));
     $this->addDisplayGroup(array('term', 'termdesc', 'valid'), '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');
     $this->details->setLegend('Decoration method details: ');
 }
Example #6
0
 public function __construct($options = null)
 {
     $periods = new Periods();
     $period_options = $periods->getCoinsPeriod();
     parent::__construct($options);
     $this->setName('ruler');
     $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')));
     $issuer = new Zend_Form_Element_Text('issuer');
     $issuer->setLabel('Ruler or issuer name: ')->setRequired(true)->addErrorMessage('Please enter a name for this issuer or ruler.')->setDecorators($decorators)->setAttrib('size', 70)->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addFilters(array('StripTags', 'StringTrim'));
     $date1 = new Zend_Form_Element_Text('date1');
     $date1->setLabel('Date issued from: ')->setRequired(true)->setDecorators($decorators)->addErrorMessage('You must enter a date for the start of their issue.')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $date2 = new Zend_Form_Element_Text('date2');
     $date2->setLabel('Date issued to: ')->setRequired(true)->setDecorators($decorators)->addErrorMessage('You must enter a date for the end of their issue.')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->SetLabel('Is this ruler or issuer currently valid: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setDecorators($decorators);
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Broad period attributed to: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose reason' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->setDecorators($decorators)->addErrorMessage('You must enter a period for this ruler/issuer');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($issuer, $date1, $date2, $period, $valid, $submit, $hash));
     $this->addDisplayGroup(array('issuer', 'date1', 'date2', 'period', 'valid', 'submit'), 'details');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->setLegend('Issuer or ruler details: ');
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
 }
 public function __construct($options = null)
 {
     parent::__construct($options);
     $this->setAttrib('enctype', 'multipart/form-data');
     $this->setName('AddRulerImage');
     $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')));
     $image = new Zend_Form_Element_File('image');
     $image->setLabel('Upload an image: ')->setRequired(true)->setDestination('./images/rulers/')->addValidator('Size', false, 2097152)->addValidator('Extension', false, 'jpeg,tif,jpg,png,gif,JPG,TIFF')->setMaxFileSize(1024000)->setAttribs(array('class' => 'textInput'))->addValidator('Count', false, array('min' => 1, 'max' => 1))->addDecorator('File');
     $caption = new Zend_Form_Element_Text('caption');
     $caption->setLabel('Image caption')->setRequired(true)->setAttrib('size', 60)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a label');
     $rulerID = new Zend_Form_Element_Hidden('rulerID');
     $rulerID->removeDecorator('label')->removeDecorator('HtmlTag')->addValidator('Int')->setRequired(true);
     $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 button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Upload an image of a ruler')->setAttribs(array('class' => 'large'));
     $this->addElements(array($image, $rulerID, $caption, $submit))->setLegend('Add an image to a ruler profile');
     $this->addDisplayGroup(array('image', 'caption'), '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)
 {
     $periods = new Periods();
     $period_options = $periods->getPeriodFromWords();
     $counties = new OsCounties();
     $counties_options = $counties->getCountiesID();
     parent::__construct($options);
     $this->setName('whatwherewhen');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addErrorMessage('Please enter a valid string!');
     //Objecttype - autocomplete from thesaurus
     $objecttype = new Zend_Form_Element_Text('objecttype');
     $objecttype->setLabel('What: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addErrorMessage('Please enter a valid string!');
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('When: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $period_options))->addValidator('InArray', false, array($period_options));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Where: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose county', 'Available counties' => $counties_options))->addValidator('InArray', false, array($counties_options));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Search!');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($old_findID, $objecttype, $county, $broadperiod, $submit, $hash));
     $this->addDisplayGroup(array('old_findID', 'objecttype', 'broadperiod', 'county', 'submit'), 'Search');
     $this->Search->setLegend('What/Where/When search');
     parent::init();
 }
 public function __construct($options = null)
 {
     parent::__construct($options);
     $this->setName('MintToRuler');
     $reverseID = new Zend_Form_Element_Select('reverseID');
     $reverseID->setLabel('Reverse type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setAttribs(array('class' => 'textInput'));
     $rulerID = new Zend_Form_Element_Hidden('rulerID');
     $rulerID->removeDecorator('label')->removeDecorator('HtmlTag')->addValidator('Int');
     $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 button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Add a reverse type for this ruler')->setAttribs(array('class' => 'large'));
     $this->addElements(array($reverseID, $rulerID, $submit));
     $this->addDisplayGroup(array('reverseID'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->details->setLegend('Add an active Mint');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
     $this->details->setLegend('Add an active reverse type');
 }
Example #10
0
 public function __construct($options = null)
 {
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFromWords();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setMethod('post');
     $this->setName('filterfinds');
     $this->addElementPrefixPath('Pas_Validate', 'Pas/Validate/', 'validate');
     $this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element/', 'element');
     $this->addPrefixPath('Pas_Form_Decorator', 'Pas/Form/Decorator/', 'decorator');
     $decorator = array('TableDecInput');
     $objecttype = new Zend_Form_Element_Text('objecttype');
     $objecttype->setLabel('Filter by object type')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha', false, array('allowWhiteSpace' => true))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 10)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $oldfindID = new Zend_Form_Element_Text('old_findID');
     $oldfindID->setLabel('Filter by find ID #')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 11)->addValidator('stringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Filter by broadperiod')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose period from' => $periodword_options))->addValidator('InArray', false, array(array_keys($periodword_options)));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Filter by county')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setLabel('Filter:')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'largefilter');
     $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($objecttype, $oldfindID, $broadperiod, $county, $submit));
 }
 public function __construct($options = null)
 {
     $periods = new Periods();
     $period_options = $periods->getPeriodFromWords();
     $counties = new Counties();
     $counties_options = $counties->getCountyname2();
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('whatwherewhen');
     $this->removeDecorator('HtmlTag');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addErrorMessage('Please enter a valid string!')->setDecorators($decorators);
     //Objecttype - autocomplete from thesaurus
     $objecttype = new Zend_Form_Element_Text('objecttype');
     $objecttype->setLabel('What: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addErrorMessage('Please enter a valid string!')->setDecorators($decorators);
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('When: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose period from' => $period_options))->addValidator('InArray', false, array($period_options))->setDecorators($decorators);
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Where: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose county' => $counties_options))->addValidator('InArray', false, array($counties_options))->setDecorators($decorators);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Search!')->setAttribs(array('class' => 'large'))->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($old_findID, $objecttype, $county, $broadperiod, $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('old_findID', 'objecttype', 'broadperiod', 'county', 'submit'), 'Search');
     $this->Search->removeDecorator('DtDdWrapper');
     $this->Search->removeDecorator('HtmlTag');
     $this->Search->addDecorators(array(array('HtmlTag', array('tag' => 'ul', 'id' => 'www'))))->setLegend('What/Where/When search')->addDecorator('FieldSet');
 }
Example #12
0
 /** 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();
 }
Example #13
0
 /** 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)
 {
     $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');
 }
 public function __construct($options = null)
 {
     $refs = new Coinclassifications();
     $ref_list = $refs->getClass();
     parent::__construct($options);
     $this->setName('addcoinreference');
     $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')));
     $classID = new Zend_Form_Element_Select('classID');
     $classID->setLabel('Publication title: ')->setRequired(true)->addMultiOptions(array(NULL => 'Choose reference', 'Valid choices' => $ref_list))->addValidator('InArray', false, array(array_keys($ref_list)))->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a title')->setDecorators($decorators);
     $volume = new Zend_Form_Element_Text('vol_no');
     $volume->setLabel('Volume number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 9)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $reference = new Zend_Form_Element_Text('reference');
     $reference->setLabel('Reference number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 15)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($classID, $volume, $reference, $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('classID', 'vol_no', 'reference'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->details->setLegend('Add a new reference');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
 public function __construct($options = null)
 {
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFromWords();
     $activities = new PrimaryActivities();
     $activities_options = $activities->getTerms();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setName('filterpeople');
     $decorator = array('TableDecInput');
     $name = new Zend_Form_Element_Text('organisation');
     $name->setLabel('Filter by name')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 40)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $contact = new Zend_Form_Element_Text('contact');
     $contact->setLabel('Filter by contact person: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Enter a valid organisation')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $contactpersonID = new Zend_Form_Element_Hidden('contactpersonID');
     $contactpersonID->removeDecorator('Label')->removeDecorator('DtDdWrapper')->addFilters(array('StripTags', 'StringTrim'))->removeDecorator('HtmlTag')->addValidator('Alnum');
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Filter by county')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setLabel('Filter')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->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->addElement($hash);
     $this->addElements(array($name, $county, $contact, $contactpersonID, $submit));
 }
Example #17
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();
 }
Example #18
0
 public function __construct($options = null)
 {
     $periods = new Periods();
     $period_actives = $periods->getCoinsPeriod();
     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('coinsclass');
     $referenceName = new Zend_Form_Element_Text('referenceName');
     $referenceName->setLabel('Reference volume title: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->setAttrib('size', 60);
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->SetLabel('Is this volume currently valid: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Period: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('inArray', false, array(array_keys($period_actives)))->addMultiOptions(array(NULL => NULL, 'Choose period:' => $period_actives))->addErrorMessage('You must enter a period for this mint')->setDecorators($decorators);
     //Submit button
     $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($referenceName, $valid, $period, $submit));
     $this->addDisplayGroup(array('referenceName', 'period', 'valid'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->setLegend('Mint details: ');
     $this->details->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
Example #19
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     parent::__construct($options);
     $this->setName('suggested');
     $level = new Zend_Form_Element_Select('level');
     $level->setLabel('Level of research: ')->setRequired(true)->addMultiOptions(array(null => 'Please choose a level', 'Research levels' => $projectype_list))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($projectype_list)))->addFilters(array('StringTrim', 'StripTags'));
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Broad research period: ')->setRequired(true)->addMultiOptions(array(null => 'Please choose a period', 'Periods available' => $period_options))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($period_options)))->addFilters(array('StringTrim', 'StripTags'));
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Project title: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StringTrim', 'StripTags'))->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'));
     $valid = new Zend_Form_Element_Checkbox('taken');
     $valid->setLabel('Is the topic taken: ')->setRequired(true)->addValidator('Int');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($title, $level, $period, $description, $valid, $submit, $hash));
     $this->addDisplayGroup(array('title', 'level', 'period', 'description', 'taken'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
 public function __construct($options = null)
 {
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFromWords();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setMethod('get');
     $this->setName('filterfinds');
     $decorator = array('TableDecInput');
     $objectType = new Zend_Form_Element_Select('objectType');
     $objectType->setLabel('Filter by object type')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha', false, array('allowWhiteSpace' => true))->addErrorMessage('Come on it\'s not that hard, enter a title!')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Filter by broadperiod')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Filter by county')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setLabel('Filter:')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'largefilter');
     $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($objectType, $broadperiod, $county, $submit));
 }
Example #21
0
 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');
 }
 public function __construct($options = null)
 {
     parent::__construct($options);
     $services = new WebServices();
     $servicesListed = $services->getValidServices();
     $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('socialweb');
     $username = new Zend_Form_Element_Text('account');
     $username->setLabel('Account username: '******'StringTrim', 'StripTags'))->setAttrib('size', 30)->addErrorMessage('Please enter a valid username!')->setDecorators($decorators);
     $service = new Zend_Form_Element_Select('accountName');
     $service->setLabel('Social services: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => 'Choose a service', 'Valid services' => $servicesListed))->addValidator('InArray', false, array(array_keys($servicesListed)))->setDecorators($decorators);
     $public = new Zend_Form_Element_Checkbox('public');
     $public->setLabel('Show this to public users?: ')->addFilters(array('StringTrim', 'StripTags'))->setRequired(true)->setDecorators($decorators)->addErrorMessage('You must set the status of this account');
     $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(4800);
     $this->addElements(array($service, $hash, $username, $public, $submit));
     $this->addDisplayGroup(array('accountName', 'account', 'public'), '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');
 }
Example #23
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     $authors = new Users();
     $authorOptions = $authors->getAuthors();
     parent::__construct($options);
     $this->setName('activity');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Project title: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('Choose title for the project.');
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Short description of project: ')->setRequired(true)->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400))->setAttrib('ToolbarSet', 'Basic')->addFilters(array('BasicHtml', 'EmptyParagraph', 'StringTrim'));
     $length = new Zend_Form_Element_Text('length');
     $length->setLabel('Length of project: ')->setAttrib('size', 12)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a duration for this project in months')->addValidator('Digits')->setDescription('Enter length in months');
     $managedBy = new Zend_Form_Element_Select('managedBy');
     $managedBy->setLabel('Managed by: ')->addMultiOptions(array('Choose an author' => $authorOptions))->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($authorOptions)))->addErrorMessage('You must enter a manager for this project.');
     $suitableFor = new Zend_Form_Element_Select('suitableFor');
     $suitableFor->setLabel('Suitable for: ')->addMultiOptions(array(null => 'Choose type of research', 'Available types' => $projectype_list))->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($projectype_list)))->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter suitability for this task.');
     $location = new Zend_Form_Element_Text('location');
     $location->setLabel('Where would this be located?: ')->setAttrib('size', 12)->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a location for the task.');
     $valid = new Zend_Form_Element_Checkbox('status');
     $valid->setLabel('Publish this task? ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'));
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(480);
     $this->addElements(array($title, $description, $length, $valid, $managedBy, $suitableFor, $location, $submit, $hash));
     $this->addDisplayGroup(array('title', 'description', 'length', 'location', 'suitableFor', 'managedBy', 'status', 'submit'), 'details');
     $this->details->setLegend('Activity details: ');
     parent::init();
 }
Example #24
0
 public function __construct($options = null)
 {
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFrom();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setMethod('post');
     $this->setName('filterusers');
     $this->addElementPrefixPath('Pas_Validate', 'Pas/Validate/', 'validate');
     $this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element/', 'element');
     $this->addPrefixPath('Pas_Form_Decorator', 'Pas/Form/Decorator/', 'decorator');
     $decorator = array('TableDecInput');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Filter by ID #: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 11)->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $label = new Zend_Form_Element_Text('label');
     $label->setLabel('Filter by image label:')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 25)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Filter by broadperiod: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose period from' => $periodword_options))->addValidator('InArray', false, array(array_keys($periodword_options)));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Filter by county: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setLabel('Filter')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $this->addElements(array($old_findID, $label, $broadperiod, $county, $submit));
 }
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('comments');
     $commentType = new Zend_Form_Element_Hidden('comment_type');
     $commentType->addFilters(array('StripTags', 'StringTrim'));
     $comment_findID = new Zend_Form_Element_Hidden('contentID');
     $comment_findID->addFilters(array('StripTags', 'StringTrim'));
     $comment_author = new Zend_Form_Element_Text('comment_author');
     $comment_author->setLabel('Enter your name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addErrorMessage('Please enter a valid name!');
     $comment_author_email = new Zend_Form_Element_Text('comment_author_email');
     $comment_author_email->setLabel('Enter your email address: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('EmailAddress', false, array('mx' => true))->addErrorMessage('Please enter a valid email address!')->setDescription('* This will not be displayed to the public.');
     $comment_author_url = new Zend_Form_Element_Text('comment_author_url');
     $comment_author_url->setLabel('Enter your web address: ')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addErrorMessage('Please enter a valid address!')->addValidator('Url')->setDescription('* Not compulsory');
     $comment_content = new Pas_Form_Element_CKEditor('comment_content');
     $comment_content->setLabel('Enter your comment: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $status = new Zend_Form_Element_Radio('commentStatus');
     $status->setLabel('Message status:')->addMultiOptions(array('isspam' => 'Set as spam', 'isham' => 'Submit ham?', 'notspam' => 'Spam free'))->setValue('notSpam')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setOptions(array('separator' => ''));
     $commentApproval = new Zend_Form_Element_Radio('comment_approved');
     $commentApproval->setLabel('Approval:')->addMultiOptions(array('moderation' => 'Moderation', 'approved' => 'Approved'))->setValue('approved')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setOptions(array('separator' => ''));
     $this->addElements(array($comment_author, $comment_author_email, $comment_content, $comment_author_url, $comment_findID, $commentApproval, $commentType, $status, $hash, $submit));
     $this->addDisplayGroup(array('comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'commentStatus', 'comment_approved', 'contentID', 'comment_type'), 'details');
     $this->details->setLegend('Enter your comments: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Example #26
0
 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');
 }
Example #27
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     parent::__construct($options);
     $this->setName('period');
     $term = new Zend_Form_Element_Text('term');
     $term->setLabel('Period name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'))->addValidator('Alpha', false, array('allowWhiteSpace' => true))->setAttrib('size', 60)->addErrorMessage('You must enter a period name');
     $fromdate = new Zend_Form_Element_Text('fromdate');
     $fromdate->setLabel('Date period starts: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter a start date');
     $todate = new Zend_Form_Element_Text('todate');
     $todate->setLabel('Date period ends: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter an end date');
     $notes = new Pas_Form_Element_CKEditor('notes');
     $notes->setLabel('Period notes: ')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Period is currently in use: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter a status');
     $parent = new Zend_Form_Element_Select('parent');
     $parent->setLabel('Period belongs to: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($term, $fromdate, $todate, $valid, $notes, $parent, $submit, $hash));
     $this->addDisplayGroup(array('term', 'fromdate', 'todate', 'parent', 'notes', 'valid'), 'details');
     $this->details->setLegend('Period details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Example #28
0
 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)
 {
     $finds = new Findspots();
     $schema = $finds->info();
     $fields = array_flip($schema['cols']);
     $remove = array('updated', 'created', 'updatedBy', 'createdBy', 'institution', 'findID', 'address', 'fourFigure', 'gridlen', 'postcode', 'easting', 'northing', 'declong', 'declat', 'fourFigureLat', 'fourFigureLon', 'woeid', 'geonamesID', 'osmNode', 'elevation', 'geohash', 'country', 'map25k', 'map10k', 'soiltype', 'smrref', 'otherref', 'id', 'accuracy', 'secuid', 'old_occupierid', 'occupier', 'old_findspotid', 'date');
     foreach ($remove as $rem) {
         unset($fields[$rem]);
     }
     $labels = array('gridrefcert' => 'Grid reference certainty', 'gridref' => 'Grid reference', 'knownas' => 'Known as', 'disccircum' => 'Discovery circumstances', 'gridrefsrc' => 'Grid reference source', 'landusevalue' => 'Land use value', 'landusecode' => 'Land use code', 'depthdiscovery' => 'Depth of discovery', 'Highsensitivity' => 'High sensitivity');
     parent::__construct($options);
     $this->setName('configureFindSpotCopy');
     $elements = array();
     foreach (array_keys($fields) as $field) {
         $label = $field;
         $field = new Zend_Form_Element_Checkbox($field);
         if (array_key_exists($label, $labels)) {
             $clean = ucfirst($labels[$label]);
         } else {
             $clean = ucfirst($label);
         }
         $field->setLabel($clean)->setRequired(false)->addValidator('NotEmpty', 'boolean');
         $elements[] = $field;
         $this->addElement($field);
     }
     $this->addDisplayGroup($elements, 'details');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Submit find spot configuration');
     $this->addElement($submit);
     $this->details->setLegend('Choose fields: ');
     parent::init();
 }
Example #30
0
 public function __construct($options = null)
 {
     $periods = new Periods();
     $period_options = $periods->getMedievalCoinsPeriodList();
     $cats = new CategoriesCoins();
     $cat_options = $cats->getCategoriesAll();
     $rulers = new Rulers();
     $ruler_options = $rulers->getAllMedRulers();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setName('medievaltype');
     $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')));
     $type = new Zend_Form_Element_Text('type');
     $type->setLabel('Coin type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('You must enter a type name.')->setDecorators($decorators);
     $periodID = new Zend_Form_Element_Select('periodID');
     $periodID->setLabel('Medieval period: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a period for this type')->addMultioptions(array(NULL => NULL, 'Choose a period' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setDecorators($decorators);
     $rulerID = new Zend_Form_Element_Select('rulerID');
     $rulerID->setLabel('Ruler assigned: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultioptions(array(NULL => NULL, 'Choose a ruler' => $ruler_options))->addValidator('InArray', false, array(array_keys($ruler_options)))->addValidator('Int')->setDecorators($decorators);
     $datefrom = new Zend_Form_Element_Text('datefrom');
     $datefrom->setLabel('Date in use from: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setDecorators($decorators);
     $dateto = new Zend_Form_Element_Text('dateto');
     $dateto->setLabel('Date in use until: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setDecorators($decorators);
     $categoryID = new Zend_Form_Element_Select('categoryID');
     $categoryID->setLabel('Coin category: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose a category' => $cat_options))->addValidator('InArray', false, array(array_keys($cat_options)))->addValidator('Int')->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $this->addElements(array($type, $rulerID, $periodID, $categoryID, $datefrom, $dateto, $submit));
     $this->addDisplayGroup(array('periodID', 'type', 'categoryID', 'rulerID', 'datefrom', 'dateto', 'submit'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->setLegend('Mint details: ');
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
 }