Beispiel #1
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();
 }
Beispiel #2
0
 public function __construct($options = null)
 {
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     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('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')->setDecorators($decorators);
     $fromdate = new Zend_Form_Element_Text('fromdate');
     $fromdate->setLabel('Date period starts: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidators('Digits')->addErrorMessage('You must enter a start date')->setDecorators($decorators);
     $todate = new Zend_Form_Element_Text('todate');
     $todate->setLabel('Date period ends: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidators('Digits')->addErrorMessage('You must enter an end date')->setDecorators($decorators);
     $notes = new Pas_Form_Element_RTE('notes');
     $notes->setLabel('Period notes: ')->setRequired(false)->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')->setDecorators($decorators);
     $parent = new Zend_Form_Element_Select('parent');
     $parent->setLabel('Period belongs to: ')->setRequired(false)->addMultiOptions(array(NULL => NULL, 'Choose period to' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setDecorators($decorators);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($term, $fromdate, $todate, $valid, $notes, $parent, $submit));
     $this->addDisplayGroup(array('term', 'fromdate', 'todate', 'parent', 'notes', 'valid'), 'details')->removeDecorator('HtmlTag');
     $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->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->details->setLegend('Period details: ');
     $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();
     $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');
 }
 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));
 }
Beispiel #5
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();
 }
 public function __construct($options = null)
 {
     //Get data to form select menu for periods
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     //Materials menu
     $materials = new Materials();
     $material_options = $materials->getMetals();
     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('denomination');
     $denomination = new Zend_Form_Element_Text('denomination');
     $denomination->setLabel('Denomination name: ')->setRequired(true)->setAttrib('size', 70)->addErrorMessage('Please enter a term.')->setDecorators($decorators);
     //Period from: Assigned via dropdown
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Period assigned to: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($period_options)))->addMultiOptions(array(NULL => NULL, 'Choose period from' => $period_options))->setDecorators($decorators)->addErrorMessage('You must enter a period for this denomination');
     //Primary material
     $material = new Zend_Form_Element_Select('material');
     $material->setLabel('Material: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($material_options)))->addMultiOptions(array(NULL => NULL, 'Choose material' => $material_options))->addErrorMessage('You must enter a material for this denomination.')->setDecorators($decorators);
     $description = new Pas_Form_Element_RTE('description');
     $description->setLabel('Description: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('BasicHtml', 'EmptyParagraph', 'WordChars'))->addErrorMessage('You must enter a description for this denomination.');
     $rarity = new Zend_Form_Element_Textarea('rarity');
     $rarity->setLabel('Rarity: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 70)->addFilters(array('BasicHtml', 'EmptyParagraph', 'WordChars'));
     $weight = new Zend_Form_Element_Text('weight');
     $weight->setLabel('Weight: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 5)->setDecorators($decorators);
     $diameter = new Zend_Form_Element_Text('diameter');
     $diameter->setLabel('Diameter: ')->setRequired(false)->setAttrib('size', 5)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $thickness = new Zend_Form_Element_Text('thickness');
     $thickness->setLabel('Thickness: ')->setRequired(false)->setAttrib('size', 5)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Denomination in use: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must set a status')->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($denomination, $period, $material, $description, $weight, $rarity, $thickness, $diameter, $valid, $submit));
     $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->addDisplayGroup(array('denomination', 'period', 'material', 'description', 'rarity', 'thickness', 'diameter', 'weight', '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('Denomination details: ');
 }
Beispiel #7
0
 public function __construct($options = null)
 {
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     $copyrights = new Copyrights();
     $copy = $copyrights->getStyles();
     $auth = Zend_Auth::getInstance();
     $this->_auth = $auth;
     if ($this->_auth->hasIdentity()) {
         $user = $this->_auth->getIdentity();
         $this->_copyright = $user->copyright;
     } else {
         $this->_copyright = 'The Portable Antiquities Scheme';
     }
     parent::__construct($options);
     $this->setAttrib('enctype', 'multipart/form-data');
     $this->setName('imagetofind');
     $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)->setAttrib('size', 20)->addValidator('Extension', false, 'jpeg,tif,jpg,png,gif,tiff,JPG,JPEG,GIF,PNG,TIFF,TIF')->addDecorator('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li'))->addDecorator('Label')->addDecorator('HtmlTag', array('tag' => 'li'))->addDecorator('file')->setDescription('Filename should not include spaces,commas,( or )')->addErrorMessage('You must upload a file with the correct file extension in this array - jpeg,tif,jpg,png,gif');
     $imagelabel = new Zend_Form_Element_Text('label');
     $imagelabel->setLabel('Image label: ')->setRequired(true)->setAttrib('size', 60)->addErrorMessage('You must enter a label')->setDescription('This must be descriptive text about the image - NOT THE FILE or FIND NUMBER/NAME')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'));
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Period: ')->setRequired(true)->setDecorators($decorators)->addErrorMessage('You must enter a period for the image')->addMultiOptions(array(NULL => 'Select a period', 'Valid periods' => $period_options))->addValidator('inArray', false, array(array_keys($period_options)));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->setRequired(true)->setDecorators($decorators)->addErrorMessage('You must enter a county of origin')->addMultiOptions(array(NULL => 'Select a county of origin', 'Valid counties' => $county_options))->addValidator('inArray', false, array(array_keys($county_options)));
     $copyright = new Zend_Form_Element_Select('copyrighttext');
     $copyright->setLabel('Image copyright: ')->setRequired(true)->addErrorMessage('You must enter a licence holder')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Select a licence holder', 'Valid copyrights' => $copy))->setValue($this->_copyright);
     $type = new Zend_Form_Element_Select('type');
     $type->setLabel('Image type: ')->setRequired(true)->addMultiOptions(array(NULL => 'Select the type of image', 'Image types' => array('digital' => 'Digital image', 'illustration' => 'Scanned illustration')))->setValue('digital')->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper');
     $this->addElements(array($image, $imagelabel, $county, $period, $copyright, $type, $submit));
     $this->setMethod('post');
     $this->addDisplayGroup(array('image', 'label', 'county', 'period', 'copyrighttext', 'type'), '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')->removeDecorator('HtmlTag');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
     $this->details->setLegend('Attach an image');
 }
Beispiel #8
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $counties = new OsCounties();
     $county_options = $counties->getCountyNames();
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     $licenses = new LicenseTypes();
     $license = $licenses->getList();
     parent::__construct($options);
     $this->setName('imageeditfind');
     $imagelabel = new Zend_Form_Element_Text('label');
     $imagelabel->setLabel('Image label')->setRequired(true)->setAttribs(array('size' => 70, 'class' => 'span6'))->addErrorMessage('You must enter a label')->addFilters(array('StringTrim', 'StripTags'));
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Period: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a period', 'Available periods' => $period_options))->addValidator('inArray', false, array(array_keys($period_options)));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose a county', 'Available counties' => $county_options))->addValidator('inArray', false, array(array_keys($county_options)));
     $copyright = new Zend_Form_Element_Select('imagerights');
     $copyright->setLabel('Image copyright: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addErrorMessage('You must enter a licence holder')->addMultiOptions(array(null => 'Select a licence holder', 'Valid copyrights' => $this->getCopyrights()))->setDescription('You can set the copyright of your image here
                 to your institution. If you are a public recorder, it
                 should default to your full name. For institutions that do
                 not appear contact head office to suggest its addition.')->setValue($this->getCopyright());
     $licenseField = new Zend_Form_Element_Select('ccLicense');
     $licenseField->setDescription('Our philosophy is to make our content
         available openly, by default we set the license as use by attribution
         to gain the best public benefit. You can choose a different license
         if you wish.');
     $licenseField->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setLabel('Creative Commons license:')->addMultiOptions(array(null => 'Select a license', 'Available licenses' => $license))->setValue(4)->addValidator('Int');
     $type = new Zend_Form_Element_Select('type');
     $type->setLabel('Image type: ')->setRequired(true)->addMultiOptions(array('Please choose publish state' => array('digital' => 'Digital image', 'illustration' => 'Scanned illustration')))->setValue('digital')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StringTrim', 'StripTags'));
     $rotate = new Zend_Form_Element_Radio('rotate');
     $rotate->setLabel('Rotate the image: ')->setRequired(false)->addValidator('Int')->addMultiOptions(array(-90 => '90 degrees anticlockwise', -180 => '180 degrees anticlockwise', -270 => '270 degrees anticlockwise', 90 => '90 degrees clockwise', 180 => '180 degrees clockwise', 270 => '270 degrees clockwise'));
     $regenerate = new Zend_Form_Element_Checkbox('regenerate');
     $regenerate->setLabel('Regenerate thumbnail: ');
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($imagelabel, $county, $period, $copyright, $licenseField, $type, $submit));
     $this->setMethod('post');
     $this->addDisplayGroup(array('label', 'county', 'period', 'imagerights', 'ccLicense', 'type'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     $this->details->setLegend('Edit metadata on an image');
     parent::init();
 }
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     //Get data to form select menu for periods
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     //Materials menu
     $materials = new Materials();
     $material_options = $materials->getMetals();
     parent::__construct($options);
     $this->setName('denomination');
     $denomination = new Zend_Form_Element_Text('denomination');
     $denomination->setLabel('Denomination name: ')->setRequired(true)->setAttrib('size', 70)->addErrorMessage('Please enter a term.');
     //Period from: Assigned via dropdown
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Period assigned to: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($period_options)))->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $period_options))->addErrorMessage('You must enter a period for this denomination');
     //Primary material
     $material = new Zend_Form_Element_Select('material');
     $material->setLabel('Material: ')->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($material_options)))->addMultiOptions(array(null => 'Choose a material', 'Available materials' => $material_options))->addErrorMessage('You must enter a material for this denomination.');
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Description: ')->setRequired(false)->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400))->setAttrib('ToolbarSet', 'Finds')->addFilters(array('BasicHtml', 'EmptyParagraph', 'WordChars'))->addErrorMessage('You must enter a description for this denomination.');
     $rarity = new Zend_Form_Element_Textarea('rarity');
     $rarity->setLabel('Rarity: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 70)->addFilters(array('BasicHtml', 'EmptyParagraph', 'WordChars'));
     $weight = new Zend_Form_Element_Text('weight');
     $weight->setLabel('Weight: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 5);
     $diameter = new Zend_Form_Element_Text('diameter');
     $diameter->setLabel('Diameter: ')->setRequired(false)->setAttrib('size', 5)->addFilters(array('StripTags', 'StringTrim'));
     $thickness = new Zend_Form_Element_Text('thickness');
     $thickness->setLabel('Thickness: ')->setRequired(false)->setAttrib('size', 5)->addFilters(array('StripTags', 'StringTrim'));
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Denomination in use: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must set 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($denomination, $period, $material, $description, $weight, $rarity, $thickness, $diameter, $valid, $submit, $hash));
     $this->addDisplayGroup(array('denomination', 'period', 'material', 'description', 'rarity', 'thickness', 'diameter', 'weight', 'valid'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     $this->details->setLegend('Denomination details: ');
     parent::init();
 }
Beispiel #10
0
 public function __construct($options = null)
 {
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     parent::__construct($options);
     $this->setName('imageeditfind');
     $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')));
     $imagelabel = new Zend_Form_Element_Text('label');
     $imagelabel->setLabel('Image label')->setRequired(true)->setAttrib('size', 70)->addErrorMessage('You must enter a label')->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorators);
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Period: ')->setRequired(true)->setDecorators($decorators)->addMultiOptions(array(NULL => NULL, 'Choose a period' => $period_options))->addValidator('inArray', false, array(array_keys($period_options)));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->setRequired(true)->setDecorators($decorators)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose a county' => $county_options))->addValidator('inArray', false, array(array_keys($county_options)));
     $copyright = new Zend_Form_Element_Text('imagerights');
     $copyright->setLabel('Image copyright')->setAttrib('size', 70)->setDecorators($decorators)->addFilters(array('StringTrim', 'StripTags'));
     $type = new Zend_Form_Element_Select('type');
     $type->setLabel('Image type: ')->setRequired(true)->addMultiOptions(array('Please choose publish state' => array('digital' => 'Digital image', 'illustration' => 'Scanned illustration')))->setValue('digital')->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorators);
     $rotate = new Zend_Form_Element_Radio('rotate');
     $rotate->setLabel('Rotate the image: ')->setRequired(false)->addValidator('Int')->addMultiOptions(array('-90' => '90 degrees anticlockwise', '-180' => '180 degrees anticlockwise', '-270' => '270 degrees anticlockwise', '90' => '90 degrees clockwise', '180' => '180 degrees clockwise', '270' => '270 degrees clockwise'));
     $regenerate = new Zend_Form_Element_Checkbox('regenerate');
     $regenerate->setLabel('Regenerate thumbnail: ')->setDecorators($decorators);
     $filename = new Zend_Form_Element_Hidden('filename');
     $filename->removeDecorator('label')->removeDecorator('HtmlTag')->addFilters(array('StringTrim', 'StripTags'))->removeDecorator('DtDdWrapper');
     $imagedir = new Zend_Form_Element_Hidden('imagedir');
     $imagedir->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper');
     $this->addElements(array($imagelabel, $county, $period, $copyright, $type, $rotate, $regenerate, $filename, $imagedir, $submit));
     $this->setMethod('post');
     $this->addDisplayGroup(array('label', 'county', 'period', 'imagerights', 'type', 'rotate', 'regenerate'), 'details');
     $this->addDisplayGroup(array('submit'), 'submit')->removeDecorator('HtmlTag');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Attach an image');
     $this->details->setLegend('Attach an image')->addDecorators(array('FieldSet', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
 }
Beispiel #11
0
 public function __construct($options = null)
 {
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setName('hoard');
     $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')));
     $term = new Zend_Form_Element_Text('term');
     $term->setLabel('Hoard title: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorators)->addErrorMessage('You must enter a title for this hoard');
     $termdesc = new Pas_Form_Element_RTE('termdesc');
     $termdesc->setLabel('Description of hoard: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->addErrorMessage('You must enter a description for this hoard');
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Broad period attributed to: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL, 'Choose reason' => $period_options))->addValidator('inArray', false, array(array_keys($period_options)))->setDecorators($decorators)->addErrorMessage('You must choose a period');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($term, $termdesc, $period, $submit));
     $this->addDisplayGroup(array('term', 'termdesc', 'period'), 'details');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->setLegend('Hoards: ');
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  *
  */
 public function __construct(array $options = null)
 {
     ## GET OPTIONS TO POPULATE MENUS ##
     //Get site class options for select menu
     $siteclasses = new ArchaeologicalSiteClass();
     $siteclass_options = $siteclasses->getOptions();
     //Get archaeological landscape and topography options for select menu
     $landscapes = new ArchaeologicalLandscape();
     $landscape_options = $landscapes->getOptions();
     //Get periods for select menu
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     $periodword_options = $periods->getPeriodFromWords();
     //Get archaeological context options for select menu
     $contexts = new ArchaeologicalContexts();
     $context_options = $contexts->getOptions();
     //Get archaeological feature options for select menu
     $features = new ArchaeologicalFeatures();
     $feature_options = $features->getOptions();
     //Get recovery methods for select menu
     $recoveries = new RecoveryMethods();
     $rec_options = $recoveries->getOptions();
     //Get contextual data quality ratings for select menu
     $qualityrating = new DataQuality();
     $qualityrating_options = $qualityrating->getRatings();
     //End of select options construction
     $this->addElementPrefixPath('Pas_Filter', 'Pas/Filter/', 'filter');
     parent::__construct($options);
     $this->setName('archaeology');
     ## SITE INFORMATION ##
     //Known site checkbox
     $knownsite = new Zend_Form_Element_Checkbox('knownsite');
     $knownsite->setLabel('Known site: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim'));
     //Excavated checkbox
     $excavated = new Zend_Form_Element_Checkbox('excavated');
     $excavated->setLabel('Excavated site: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim'));
     //Site class menu: Assigned via dropdown
     $siteclass = new Zend_Form_Element_Select('sitecontext');
     $siteclass->setLabel('Site class: ')->addMultioptions(array(null => 'Choose class of site', 'Available classes' => $siteclass_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($siteclass_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     //Landscape and topography menu: Assigned via dropdown
     $landscape_topography = new Zend_Form_Element_Select('landscapetopography');
     $landscape_topography->setLabel('Landscape and topography: ')->addMultioptions(array(null => 'Choose landscape term', 'Available terms' => $landscape_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($landscape_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     ## SITE DATING ##
     //Broad period
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Broad period: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose broadperiod', 'Available periods' => $periodword_options))->addErrorMessage('You must enter a broad period.')->addValidator('InArray', false, array(array_keys($periodword_options)))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Sub period from: Assigned via dropdown
     $sitesubperiod1 = new Zend_Form_Element_Select('subperiod1');
     $sitesubperiod1->setLabel('Sub period from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a subperiod', 'Valid sub periods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->setAttribs(array('class' => 'selectpicker show-menu-arrow'));
     //Period from: Assigned via dropdown
     $siteperiod1 = new Zend_Form_Element_Select('period1');
     $siteperiod1->setLabel('Period from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a period from', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Sub period to: Assigned via dropdown
     $sitesubperiod2 = new Zend_Form_Element_Select('subperiod2');
     $sitesubperiod2->setLabel('Sub period to: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a subperiod', 'Valid sub periods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->addValidator('Digits')->setAttribs(array('class' => 'selectpicker show-menu-arrow'));
     //Period to: Assigned via dropdown
     $siteperiod2 = new Zend_Form_Element_Select('period2');
     $siteperiod2->setLabel('Period to: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Date from: Free text Integer +ve or -ve
     $numdate1 = new Zend_Form_Element_Text('sitedateyear1');
     $numdate1->setLabel('Date from: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     //Date to: Free text Integer +ve or -ve
     $numdate2 = new Zend_Form_Element_Text('sitedateyear2');
     $numdate2->setLabel('Date to: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     ## CONTEXT DETAILS ##
     //Archaeological context: Assigned via dropdown
     $arch_context = new Zend_Form_Element_Select('sitetype');
     $arch_context->setLabel('Context: ')->addMultioptions(array(null => 'Choose a context', 'Available contexts' => $context_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($context_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     //Archaeological feature: Assigned via dropdown
     $arch_feature = new Zend_Form_Element_Select('feature');
     $arch_feature->setLabel('Feature: ')->addMultioptions(array(null => 'Choose a feature', 'Available features' => $feature_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($feature_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     //Feature date from: Free text Integer +ve or -ve
     $featuredate1 = new Zend_Form_Element_Text('featuredateyear1');
     $featuredate1->setLabel('Feature date from: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     //Feature date to: Free text Integer +ve or -ve
     $featuredate2 = new Zend_Form_Element_Text('featuredateyear2');
     $featuredate2->setLabel('Feature date to: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     ## RECOVERY INFORMATION ##
     //Recovery method: Assigned via dropdown
     $recmethod = new Zend_Form_Element_Select('recmethod');
     $recmethod->setLabel('Recovery method: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addValidator('inArray', true, array(array_keys($rec_options)))->addMultiOptions(array(null => 'Choose method of discovery', 'Available methods' => $rec_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     //First excavation year: Free text Integer +ve or -ve
     $excavationyear1 = new Zend_Form_Element_Text('yearexc1');
     $excavationyear1->setLabel('First excavation year: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY', 'class' => 'input-large'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     //Second excavation year: Free text Integer +ve or -ve
     $excavationyear2 = new Zend_Form_Element_Text('yearexc2');
     $excavationyear2->setLabel('Second excavation year: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     ## ARCHAEOLOGICAL DETAILS ##
     //Archaeology description: free text field
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Archaeology description: ')->setRequired(false)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     //Contextual data quality rating: Assigned via dropdown
     $contextualdataquality = new Zend_Form_Element_Select('contextualrating');
     $contextualdataquality->setLabel('Context data quality rating: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a rating', 'Available ratings' => $qualityrating_options))->addValidator('InArray', false, array(array_keys($qualityrating_options)))->setAttrib('class', 'input-large selectpicker show-menu-arrow')->setDescription('This data quality field can only be completed by hoards project staff')->addValidator('Int');
     ## ARCHIVE LOCATION ##
     //Archive location: free text field
     $archive_loc = new Zend_Form_Element_Text('archiveloc');
     $archive_loc->setLabel('Archive location: ')->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim'));
     ## SUBMIT BUTTON ##
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($knownsite, $excavated, $siteclass, $landscape_topography, $broadperiod, $sitesubperiod1, $siteperiod1, $sitesubperiod2, $siteperiod2, $numdate1, $numdate2, $arch_context, $arch_feature, $featuredate1, $featuredate2, $recmethod, $excavationyear1, $excavationyear2, $description, $contextualdataquality, $archive_loc, $submit));
     $this->addDisplayGroup(array('knownsite', 'excavated', 'sitecontext', 'landscapetopography'), 'siteinfo');
     $this->siteinfo->setLegend('Site information');
     $this->addDisplayGroup(array('broadperiod', 'subperiod1', 'period1', 'subperiod2', 'period2', 'sitedateyear1', 'sitedateyear2'), 'sitedating');
     $this->sitedating->setLegend('Site dating');
     $this->addDisplayGroup(array('sitetype', 'feature', 'featuredateyear1', 'featuredateyear2'), 'contextdetails');
     $this->contextdetails->setLegend('Context details');
     $this->addDisplayGroup(array('recmethod', 'yearexc1', 'yearexc2'), 'recoveryinfo');
     $this->recoveryinfo->setLegend('Recovery information');
     $this->addDisplayGroup(array('description', 'contextualrating'), 'archaeologicaldetails');
     $this->archaeologicaldetails->setLegend('Archaeological details');
     $this->addDisplayGroup(array('archiveloc'), 'archivelocation');
     $this->archivelocation->setLegend('Archive location');
     $this->addDisplayGroup(array('submit'), 'buttons');
     $person = new Pas_User_Details();
     $role = $person->getRole();
     $projectTeam = array('hoard', 'admin');
     if (!in_array($role, $projectTeam)) {
         $contextualdataquality->disabled = true;
     }
     parent::init();
 }
Beispiel #13
0
    /** The constructor
     * @access public
     * @param array $options
     * @return void
     */
    public function __construct(array $options = null)
    {
        $counties = new OsCounties();
        $county_options = $counties->getCountyNames();
        $periods = new Periods();
        $period_options = $periods->getPeriodFrom();
        $copyrights = new Copyrights();
        $copy = $copyrights->getTypes();
        $licenses = new LicenseTypes();
        $license = $licenses->getList();
        if (array_key_exists('id', $options)) {
            $slides = new Slides();
            $images = $slides->getSlides($options['id']);
        }
        $auth = Zend_Auth::getInstance();
        $this->_auth = $auth;
        if ($this->_auth->hasIdentity()) {
            $user = $this->_auth->getIdentity();
            if (!is_null($user->copyright)) {
                $this->_copyright = $user->copyright;
            } elseif (!is_null($user->fullname)) {
                $this->_copyright = $user->first_name . ' ' . $user->last_name;
            } else {
                $this->_copyright = $user->fullname;
            }
            if (!is_null($user->fullname)) {
                $copy[] = $user->first_name . ' ' . $user->last_name;
            } else {
                $copy[] = $user->fullname;
            }
        }
        $copyList = array_filter(array_merge(array($this->_copyright => $this->_copyright), $copy));
        parent::__construct($options);
        $this->setName('imagetofind');
        $period = new Zend_Form_Element_Select('period');
        $period->setLabel('Period: ')->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow required')->addErrorMessage('You must enter a period for the image')->addMultiOptions(array(null => 'Select a period', 'Valid periods' => $period_options))->addValidator('inArray', false, array(array_keys($period_options)));
        $country = new Zend_Form_Element_Select('country');
        $country->setLabel('Country: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow required')->setRequired(true)->addErrorMessage('You must enter a country of origin')->addMultiOptions(array(null => 'Select a country of origin', 'Valid countries' => array('England' => 'England', 'Wales' => 'Wales')))->addValidator('inArray', false, array(array_keys($county_options)));
        $county = new Zend_Form_Element_Select('county');
        $county->setLabel('County: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow required')->setRequired(true)->addErrorMessage('You must enter a county of origin')->addMultiOptions(array(null => 'Select a county of origin', 'Valid counties' => $county_options))->addValidator('inArray', false, array(array_keys($county_options)));
        $copyright = new Zend_Form_Element_Select('imagerights');
        $copyright->setLabel('Image copyright: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addErrorMessage('You must enter a licence holder')->addMultiOptions(array(null => 'Select a licence holder', 'Valid copyrights' => $copyList))->setDescription('You can set the copyright of your image here
                    to your institution. If you are a public recorder, it should
                    default to your full name. For institutions that do not
                    appear contact head office to suggest its addition')->setValue($this->_copyright);
        $licenseField = new Zend_Form_Element_Select('ccLicense');
        $licenseField->setDescription('Our philosophy is to make our content available openly, by default we
        set the license as use by attribution to gain the best public benefit. You can choose a different license
        if you wish.');
        $licenseField->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setLabel('Creative Commons license:')->addMultiOptions(array(null => 'Select a license', 'Available licenses' => $license))->setValue(4)->addValidator('Int');
        $type = new Zend_Form_Element_Select('type');
        $type->setLabel('Image type: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addMultiOptions(array(null => 'Select the type of image', 'Image types' => array('digital' => 'Digital image', 'illustration' => 'Scanned illustration')))->setValue('digital');
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Add metadata for images');
        $this->addElements(array($country, $county, $period, $copyright, $type, $licenseField, $submit));
        $this->setMethod('post');
        $this->addDisplayGroup(array('country', 'filename', 'county', 'period', 'imagerights', 'ccLicense', 'type'), 'details');
        foreach ($images as $image) {
            $label = 'label' . $image['imageID'];
            $group = 'metadata' . $image['imageID'];
            echo '<img src="http://finds.org.uk/images/thumbnails/' . $image['imageID'] . '.jpg"/>';
            $image['imageID'] = new Zend_Form_Element_Text($label);
            $image['imageID']->setLabel('Image label: ')->setRequired(true)->setAttribs(array('size' => 60, 'class' => 'span6 required'))->addErrorMessage('You must enter a label')->setDescription('This must be descriptive text about the image - NOT THE FILE or FIND NUMBER/NAME - and follow the
		conventions outlined below this form')->addFilters(array('StripTags', 'StringTrim'));
            $this->addElements(array($image['imageID']));
            $this->addDisplayGroup(array($label), $group);
        }
        $this->addDisplayGroup(array('submit'), 'buttons')->removeDecorator('HtmlTag');
        $this->details->setLegend('Attach an image');
        parent::init();
    }
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $institutions = new Institutions();
     $inst_options = $institutions->getInsts();
     $discs = new DiscoMethods();
     $disc_options = $discs->getOptions();
     $mans = new Manufactures();
     $man_options = $mans->getOptions();
     $primaries = new Materials();
     $primary_options = $primaries->getPrimaries();
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     $primaries = new Materials();
     $primary_options = $primaries->getPrimaries();
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFromWords();
     $cultures = new Cultures();
     $culture_options = $cultures->getCultures();
     $surfaces = new SurfaceTreatments();
     $surface_options = $surfaces->getSurfaces();
     $decorations = new DecStyles();
     $decoration_options = $decorations->getStyles();
     $decmeths = new DecMethods();
     $decmeth_options = $decmeths->getDecmethods();
     $reasons = new Findofnotereasons();
     $reason_options = $reasons->getReasons();
     $preserves = new Preservations();
     $preserve_options = $preserves->getPreserves();
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     $counties = new OsCounties();
     $county_options = $counties->getCountiesID();
     $regions = new OsRegions();
     $region_options = $regions->getRegionsID();
     $current_year = date('Y');
     $years = range(1850, $current_year);
     $years_list = array_combine($years, $years);
     parent::__construct($options);
     $this->setName('Advanced');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->addFilters(array('StringTrim', 'StripTags'))->addValidator('StringLength', false, array(3, 20))->addErrorMessage('Please enter a valid number!');
     $objecttype = new Zend_Form_Element_Text('objecttype');
     $objecttype->setLabel('Object type: ')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Please enter a valid object type!');
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Object description contains: ')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Please enter a valid term');
     //Find of note
     $findofnote = new Zend_Form_Element_Checkbox('note');
     $findofnote->setLabel('Find of Note: ')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null);
     //Reason for find of note
     $findofnotereason = new Zend_Form_Element_Select('reason');
     $findofnotereason->setLabel('Reason for noteworthy status: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose reason', 'Available reasons' => $reason_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     //Institution
     $institution = new Zend_Form_Element_Select('institution');
     $institution->setLabel('Recording institution: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose institution', 'Available institutions' => $inst_options))->setAttribs(array('class' => 'input-medium selectpicker show-menu-arrow'));
     $notes = new Zend_Form_Element_Text('notes');
     $notes->setLabel('Notes: ')->addFilters(array('StringTrim', 'StripTags'));
     $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'));
     $objdate1subperiod = new Zend_Form_Element_Select('fromsubperiod');
     $objdate1subperiod->setLabel('Sub period from: ')->addMultiOptions(array(null => 'Choose sub-period from', 'Available sub period from' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => ''))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Period from: Assigned via dropdown
     $objdate1period = new Zend_Form_Element_Select('periodFrom');
     $objdate1period->setLabel('Period from: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $objdate2subperiod = new Zend_Form_Element_Select('tosubperiod');
     $objdate2subperiod->setLabel('Sub period to: ')->addMultiOptions(array(null => 'Choose sub-period from', 'Available subperiods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->setDisableTranslator(true)->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => ''))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Period to: Assigned via dropdown
     $objdate2period = new Zend_Form_Element_Select('periodTo');
     $objdate2period->setLabel('Period to: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $culture = new Zend_Form_Element_Select('culture');
     $culture->setLabel('Ascribed culture: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose ascribed culture', 'Available cultures' => $culture_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $from = new Zend_Form_Element_Text('fromdate');
     $from->setLabel('Start date: ')->addFilters(array('StringTrim', 'StripTags'))->addValidators(array('NotEmpty', 'Int'))->addErrorMessage('Please enter a valid date')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'))->setDescription('If you want to search for a date range, ' . 'enter a start date in this box and and end in the ' . 'box below. You do not need to add AD or BC');
     $to = new Zend_Form_Element_Text('todate');
     $to->setLabel('End date: ')->addFilters(array('StringTrim', 'StripTags'))->addValidators(array('NotEmpty', 'Int'))->addErrorMessage('Please enter a valid date')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $workflow = new Zend_Form_Element_Select('workflow');
     $workflow->setLabel('Workflow stage: ')->addFilters(array('StringTrim', 'StripTags'))->addValidator('Int')->setAttribs(array('class' => 'input-medium selectpicker show-menu-arrow'));
     if (in_array($this->_role, $this->_higherlevel)) {
         $workflow->addMultiOptions(array(null => 'Available Workflow stages', 'Choose Worklow stage' => array('1' => 'Quarantine', '2' => 'On review', '4' => 'Awaiting validation', '3' => 'Published')));
     }
     if (in_array($this->_role, $this->_restricted)) {
         $workflow->addMultiOptions(array(null => 'Available Workflow stages', 'Choose Worklow stage' => array('4' => 'Awaiting validation', '3' => 'Published')));
     }
     $treasure = new Zend_Form_Element_Checkbox('treasure');
     $treasure->setLabel('Treasure find: ')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null);
     $treasureID = new Zend_Form_Element_Text('TID');
     $treasureID->setLabel('Treasure ID number: ')->addFilters(array('StringTrim', 'StripTags'));
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null);
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose a rally', 'Available rallies' => $rally_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $other_ref = new Zend_Form_Element_Text('otherRef');
     $other_ref->setLabel('Other reference: ')->addFilters(array('StringTrim', 'StripTags'));
     $smrRef = new Zend_Form_Element_Text('smrRef');
     $smrRef->setLabel('SMR reference: ')->addFilters(array('StringTrim', 'StripTags'));
     //Manufacture method
     $manmethod = new Zend_Form_Element_Select('manufacture');
     $manmethod->setLabel('Manufacture method: ')->addFilters(array('StringTrim', 'StripTags'))->addValidator('Int')->addMultiOptions(array(null => 'Choose method of manufacture', 'Available methods' => $man_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Decoration method
     $decmethod = new Zend_Form_Element_Select('decoration');
     $decmethod->setLabel('Decoration method: ')->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose decoration method', 'Available decorative methods' => $decmeth_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Surface treatment
     $surftreat = new Zend_Form_Element_Select('surface');
     $surftreat->setLabel('Surface Treatment: ')->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose surface treatment', 'Available surface treatments' => $surface_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //decoration style
     $decstyle = new Zend_Form_Element_Select('decstyle');
     $decstyle->setLabel('Decorative style: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose decorative style', 'Available decorative options' => $decoration_options))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Preservation of object
     $preservation = new Zend_Form_Element_Select('preservation');
     $preservation->setLabel('Preservation: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addMultiOptions(array(null => 'Choose level of preservation', 'Available options' => $preserve_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $county = new Zend_Form_Element_Select('countyID');
     $county->setLabel('County: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose county', 'Available counties' => $county_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $district = new Zend_Form_Element_Select('districtID');
     $district->setLabel('District: ')->addMultiOptions(array(null => 'Choose district after county'))->setRegisterInArrayValidator(false)->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $parish = new Zend_Form_Element_Select('parishID');
     $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose parish after county'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->addValidator('Int')->addMultiOptions(array(null => 'Choose a region for a wide result', 'Choose region' => $region_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->addValidators(array('NotEmpty', 'ValidGridRef'))->addFilters(array('StringTrim', 'StripTags'));
     $fourFigure = new Zend_Form_Element_Text('fourFigure');
     $fourFigure->setLabel('Four figure grid reference: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'));
     $idBy = new Zend_Form_Element_Text('idBy');
     $idBy->setLabel('Primary identifier: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'));
     $identifierID = new Zend_Form_Element_Hidden('identifierID');
     $identifierID->addFilters(array('StringTrim', 'StripTags'));
     $created = new Zend_Form_Element_Text('createdBefore');
     $created->setLabel('Date record created on or before: ')->addFilters(array('StringTrim', 'StripTags'));
     $created2 = new Zend_Form_Element_Text('createdAfter');
     $created2->setLabel('Date record created on or after: ')->addFilters(array('StringTrim', 'StripTags'));
     $updated = new Zend_Form_Element_Text('updatedBefore');
     $updated->setLabel('Date record updated on or before: ')->addFilters(array('StringTrim', 'StripTags'));
     $updated2 = new Zend_Form_Element_Text('updatedAfter');
     $updated2->setLabel('Date record updated on or after: ')->addFilters(array('StringTrim', 'StripTags'));
     $finder = new Zend_Form_Element_Text('finder');
     $finder->setLabel('Found by: ')->addFilters(array('StringTrim', 'StripTags'));
     $finderID = new Zend_Form_Element_Hidden('finderID');
     $finderID->addFilters(array('StringTrim', 'StripTags'));
     $recordby = new Zend_Form_Element_Text('recordername');
     $recordby->setLabel('Recorded by: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'))->setAttrib('autoComplete', 'true');
     $recorderID = new Zend_Form_Element_Hidden('recorderID');
     $recorderID->addFilters(array('StringTrim', 'StripTags'));
     $discoverydate = new Zend_Form_Element_Select('discovered');
     $discoverydate->setLabel('Year of discovery')->setMultiOptions(array(null => 'Choose a year of discovery', 'Date range' => $years_list))->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Submit your search');
     $material1 = new Zend_Form_Element_Select('material');
     $material1->setLabel('Primary material: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose primary material', 'Available options' => $primary_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $woeid = new Zend_Form_Element_Text('woeid');
     $woeid->setLabel('Where on earth ID: ')->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'));
     $elevation = new Zend_Form_Element_Text('elevation');
     $elevation->setLabel('Elevation: ')->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     if (in_array($this->_role, $this->_restricted)) {
         $this->addElements(array($old_findID, $objecttype, $broadperiod, $description, $from, $to, $workflow, $findofnote, $findofnotereason, $rally, $rallyID, $other_ref, $manmethod, $notes, $objdate1period, $objdate2period, $county, $regionID, $district, $parish, $fourFigure, $objdate1subperiod, $objdate2subperiod, $treasure, $treasureID, $discoverydate, $created, $created2, $updated, $updated2, $culture, $surftreat, $submit, $material1, $elevation, $woeid, $institution, $hash, $smrRef));
     } else {
         $this->addElements(array($old_findID, $objecttype, $broadperiod, $description, $from, $to, $workflow, $findofnote, $findofnotereason, $rally, $rallyID, $other_ref, $manmethod, $notes, $objdate1period, $objdate2period, $county, $regionID, $district, $parish, $fourFigure, $elevation, $woeid, $objdate1subperiod, $objdate2subperiod, $treasure, $treasureID, $discoverydate, $created, $created2, $updated, $updated2, $idBy, $finder, $finderID, $recordby, $recorderID, $identifierID, $culture, $surftreat, $submit, $material1, $institution, $smrRef, $hash));
     }
     $this->addDisplayGroup(array('old_findID', 'objecttype', 'description', 'notes', 'note', 'reason', 'treasure', 'TID', 'rally', 'rallyID', 'workflow', 'otherRef', 'smrRef', 'material', 'manufacture', 'surface'), 'details');
     $this->details->setLegend('Main details: ');
     $this->addDisplayGroup(array('broadperiod', 'fromsubperiod', 'periodFrom', 'tosubperiod', 'periodTo', 'culture', 'fromdate', 'todate'), 'Temporaldetails');
     $this->Temporaldetails->setLegend('Dates and periods: ');
     $this->addDisplayGroup(array('countyID', 'regionID', 'districtID', 'parishID', 'fourFigure', 'elevation', 'woeid'), 'Spatial');
     $this->Spatial->setLegend('Spatial details: ');
     if (in_array($this->_role, $this->_restricted)) {
         $this->addDisplayGroup(array('institution', 'createdAfter', 'createdBefore', 'updatedAfter', 'updatedBefore', 'discovered'), 'Discovery');
     } else {
         $this->addDisplayGroup(array('institution', 'finder', 'idBy', 'identifierID', 'recordername', 'recorderID', 'createdAfter', 'createdBefore', 'updatedAfter', 'updatedBefore', 'discovered'), 'Discovery');
     }
     $this->Discovery->setLegend('Discovery details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Beispiel #15
0
 /** Get the periods dropdown
  * @access public
  * @return array
  */
 public function getPeriods()
 {
     $periods = new Periods();
     return $periods->getPeriodFrom();
 }
Beispiel #16
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $discs = new DiscoMethods();
     $disc_options = $discs->getOptions();
     //Get data to form select menu for manufacture methods
     $mans = new Manufactures();
     $man_options = $mans->getOptions();
     //Get data to form select menu for primary and secondary material
     $primaries = new Materials();
     $primary_options = $primaries->getPrimaries();
     //Get data to form select menu for periods
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     //Get data to form select menu for cultures
     $cultures = new Cultures();
     $culture_options = $cultures->getCultures();
     //Get data to form Surface treatments menu
     $surfaces = new SurfaceTreatments();
     $surface_options = $surfaces->getSurfaces();
     //Get data to form Decoration styles menu
     $decorations = new DecStyles();
     $decoration_options = $decorations->getStyles();
     //Get data to form Decoration methods menu
     $decmeths = new DecMethods();
     $decmeth_options = $decmeths->getDecmethods();
     //Get Find of note reason data
     $reasons = new Findofnotereasons();
     $reason_options = $reasons->getReasons();
     //Get Preservation data
     $preserves = new Preservations();
     $preserve_options = $preserves->getPreserves();
     //Get Rally data
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFromWords();
     $circa = new DateQualifiers();
     $circa_o = $circa->getTerms();
     $actions = new SubsequentActions();
     $actionsDD = $actions->getSubActionsDD();
     //End of select options construction
     $this->addElementPrefixPath('Pas_Filter', 'Pas/Filter/', 'filter');
     parent::__construct($options);
     $this->setName('finds');
     $secuid = new Zend_Form_Element_Hidden('secuid');
     $secuid->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum');
     // Object specifics
     $old_findID = new Zend_Form_Element_Hidden('old_findID');
     $old_findID->addFilters(array('StripTags', 'StringTrim'));
     //Objecttype - autocomplete from thesaurus
     $objecttype = new Zend_Form_Element_Text('objecttype');
     $objecttype->setLabel('Object type: ')->setRequired(true)->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'))->addValidator('ValidObjectType');
     $objecttypecert = new Zend_Form_Element_Radio('objecttypecert');
     $objecttypecert->setLabel('Object type certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setOptions(array('separator' => ''));
     //Object description
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Object description: ')->setRequired(false)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     //Object notes
     $notes = new Pas_Form_Element_CKEditor('notes');
     $notes->setLabel('Notes: ')->setRequired(false)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     //Find of note
     $findofnote = new Zend_Form_Element_Checkbox('findofnote');
     $findofnote->setLabel('Find of Note: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Int');
     //Reason for find of note
     $findofnotereason = new Zend_Form_Element_Select('findofnotereason');
     $findofnotereason->setLabel('Why this find is considered noteworthy: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a reasoning', 'Available reasons' => $reason_options))->addValidator('InArray', false, array(array_keys($reason_options)))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Int');
     //Find classification
     $class = new Zend_Form_Element_Text('classification');
     $class->setLabel('Classification: ')->setAttrib('size', 60)->setRequired(false)->setAttribs(array('class' => 'span6', 'placeholder' => 'Do not put numismatic information here ' . '(such as penny), it is the wrong place for it.'))->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     //Find subclassification
     $subclass = new Zend_Form_Element_Text('subclass');
     $subclass->setLabel('Sub-classification: ')->setRequired(false)->setAttribs(array('class' => 'span6', 'placeholder' => 'Do not put numismatic information here ' . '(such as penny), it is the wrong place for it.'))->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     //Inscription: Only available if !=coin
     $inscription = new Zend_Form_Element_Text('inscription');
     $inscription->setLabel('Inscription: ')->setRequired(false)->setAttribs(array('class' => 'span6', 'placeholder' => 'This is for the inscription on objects, not coins'))->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->setAttrib('size', 60);
     //Treasure: enumerator 1/0
     $treasure = new Zend_Form_Element_Checkbox('treasure');
     $treasure->setLabel('Treasure: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim'));
     //Treasure: enumerator 1/0
     $treasureID = new Zend_Form_Element_Text('treasureID');
     $treasureID->setLabel('Treasure number: ')->setRequired(false)->setAttribs(array('placeholder' => 'T numbers are in the format of YYYYT1234', 'class' => 'span6'))->addValidator('Alnum', false, array('allowWhiteSpace' => false))->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'));
     //Container for hoard
     $hoardcontainer = new Zend_Form_Element_Checkbox('hoardcontainer');
     $hoardcontainer->setLabel('This find is a hoard container: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Int');
     // Temporal details section //
     //Broadperiod:
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Broad period: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose broadperiod', 'Available periods' => $periodword_options))->addErrorMessage('You must enter a broad period.')->addValidator('InArray', false, array(array_keys($periodword_options)))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Period from: Assigned via dropdown
     $objdate1subperiod = new Zend_Form_Element_Select('objdate1subperiod');
     $objdate1subperiod->setLabel('Sub period from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a subperiod', 'Valid sub periods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->setAttribs(array('class' => 'selectpicker show-menu-arrow'));
     //Period from: Assigned via dropdown
     $objdate1period = new Zend_Form_Element_Select('objdate1period');
     $objdate1period->setLabel('Period from: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a period from', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $objdate1cert = new Zend_Form_Element_Radio('objdate1cert');
     $objdate1cert->setLabel('Period from certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addValidator('Digits');
     //Period from: Assigned via dropdown
     $objdate2subperiod = new Zend_Form_Element_Select('objdate2subperiod');
     $objdate2subperiod->setLabel('Sub period to: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a subperiod', 'Valid sub periods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->addValidator('Digits')->setAttribs(array('class' => 'selectpicker show-menu-arrow'));
     //Period to: Assigned via dropdown
     $objdate2period = new Zend_Form_Element_Select('objdate2period');
     $objdate2period->setLabel('Period to: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $objdate2cert = new Zend_Form_Element_Radio('objdate2cert');
     $objdate2cert->setLabel('Period to certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addValidator('Digits');
     $numdate1qual = new Zend_Form_Element_Radio('numdate1qual');
     $numdate1qual->setLabel('Date certainty: ')->addMultiOptions($circa_o)->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addValidator('Digits');
     //Date from: Free text Integer +ve or -ve
     $numdate1 = new Zend_Form_Element_Text('numdate1');
     $numdate1->setLabel('Date from: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $numdate2qual = new Zend_Form_Element_Radio('numdate2qual');
     $numdate2qual->setLabel('Date certainty: ')->addMultiOptions($circa_o)->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addValidator('Digits');
     //Date to: Free text Integer +ve or -ve
     $numdate2 = new Zend_Form_Element_Text('numdate2');
     $numdate2->setLabel('Date to: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     //Ascribed culture: assigned via dropdown
     $culture = new Zend_Form_Element_Select('culture');
     $culture->setLabel('Ascribed culture: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose ascribed culture', 'Available cultures' => $culture_options))->addValidator('InArray', false, array(array_keys($culture_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Period of reuse
     $reuse_period = new Zend_Form_Element_Select('reuse_period');
     $reuse_period->setLabel('Period of reuse: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose period of reuse', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Evidence of reuse
     $reuse = new Zend_Form_Element_Text('reuse');
     $reuse->setLabel('Evidence of reuse: ')->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'));
     //METRICS SECTION//
     //Weight: grammes
     $weight = new Zend_Form_Element_Text('weight');
     $weight->setLabel('Weight: ')->setAttrib('size', 5)->addValidator('Float')->setAttribs(array('placeholder' => 'Value in grammes - NOT kilogrammes'))->addFilters(array('StripTags', 'StringTrim'));
     //Height: millimetres
     $height = new Zend_Form_Element_Text('height');
     $height->setLabel('Height: ')->setAttrib('size', 5)->addValidator('Float')->setAttribs(array('placeholder' => 'Value in millimetres'))->addFilters(array('StripTags', 'StringTrim'));
     //Length: millimetres
     $length = new Zend_Form_Element_Text('length');
     $length->setLabel('Length: ')->setAttrib('size', 5)->addValidator('Float')->setAttribs(array('placeholder' => 'Value in millimetres'))->addFilters(array('StripTags', 'StringTrim'));
     //Diameter: millimetres
     $diameter = new Zend_Form_Element_Text('diameter');
     $diameter->setLabel('Diameter: ')->setAttrib('size', 5)->setAttribs(array('placeholder' => 'Value in millimetres'))->addValidator('Float')->addFilters(array('StripTags', 'StringTrim'));
     //
     $width = new Zend_Form_Element_Text('width');
     $width->setLabel('Width: ')->setAttrib('size', 5)->setAttribs(array('placeholder' => 'Value in millimetres'))->addValidator('Float')->addFilters(array('StripTags', 'StringTrim'));
     //Thickness: millimetres
     $thickness = new Zend_Form_Element_Text('thickness');
     $thickness->setLabel('Thickness: ')->setAttrib('size', 5)->setAttribs(array('placeholder' => 'Value in millimetres'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Float');
     //Quantity: positive integers only
     $quantity = new Zend_Form_Element_Text('quantity');
     $quantity->setLabel('Quantity: ')->setRequired(true)->setValue('1')->setAttrib('size', 3)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $material1 = new Zend_Form_Element_Select('material1');
     $material1->setLabel('Primary material: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose primary material', 'Available materials' => $primary_options))->addValidator('InArray', false, array(array_keys($primary_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Secondary material
     $material2 = new Zend_Form_Element_Select('material2');
     $material2->setLabel('Secondary material: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose secondary material', 'Available materials' => $primary_options))->addValidator('InArray', false, array(array_keys($primary_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Manufacture method
     $manmethod = new Zend_Form_Element_Select('manmethod');
     $manmethod->setLabel('Manufacture method: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose method of manufacture', 'Available methods' => $man_options))->addValidator('InArray', false, array(array_keys($man_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Decoration method
     $decmethod = new Zend_Form_Element_Select('decmethod');
     $decmethod->setLabel('Decoration method: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose decoration method', 'Available methods' => $decmeth_options))->addValidator('InArray', false, array(array_keys($decmeth_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Surface treatment
     $surftreat = new Zend_Form_Element_Select('surftreat');
     $surftreat->setLabel('Surface Treatment: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose surface treatment', 'Available treatments' => $surface_options))->addValidator('InArray', false, array(array_keys($surface_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //decoration style
     $decstyle = new Zend_Form_Element_Select('decstyle');
     $decstyle->setLabel('Decorative style: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose decorative style', 'Available styles' => $decoration_options))->addValidator('InArray', false, array(array_keys($decoration_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Preservation of object
     $preservation = new Zend_Form_Element_Select('preservation');
     $preservation->setLabel('Preservation: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addMultiOptions(array(null => 'Choose level of preservation', 'Available states' => $preserve_options))->addValidator('InArray', false, array(array_keys($preserve_options)))->addValidator('Int')->setAttribs(array('class' => 'selectpicker show-menu-arrow'));
     //Completeness of object
     $completeness = new Zend_Form_Element_Radio('completeness');
     $completeness->setLabel('Completeness: ')->addMultiOptions(array('4' => 'Complete', '2' => 'Incomplete', '1' => 'Fragment', '3' => 'Uncertain'))->setValue('4')->setOptions(array('separator' => ''))->addFilters(array('StripTags', 'StringTrim'));
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose rally name', 'Available rallies' => $rally_options))->addValidator('InArray', false, array(array_keys($rally_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     ## PERSONNEL INFORMATION (or personal depending on the way you see it!)
     // Identifier
     $finder = new Zend_Form_Element_Text('finder');
     $finder->setLabel('Found by: ')->addFilters(array('StripTags', 'StringTrim'))->setDescription('To make a new finder/identifier appear, you ' . 'first need to create them from the people menu on ' . 'the left hand side');
     $finderID = new Zend_Form_Element_Hidden('finderID');
     $finderID->setRequired(false)->addFilters(array('StripTags', 'StringTrim'));
     $secondfinder = new Zend_Form_Element_Text('secondfinder');
     $secondfinder->setLabel('Secondary finder: ')->addFilters(array('StripTags', 'StringTrim'));
     //Secondary finder
     $finder2ID = new Zend_Form_Element_Hidden('finder2ID');
     $finder2ID->addFilters(array('StripTags', 'StringTrim'));
     $recordername = new Zend_Form_Element_Text('recordername');
     $recordername->setLabel('Recorded by: ')->addFilters(array('StripTags', 'StringTrim'));
     //recorder information
     $recorderID = new Zend_Form_Element_Hidden('recorderID');
     $recorderID->addFilters(array('StripTags', 'StringTrim'));
     $idBy = new Zend_Form_Element_Text('idBy');
     $idBy->setLabel('Primary identifier: ')->addFilters(array('StripTags', 'StringTrim'));
     $identifier1ID = new Zend_Form_Element_Hidden('identifier1ID');
     $identifier1ID->addFilters(array('StripTags', 'StringTrim'));
     $id2by = new Zend_Form_Element_Text('id2by');
     $id2by->setLabel('Secondary Identifier: ')->addFilters(array('StripTags', 'StringTrim'));
     //Secondary Identifier
     $identifier2ID = new Zend_Form_Element_Hidden('identifier2ID');
     $identifier2ID->setRequired(false)->addFilters(array('StripTags', 'StringTrim'));
     ##DISCOVERY INFORMATION
     //Discovery method
     $discmethod = new Zend_Form_Element_Select('discmethod');
     $discmethod->setLabel('Discovery method: ')->setRequired(true)->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addValidator('inArray', true, array(array_keys($disc_options)))->addMultiOptions(array(null => 'Choose method of discovery', 'Available methods' => $disc_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     //Discovery circumstances
     $disccircum = new Zend_Form_Element_Text('disccircum');
     $disccircum->setLabel('Discovery circumstances: ')->setAttrib('size', 50)->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim'));
     //Date found from
     $datefound1 = new Zend_Form_Element_Text('datefound1');
     $datefound1->setLabel('First discovery date: ')->setAttrib('size', 10)->addFilters(array('StripTags', 'StringTrim'));
     //Date found to
     $datefound2 = new Zend_Form_Element_Text('datefound2');
     $datefound2->setLabel('Second discovery date: ')->setAttrib('size', 10)->addFilters(array('StripTags', 'StringTrim'));
     ##OTHER REFERENCE NUMBERS
     //Other reference number
     $other_ref = new Zend_Form_Element_Text('other_ref');
     $other_ref->setLabel('Other reference: ')->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim'));
     //SMR reference number
     $smrrefno = new Zend_Form_Element_Text('smr_ref');
     $smrrefno->setLabel('Sites and Monuments record number: ')->setAttrib('size', 30)->addFilters(array('StripTags', 'StringTrim'));
     //Museum accession number
     $musaccno = new Zend_Form_Element_Text('musaccno');
     $musaccno->setLabel('Museum accession number: ')->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim'));
     //Current location of object
     $curr_loc = new Zend_Form_Element_Text('curr_loc');
     $curr_loc->setLabel('Current location: ')->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim'));
     //Current location of object
     $subs_action = new Zend_Form_Element_Select('subs_action');
     $subs_action->setLabel('Subsequent action: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'span6')->addMultiOptions(array(null => 'Choose a subsequent action', 'Available options' => $actionsDD))->setValue(1)->addValidator('InArray', false, array(array_keys($actionsDD)))->addValidator('Int')->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($secuid, $old_findID, $objecttype, $broadperiod, $objdate1period, $objdate1subperiod, $objdate2subperiod, $objdate2period, $numdate1, $numdate2, $culture, $inscription, $description, $notes, $findofnote, $class, $subclass, $weight, $length, $thickness, $diameter, $height, $quantity, $manmethod, $surftreat, $treasure, $treasureID, $decstyle, $recordername, $recorderID, $idBy, $identifier1ID, $id2by, $identifier2ID, $finder, $finderID, $secondfinder, $finder2ID, $discmethod, $disccircum, $datefound1, $datefound2, $reuse, $reuse_period, $material1, $material2, $curr_loc, $smrrefno, $musaccno, $other_ref, $width, $preservation, $completeness, $findofnotereason, $rally, $objecttypecert, $rallyID, $objdate1cert, $objdate2cert, $submit, $subs_action, $numdate1qual, $numdate2qual, $hoardcontainer));
     $this->addDisplayGroup(array('objecttype', 'objecttypecert', 'classification', 'subclass', 'description', 'notes', 'inscription', 'findofnote', 'findofnotereason', 'treasure', 'treasureID', 'hoardcontainer'), 'objectdetails');
     $this->objectdetails->setLegend('Object details');
     $this->addDisplayGroup(array('broadperiod', 'objdate1period', 'objdate1cert', 'objdate1subperiod', 'objdate2period', 'objdate2cert', 'objdate2subperiod', 'numdate1qual', 'numdate1', 'numdate2qual', 'numdate2', 'culture', 'reuse_period', 'reuse'), 'date');
     $this->date->setLegend('Temporal details');
     $this->addDisplayGroup(array('length', 'width', 'thickness', 'height', 'diameter', 'weight', 'quantity'), 'metrics');
     $this->metrics->setLegend('Measurements');
     $this->addDisplayGroup(array('material1', 'material2', 'manmethod', 'surftreat', 'decstyle', 'preservation', 'completeness'), 'methods');
     $this->methods->setLegend('Methods of production and decoration');
     $this->addDisplayGroup(array('recordername', 'recorderID', 'idBy', 'identifier1ID', 'id2by', 'identifier2ID'), 'people');
     $this->people->setLegend('Recording details');
     $this->addDisplayGroup(array('finder', 'finderID', 'secondfinder', 'finder2ID'), 'discoverers');
     $this->discoverers->setLegend('Discoverer details');
     $this->addDisplayGroup(array('disccircum', 'discmethod', 'datefound1', 'datefound2', 'rally', 'rallyID'), 'discovery');
     $this->discovery->setLegend('Discovery details');
     $this->addDisplayGroup(array('other_ref', 'smr_ref', 'musaccno', 'curr_loc', 'subs_action'), 'references');
     $this->references->setLegend('Reference numbers');
     $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->getRomanRulers();
     $discs = new DiscoMethods();
     $disc_options = $discs->getOptions();
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFromWords();
     $reasons = new Findofnotereasons();
     $reason_options = $reasons->getReasons();
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     $counties = new OsCounties();
     $county_options = $counties->getCountiesID();
     $regions = new OsRegions();
     $region_options = $regions->getRegionsID();
     $terminalDates = new TerminalReasons();
     $termOptions = $terminalDates->getReasons();
     $qualityRatings = new DataQuality();
     $qualityStreet = $qualityRatings->getRatings();
     $current_year = date('Y');
     $years = range(1650, $current_year);
     $years_list = array_combine($years, $years);
     $reeces = new Reeces();
     $reece_options = $reeces->getReeces();
     $siteclasses = new ArchaeologicalSiteClass();
     $siteclass_options = $siteclasses->getOptions();
     $contexts = new ArchaeologicalContexts();
     $context_options = $contexts->getOptions();
     $features = new ArchaeologicalFeatures();
     $feature_options = $features->getOptions();
     parent::__construct($options);
     $this->setName('AdvancedHoards');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->addFilters(array('StringTrim', 'StripTags'))->addValidator('StringLength', false, array(3, 20))->addErrorMessage('Please enter a valid number!');
     $objecttype = new Zend_Form_Element_Hidden('objecttype');
     $objecttype->setValue('HOARD')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Please enter a valid object type!');
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Hoard description contains: ')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Please enter a valid term');
     //Find of note
     $findofnote = new Zend_Form_Element_Checkbox('note');
     $findofnote->setLabel('Find of Note: ')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null);
     //Reason for find of note
     $findofnotereason = new Zend_Form_Element_Select('reason');
     $findofnotereason->setLabel('Reason for noteworthy status: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose reason', 'Available reasons' => $reason_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     //Institution
     $institution = new Zend_Form_Element_Select('institution');
     $institution->setLabel('Recording institution: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose institution', 'Available institutions' => $inst_options))->setAttribs(array('class' => 'input-medium selectpicker show-menu-arrow'));
     $notes = new Zend_Form_Element_Text('notes');
     $notes->setLabel('Notes: ')->addFilters(array('StringTrim', 'StripTags'));
     $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'));
     $objdate1subperiod = new Zend_Form_Element_Select('fromsubperiod');
     $objdate1subperiod->setLabel('Sub period from: ')->addMultiOptions(array(null => 'Choose sub-period from', 'Available sub period from' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => ''))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Period from: Assigned via dropdown
     $objdate1period = new Zend_Form_Element_Select('periodFrom');
     $objdate1period->setLabel('Period from: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $objdate2subperiod = new Zend_Form_Element_Select('tosubperiod');
     $objdate2subperiod->setLabel('Sub period to: ')->addMultiOptions(array(null => 'Choose sub-period from', 'Available subperiods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->setDisableTranslator(true)->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => ''))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Period to: Assigned via dropdown
     $objdate2period = new Zend_Form_Element_Select('periodTo');
     $objdate2period->setLabel('Period to: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $from = new Zend_Form_Element_Text('fromdate');
     $from->setLabel('Start date: ')->addFilters(array('StringTrim', 'StripTags'))->addValidators(array('NotEmpty', 'Int'))->addErrorMessage('Please enter a valid date')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'))->setDescription('If you want to search for a date range, ' . 'enter a start date in this box and and end in the ' . 'box below. You do not need to add AD or BC');
     $to = new Zend_Form_Element_Text('todate');
     $to->setLabel('End date: ')->addFilters(array('StringTrim', 'StripTags'))->addValidators(array('NotEmpty', 'Int'))->addErrorMessage('Please enter a valid date')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $workflow = new Zend_Form_Element_Select('workflow');
     $workflow->setLabel('Workflow stage: ')->addFilters(array('StringTrim', 'StripTags'))->addValidator('Int')->setAttribs(array('class' => 'input-medium selectpicker show-menu-arrow'));
     if (in_array($this->_role, $this->_higherlevel)) {
         $workflow->addMultiOptions(array(null => 'Available Workflow stages', 'Choose Worklow stage' => array('1' => 'Quarantine', '2' => 'On review', '4' => 'Awaiting validation', '3' => 'Published')));
     }
     if (in_array($this->_role, $this->_restricted)) {
         $workflow->addMultiOptions(array(null => 'Available Workflow stages', 'Choose Worklow stage' => array('4' => 'Awaiting validation', '3' => 'Published')));
     }
     $treasure = new Zend_Form_Element_Checkbox('treasure');
     $treasure->setLabel('Treasure find: ')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null);
     $treasureID = new Zend_Form_Element_Text('TID');
     $treasureID->setLabel('Treasure ID number: ')->addFilters(array('StringTrim', 'StripTags'));
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null);
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose a rally', 'Available rallies' => $rally_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $other_ref = new Zend_Form_Element_Text('otherRef');
     $other_ref->setLabel('Other reference: ')->addFilters(array('StringTrim', 'StripTags'));
     $smrRef = new Zend_Form_Element_Text('smrRef');
     $smrRef->setLabel('SMR reference: ')->addFilters(array('StringTrim', 'StripTags'));
     $county = new Zend_Form_Element_Select('countyID');
     $county->setLabel('County: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose county', 'Available counties' => $county_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $district = new Zend_Form_Element_Select('districtID');
     $district->setLabel('District: ')->addMultiOptions(array(null => 'Choose district after county'))->setRegisterInArrayValidator(false)->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $parish = new Zend_Form_Element_Select('parishID');
     $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose parish after county'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->addValidator('Int')->addMultiOptions(array(null => 'Choose a region for a wide result', 'Choose region' => $region_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->addValidators(array('NotEmpty', 'ValidGridRef'))->addFilters(array('StringTrim', 'StripTags'));
     $fourFigure = new Zend_Form_Element_Text('fourFigure');
     $fourFigure->setLabel('Four figure grid reference: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'));
     $idBy = new Zend_Form_Element_Text('idBy');
     $idBy->setLabel('Primary identifier: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'));
     $identifierID = new Zend_Form_Element_Hidden('identifierID');
     $identifierID->addFilters(array('StringTrim', 'StripTags'));
     $created = new Zend_Form_Element_Text('createdBefore');
     $created->setLabel('Date record created on or before: ')->addFilters(array('StringTrim', 'StripTags'));
     $created2 = new Zend_Form_Element_Text('createdAfter');
     $created2->setLabel('Date record created on or after: ')->addFilters(array('StringTrim', 'StripTags'));
     $updated = new Zend_Form_Element_Text('updatedBefore');
     $updated->setLabel('Date record updated on or before: ')->addFilters(array('StringTrim', 'StripTags'));
     $updated2 = new Zend_Form_Element_Text('updatedAfter');
     $updated2->setLabel('Date record updated on or after: ')->addFilters(array('StringTrim', 'StripTags'));
     $finder = new Zend_Form_Element_Text('finder');
     $finder->setLabel('Found by: ')->addFilters(array('StringTrim', 'StripTags'));
     $finderID = new Zend_Form_Element_Hidden('finderID');
     $finderID->addFilters(array('StringTrim', 'StripTags'));
     $recordby = new Zend_Form_Element_Text('recordername');
     $recordby->setLabel('Recorded by: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'))->setAttrib('autoComplete', 'true');
     $recorderID = new Zend_Form_Element_Hidden('recorderID');
     $recorderID->addFilters(array('StringTrim', 'StripTags'));
     $discoverydate = new Zend_Form_Element_Select('discovered');
     $discoverydate->setLabel('Year of discovery')->setMultiOptions(array(null => 'Choose a year of discovery', 'Date range' => $years_list))->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Submit your search');
     $woeid = new Zend_Form_Element_Text('woeid');
     $woeid->setLabel('Where on earth ID: ')->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'));
     $elevation = new Zend_Form_Element_Text('elevation');
     $elevation->setLabel('Elevation: ')->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'));
     $lastRulerID = new Zend_Form_Element_Select('lastRulerID');
     $lastRulerID->setLabel('Last Ruler: ')->addValidator('Int')->addMultiOptions(array(null => 'Choose primary ruler', 'Available rulers' => $ruler_options))->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setDescription('You need to pick a broad period first')->setRegisterInArrayValidator(false);
     $termDate1 = new Zend_Form_Element_Text('fromTerminalYear');
     $termDate1->setLabel('Terminal year from: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $termDate2 = new Zend_Form_Element_Text('toTerminalYear');
     $termDate2->setLabel('Terminal year to: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $qualityRatingNum = new Zend_Form_Element_Select('qualityRatingNumismatic');
     $qualityRatingNum->setLabel('Coin data quality rating: ')->addMultiOptions(array(null => 'Choose quality rating', 'Available options' => $qualityStreet))->addValidator('Int')->addValidator('InArray', false, array(array_keys($qualityStreet)))->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $qualityRatingArch = new Zend_Form_Element_Select('qualityRatingArchaeological');
     $qualityRatingArch->setLabel('Archaeology data quality rating: ')->addMultiOptions(array(null => 'Choose quality rating', 'Available options' => $qualityStreet))->addValidator('Int')->addValidator('InArray', false, array(array_keys($qualityStreet)))->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $qualityRatingFindspot = new Zend_Form_Element_Select('qualityRatingFindspot');
     $qualityRatingFindspot->setLabel('Findspot data quality rating: ')->addMultiOptions(array(null => 'Choose quality rating', 'Available options' => $qualityStreet))->addValidator('Int')->addValidator('InArray', false, array(array_keys($qualityStreet)))->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $terminalReasonID = new Zend_Form_Element_Select('terminalReasonID');
     $terminalReasonID->setLabel('Terminal date reasoning: ')->addMultiOptions(array(null => 'Choose terminal reasoning', 'Available options' => $termOptions))->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $excavatedYear1 = new Zend_Form_Element_Text('excavatedYear1');
     $excavatedYear1->setLabel('Excavated year first date: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $excavatedYear2 = new Zend_Form_Element_Text('excavatedYear2');
     $excavatedYear2->setLabel('Excavated year end date: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $archaeologicalDescription = new Zend_Form_Element_Text('archaeologyDescription');
     $archaeologicalDescription->setLabel('Archaeological description contains: ');
     //Period from: Assigned via dropdown
     $archdate1period = new Zend_Form_Element_Select('archaeologyPeriodFrom');
     $archdate1period->setLabel('Period from: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Period to: Assigned via dropdown
     $archdate2period = new Zend_Form_Element_Select('archaeologyPeriodTo');
     $archdate2period->setLabel('Period to: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $siteDateYear1 = new Zend_Form_Element_Text('siteDateYear1');
     $siteDateYear1->setLabel('Site date from: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $siteDateYear2 = new Zend_Form_Element_Text('siteDateYear2');
     $siteDateYear2->setLabel('Site date to: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $featureDateYear1 = new Zend_Form_Element_Text('featureDateYear1');
     $featureDateYear1->setLabel('Feature date from: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $featureDateYear2 = new Zend_Form_Element_Text('featureDateYear2');
     $featureDateYear2->setLabel('Feature date to: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $knownSite = new Zend_Form_Element_Checkbox('knownSite');
     $knownSite->setLabel('Known site: ')->setUncheckedValue(null);
     $excavated = new Zend_Form_Element_Checkbox('excavated');
     $excavated->setLabel('Excavated: ')->setUncheckedValue(null);
     $siteclass = new Zend_Form_Element_Select('siteClassID');
     $siteclass->setLabel('Site class: ')->addMultioptions(array(null => 'Choose class of site', 'Available classes' => $siteclass_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($siteclass_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     $arch_context = new Zend_Form_Element_Select('siteContextID');
     $arch_context->setLabel('Context: ')->addMultioptions(array(null => 'Choose a context', 'Available contexts' => $context_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($context_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     $arch_feature = new Zend_Form_Element_Select('featureID');
     $arch_feature->setLabel('Feature: ')->addMultioptions(array(null => 'Choose a feature', 'Available features' => $feature_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($feature_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     $quantityCoins = new Zend_Form_Element_Text('quantityCoins');
     $quantityCoins->setLabel('Quantity of coins in hoard: ');
     $quantityCoins->setDescription('This searches for an exact quantity. ' . 'To search for a range use advanced search syntax in the simple ' . 'search box');
     $quantityArtefacts = new Zend_Form_Element_Text('quantityArtefacts');
     $quantityArtefacts->setLabel('Quantity of artefacts in hoard: ');
     $quantityArtefacts->setDescription('This searches for an exact quantity. ' . 'To search for a range use advanced search syntax in the simple ' . 'search box');
     $quantityContainers = new Zend_Form_Element_Text('quantityContainers');
     $quantityContainers->setLabel('Quantity of containers in hoard: ');
     $quantityContainers->setDescription('This searches for an exact quantity. ' . 'To search for a range use advanced search syntax in the simple ' . 'search box');
     $legacyID = new Zend_Form_Element_Text('legacyID');
     $legacyID->setLabel('Legacy hoard database number: ');
     //Reece
     $reece = new Zend_Form_Element_Select('reeceID');
     $reece->setLabel('Reece period: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose Reece period', 'Available Reece periods' => $reece_options))->addValidator('InArray', false, array(array_keys($reece_options)))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     if (in_array($this->_role, $this->_restricted)) {
         $this->addElements(array($old_findID, $objecttype, $broadperiod, $description, $from, $to, $workflow, $findofnote, $findofnotereason, $rally, $rallyID, $other_ref, $notes, $objdate1period, $termDate1, $objdate2period, $county, $regionID, $district, $parish, $fourFigure, $treasure, $treasureID, $discoverydate, $created, $created2, $updated, $updated2, $submit, $elevation, $woeid, $institution, $hash, $smrRef, $lastRulerID, $termDate2, $terminalReasonID, $qualityRatingNum, $qualityRatingArch, $qualityRatingFindspot, $archaeologicalDescription, $excavatedYear1, $excavatedYear2, $featureDateYear1, $featureDateYear2, $knownSite, $excavated, $siteclass, $arch_context, $arch_feature, $quantityArtefacts, $quantityCoins, $quantityContainers, $legacyID, $reece, $archdate1period, $archdate2period));
     } else {
         $this->addElements(array($old_findID, $objecttype, $broadperiod, $description, $from, $to, $workflow, $findofnote, $findofnotereason, $rally, $rallyID, $other_ref, $notes, $objdate1period, $objdate2period, $county, $regionID, $district, $parish, $fourFigure, $elevation, $woeid, $treasure, $treasureID, $discoverydate, $created, $created2, $updated, $updated2, $idBy, $finder, $finderID, $recordby, $recorderID, $identifierID, $lastRulerID, $submit, $institution, $archaeologicalDescription, $smrRef, $hash, $termDate1, $termDate2, $terminalReasonID, $qualityRatingNum, $qualityRatingArch, $qualityRatingFindspot, $excavatedYear1, $excavatedYear2, $featureDateYear1, $featureDateYear2, $siteclass, $arch_context, $arch_feature, $knownSite, $excavated, $quantityArtefacts, $quantityCoins, $quantityContainers, $legacyID, $reece, $archdate1period, $archdate2period));
     }
     $this->addDisplayGroup(array('old_findID', 'objecttype', 'description', 'notes', 'note', 'reason', 'treasure', 'TID', 'rally', 'rallyID', 'workflow', 'otherRef', 'smrRef', 'quantityArtefacts', 'quantityCoins', 'quantityContainers'), 'details');
     $this->details->setLegend('Main details: ');
     $this->addDisplayGroup(array('broadperiod', 'periodFrom', 'periodTo', 'fromdate', 'todate'), 'temporaldetails');
     $this->temporaldetails->setLegend('Dates and periods: ');
     $this->addDisplayGroup(array('lastRulerID', 'reeceID', 'fromTerminalYear', 'toTerminalYear', 'terminalReasonID', 'legacyID', 'qualityRatingNumismatic'), 'numismatics');
     $this->numismatics->setLegend('Numismatic analysis: ');
     $this->addDisplayGroup(array('knownSite', 'excavated', 'archaeologyPeriodFrom', 'archaeologyPeriodTo', 'archaeologyDescription', 'excavatedYear1', 'excavatedYear2', 'siteClassID', 'siteContextID', 'featureID', 'featureDateYear1', 'featureDateYear2', 'qualityRatingArchaeological'), 'archaeology');
     $this->archaeology->setLegend('Archaeological context: ');
     $this->addDisplayGroup(array('countyID', 'regionID', 'districtID', 'parishID', 'fourFigure', 'elevation', 'woeid', 'qualityRatingFindspot'), 'Spatial');
     $this->Spatial->setLegend('Spatial details: ');
     if (in_array($this->_role, $this->_restricted)) {
         $this->addDisplayGroup(array('institution', 'createdAfter', 'createdBefore', 'updatedAfter', 'updatedBefore', 'discovered'), 'Discovery');
     } else {
         $this->addDisplayGroup(array('institution', 'finder', 'idBy', 'identifierID', 'recordername', 'recorderID', 'createdAfter', 'createdBefore', 'updatedAfter', 'updatedBefore', 'discovered'), 'Discovery');
     }
     $this->Discovery->setLegend('Discovery details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Beispiel #18
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     ## GET OPTIONS TO POPULATE MENUS ##
     //Get periods for select menu
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     $periodword_options = $periods->getPeriodFromWords();
     //Get terminal reasons for select menu
     $terminalreasons = new TerminalReasons();
     $terminalreason_options = $terminalreasons->getReasons();
     //Get coin data quality ratings for select menu
     $qualityrating = new DataQuality();
     $qualityrating_options = $qualityrating->getRatings();
     //Get Find of note reason options for select menu
     $reasons = new Findofnotereasons();
     $reason_options = $reasons->getReasons();
     //Get primary materials for multiselect
     $primarymaterials = new Materials();
     $materials_options = $primarymaterials->getPrimaries();
     //Get discovery methods for select menu
     $discs = new DiscoMethods();
     $disc_options = $discs->getOptions();
     //Get Rally data for select menu
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     //Get Subsequent actions for select menu
     $actions = new SubsequentActions();
     $actionsDD = $actions->getSubActionsDD();
     //Get the reece periods for inclusion
     $reece = new Reeces();
     $reeces = $reece->getReeces();
     //End of select options construction
     $this->addElementPrefixPath('Pas_Filter', 'Pas/Filter/', 'filter');
     parent::__construct($options);
     $this->setName('hoards');
     ## UNIQUE ID FIELDS ##
     $secuid = new Zend_Form_Element_Hidden('secuid');
     $secuid->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum');
     $old_hoardID = new Zend_Form_Element_Hidden('hoardID');
     $old_hoardID->addFilters(array('StripTags', 'StringTrim'));
     ## HOARD DATING ##
     //Broadperiod:
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Broad period: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose broadperiod', 'Available periods' => $periodword_options))->addErrorMessage('You must enter a broad period.')->addValidator('InArray', false, array(array_keys($periodword_options)))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(1);
     //Sub period from: Assigned via dropdown
     $hoardsubperiod1 = new Zend_Form_Element_Select('subperiod1');
     $hoardsubperiod1->setLabel('Sub period from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a subperiod', 'Valid sub periods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->setAttribs(array('class' => 'selectpicker show-menu-arrow'))->setOrder(2);
     //Period from: Assigned via dropdown
     $hoardperiod1 = new Zend_Form_Element_Select('period1');
     $hoardperiod1->setLabel('Period from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a period from', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(3);
     //Sub period to: Assigned via dropdown
     $hoardsubperiod2 = new Zend_Form_Element_Select('subperiod2');
     $hoardsubperiod2->setLabel('Sub period to: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a subperiod', 'Valid sub periods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->addValidator('Digits')->setAttribs(array('class' => 'selectpicker show-menu-arrow'))->setOrder(4);
     //Period to: Assigned via dropdown
     $hoardperiod2 = new Zend_Form_Element_Select('period2');
     $hoardperiod2->setLabel('Period to: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(5);
     //Date from: Free text Integer +ve or -ve
     $numdate1 = new Zend_Form_Element_Text('numdate1');
     $numdate1->setLabel('Date from: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(6);
     //Date to: Free text Integer +ve or -ve
     $numdate2 = new Zend_Form_Element_Text('numdate2');
     $numdate2->setLabel('Date to: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(7);
     ## COIN DATING ##
     //Ruler of latest coins in hoard:
     $lastruler = new Zend_Form_Element_Select('lastrulerID');
     $lastruler->setLabel('Last ruler: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose ruler after broad period'))->setRegisterInArrayValidator(false)->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(8);
     //Ruler of latest coins in hoard:
     $lastreeceperiod = new Zend_Form_Element_Select('reeceID');
     $lastreeceperiod->setLabel('Last Reece period: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose Reece period', 'Available periods' => $reeces))->setRegisterInArrayValidator(false)->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(9);
     //Date from: Free text Integer +ve or -ve
     $terminaldate1 = new Zend_Form_Element_Text('terminalyear1');
     $terminaldate1->setLabel('Terminal date from: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(10);
     //Date to: Free text Integer +ve or -ve
     $terminaldate2 = new Zend_Form_Element_Text('terminalyear2');
     $terminaldate2->setLabel('Terminal date to: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(11);
     //Reason for terminal coin dating
     $terminalreason = new Zend_Form_Element_Select('terminalreason');
     $terminalreason->setLabel('Terminal reason: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a reasoning', 'Available reasons' => $terminalreason_options))->addValidator('InArray', false, array(array_keys($terminalreason_options)))->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow')->addValidator('Int')->setOrder(12);
     ## HOARD DETAILS ##
     //Hoard description
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Hoard description: ')->setRequired(false)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->setOrder(13);
     //Object notes
     $notes = new Pas_Form_Element_CKEditor('notes');
     $notes->setLabel('Notes: ')->setRequired(false)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->setOrder(14);
     //Coin data quality rating
     $coindataquality = new Zend_Form_Element_Select('qualityrating');
     $coindataquality->setLabel('Coin data quality rating: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a rating', 'Available ratings' => $qualityrating_options))->addValidator('InArray', false, array(array_keys($qualityrating_options)))->setAttrib('class', 'input-large selectpicker show-menu-arrow')->setDescription('This data quality field can only be completed by hoards project staff')->addValidator('Int')->setOrder(15);
     //Find of note
     $findofnote = new Zend_Form_Element_Checkbox('findofnote');
     $findofnote->setLabel('Find of Note: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('NotEmpty', 'Int')->setOrder(16);
     //Reason for find of note
     $findofnotereason = new Zend_Form_Element_Select('findofnotereason');
     $findofnotereason->setLabel('Why this find is considered noteworthy: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a reasoning', 'Available reasons' => $reason_options))->addValidator('InArray', false, array(array_keys($reason_options)))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Int')->setOrder(17);
     //Treasure: enumerator 1/0
     $treasure = new Zend_Form_Element_Checkbox('treasure');
     $treasure->setLabel('Treasure: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(18);
     //Treasure ID
     $treasureID = new Zend_Form_Element_Text('treasureID');
     $treasureID->setLabel('Treasure number: ')->setRequired(false)->setAttribs(array('placeholder' => 'T numbers are in the format of YYYYT1234', 'class' => 'span6'))->addValidator('Alnum', false, array('allowWhiteSpace' => false))->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'))->setOrder(19);
     ## QUANTITIES ##
     $quantityCoins = new Zend_Form_Element_Text('quantityCoins');
     $quantityCoins->setLabel('Quantity of coins: ')->addValidator('Int')->setOrder(20);
     $quantityArtefacts = new Zend_Form_Element_Text('quantityArtefacts');
     $quantityArtefacts->setLabel('Quantity of artefacts: ')->addValidator('Int')->setOrder(21);
     $quantityContainers = new Zend_Form_Element_Text('quantityContainers');
     $quantityContainers->setLabel('Quantity of containers: ')->addValidator('Int')->setOrder(22);
     ## MATERIALS ##
     //Materials
     $materials = new Zend_Form_Element_Multiselect('materials');
     $materials->setLabel('Primary materials: ')->addMultiOptions($materials_options)->setAttrib('class', 'multiselect')->setDescription('Primary materials of coins and artefacts in the hoard')->addFilters(array('Null'))->setOrder(23);
     ## RECORDING DETAILS ##
     //Recorder
     $recorderID = new Zend_Form_Element_Hidden('recorderID');
     $recorderID->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(24);
     $recordername = new Zend_Form_Element_Text('recordername');
     $recordername->setLabel('Recorded by: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(25);
     //Primary Identifier
     $idBy = new Zend_Form_Element_Text('idBy');
     $idBy->setLabel('Primary identifier: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(26);
     $identifier1ID = new Zend_Form_Element_Hidden('identifier1ID');
     $identifier1ID->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(27);
     $id2by = new Zend_Form_Element_Text('id2by');
     $id2by->setLabel('Secondary Identifier: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(28);
     //Secondary Identifier
     $identifier2ID = new Zend_Form_Element_Hidden('identifier2ID');
     $identifier2ID->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(29);
     ## DISCOVERER DETAILS ##
     //Finder
     $finder1ID = new Zend_Form_Element_Hidden('finder1ID');
     $finder1ID->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(30);
     $hiddenfield = new Zend_Form_Element_Hidden('hiddenfield');
     $hiddenfield->setValue(2)->setOrder(31);
     $finder1 = new Zend_Form_Element_Text('finder1');
     $finder1->setLabel('Found by: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setDescription('To make a new finder/identifier appear, you ' . 'first need to create them from the people menu on ' . 'the left hand side')->setOrder(32);
     $addFinderButton = new Zend_Form_Element_Button('addFinder');
     $addFinderButton->setLabel('Add Additional Finder')->setAttribs(array('class' => 'btn btn-info'));
     $addFinderButton->setOrder(50);
     $removeFinderButton = new Zend_Form_Element_Button('removeFinder');
     $removeFinderButton->setLabel('Remove Last Finder')->setAttribs(array('class' => 'btn btn-warning hidden'));
     $removeFinderButton->setOrder(51);
     ## DISCOVERY INFORMATION ##
     //Discovery method
     $discmethod = new Zend_Form_Element_Select('discmethod');
     $discmethod->setLabel('Discovery method: ')->setRequired(false)->setValue(1)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->addValidator('inArray', true, array(array_keys($disc_options)))->addMultiOptions(array(null => 'Choose method of discovery', 'Available methods' => $disc_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->setOrder(52);
     //Discovery circumstances
     $disccircum = new Zend_Form_Element_Text('disccircum');
     $disccircum->setLabel('Discovery circumstances: ')->setAttrib('size', 50)->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(53);
     //Date found from
     $datefound1 = new Zend_Form_Element_Text('datefound1');
     $datefound1->setLabel('First discovery date: ')->setAttrib('size', 10)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(54);
     //Date found to
     $datefound2 = new Zend_Form_Element_Text('datefound2');
     $datefound2->setLabel('Second discovery date: ')->setAttrib('size', 10)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(55);
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(56);
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose rally name', 'Available rallies' => $rally_options))->addValidator('InArray', false, array(array_keys($rally_options)))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->addValidator('Int')->setOrder(57);
     ## OTHER REFERENCE NUMBERS ##
     //Legacy hoard ID
     $legacy_ref = new Zend_Form_Element_Text('legacyID');
     $legacy_ref->setLabel('Legacy hoard ID: ')->setAttrib('size', 5)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(58)->disabled = true;
     //Other reference number
     $other_ref = new Zend_Form_Element_Text('other_ref');
     $other_ref->setLabel('Other reference: ')->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(59);
     //HER reference number
     $smrrefno = new Zend_Form_Element_Text('smrrefno');
     $smrrefno->setLabel('Historic Environment Record number: ')->setAttrib('size', 30)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(60);
     //Museum accession number
     $musaccno = new Zend_Form_Element_Text('musaccno');
     $musaccno->setLabel('Museum accession number: ')->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(61);
     //Current location of object
     $curr_loc = new Zend_Form_Element_Text('curr_loc');
     $curr_loc->setLabel('Current location: ')->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(62);
     //Current location of object
     $subs_action = new Zend_Form_Element_Select('subs_action');
     $subs_action->setLabel('Subsequent action: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setAttrib('class', 'span6')->addMultiOptions(array(null => 'Choose a subsequent action', 'Available options' => $actionsDD))->setValue(1)->addValidator('InArray', false, array(array_keys($actionsDD)))->addValidator('Int')->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->setOrder(63);
     ## Quantities ##
     $quantityCoins = new Zend_Form_Element_Text('quantityCoins');
     $quantityCoins->setLabel('Quantity of coins: ')->addValidator('Int')->setValue(null);
     $quantityArtefacts = new Zend_Form_Element_Text('quantityArtefacts');
     $quantityArtefacts->setLabel('Quantity of artefacts: ')->addValidator('Int')->setValue(null);
     $quantityContainers = new Zend_Form_Element_Text('quantityContainers');
     $quantityContainers->setLabel('Quantity of containers: ')->addValidator('Int')->setValue(null);
     ## SUBMIT BUTTON ##
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setOrder(67);
     $this->addElements(array($secuid, $old_hoardID, $broadperiod, $hoardperiod1, $hoardperiod2, $hoardsubperiod1, $hoardsubperiod2, $numdate1, $numdate2, $lastruler, $lastreeceperiod, $terminaldate1, $terminaldate2, $terminalreason, $description, $notes, $coindataquality, $findofnote, $findofnotereason, $treasure, $treasureID, $quantityArtefacts, $quantityCoins, $quantityContainers, $materials, $recorderID, $recordername, $idBy, $id2by, $identifier1ID, $identifier2ID, $finder1, $finder1ID, $hiddenfield, $addFinderButton, $removeFinderButton, $discmethod, $disccircum, $datefound1, $datefound2, $rally, $rallyID, $legacy_ref, $other_ref, $smrrefno, $musaccno, $curr_loc, $subs_action, $submit));
     $this->addDisplayGroup(array('broadperiod', 'subperiod1', 'period1', 'subperiod2', 'period2', 'numdate1', 'numdate2'), 'hoarddating');
     $this->hoarddating->setLegend('Hoard dating');
     $this->addDisplayGroup(array('lastrulerID', 'reeceID', 'terminalyear1', 'terminalyear2', 'terminalreason'), 'coindating');
     $this->coindating->setLegend('Coin dating');
     $this->addDisplayGroup(array('description', 'notes', 'qualityrating', 'findofnote', 'findofnotereason', 'treasure', 'treasureID'), 'hoarddetails');
     $this->hoarddetails->setLegend('Hoard details');
     $this->addDisplayGroup(array('quantityCoins', 'quantityArtefacts', 'quantityContainers'), 'quantities');
     $this->quantities->setLegend('Quantities');
     $this->addDisplayGroup(array('materials'), 'primarymaterials');
     $this->primarymaterials->setLegend('Materials');
     $this->addDisplayGroup(array('recordername', 'recorderID', 'idBy', 'identifier1ID', 'id2by', 'identifier2ID'), 'recorders');
     $this->recorders->setLegend('Recording details');
     $this->addDisplayGroup(array('finder1', 'finder1ID', 'hiddenfield', 'addFinder', 'removeFinder'), 'discoverers');
     $this->discoverers->setLegend('Discoverer details');
     $this->addDisplayGroup(array('disccircum', 'discmethod', 'datefound1', 'datefound2', 'rally', 'rallyID'), 'discovery');
     $this->discovery->setLegend('Discovery details');
     $this->addDisplayGroup(array('legacyID', 'other_ref', 'smrrefno', 'musaccno', 'curr_loc', 'subs_action'), 'references');
     $this->references->setLegend('Reference numbers');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
     $addFinderButton->removeDecorator('Label');
     $addFinderButtonDecorator = $addFinderButton->getDecorator('HtmlTag');
     $addFinderButtonDecorator->setOption('id', 'addFinderDiv');
     $removeFinderButton->removeDecorator('Label');
     $person = new Pas_User_Details();
     $role = $person->getRole();
     $projectTeam = array('hoard', 'admin');
     if (!in_array($role, $projectTeam)) {
         $coindataquality->disabled = true;
     }
 }
 public function __construct($options = null)
 {
     $institutions = new Institutions();
     $inst_options = $institutions->getInsts();
     //Get data to form select menu for discovery methods
     $discs = new DiscoMethods();
     $disc_options = $discs->getOptions();
     //Get data to form select menu for manufacture methods
     $mans = new Manufactures();
     $man_options = $mans->getOptions();
     //Get data to form select menu for primary and secondary material
     $primaries = new Materials();
     $primary_options = $primaries->getPrimaries();
     //Get data to form select menu for periods
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     //Get primary material list
     $primaries = new Materials();
     $primary_options = $primaries->getPrimaries();
     //Get period list
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFromWords();
     //Get data to form select menu for cultures
     $cultures = new Cultures();
     $culture_options = $cultures->getCultures();
     //Get data to form Surface treatments menu
     $surfaces = new Surftreatments();
     $surface_options = $surfaces->getSurfaces();
     //Get data to form Decoration styles menu
     $decorations = new Decstyles();
     $decoration_options = $decorations->getStyles();
     //Get data to form Decoration methods menu
     $decmeths = new Decmethods();
     $decmeth_options = $decmeths->getDecmethods();
     //Get Find of note reason data
     $reasons = new Findofnotereasons();
     $reason_options = $reasons->getReasons();
     //Get Preservation data
     $preserves = new Preservations();
     $preserve_options = $preserves->getPreserves();
     //Get Rally data
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     //Get Hoard data
     $hoards = new Hoards();
     $hoard_options = $hoards->getHoards();
     //Get county dropdown
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     //Get regions list
     $regions = new Regions();
     $region_options = $regions->getRegionName();
     //Set up year of discovery dropdown
     $current_year = date('Y');
     $years = range(1950, $current_year);
     $years_list = array_combine($years, $years);
     parent::__construct($options);
     $decorator = array('SimpleInput');
     $decoratorSelect = array('SelectInput');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'requiredSuffix' => ' *')), array('HtmlTag', array('tag' => 'li')));
     $decoratorsHide = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'class' => 'hideme')), array('HtmlTag', array('tag' => 'li')));
     $decoratorsRally = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'class' => 'hiderally')), array('HtmlTag', array('tag' => 'li')));
     $decoratorsHoard = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'class' => 'hidehoard')), array('HtmlTag', array('tag' => 'li')));
     $decoratorsNote = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'class' => 'hidenote')), array('HtmlTag', array('tag' => 'li')));
     $this->setName('Advanced');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->addFilters(array('StringTrim', 'StripTags'))->addValidator('StringLength', false, array(3, 20))->addErrorMessage('Please enter a valid number!')->setDecorators($decorators);
     $objecttype = new Zend_Form_Element_Text('objecttype');
     $objecttype->setLabel('Object type: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Please enter a valid object type!')->setDecorators($decorator);
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Object description contains: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Please enter a valid term')->setDecorators($decorator);
     //Find of note
     $findofnote = new Zend_Form_Element_Checkbox('note');
     $findofnote->setLabel('Find of Note: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(NULL)->setDecorators($decorators);
     //Reason for find of note
     $findofnotereason = new Zend_Form_Element_Select('reason');
     $findofnotereason->setLabel('Reason for noteworthy status: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose reason' => $reason_options))->setDisableTranslator(true)->setDecorators($decoratorsNote);
     //Institution
     $institution = new Zend_Form_Element_Select('institution');
     $institution->setLabel('Recording institution: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose institution' => $inst_options))->setDecorators($decoratorsNote);
     $notes = new Zend_Form_Element_Text('notes');
     $notes->setLabel('Notes: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorator);
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Broad period: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose period from' => $periodword_options))->setDecorators($decorators);
     $objdate1subperiod = new Zend_Form_Element_Select('fromsubperiod');
     $objdate1subperiod->setLabel('Sub period from: ')->setRequired(false)->addMultiOptions(array(NULL => NULL, 'Choose sub-period from' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => ''))->setDecorators($decorators);
     //Period from: Assigned via dropdown
     $objdate1period = new Zend_Form_Element_Select('periodFrom');
     $objdate1period->setLabel('Period from: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose period from' => $period_options))->setDisableTranslator(true)->setDecorators($decorators);
     $objdate2subperiod = new Zend_Form_Element_Select('tosubperiod');
     $objdate2subperiod->setLabel('Sub period to: ')->addMultiOptions(array(NULL => NULL, 'Choose sub-period from' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->setDisableTranslator(true)->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => ''))->setDecorators($decorators);
     //Period to: Assigned via dropdown
     $objdate2period = new Zend_Form_Element_Select('periodTo');
     $objdate2period->setLabel('Period to: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose period to' => $period_options))->setDecorators($decorators);
     $culture = new Zend_Form_Element_Select('culture');
     $culture->setLabel('Ascribed culture: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose ascribed culture to' => $culture_options))->setDecorators($decorators);
     $from = new Zend_Form_Element_Text('from');
     $from->setLabel('Start date greater than: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addValidators(array('NotEmpty', 'Int'))->addErrorMessage('Please enter a valid date')->setDisableTranslator(true)->setDecorators($decorator);
     $fromend = new Zend_Form_Element_Text('fromend');
     $fromend->setLabel('Start date smaller than: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addValidators(array('NotEmpty', 'Int'))->addErrorMessage('Please enter a valid date')->setDecorators($decorator)->setDisableTranslator(true);
     $to = new Zend_Form_Element_Text('to');
     $to->setLabel('End date greater than: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addValidators(array('NotEmpty', 'Int'))->addErrorMessage('Please enter a valid date')->setDecorators($decorator);
     $toend = new Zend_Form_Element_Text('toend');
     $toend->setLabel('End date smaller than: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addValidators(array('NotEmpty', 'Int'))->addErrorMessage('Please enter a valid date')->setDecorators($decorator);
     $workflow = new Zend_Form_Element_Select('workflow');
     $workflow->setLabel('Workflow stage: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addValidator('Int')->setDecorators($decorators);
     if (in_array($this->getRole(), $this->higherlevel)) {
         $workflow->addMultiOptions(array(NULL => NULL, 'Choose Worklow stage' => array('1' => 'Quarantine', '2' => 'On review', '4' => 'Awaiting validation', '3' => 'Published')));
     }
     if (in_array($this->getRole(), $this->restricted)) {
         $workflow->addMultiOptions(array(NULL => NULL, 'Choose Worklow stage' => array('4' => 'Awaiting validation', '3' => 'Published')));
     }
     $treasure = new Zend_Form_Element_Checkbox('treasure');
     $treasure->setLabel('Treasure find: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(NULL)->setDecorators($decorators);
     $treasureID = new Zend_Form_Element_Text('TID');
     $treasureID->setLabel('Treasure ID number: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decoratorsHide);
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->setRequired(false)->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(NULL)->setDecorators($decorators);
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose rally name' => $rally_options))->setDisableTranslator(true)->setDecorators($decoratorsRally);
     $hoard = new Zend_Form_Element_Checkbox('hoard');
     $hoard->setLabel('Hoard find: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(NULL)->setDecorators($decorators);
     $hoardID = new Zend_Form_Element_Select('hID');
     $hoardID->setLabel('Part of this hoard: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose rally name' => $hoard_options))->setDecorators($decoratorsHoard);
     $other_ref = new Zend_Form_Element_Text('otherRef');
     $other_ref->setLabel('Other reference: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorator);
     //Manufacture method
     $manmethod = new Zend_Form_Element_Select('manufacture');
     $manmethod->setLabel('Manufacture method: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addValidator('Int')->addMultiOptions(array(NULL => NULL, 'Choose method of manufacture' => $man_options))->setDecorators($decorators);
     //Decoration method
     $decmethod = new Zend_Form_Element_Select('decoration');
     $decmethod->setLabel('Decoration method: ')->setRequired(false)->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose decoration method' => $decmeth_options))->setDecorators($decorators);
     //Surface treatment
     $surftreat = new Zend_Form_Element_Select('surface');
     $surftreat->setLabel('Surface Treatment: ')->setRequired(false)->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose surface treatment' => $surface_options))->setDecorators($decorators);
     //decoration style
     $decstyle = new Zend_Form_Element_Select('decstyle');
     $decstyle->setLabel('Decorative style: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose decorative style' => $decoration_options))->addValidator('Int')->setDecorators($decorators);
     //Preservation of object
     $preservation = new Zend_Form_Element_Select('preservation');
     $preservation->setLabel('Preservation: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('Int')->addMultiOptions(array(NULL => NULL, 'Choose level of preservation' => $preserve_options))->setDecorators($decorators);
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->setDecorators($decorators);
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->addMultiOptions(array(NULL => 'Choose district after county'))->setRegisterInArrayValidator(false)->addFilters(array('StringTrim', 'StripTags'))->setDisableTranslator(true)->setDecorators($decorators);
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => 'Choose parish after county'))->setDisableTranslator(true)->setDecorators($decorators);
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->addValidator('Int')->addMultiOptions(array(NULL => 'Choose a region for a wide result', 'Choose region' => $region_options))->setDisableTranslator(true)->setDecorators($decorators);
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorator);
     $fourFigure = new Zend_Form_Element_Text('fourFigure');
     $fourFigure->setLabel('Four figure grid reference: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorator);
     $idBy = new Zend_Form_Element_Text('idby');
     $idBy->setLabel('Primary identifier: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorator);
     $identifierID = new Zend_Form_Element_Hidden('identifierID');
     $identifierID->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addFilters(array('StringTrim', 'StripTags'))->removeDecorator('Label');
     $created = new Zend_Form_Element_Text('createdBefore');
     $created->setLabel('Date record created on or before: ')->addValidator('Date')->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorator);
     $created2 = new Zend_Form_Element_Text('createdAfter');
     $created2->setLabel('Date record created on or after: ')->addValidator('Date')->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorator);
     $finder = new Zend_Form_Element_Text('finder');
     $finder->setLabel('Found by: ')->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorator);
     $finderID = new Zend_Form_Element_Hidden('finderID');
     $finderID->removeDecorator('HtmlTag')->addFilters(array('StringTrim', 'StripTags'))->removeDecorator('DtDdWrapper')->removeDecorator('Label');
     $recordby = new Zend_Form_Element_Text('recordby');
     $recordby->setLabel('Recorded by: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'))->setAttrib('autoComplete', 'true')->setDecorators($decorator);
     $recorderID = new Zend_Form_Element_Hidden('recorderID');
     $recorderID->removeDecorator('HtmlTag')->addFilters(array('StringTrim', 'StripTags'))->removeDecorator('DtDdWrapper')->removeDecorator('Label');
     $discoverydate = new Zend_Form_Element_Select('discovered');
     $discoverydate->setLabel('Year of discovery')->setMultiOptions(array(NULL => 'Choose a year of discovery', 'Date range' => $years_list))->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorators);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->setLabel('Submit your search');
     $material1 = new Zend_Form_Element_Select('material');
     $material1->setLabel('Primary material: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose primary material' => $primary_options))->setDecorators($decorators);
     $woeid = new Zend_Form_Element_Text('woeid');
     $woeid->setLabel('Where on earth ID: ')->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorator);
     $elevation = new Zend_Form_Element_Text('elevation');
     $elevation->setLabel('Elevation: ')->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorator);
     if (in_array($this->getRole(), $this->restricted)) {
         $this->addElements(array($old_findID, $objecttype, $broadperiod, $description, $from, $to, $workflow, $findofnote, $findofnotereason, $rally, $rallyID, $hoard, $hoardID, $other_ref, $manmethod, $fromend, $toend, $notes, $objdate1period, $objdate2period, $county, $regionID, $district, $parish, $fourFigure, $objdate1subperiod, $objdate2subperiod, $treasure, $treasureID, $discoverydate, $created, $created2, $idBy, $recordby, $recorderID, $identifierID, $culture, $surftreat, $submit, $material1, $elevation, $woeid, $institution));
     } else {
         $this->addElements(array($old_findID, $objecttype, $broadperiod, $description, $from, $to, $workflow, $findofnote, $findofnotereason, $rally, $rallyID, $hoard, $hoardID, $other_ref, $manmethod, $fromend, $toend, $notes, $objdate1period, $objdate2period, $county, $regionID, $district, $parish, $fourFigure, $elevation, $woeid, $objdate1subperiod, $objdate2subperiod, $treasure, $treasureID, $discoverydate, $created, $created2, $idBy, $finder, $finderID, $recordby, $recorderID, $identifierID, $culture, $surftreat, $submit, $material1, $institution));
     }
     $this->addDisplayGroup(array('old_findID', 'objecttype', 'description', 'notes', 'note', 'reason', 'treasure', 'TID', 'rally', 'rallyID', 'hoard', 'hID', 'workflow', 'otherRef', 'material', 'manufacture', 'surface'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Main details: ');
     $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->addDisplayGroup(array('broadperiod', 'fromsubperiod', 'periodFrom', 'tosubperiod', 'periodTo', 'culture', 'from', 'fromend', 'to', 'toend'), 'Temporaldetails')->removeDecorator('HtmlTag');
     $this->Temporaldetails->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->Temporaldetails->removeDecorator('DtDdWrapper');
     $this->Temporaldetails->setLegend('Temporal details: ');
     $this->addDisplayGroup(array('county', 'regionID', 'district', 'parish', 'fourFigure', 'elevation', 'woeid'), 'Spatial')->removeDecorator('HtmlTag');
     $this->Spatial->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->Spatial->removeDecorator('DtDdWrapper');
     $this->Spatial->setLegend('Spatial details: ');
     if (in_array($this->getRole(), $this->restricted)) {
         $this->addDisplayGroup(array('institution', 'idby', 'identifierID', 'recordby', 'recorderID', 'createdAfter', 'createdBefore', 'discovered'), 'Discovery')->removeDecorator('HtmlTag');
     } else {
         $this->addDisplayGroup(array('institution', 'finder', 'idby', 'identifierID', 'recordby', 'recorderID', 'createdAfter', 'createdBefore', 'discovered'), 'Discovery')->removeDecorator('HtmlTag');
     }
     $this->Discovery->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->Discovery->removeDecorator('DtDdWrapper');
     $this->Discovery->setLegend('Discovery details: ');
     //$this->setLegend('Perform an advanced search on our database: ');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }