示例#1
0
 public function __construct($options = null)
 {
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFromWords();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setMethod('post');
     $this->setName('filterfinds');
     $this->addElementPrefixPath('Pas_Validate', 'Pas/Validate/', 'validate');
     $this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element/', 'element');
     $this->addPrefixPath('Pas_Form_Decorator', 'Pas/Form/Decorator/', 'decorator');
     $decorator = array('TableDecInput');
     $objecttype = new Zend_Form_Element_Text('objecttype');
     $objecttype->setLabel('Filter by object type')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha', false, array('allowWhiteSpace' => true))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 10)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $oldfindID = new Zend_Form_Element_Text('old_findID');
     $oldfindID->setLabel('Filter by find ID #')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 11)->addValidator('stringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Filter by broadperiod')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose period from' => $periodword_options))->addValidator('InArray', false, array(array_keys($periodword_options)));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Filter by county')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setLabel('Filter:')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'largefilter');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $this->addElements(array($objecttype, $oldfindID, $broadperiod, $county, $submit));
 }
 public function __construct($options = null)
 {
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFromWords();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setMethod('get');
     $this->setName('filterfinds');
     $decorator = array('TableDecInput');
     $objecttype = new Zend_Form_Element_Text('objecttype');
     $objecttype->setLabel('Filter by object type')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 15)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $oldfindID = new Zend_Form_Element_Text('old_findID');
     $oldfindID->setLabel('Filter by find ID #')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 15)->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $TID = new Zend_Form_Element_Text('TID');
     $TID->setLabel('Filter by treasure ID #')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 15)->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Filter by broadperiod')->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')->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)));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setLabel('Filter')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $this->addElements(array($objecttype, $oldfindID, $TID, $broadperiod, $county, $submit, $hash));
 }
示例#3
0
 public function __construct($options = null)
 {
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFrom();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setMethod('post');
     $this->setName('filterusers');
     $this->addElementPrefixPath('Pas_Validate', 'Pas/Validate/', 'validate');
     $this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element/', 'element');
     $this->addPrefixPath('Pas_Form_Decorator', 'Pas/Form/Decorator/', 'decorator');
     $decorator = array('TableDecInput');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Filter by ID #: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 11)->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $label = new Zend_Form_Element_Text('label');
     $label->setLabel('Filter by image label:')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 25)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Filter by broadperiod: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose period from' => $periodword_options))->addValidator('InArray', false, array(array_keys($periodword_options)));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Filter by county: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setLabel('Filter')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $this->addElements(array($old_findID, $label, $broadperiod, $county, $submit));
 }
 public function __construct($options = null)
 {
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFromWords();
     $activities = new PrimaryActivities();
     $activities_options = $activities->getTerms();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setName('filterpeople');
     $decorator = array('TableDecInput');
     $name = new Zend_Form_Element_Text('organisation');
     $name->setLabel('Filter by name')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 40)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $contact = new Zend_Form_Element_Text('contact');
     $contact->setLabel('Filter by contact person: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Enter a valid organisation')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $contactpersonID = new Zend_Form_Element_Hidden('contactpersonID');
     $contactpersonID->removeDecorator('Label')->removeDecorator('DtDdWrapper')->addFilters(array('StripTags', 'StringTrim'))->removeDecorator('HtmlTag')->addValidator('Alnum');
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Filter by county')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setLabel('Filter')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElement($hash);
     $this->addElements(array($name, $county, $contact, $contactpersonID, $submit));
 }
 public function __construct($options = null)
 {
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFromWords();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setMethod('get');
     $this->setName('filterfinds');
     $decorator = array('TableDecInput');
     $objectType = new Zend_Form_Element_Select('objectType');
     $objectType->setLabel('Filter by object type')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha', false, array('allowWhiteSpace' => true))->addErrorMessage('Come on it\'s not that hard, enter a title!')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Filter by broadperiod')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Filter by county')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setLabel('Filter:')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'largefilter');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $this->addElements(array($objectType, $broadperiod, $county, $submit));
 }
 public function __construct($options = null)
 {
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $crimes = new CrimeTypes();
     $crimeoptions = $crimes->getTypes();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('rally');
     $crimeType = new Zend_Form_Element_Select('crimeType');
     $crimeType->setLabel('Crime type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must set crime type or no point entering it!')->addMultiOptions(array(NULL => 'Choose a crime type', 'Valid types' => $crimeoptions))->addValidator('inArray', false, array(array_keys($crimeoptions)))->setDecorators($decorators);
     $subject = new Zend_Form_Element_Text('subject');
     $subject->setLabel('Title: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators)->setAttrib('size', 50)->addErrorMessage('You must enter a subject for this crime');
     $reporterID = new Zend_Form_Element_Hidden('reporterID');
     $reporterID->removeDecorator('Label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You do not appear to have chosen a reporter');
     $reporter = new Zend_Form_Element_Text('reporter');
     $reporter->setLabel('Source: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->setDescription('Name and address of person providing intelligence.')->addErrorMessage('You must enter a reporter name');
     $reportingPerson = new Zend_Form_Element_Text('reportingPerson');
     $reportingPerson->setLabel('Person making the report: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->setDescription('Name of person providing intelligence.')->addErrorMessage('You must enter a reporter name');
     $reportSubject = new Zend_Form_Element_Text('reportSubject');
     $reportSubject->setLabel('Subject of report: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators)->setDescription('Name of suspect if known.')->addErrorMessage('You must enter a reporter name');
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a county', 'Valid counties' => $county_options))->addValidator('inArray', false, array(array_keys($county_options)))->setDecorators($decorators);
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose district after county'));
     $reliability = new Zend_Form_Element_Select('reliability');
     $reliability->setLabel('Source Evaluation: ')->addMultiOptions(array('1' => 'Always reliable', '2' => 'Mostly reliable', '3' => 'Sometimes reliable', '4' => 'Unreliable', '5' => 'Don\'t know'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->setDecorators($decorators);
     $intellEvaluation = new Zend_Form_Element_Select('intellEvaluation');
     $intellEvaluation->setLabel('Intelligence Evaluation: ')->addMultiOptions(array('1' => 'Known to be true', '2' => 'Known to be true by the source, but not by the person making the report', '3' => 'Not known, but is corroborated', '4' => 'Cannot be judged', '5' => 'Suspected to be false!'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setDescription('What you know about the intelligence itself.')->setOptions(array('separator' => ''))->setDecorators($decorators);
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose parish after district'))->addFilters(array('StripTags', 'StringTrim'));
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Associated NGR: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'ValidGridRef'))->setAttrib('maxlength', 16)->setDecorators($decorators);
     $description = new Pas_Form_Element_RTE('description');
     $description->setLabel('Description of crime - Main report: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $subjectDetails = new Pas_Form_Element_RTE('subjectDetails');
     $subjectDetails->setLabel('Subject details: ')->setRequired(false)->setDescription('DOB,address,description,etc if known.')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $evaluation = new Pas_Form_Element_RTE('evaluation');
     $evaluation->setLabel('Offences: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $incidentDate = new ZendX_JQuery_Form_Element_DatePicker('incidentDate');
     $incidentDate->setLabel('Date of incident: ')->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Date'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $sam = new Zend_Form_Element_Text('sam');
     $sam->setLabel('Associated with scheduled monument: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->setAttrib('size', 35);
     $samID = new Zend_Form_Element_Hidden('samID');
     $samID->removeDecorator('Label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($crimeType, $incidentDate, $samID, $sam, $reporter, $reporterID, $county, $district, $parish, $gridref, $description, $reliability, $evaluation, $subject, $reliability, $intellEvaluation, $subjectDetails, $reportSubject, $reportingPerson, $submit));
     $this->addDisplayGroup(array('subject', 'crimeType', 'description', 'incidentDate', 'evaluation', 'reportingPerson', 'reporter', 'reporterID', 'reliability', 'intellEvaluation', 'reportSubject', 'subjectDetails', 'sam', 'samID', 'gridref', 'county', 'district', 'parish'), 'details');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Crime details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
示例#7
0
 public function __construct($options = null)
 {
     $countries = new Countries();
     $countries_options = $countries->getOptions();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('coroner');
     $firstname = new Zend_Form_Element_Text('firstname');
     $firstname->setLabel('First name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Come on it\'s not that hard, enter a firstname!')->setDecorators($decorators);
     $lastname = new Zend_Form_Element_Text('lastname');
     $lastname->setLabel('Last name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     $email = new Zend_Form_Element_Text('email');
     $email->SetLabel('Email address: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->addValidator('EmailAddress', false)->setDecorators($decorators);
     $address_1 = new Zend_Form_Element_Text('address_1');
     $address_1->SetLabel('Address line one: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     $address_2 = new Zend_Form_Element_Text('address_2');
     $address_2->SetLabel('Address line two: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     $town = new Zend_Form_Element_Text('town');
     $town->SetLabel('Town: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty'))->addMultiOptions(array(NULL => 'Choose county', 'Valid county' => $county_options))->setDecorators($decorators);
     $region_name = new Zend_Form_Element_Text('region_name');
     $region_name->SetLabel('Administrative region: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     $postcode = new Zend_Form_Element_Text('postcode');
     $postcode->SetLabel('Postcode: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->addValidator('ValidPostCode')->setDecorators($decorators);
     $country = new Zend_Form_Element_Select('country');
     $country->SetLabel('Country: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 4))->addValidator('InArray', false, array(array_keys($countries_options)))->addMultiOptions($countries_options)->setValue('GB')->setDecorators($decorators);
     $telephone = new Zend_Form_Element_Text('telephone');
     $telephone->SetLabel('Telephone number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     $fax = new Zend_Form_Element_Text('fax');
     $fax->SetLabel('Fax number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setDecorators($decorators);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($firstname, $lastname, $email, $address_1, $address_2, $town, $postcode, $county, $country, $telephone, $fax, $region_name, $submit));
     $this->addDisplayGroup(array('firstname', 'lastname', 'region_name', 'email', 'address_1', 'address_2', 'town', 'postcode', 'county', 'country', 'telephone', 'fax'), '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('Submit Coroner\'s details ');
 }
示例#8
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');
 }
示例#9
0
 public function __construct($options = null)
 {
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     ZendX_JQuery::enableForm($this);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('rally');
     $rally_name = new Zend_Form_Element_Text('rally_name');
     $rally_name->setLabel('Rally name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setAttrib('size', 60)->addErrorMessage('Come on it\'s not that hard, enter a name for the rally!')->setDecorators($decorators);
     $organisername = new Zend_Form_Element_Text('organisername');
     $organisername->setLabel('Rally Organiser: ')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $organiser = new Zend_Form_Element_Hidden('organiser');
     $organiser->removeDecorator('Label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addFilters(array('StripTags', 'StringTrim'));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addMultiOptions(array(NULL => 'Choose a county', 'Valid counties' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha', false, array('allowWhiteSpace' => true));
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose district after county'))->addValidator('Alpha', false, array('allowWhiteSpace' => true));
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose parish after district'))->addValidator('Alpha', false, array('allowWhiteSpace' => true));
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Centred on field at NGR: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('maxlength', 16)->setDecorators($decorators)->addValidators(array('NotEmpty', 'ValidGridRef'));
     $record_method = new Pas_Form_Element_RTE('record_method');
     $record_method->setLabel('Recording methodology employed: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 80)->addFilters(array('BasicHtml', 'EmptyParagraph', 'StringTrim'));
     $comments = new Zend_Form_Element_Textarea('comments');
     $comments->setLabel('Comments on rally: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 80)->addFilters(array('BasicHtml', 'EmptyParagraph', 'StringTrim'));
     //Date found from
     $date_from = new ZendX_JQuery_Form_Element_DatePicker('date_from');
     $date_from->setLabel('Start date of rally: ')->setRequired(false)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Date')->setDecorators($decorators);
     //Date found to
     $date_to = new ZendX_JQuery_Form_Element_DatePicker('date_to');
     $date_to->setLabel('End date of rally: ')->setRequired(false)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Date')->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($rally_name, $date_from, $date_to, $organiser, $organisername, $county, $district, $parish, $gridref, $comments, $record_method, $submit));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElement($hash);
     $this->addDisplayGroup(array('rally_name', 'comments', 'record_method', 'date_from', 'date_to', 'organiser', 'organisername', 'county', 'district', 'parish', 'gridref'), 'details');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Rally details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
示例#10
0
 public function __construct($options = null)
 {
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setName('filtersams');
     $decorator = array('TableDecInput');
     $monumentName = new Zend_Form_Element_Text('monumentName');
     $monumentName->setLabel('Filter by name:')->addFilters(array('StringTrim', 'StripTags'))->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Filter by parish')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('Filter by district: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addValidator('StringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Filter by county: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->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)));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setLabel('Filter:')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'largefilter');
     $this->addElements(array($monumentName, $county, $district, $parish, $submit, $hash));
 }
示例#11
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');
 }
示例#12
0
 public function __construct($options = null)
 {
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('mapsearch');
     $latitude = new Zend_Form_Element_Text('declat');
     $latitude->setLabel('Latitude: ')->setDecorators($decorators);
     $longitude = new Zend_Form_Element_Text('declong');
     $longitude->setLabel('Longitude: ')->setDecorators($decorators);
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addValidators(array('NotEmpty'))->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->setDecorators($decorators);
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->setRegisterInArrayValidator(false)->setDecorators($decorators);
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->setDecorators($decorators);
     $distance = new Zend_Form_Element_Select('distance');
     $distance->setLabel('Distance from point: ')->addMultiOptions(array(NULL => NULL, 'Choose distance' => array('0.05' => '50 metres', '0.1' => '100 metres', '0.25' => '250 metres', '0.5' => '500 metres', '1' => '1 kilometre', '2' => '2 kilometres', '3' => '3 kilometres', '4' => '4 kilometres', '5' => '5 kilometres', '10' => '10 kilometres')))->setDecorators($decorators);
     $objecttype = new Zend_Form_Element_Text('objecttype');
     $objecttype->setLabel('Object type: ')->setRequired(false)->setAttrib('size', 20)->addFilter('StripTags')->addFilter('StringTrim')->setDecorators($decorators)->addErrorMessage('You must enter an object type and it must be valid');
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Nat. Grid Reference: ')->setRequired(false)->setAttrib('size', 16)->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('maxlength', 16)->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $this->addElements(array($objecttype, $distance, $county, $district, $parish, $gridref, $latitude, $longitude, $submit));
     $this->addDisplayGroup(array('objecttype', 'county', 'district', 'parish', 'gridref', 'declat', 'declong', 'distance'), 'details');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('ListWrapper');
     $this->removeDecorator('HtmlTag');
     $this->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'div', 'id' => 'mapsearchcontainer'));
     $this->details->setLegend('Spatial data: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
 public function __construct($options = null)
 {
     $institutions = new Institutions();
     $inst_options = $institutions->getInsts();
     //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
     //Get Rally data
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     //Get Hoard data
     $hoards = new Hoards();
     $hoard_options = $hoards->getHoards();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $rulers = new Rulers();
     $ruler_options = $rulers->getRulersByzantine();
     $denominations = new Denominations();
     $denomination_options = $denominations->getDenomsByzantine();
     $mints = new Mints();
     $mint_options = $mints->getMintsByzantine();
     $axis = new Dieaxes();
     $axis_options = $axis->getAxes();
     $reece = new Reeces();
     $reece_options = $reece->getReeces();
     $regions = new Regions();
     $region_options = $regions->getRegionName();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->clearDecorators();
     $decorator = array('SimpleInput');
     $decoratorButton = array('NormalDecButton');
     $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('byzantine-search');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addErrorMessage('Please enter a valid number!')->setDecorators($decorators)->setDisableTranslator(true);
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Object description contains: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addErrorMessage('Please enter a valid term')->setDecorators($decorators)->setDisableTranslator(true);
     $workflow = new Zend_Form_Element_Select('workflow');
     $workflow->setLabel('Workflow stage: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addMultiOptions(array(NULL => NULL, 'Choose Worklow stage' => array('1' => 'Quarantine', '2' => 'On review', '3' => 'Awaiting validation', '4' => 'Published')))->setDecorators($decorators)->setDisableTranslator(true);
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->setUncheckedValue(NULL)->setDecorators($decorators)->setDisableTranslator(true);
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addMultiOptions(array(NULL => NULL, 'Choose rally name' => $rally_options))->setDecorators($decorators)->setDisableTranslator(true);
     $hoard = new Zend_Form_Element_Checkbox('hoard');
     $hoard->setLabel('Hoard find: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->setUncheckedValue(NULL)->setDecorators($decorators);
     $hoardID = new Zend_Form_Element_Select('hID');
     $hoardID->setLabel('Part of this hoard: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose rally name' => $hoard_options))->setDecorators($decorators);
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty'))->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)->setDecorators($decorators)->disabled = true;
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose parish after county'))->setDecorators($decorators)->disabled = true;
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a region for a wide result', 'Choose region' => $region_options))->setDecorators($decorators);
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'ValidGridRef'))->setDecorators($decorators);
     $fourFigure = new Zend_Form_Element_Text('fourFigure');
     $fourFigure->setLabel('Four figure grid reference: ')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'ValidGridRef'))->setDecorators($decorators);
     ###
     ##Numismatic data
     ###
     //Denomination
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose denomination type' => $denomination_options))->setDecorators($decorators);
     //Primary ruler
     $ruler = new Zend_Form_Element_Select('ruler');
     $ruler->setLabel('Ruler / issuer: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose primary ruler' => $ruler_options))->setDecorators($decorators);
     //Mint
     $mint = new Zend_Form_Element_Select('mint');
     $mint->setLabel('Issuing mint: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose denomination type' => $mint_options))->setDecorators($decorators);
     //Obverse inscription
     $obverseinsc = new Zend_Form_Element_Text('obverseLegend');
     $obverseinsc->setLabel('Obverse inscription contains: ')->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //Obverse description
     $obversedesc = new Zend_Form_Element_Text('obverseDescription');
     $obversedesc->setLabel('Obverse description contains: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //reverse inscription
     $reverseinsc = new Zend_Form_Element_Text('reverseLegend');
     $reverseinsc->setLabel('Reverse inscription contains: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //reverse description
     $reversedesc = new Zend_Form_Element_Text('reverseDescription');
     $reversedesc->setLabel('Reverse description contains: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //Die axis
     $axis = new Zend_Form_Element_Select('axis');
     $axis->setLabel('Die axis measurement: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose measurement' => $axis_options))->setDecorators($decorators);
     $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($decorators);
     $objecttype = new Zend_Form_Element_Hidden('objecttype');
     $objecttype->setValue('coin');
     $objecttype->removeDecorator('HtmlTag')->addFilters(array('StripTags', 'StringTrim'))->removeDecorator('DtDdWrapper')->removeDecorator('label');
     $broadperiod = new Zend_Form_Element_Hidden('broadperiod');
     $broadperiod->setValue('Byzantine')->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->removeDecorator('label');
     //	Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($old_findID, $description, $workflow, $rally, $rallyID, $hoard, $hoardID, $county, $regionID, $district, $parish, $fourFigure, $gridref, $denomination, $ruler, $mint, $axis, $obverseinsc, $obversedesc, $reverseinsc, $reversedesc, $objecttype, $broadperiod, $institution, $submit));
     $this->addDisplayGroup(array('denomination', 'ruler', 'mint', 'moneyer', 'axis', 'obverseLegend', 'obverseDescription', 'reverseLegend', 'reverseDescription'), 'numismatics');
     $this->addDisplayGroup(array('old_findID', 'description', 'rally', 'rallyID', 'hoard', 'hID', 'workflow'), 'details');
     $this->addDisplayGroup(array('county', 'regionID', 'district', 'parish', 'gridref', 'fourFigure', 'institution'), 'spatial');
     $this->numismatics->setLegend('Numismatic details');
     $this->numismatics->removeDecorator('DtDdWrapper');
     $this->numismatics->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->setLegend('Artefact details');
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->spatial->setLegend('Spatial details');
     $this->spatial->removeDecorator('DtDdWrapper');
     $this->spatial->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->addDecorator('FormElements')->addDecorator('Form')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'div'));
     $this->removeDecorator('DtDdWrapper');
 }
 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');
 }
示例#15
0
 public function __construct($options = null)
 {
     // Construct the select menu data
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $origins = new MapOrigins();
     $origin_options = $origins->getValidOrigins();
     $landusevalues = new Landuses();
     $landuse_options = $landusevalues->getUsesValid();
     $landusecodes = new Landuses();
     $landcodes_options = $landusecodes->getCodesValid();
     parent::__construct($options);
     $this->addPrefixPath('Pas_Form_Decorator', 'Pas/Form/Decorator/', 'decorator');
     $this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element/', 'element');
     $this->addElementPrefixPath('Pas_Validate', 'Pas/Validate/', 'validate');
     $decorator = array('SimpleInput');
     $decoratorButton = array('NormalDecButton');
     $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('findspots');
     // Object specifics
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose county', 'Valid counties' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)))->setDecorators($decorators);
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->setRequired(false)->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose district after county'));
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->setRequired(false)->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose parish after district'));
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addValidator('Digits')->addMultiOptions(array(NULL => 'Choose region after county'));
     $action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->addValidators(array('NotEmpty', 'ValidGridRef'))->addValidator('Alnum', array('allowWhiteSpace' => true))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'));
     $gridrefsrc = new Zend_Form_Element_Select('gridrefsrc');
     $gridrefsrc->setLabel('Grid reference source: ')->addMultioptions(array(NULL => NULL, 'Choose source' => $origin_options))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($origin_options)))->addValidator('Int');
     $gridrefcert = new Zend_Form_Element_Radio('gridrefcert');
     $gridrefcert->setLabel('Grid reference certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators);
     if ($action == 'edit') {
         $fourFigure = new Zend_Form_Element_Text('fourFigure');
         $fourFigure->setLabel('Four figure grid reference: ')->addValidator('NotEmpty', 'ValidGridRef')->addValidator('Alnum')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->disabled = true;
         $easting = new Zend_Form_Element_Text('easting');
         $easting->setLabel('Easting: ')->addValidator('NotEmpty', 'Digits')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->disabled = true;
         $northing = new Zend_Form_Element_Text('northing');
         $northing->setLabel('Northing: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Digits')->setDecorators($decorators)->disabled = true;
         $map10k = new Zend_Form_Element_Text('map10k');
         $map10k->setLabel('10 km map: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Alnum')->setDecorators($decorators)->disabled = true;
         $map25k = new Zend_Form_Element_Text('map25k');
         $map25k->setLabel('25 km map: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Alnum')->setDecorators($decorators)->disabled = true;
         $declong = new Zend_Form_Element_Text('declong');
         $declong->setLabel('Longitude: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Float')->setDecorators($decorators)->disabled = true;
         $declat = new Zend_Form_Element_Text('declat');
         $declat->setLabel('Latitude: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Float')->setDecorators($decorators)->disabled = true;
         $woeid = new Zend_Form_Element_Text('woeid');
         $woeid->setLabel('Where on Earth ID: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Digits')->setDecorators($decorators)->disabled = true;
         $elevation = new Zend_Form_Element_Text('elevation');
         $elevation->setLabel('Elevation: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Digits')->setDecorators($decorators)->disabled = true;
     }
     $depthdiscovery = new Zend_Form_Element_Select('depthdiscovery');
     $depthdiscovery->setLabel('Depth of discovery')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Digits')->addMultiOptions(array(NULL => NULL, 'Approximate depth' => array('10' => '0 - 10cm', '20' => '10 - 20cm', '30' => '20 - 30cm', '40' => '30 - 40cm', '50' => '40 - 50cm', '60' => 'Over 60 cm')));
     $soiltype = new Zend_Form_Element_Select('soiltype');
     $soiltype->setLabel('Type of soil around findspot: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Digits')->addMultiOptions(array(NULL => NULL));
     $landusevalue = new Zend_Form_Element_Select('landusevalue');
     $landusevalue->setLabel('Landuse type: ')->addValidators(array('NotEmpty'))->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose landuse', 'Valid landuses' => $landuse_options));
     $landusecode = new Zend_Form_Element_Select('landusecode');
     $landusecode->setLabel('Specific landuse: ')->setRegisterInArrayValidator(false)->addValidators(array('NotEmpty'))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Specific landuse will be enabled after type'));
     $address = new Zend_Form_Element_Textarea('address');
     $address->setLabel('Address: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 5)->setAttrib('cols', 40)->addFilters(array('BasicHtml', 'StringTrim', 'EmptyParagraph'))->setAttrib('class', 'expanding')->setAttrib('class', 'privatedata');
     $postcode = new Zend_Form_Element_Text('postcode');
     $postcode->setLabel('Postcode: ')->addValidators(array('NotEmpty', 'ValidPostcode'))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'));
     $knownas = new Zend_Form_Element_Text('knownas');
     $knownas->setLabel('Findspot to be known as: ')->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators)->setAttrib('class', 'privatedata')->addFilters(array('StripTags', 'StringTrim'));
     $landownername = new Zend_Form_Element_Text('landownername');
     $landownername->setLabel('Landowner: ')->addValidators(array('NotEmpty'))->setDecorators($decorators)->setAttrib('class', 'privatedata')->addFilters(array('StripTags', 'StringTrim'));
     $landowner = new Zend_Form_Element_Hidden('landowner');
     $landowner->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->removeDecorator('Label')->addFilters(array('StripTags', 'StringTrim'));
     $description = new Pas_Form_Element_RTE('description');
     $description->setLabel('Findspot description: ')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $comments = new Pas_Form_Element_RTE('comments');
     $comments->setLabel('Findspot comments: ')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(600);
     $this->addElement($hash);
     if ($action == 'edit') {
         $this->addElements(array($county, $district, $parish, $knownas, $description, $comments, $regionID, $gridref, $fourFigure, $easting, $northing, $map10k, $map25k, $declong, $declat, $woeid, $elevation, $address, $gridrefsrc, $gridrefcert, $depthdiscovery, $postcode, $landusevalue, $landusecode, $landownername, $landowner, $submit, $hash));
     } else {
         $this->addElements(array($county, $district, $parish, $knownas, $depthdiscovery, $description, $comments, $regionID, $gridref, $findsecuid, $gridrefsrc, $gridrefcert, $address, $postcode, $landusevalue, $landusecode, $landownername, $landowner, $submit, $hash));
     }
     $this->addDisplayGroup(array('county', 'regionID', 'district', 'parish', 'knownas', 'address', 'postcode', 'landownername', 'landowner'), 'details');
     $this->details->setLegend('Findspot information');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     if ($action == 'edit') {
         $this->addDisplayGroup(array('gridref', 'gridrefcert', 'gridrefsrc', 'fourFigure', 'easting', 'northing', 'map25k', 'map10k', 'declat', 'declong', 'woeid', 'elevation', 'landusevalue', 'landusecode', 'depthdiscovery'), 'spatial');
     } else {
         $this->addDisplayGroup(array('gridref', 'gridrefcert', 'gridrefsrc', 'landusevalue', 'landusecode', 'depthdiscovery', 'soiltype'), 'spatial');
     }
     $this->spatial->setLegend('Spatial information');
     $this->spatial->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->spatial->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('description', 'comments'), 'commentary');
     $this->commentary->setLegend('Findspot comments');
     $this->commentary->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->commentary->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
示例#16
0
 public function countiesAction()
 {
     $counties = new Counties();
     $countiesjson = $counties->getCountyName2();
     echo Zend_Json::encode($countiesjson);
 }
 public function __construct($options = null)
 {
     $primaries = new Materials();
     $primary_options = $primaries->getPrimaries();
     //Get data to form select menu for periods
     //Get Rally data
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     //Get Hoard data
     $hoards = new Hoards();
     $hoard_options = $hoards->getHoards();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $rulers = new Rulers();
     $ruler_options = $rulers->getMedievalRulers();
     $denominations = new Denominations();
     $denomination_options = $denominations->getOptionsMedieval();
     $mints = new Mints();
     $mint_options = $mints->getMedievalMints();
     $axis = new Dieaxes();
     $axis_options = $axis->getAxes();
     $cats = new CategoriesCoins();
     $cat_options = $cats->getPeriodMed();
     $regions = new Regions();
     $region_options = $regions->getRegionName();
     $institutions = new Institutions();
     $inst_options = $institutions->getInsts();
     $axis = new Dieaxes();
     $axis_options = $axis->getAxes();
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'requiredSuffix' => ' *')), array('HtmlTag', array('tag' => 'li')));
     $this->setName('medNumismaticsSearch');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid number!')->setDecorators($decorators);
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Object description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     $workflow = new Zend_Form_Element_Select('workflow');
     $workflow->setLabel('Workflow stage: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose Worklow stage' => array('1' => 'Quarantine', '2' => 'On review', '3' => 'Awaiting validation', '4' => 'Published')))->setDecorators($decorators);
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setUncheckedValue(NULL)->setDecorators($decorators);
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose rally name' => $rally_options))->addValidator('InArray', false, array(array_keys($rally_options)))->setDecorators($decorators);
     $hoard = new Zend_Form_Element_Checkbox('hoard');
     $hoard->setLabel('Hoard find: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setUncheckedValue(NULL)->setDecorators($decorators);
     $hoardID = new Zend_Form_Element_Select('hID');
     $hoardID->setLabel('Part of this hoard: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose rally name' => $hoard_options))->addValidator('InArray', false, array(array_keys($hoard_options)))->setDecorators($decorators);
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)))->setDecorators($decorators);
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->addMultiOptions(array(NULL => 'Choose district after county'))->setRegisterInArrayValidator(false)->setDecorators($decorators);
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->addMultiOptions(array(NULL => 'Choose parish after county'))->setDecorators($decorators);
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->addMultiOptions(array(NULL => 'Choose a region for a wide result', 'Choose region' => $region_options))->setDecorators($decorators);
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->addValidators(array('NotEmpty', 'ValidGridRef'))->setDecorators($decorators);
     $fourFigure = new Zend_Form_Element_Text('fourFigure');
     $fourFigure->setLabel('Four figure grid reference: ')->addValidators(array('NotEmpty', 'ValidGridRef'))->setDecorators($decorators);
     ###
     ##Numismatic data
     ###
     //	Denomination
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a denomination', 'Available denominations' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options)))->setDecorators($decorators);
     $cat = new Zend_Form_Element_Select('category');
     $cat->setLabel('Category: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a category', 'Available categories' => $cat_options))->addValidator('InArray', false, array(array_keys($cat_options)))->setDecorators($decorators);
     $type = new Zend_Form_Element_Select('typeID');
     $type->setLabel('Coin type: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     //Primary ruler
     $ruler = new Zend_Form_Element_Select('ruler');
     $ruler->setLabel('Ruler / issuer: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a ruler', 'Available issuers' => $ruler_options))->addValidator('InArray', false, array(array_keys($ruler_options)))->setDecorators($decorators);
     //Mint
     $mint = new Zend_Form_Element_Select('mint');
     $mint->setLabel('Issuing mint: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addMultiOptions(array(NULL => 'Choose a mint', 'Available mints' => $mint_options))->addValidator('InArray', false, array(array_keys($mint_options)))->setDecorators($decorators);
     //Obverse inscription
     $obverseinsc = new Zend_Form_Element_Text('obinsc');
     $obverseinsc->setLabel('Obverse inscription contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //Obverse description
     $obversedesc = new Zend_Form_Element_Text('obdesc');
     $obversedesc->setLabel('Obverse description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //reverse inscription
     $reverseinsc = new Zend_Form_Element_Text('revinsc');
     $reverseinsc->setLabel('Reverse inscription contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //reverse description
     $reversedesc = new Zend_Form_Element_Text('revdesc');
     $reversedesc->setLabel('Reverse description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //Die axis
     $axis = new Zend_Form_Element_Select('axis');
     $axis->setLabel('Die axis measurement: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose an axis', 'Available measurements' => $axis_options))->addValidator('InArray', false, array(array_keys($axis_options)))->setDecorators($decorators);
     $objecttype = new Zend_Form_Element_Hidden('objecttype');
     $objecttype->setValue('COIN')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'none')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addValidator('Alpha');
     $broadperiod = new Zend_Form_Element_Hidden('broadperiod');
     $broadperiod->setValue('MEDIEVAL')->setAttrib('class', 'none')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setLabel('Submit')->setAttrib('class', 'large');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElement($hash);
     $institution = new Zend_Form_Element_Select('institution');
     $institution->setLabel('Recording institution: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => 'Choose an institution', 'Available institutions' => $inst_options))->setDecorators($decorators);
     $this->addElements(array($old_findID, $type, $description, $workflow, $rally, $rallyID, $hoard, $hoardID, $county, $regionID, $district, $parish, $fourFigure, $gridref, $denomination, $ruler, $mint, $axis, $obverseinsc, $obversedesc, $reverseinsc, $reversedesc, $objecttype, $broadperiod, $cat, $submit, $hash, $institution));
     $this->addDisplayGroup(array('category', 'ruler', 'typeID', 'denomination', 'mint', 'moneyer', 'axis', 'obinsc', 'obdesc', 'revinsc', 'revdesc'), 'numismatics')->removeDecorator('HtmlTag');
     $this->numismatics->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->numismatics->removeDecorator('DtDdWrapper');
     $this->numismatics->setLegend('Numismatic details: ');
     $this->addDisplayGroup(array('old_findID', 'description', 'rally', 'rallyID', 'hoard', 'hID', 'workflow'), 'details')->removeDecorator('HtmlTag');
     $this->details->setLegend('Object details:');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('county', 'regionID', 'district', 'parish', 'gridref', 'fourFigure', 'institution'), 'spatial')->removeDecorator('HtmlTag');
     $this->spatial->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->spatial->removeDecorator('DtDdWrapper');
     $this->spatial->setLegend('Spatial details: ');
     $this->setLegend('Perform an advanced search on our database: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
 public function __construct($options = null)
 {
     //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
     //Get Rally data
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     //Get Hoard data
     $hoards = new Hoards();
     $hoard_options = $hoards->getHoards();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $denominations = new Denominations();
     $denom_options = $denominations->getOptionsIronAge();
     $rulers = new Rulers();
     $ruler_options = $rulers->getIronAgeRulers();
     $mints = new Mints();
     $mint_options = $mints->getIronAgeMints();
     $axis = new Dieaxes();
     $axis_options = $axis->getAxes();
     $geog = new Geography();
     $geog_options = $geog->getIronAgeGeographyDD();
     $regions = new Regions();
     $region_options = $regions->getRegionName();
     $tribes = new Tribes();
     $tribe_options = $tribes->getTribes();
     $institutions = new Institutions();
     $inst_options = $institutions->getInsts();
     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('Advanced');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid number!')->setDecorators($decorators);
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Object description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     $workflow = new Zend_Form_Element_Select('workflow');
     $workflow->setLabel('Workflow stage: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     if (in_array($this->getRole(), $this->_higherlevel)) {
         $workflow->addMultiOptions(array(NULL => 'Choose a workflow stage', 'Available workflow stages' => array('1' => 'Quarantine', '2' => 'On review', '4' => 'Awaiting validation', '3' => 'Published')));
     }
     if (in_array($this->getRole(), $this->_restricted)) {
         $workflow->addMultiOptions(array(NULL => 'Choose a workflow stage', 'Available workflow stages' => array('4' => 'Awaiting validation', '3' => 'Published')));
     }
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setUncheckedValue(NULL)->setDecorators($decorators);
     $geographyID = new Zend_Form_Element_Select('geographyID');
     $geographyID->setLabel('Geographic area: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a geography', 'Available geographies' => $geog_options))->addValidator('inArray', false, array(array_keys($geog_options)))->addValidator('Int');
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a rally', 'Available rallies' => $rally_options))->setDecorators($decorators)->addValidator('inArray', false, array(array_keys($rally_options)))->addValidator('Int');
     $hoard = new Zend_Form_Element_Checkbox('hoard');
     $hoard->setLabel('Hoard find: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setUncheckedValue(NULL)->setDecorators($decorators);
     $hoardID = new Zend_Form_Element_Select('hID');
     $hoardID->setLabel('Part of this hoard: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a hoard', 'Available hoards' => $hoard_options))->setDecorators($decorators)->addValidator('inArray', false, array(array_keys($hoard_options)))->addValidator('Int');
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a county', 'Available counties' => $county_options))->addValidator('inArray', false, array(array_keys($county_options)))->setDecorators($decorators);
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose district after county'))->setDecorators($decorators)->disabled = true;
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose parish after county'))->setDecorators($decorators)->disabled = true;
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose a region for a wide result', 'Available regions' => $region_options))->addValidator('Int');
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->setDecorators($decorators)->addValidator('ValidGridRef')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum');
     $fourFigure = new Zend_Form_Element_Text('fourFigure');
     $fourFigure->setLabel('Four figure grid reference: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('ValidGridRef')->addValidator('Alnum');
     ###
     ##Numismatic data
     ###
     //	Denomination
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose denomination type', 'Available denominations' => $denom_options))->addValidator('inArray', false, array(array_keys($denom_options)))->setDecorators($decorators);
     //Primary ruler
     $ruler = new Zend_Form_Element_Select('ruler');
     $ruler->setLabel('Ruler / issuer: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose primary ruler', 'Available rulers' => $ruler_options))->addValidator('inArray', false, array(array_keys($denom_options)))->setDecorators($decorators);
     //Mint
     $mint = new Zend_Form_Element_Select('mint');
     $mint->setLabel('Issuing mint: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose issuing mint', 'Available mints' => $mint_options))->addValidator('inArray', false, array(array_keys($mint_options)))->setDecorators($decorators);
     //Secondary ruler
     $ruler2 = new Zend_Form_Element_Select('ruler2');
     $ruler2->setLabel('Secondary ruler / issuer: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose secondary ruler', 'Available rulers' => $ruler_options))->addValidator('inArray', false, array(array_keys($ruler_options)))->setDecorators($decorators);
     //Obverse inscription
     $obverseinsc = new Zend_Form_Element_Text('obverseLegend');
     $obverseinsc->setLabel('Obverse inscription contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //Obverse description
     $obversedesc = new Zend_Form_Element_Text('obverseDescription');
     $obversedesc->setLabel('Obverse description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //reverse inscription
     $reverseinsc = new Zend_Form_Element_Text('reverseLegend');
     $reverseinsc->setLabel('Reverse inscription contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //reverse description
     $reversedesc = new Zend_Form_Element_Text('reverseDescription');
     $reversedesc->setLabel('Reverse description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //Die axis
     $axis = new Zend_Form_Element_Select('axis');
     $axis->setLabel('Die axis measurement: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose measurement', 'Available die axes' => $axis_options))->addValidator('inArray', false, array(array_keys($axis_options)))->addErrorMessage('That option is not a valid choice')->addValidator('Int')->setDecorators($decorators);
     //Tribe
     $tribe = new Zend_Form_Element_Select('tribe');
     $tribe->setLabel('Iron Age tribe: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a tribe', 'Available tribes' => $tribe_options))->addValidator('inArray', false, array(array_keys($tribe_options)))->addErrorMessage('That option is not a valid choice')->addValidator('Int')->setDecorators($decorators);
     $objecttype = new Zend_Form_Element_Hidden('objecttype');
     $objecttype->setValue('COIN')->setAttrib('class', 'none')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha', false, array('allowWhiteSpace' => true))->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label');
     $broadperiod = new Zend_Form_Element_Hidden('broadperiod');
     $broadperiod->setValue('IRON AGE')->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setAttrib('class', 'none')->addFilters(array('StripTags', 'StringTrim'))->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label');
     $mack_type = new Zend_Form_Element_Text('mackType');
     $mack_type->setLabel('Mack Type: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $bmc_type = new Zend_Form_Element_Text('bmc');
     $bmc_type->setLabel('British Museum catalogue number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $allen_type = new Zend_Form_Element_Text('allenType');
     $allen_type->setLabel('Allen Type: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $va_type = new Zend_Form_Element_Text('vaType');
     $va_type->setLabel('Van Arsdell Number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $rudd_type = new Zend_Form_Element_Text('ruddType');
     $rudd_type->setLabel('Ancient British Coinage number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $phase_date_1 = new Zend_Form_Element_Text('phase_date_1');
     $phase_date_1->setLabel('Phase date 1: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $phase_date_2 = new Zend_Form_Element_Text('phase_date_2');
     $phase_date_2->setLabel('Phase date 2: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $context = new Zend_Form_Element_Text('context');
     $context->setLabel('Context of coins: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $depositionDate = new Zend_Form_Element_Text('depositionDate');
     $depositionDate->setLabel('Date of deposition: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $numChiab = new Zend_Form_Element_Text('numChiab');
     $numChiab->setLabel('Coin hoards of Iron Age Britain number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->setLabel('Submit your search...');
     $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($decorators);
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElement($hash);
     $this->addElements(array($old_findID, $description, $workflow, $rally, $rallyID, $hoard, $hoardID, $county, $regionID, $district, $parish, $fourFigure, $gridref, $denomination, $ruler, $mint, $axis, $obverseinsc, $obversedesc, $reverseinsc, $reversedesc, $ruler2, $tribe, $objecttype, $broadperiod, $geographyID, $bmc_type, $mack_type, $allen_type, $va_type, $rudd_type, $numChiab, $context, $depositionDate, $phase_date_1, $phase_date_2, $submit, $institution));
     $this->addDisplayGroup(array('denomination', 'geographyID', 'ruler', 'ruler2', 'tribe', 'mint', 'axis', 'obverseLegend', 'obverseDescription', 'reverseLegend', 'reverseDescription', 'bmc', 'vaType', 'allenType', 'ruddType', 'mackType', 'numChiab', 'context', 'phase_date_1', 'phase_date_2', 'depositionDate'), 'numismatics')->removeDecorator('HtmlTag');
     $this->numismatics->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->numismatics->removeDecorator('DtDdWrapper');
     $this->numismatics->setLegend('Numismatic details: ');
     $this->addDisplayGroup(array('old_findID', 'description', 'rally', 'rallyID', 'hoard', 'hID', 'workflow'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Object details: ');
     $this->addDisplayGroup(array('county', 'regionID', 'district', 'parish', 'gridref', 'fourFigure', 'institution'), 'spatial')->removeDecorator('HtmlTag');
     $this->spatial->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->spatial->removeDecorator('DtDdWrapper');
     $this->spatial->setLegend('Spatial details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
 public function __construct($options = null)
 {
     //Get data to form select menu for primary and secondary material
     $primaries = new Materials();
     $primary_options = $primaries->getPrimaries();
     //Get Rally data
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     //Get Hoard data
     $hoards = new Hoards();
     $hoard_options = $hoards->getHoards();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $denominations = new Denominations();
     $denom_options = $denominations->getOptionsRoman();
     $rulers = new Rulers();
     $ruler_options = $rulers->getRomanRulers();
     $mints = new Mints();
     $mint_options = $mints->getRomanMints();
     $axis = new Dieaxes();
     $axis_options = $axis->getAxes();
     $reece = new Reeces();
     $reece_options = $reece->getReeces();
     $regions = new Regions();
     $region_options = $regions->getRegionName();
     $moneyers = new Moneyers();
     $money = $moneyers->getRepublicMoneyers();
     $institutions = new Institutions();
     $inst_options = $institutions->getInsts();
     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('search-roman-coins');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid number!')->setDecorators($decorators);
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Object description contains: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     $workflow = new Zend_Form_Element_Select('workflow');
     $workflow->setLabel('Workflow stage: ')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     if (in_array($this->getRole(), $this->_higherlevel)) {
         $workflow->addMultiOptions(array(NULL => NULL, 'Available worklow stage' => array('1' => 'Quarantine', '2' => 'On review', '4' => 'Awaiting validation', '3' => 'Published')));
     }
     if (in_array($this->getRole(), $this->_restricted)) {
         $workflow->addMultiOptions(array(NULL => 'Choose a workflow stage', 'Available worklow stage' => array('4' => 'Awaiting validation', '3' => 'Published')));
     }
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElement($hash);
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->addFilters(array('StripTags', 'StringTrim'))->setUncheckedValue(NULL)->setDecorators($decorators);
     $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)))->setDecorators($decorators);
     $hoard = new Zend_Form_Element_Checkbox('hoard');
     $hoard->setLabel('Hoard find: ')->addFilters(array('StripTags', 'StringTrim'))->setUncheckedValue(NULL)->setDecorators($decorators);
     $hoardID = new Zend_Form_Element_Select('hID');
     $hoardID->setLabel('Part of this hoard: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose hoard name', 'Available hoards' => $hoard_options))->addValidator('InArray', false, array(array_keys($hoard_options)))->setDecorators($decorators);
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addValidators(array('NotEmpty'))->addMultiOptions(array(NULL => 'Choose county first', 'Available counties' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)))->setDecorators($decorators);
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->addMultiOptions(array(NULL => 'Choose district after county'))->setRegisterInArrayValidator(false)->setDecorators($decorators)->disabled = true;
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->addMultiOptions(array(NULL => 'Choose parish after county'))->setDecorators($decorators)->disabled = true;
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose a region for a wide result', 'Choose region' => $region_options))->addValidator('InArray', false, array(array_keys($region_options)))->addFilters(array('StripTags', 'StringTrim'));
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->addValidators(array('ValidGridRef'))->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $fourFigure = new Zend_Form_Element_Text('fourFigure');
     $fourFigure->setLabel('Four figure grid reference: ')->addValidators(array('ValidGridRef'))->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     ###
     ##Numismatic data
     ###
     //Denomination
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose denomination type', 'Available denominations' => $denom_options))->addValidator('InArray', false, array(array_keys($denom_options)))->setDecorators($decorators);
     //Primary ruler
     $ruler = new Zend_Form_Element_Select('ruler');
     $ruler->setLabel('Ruler / issuer: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose primary ruler', 'Available rulers' => $ruler_options))->addValidator('InArray', false, array(array_keys($ruler_options)))->setDecorators($decorators);
     //Mint
     $mint = new Zend_Form_Element_Select('mint');
     $mint->setLabel('Issuing mint: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose issuing mint', 'Available mints' => $mint_options))->addValidator('InArray', false, array(array_keys($mint_options)))->setDecorators($decorators);
     //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)))->setDecorators($decorators);
     //Reverse type
     $reverse = new Zend_Form_Element_Select('revtypeID');
     $reverse->setLabel('Fourth Century reverse type: ')->setDescription('This field is only applicable for fourth century AD coins.')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->addMultiOptions(array(NULL => 'Only available after choosing a 4th century issuer'));
     //Moneyer
     $moneyer = new Zend_Form_Element_Select('moneyer');
     $moneyer->setLabel('Republican moneyers: ')->setDescription('This field is only applicable for Republican coins.')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->addMultiOptions(array(NULL => 'Only available after choosing a Republican issuer'))->addValidator('InArray', false, array(array_keys($money)));
     //Obverse inscription
     $obverseinsc = new Zend_Form_Element_Text('obverseLegend');
     $obverseinsc->setLabel('Obverse inscription contains: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //Obverse description
     $obversedesc = new Zend_Form_Element_Text('obverseDescription');
     $obversedesc->setLabel('Obverse description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //reverse inscription
     $reverseinsc = new Zend_Form_Element_Text('reverseLegend');
     $reverseinsc->setLabel('Reverse inscription contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setAttrib('size', 60)->setDecorators($decorators);
     //reverse description
     $reversedesc = new Zend_Form_Element_Text('reverseDescription');
     $reversedesc->setLabel('Reverse description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setAttrib('size', 60)->setDecorators($decorators);
     //Die axis
     $axis = new Zend_Form_Element_Select('axis');
     $axis->setLabel('Die axis measurement: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose measurement' => $axis_options))->addValidator('InArray', false, array(array_keys($axis_options)))->setDecorators($decorators);
     $objecttype = new Zend_Form_Element_Hidden('objecttype');
     $objecttype->setValue('coin')->setAttrib('class', 'none')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $broadperiod = new Zend_Form_Element_Hidden('broadperiod');
     $broadperiod->setValue('Roman')->setAttrib('class', 'none')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addFilters(array('StringToUpper', 'StripTags', 'StringTrim'))->addValidator('Alpha');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setLabel('Submit your search ..')->setAttrib('class', 'large');
     $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($decorators);
     $this->addElements(array($old_findID, $description, $workflow, $rally, $rallyID, $hoard, $hoardID, $county, $regionID, $district, $parish, $fourFigure, $gridref, $denomination, $ruler, $mint, $axis, $reece, $reverse, $obverseinsc, $obversedesc, $reverseinsc, $reversedesc, $moneyer, $objecttype, $broadperiod, $submit, $hash, $institution));
     $this->addDisplayGroup(array('denomination', 'ruler', 'mint', 'moneyer', 'axis', 'reeceID', 'revtypeID', 'obverseLegend', 'obverseDescription', 'reverseLegend', 'reverseDescription'), 'numismatics')->removeDecorator('HtmlTag');
     $this->numismatics->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->numismatics->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('old_findID', 'description', 'rally', 'rallyID', 'hoard', 'hID', 'workflow'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('county', 'regionID', 'district', 'parish', 'gridref', 'fourFigure', 'institution'), 'spatial')->removeDecorator('HtmlTag');
     $this->spatial->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->spatial->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->numismatics->setLegend('Numismatic details');
     $this->details->setLegend('Artefact details');
     $this->spatial->setLegend('Spatial details');
 }