コード例 #1
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $institutions = new Institutions();
     $inst_options = $institutions->getInsts();
     $rulers = new Rulers();
     $ruler_options = $rulers->getRomanRulers();
     $discs = new DiscoMethods();
     $disc_options = $discs->getOptions();
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFromWords();
     $reasons = new Findofnotereasons();
     $reason_options = $reasons->getReasons();
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     $counties = new OsCounties();
     $county_options = $counties->getCountiesID();
     $regions = new OsRegions();
     $region_options = $regions->getRegionsID();
     $terminalDates = new TerminalReasons();
     $termOptions = $terminalDates->getReasons();
     $qualityRatings = new DataQuality();
     $qualityStreet = $qualityRatings->getRatings();
     $current_year = date('Y');
     $years = range(1650, $current_year);
     $years_list = array_combine($years, $years);
     $reeces = new Reeces();
     $reece_options = $reeces->getReeces();
     $siteclasses = new ArchaeologicalSiteClass();
     $siteclass_options = $siteclasses->getOptions();
     $contexts = new ArchaeologicalContexts();
     $context_options = $contexts->getOptions();
     $features = new ArchaeologicalFeatures();
     $feature_options = $features->getOptions();
     parent::__construct($options);
     $this->setName('AdvancedHoards');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->addFilters(array('StringTrim', 'StripTags'))->addValidator('StringLength', false, array(3, 20))->addErrorMessage('Please enter a valid number!');
     $objecttype = new Zend_Form_Element_Hidden('objecttype');
     $objecttype->setValue('HOARD')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Please enter a valid object type!');
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Hoard description contains: ')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Please enter a valid term');
     //Find of note
     $findofnote = new Zend_Form_Element_Checkbox('note');
     $findofnote->setLabel('Find of Note: ')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null);
     //Reason for find of note
     $findofnotereason = new Zend_Form_Element_Select('reason');
     $findofnotereason->setLabel('Reason for noteworthy status: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose reason', 'Available reasons' => $reason_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     //Institution
     $institution = new Zend_Form_Element_Select('institution');
     $institution->setLabel('Recording institution: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose institution', 'Available institutions' => $inst_options))->setAttribs(array('class' => 'input-medium selectpicker show-menu-arrow'));
     $notes = new Zend_Form_Element_Text('notes');
     $notes->setLabel('Notes: ')->addFilters(array('StringTrim', 'StripTags'));
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Broad period: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $periodword_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $objdate1subperiod = new Zend_Form_Element_Select('fromsubperiod');
     $objdate1subperiod->setLabel('Sub period from: ')->addMultiOptions(array(null => 'Choose sub-period from', 'Available sub period from' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => ''))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Period from: Assigned via dropdown
     $objdate1period = new Zend_Form_Element_Select('periodFrom');
     $objdate1period->setLabel('Period from: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $objdate2subperiod = new Zend_Form_Element_Select('tosubperiod');
     $objdate2subperiod->setLabel('Sub period to: ')->addMultiOptions(array(null => 'Choose sub-period from', 'Available subperiods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->setDisableTranslator(true)->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => ''))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Period to: Assigned via dropdown
     $objdate2period = new Zend_Form_Element_Select('periodTo');
     $objdate2period->setLabel('Period to: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $from = new Zend_Form_Element_Text('fromdate');
     $from->setLabel('Start date: ')->addFilters(array('StringTrim', 'StripTags'))->addValidators(array('NotEmpty', 'Int'))->addErrorMessage('Please enter a valid date')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'))->setDescription('If you want to search for a date range, ' . 'enter a start date in this box and and end in the ' . 'box below. You do not need to add AD or BC');
     $to = new Zend_Form_Element_Text('todate');
     $to->setLabel('End date: ')->addFilters(array('StringTrim', 'StripTags'))->addValidators(array('NotEmpty', 'Int'))->addErrorMessage('Please enter a valid date')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $workflow = new Zend_Form_Element_Select('workflow');
     $workflow->setLabel('Workflow stage: ')->addFilters(array('StringTrim', 'StripTags'))->addValidator('Int')->setAttribs(array('class' => 'input-medium selectpicker show-menu-arrow'));
     if (in_array($this->_role, $this->_higherlevel)) {
         $workflow->addMultiOptions(array(null => 'Available Workflow stages', 'Choose Worklow stage' => array('1' => 'Quarantine', '2' => 'On review', '4' => 'Awaiting validation', '3' => 'Published')));
     }
     if (in_array($this->_role, $this->_restricted)) {
         $workflow->addMultiOptions(array(null => 'Available Workflow stages', 'Choose Worklow stage' => array('4' => 'Awaiting validation', '3' => 'Published')));
     }
     $treasure = new Zend_Form_Element_Checkbox('treasure');
     $treasure->setLabel('Treasure find: ')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null);
     $treasureID = new Zend_Form_Element_Text('TID');
     $treasureID->setLabel('Treasure ID number: ')->addFilters(array('StringTrim', 'StripTags'));
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null);
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose a rally', 'Available rallies' => $rally_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $other_ref = new Zend_Form_Element_Text('otherRef');
     $other_ref->setLabel('Other reference: ')->addFilters(array('StringTrim', 'StripTags'));
     $smrRef = new Zend_Form_Element_Text('smrRef');
     $smrRef->setLabel('SMR reference: ')->addFilters(array('StringTrim', 'StripTags'));
     $county = new Zend_Form_Element_Select('countyID');
     $county->setLabel('County: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose county', 'Available counties' => $county_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $district = new Zend_Form_Element_Select('districtID');
     $district->setLabel('District: ')->addMultiOptions(array(null => 'Choose district after county'))->setRegisterInArrayValidator(false)->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $parish = new Zend_Form_Element_Select('parishID');
     $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose parish after county'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->addValidator('Int')->addMultiOptions(array(null => 'Choose a region for a wide result', 'Choose region' => $region_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->addValidators(array('NotEmpty', 'ValidGridRef'))->addFilters(array('StringTrim', 'StripTags'));
     $fourFigure = new Zend_Form_Element_Text('fourFigure');
     $fourFigure->setLabel('Four figure grid reference: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'));
     $idBy = new Zend_Form_Element_Text('idBy');
     $idBy->setLabel('Primary identifier: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'));
     $identifierID = new Zend_Form_Element_Hidden('identifierID');
     $identifierID->addFilters(array('StringTrim', 'StripTags'));
     $created = new Zend_Form_Element_Text('createdBefore');
     $created->setLabel('Date record created on or before: ')->addFilters(array('StringTrim', 'StripTags'));
     $created2 = new Zend_Form_Element_Text('createdAfter');
     $created2->setLabel('Date record created on or after: ')->addFilters(array('StringTrim', 'StripTags'));
     $updated = new Zend_Form_Element_Text('updatedBefore');
     $updated->setLabel('Date record updated on or before: ')->addFilters(array('StringTrim', 'StripTags'));
     $updated2 = new Zend_Form_Element_Text('updatedAfter');
     $updated2->setLabel('Date record updated on or after: ')->addFilters(array('StringTrim', 'StripTags'));
     $finder = new Zend_Form_Element_Text('finder');
     $finder->setLabel('Found by: ')->addFilters(array('StringTrim', 'StripTags'));
     $finderID = new Zend_Form_Element_Hidden('finderID');
     $finderID->addFilters(array('StringTrim', 'StripTags'));
     $recordby = new Zend_Form_Element_Text('recordername');
     $recordby->setLabel('Recorded by: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'))->setAttrib('autoComplete', 'true');
     $recorderID = new Zend_Form_Element_Hidden('recorderID');
     $recorderID->addFilters(array('StringTrim', 'StripTags'));
     $discoverydate = new Zend_Form_Element_Select('discovered');
     $discoverydate->setLabel('Year of discovery')->setMultiOptions(array(null => 'Choose a year of discovery', 'Date range' => $years_list))->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Submit your search');
     $woeid = new Zend_Form_Element_Text('woeid');
     $woeid->setLabel('Where on earth ID: ')->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'));
     $elevation = new Zend_Form_Element_Text('elevation');
     $elevation->setLabel('Elevation: ')->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'));
     $lastRulerID = new Zend_Form_Element_Select('lastRulerID');
     $lastRulerID->setLabel('Last Ruler: ')->addValidator('Int')->addMultiOptions(array(null => 'Choose primary ruler', 'Available rulers' => $ruler_options))->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setDescription('You need to pick a broad period first')->setRegisterInArrayValidator(false);
     $termDate1 = new Zend_Form_Element_Text('fromTerminalYear');
     $termDate1->setLabel('Terminal year from: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $termDate2 = new Zend_Form_Element_Text('toTerminalYear');
     $termDate2->setLabel('Terminal year to: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $qualityRatingNum = new Zend_Form_Element_Select('qualityRatingNumismatic');
     $qualityRatingNum->setLabel('Coin data quality rating: ')->addMultiOptions(array(null => 'Choose quality rating', 'Available options' => $qualityStreet))->addValidator('Int')->addValidator('InArray', false, array(array_keys($qualityStreet)))->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $qualityRatingArch = new Zend_Form_Element_Select('qualityRatingArchaeological');
     $qualityRatingArch->setLabel('Archaeology data quality rating: ')->addMultiOptions(array(null => 'Choose quality rating', 'Available options' => $qualityStreet))->addValidator('Int')->addValidator('InArray', false, array(array_keys($qualityStreet)))->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $qualityRatingFindspot = new Zend_Form_Element_Select('qualityRatingFindspot');
     $qualityRatingFindspot->setLabel('Findspot data quality rating: ')->addMultiOptions(array(null => 'Choose quality rating', 'Available options' => $qualityStreet))->addValidator('Int')->addValidator('InArray', false, array(array_keys($qualityStreet)))->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $terminalReasonID = new Zend_Form_Element_Select('terminalReasonID');
     $terminalReasonID->setLabel('Terminal date reasoning: ')->addMultiOptions(array(null => 'Choose terminal reasoning', 'Available options' => $termOptions))->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $excavatedYear1 = new Zend_Form_Element_Text('excavatedYear1');
     $excavatedYear1->setLabel('Excavated year first date: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $excavatedYear2 = new Zend_Form_Element_Text('excavatedYear2');
     $excavatedYear2->setLabel('Excavated year end date: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $archaeologicalDescription = new Zend_Form_Element_Text('archaeologyDescription');
     $archaeologicalDescription->setLabel('Archaeological description contains: ');
     //Period from: Assigned via dropdown
     $archdate1period = new Zend_Form_Element_Select('archaeologyPeriodFrom');
     $archdate1period->setLabel('Period from: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Period to: Assigned via dropdown
     $archdate2period = new Zend_Form_Element_Select('archaeologyPeriodTo');
     $archdate2period->setLabel('Period to: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     $siteDateYear1 = new Zend_Form_Element_Text('siteDateYear1');
     $siteDateYear1->setLabel('Site date from: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $siteDateYear2 = new Zend_Form_Element_Text('siteDateYear2');
     $siteDateYear2->setLabel('Site date to: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $featureDateYear1 = new Zend_Form_Element_Text('featureDateYear1');
     $featureDateYear1->setLabel('Feature date from: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $featureDateYear2 = new Zend_Form_Element_Text('featureDateYear2');
     $featureDateYear2->setLabel('Feature date to: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'));
     $knownSite = new Zend_Form_Element_Checkbox('knownSite');
     $knownSite->setLabel('Known site: ')->setUncheckedValue(null);
     $excavated = new Zend_Form_Element_Checkbox('excavated');
     $excavated->setLabel('Excavated: ')->setUncheckedValue(null);
     $siteclass = new Zend_Form_Element_Select('siteClassID');
     $siteclass->setLabel('Site class: ')->addMultioptions(array(null => 'Choose class of site', 'Available classes' => $siteclass_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($siteclass_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     $arch_context = new Zend_Form_Element_Select('siteContextID');
     $arch_context->setLabel('Context: ')->addMultioptions(array(null => 'Choose a context', 'Available contexts' => $context_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($context_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     $arch_feature = new Zend_Form_Element_Select('featureID');
     $arch_feature->setLabel('Feature: ')->addMultioptions(array(null => 'Choose a feature', 'Available features' => $feature_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($feature_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     $quantityCoins = new Zend_Form_Element_Text('quantityCoins');
     $quantityCoins->setLabel('Quantity of coins in hoard: ');
     $quantityCoins->setDescription('This searches for an exact quantity. ' . 'To search for a range use advanced search syntax in the simple ' . 'search box');
     $quantityArtefacts = new Zend_Form_Element_Text('quantityArtefacts');
     $quantityArtefacts->setLabel('Quantity of artefacts in hoard: ');
     $quantityArtefacts->setDescription('This searches for an exact quantity. ' . 'To search for a range use advanced search syntax in the simple ' . 'search box');
     $quantityContainers = new Zend_Form_Element_Text('quantityContainers');
     $quantityContainers->setLabel('Quantity of containers in hoard: ');
     $quantityContainers->setDescription('This searches for an exact quantity. ' . 'To search for a range use advanced search syntax in the simple ' . 'search box');
     $legacyID = new Zend_Form_Element_Text('legacyID');
     $legacyID->setLabel('Legacy hoard database number: ');
     //Reece
     $reece = new Zend_Form_Element_Select('reeceID');
     $reece->setLabel('Reece period: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose Reece period', 'Available Reece periods' => $reece_options))->addValidator('InArray', false, array(array_keys($reece_options)))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     if (in_array($this->_role, $this->_restricted)) {
         $this->addElements(array($old_findID, $objecttype, $broadperiod, $description, $from, $to, $workflow, $findofnote, $findofnotereason, $rally, $rallyID, $other_ref, $notes, $objdate1period, $termDate1, $objdate2period, $county, $regionID, $district, $parish, $fourFigure, $treasure, $treasureID, $discoverydate, $created, $created2, $updated, $updated2, $submit, $elevation, $woeid, $institution, $hash, $smrRef, $lastRulerID, $termDate2, $terminalReasonID, $qualityRatingNum, $qualityRatingArch, $qualityRatingFindspot, $archaeologicalDescription, $excavatedYear1, $excavatedYear2, $featureDateYear1, $featureDateYear2, $knownSite, $excavated, $siteclass, $arch_context, $arch_feature, $quantityArtefacts, $quantityCoins, $quantityContainers, $legacyID, $reece, $archdate1period, $archdate2period));
     } else {
         $this->addElements(array($old_findID, $objecttype, $broadperiod, $description, $from, $to, $workflow, $findofnote, $findofnotereason, $rally, $rallyID, $other_ref, $notes, $objdate1period, $objdate2period, $county, $regionID, $district, $parish, $fourFigure, $elevation, $woeid, $treasure, $treasureID, $discoverydate, $created, $created2, $updated, $updated2, $idBy, $finder, $finderID, $recordby, $recorderID, $identifierID, $lastRulerID, $submit, $institution, $archaeologicalDescription, $smrRef, $hash, $termDate1, $termDate2, $terminalReasonID, $qualityRatingNum, $qualityRatingArch, $qualityRatingFindspot, $excavatedYear1, $excavatedYear2, $featureDateYear1, $featureDateYear2, $siteclass, $arch_context, $arch_feature, $knownSite, $excavated, $quantityArtefacts, $quantityCoins, $quantityContainers, $legacyID, $reece, $archdate1period, $archdate2period));
     }
     $this->addDisplayGroup(array('old_findID', 'objecttype', 'description', 'notes', 'note', 'reason', 'treasure', 'TID', 'rally', 'rallyID', 'workflow', 'otherRef', 'smrRef', 'quantityArtefacts', 'quantityCoins', 'quantityContainers'), 'details');
     $this->details->setLegend('Main details: ');
     $this->addDisplayGroup(array('broadperiod', 'periodFrom', 'periodTo', 'fromdate', 'todate'), 'temporaldetails');
     $this->temporaldetails->setLegend('Dates and periods: ');
     $this->addDisplayGroup(array('lastRulerID', 'reeceID', 'fromTerminalYear', 'toTerminalYear', 'terminalReasonID', 'legacyID', 'qualityRatingNumismatic'), 'numismatics');
     $this->numismatics->setLegend('Numismatic analysis: ');
     $this->addDisplayGroup(array('knownSite', 'excavated', 'archaeologyPeriodFrom', 'archaeologyPeriodTo', 'archaeologyDescription', 'excavatedYear1', 'excavatedYear2', 'siteClassID', 'siteContextID', 'featureID', 'featureDateYear1', 'featureDateYear2', 'qualityRatingArchaeological'), 'archaeology');
     $this->archaeology->setLegend('Archaeological context: ');
     $this->addDisplayGroup(array('countyID', 'regionID', 'districtID', 'parishID', 'fourFigure', 'elevation', 'woeid', 'qualityRatingFindspot'), 'Spatial');
     $this->Spatial->setLegend('Spatial details: ');
     if (in_array($this->_role, $this->_restricted)) {
         $this->addDisplayGroup(array('institution', 'createdAfter', 'createdBefore', 'updatedAfter', 'updatedBefore', 'discovered'), 'Discovery');
     } else {
         $this->addDisplayGroup(array('institution', 'finder', 'idBy', 'identifierID', 'recordername', 'recorderID', 'createdAfter', 'createdBefore', 'updatedAfter', 'updatedBefore', 'discovered'), 'Discovery');
     }
     $this->Discovery->setLegend('Discovery details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
コード例 #2
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  *
  */
 public function __construct(array $options = null)
 {
     ## GET OPTIONS TO POPULATE MENUS ##
     //Get site class options for select menu
     $siteclasses = new ArchaeologicalSiteClass();
     $siteclass_options = $siteclasses->getOptions();
     //Get archaeological landscape and topography options for select menu
     $landscapes = new ArchaeologicalLandscape();
     $landscape_options = $landscapes->getOptions();
     //Get periods for select menu
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     $periodword_options = $periods->getPeriodFromWords();
     //Get archaeological context options for select menu
     $contexts = new ArchaeologicalContexts();
     $context_options = $contexts->getOptions();
     //Get archaeological feature options for select menu
     $features = new ArchaeologicalFeatures();
     $feature_options = $features->getOptions();
     //Get recovery methods for select menu
     $recoveries = new RecoveryMethods();
     $rec_options = $recoveries->getOptions();
     //Get contextual data quality ratings for select menu
     $qualityrating = new DataQuality();
     $qualityrating_options = $qualityrating->getRatings();
     //End of select options construction
     $this->addElementPrefixPath('Pas_Filter', 'Pas/Filter/', 'filter');
     parent::__construct($options);
     $this->setName('archaeology');
     ## SITE INFORMATION ##
     //Known site checkbox
     $knownsite = new Zend_Form_Element_Checkbox('knownsite');
     $knownsite->setLabel('Known site: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim'));
     //Excavated checkbox
     $excavated = new Zend_Form_Element_Checkbox('excavated');
     $excavated->setLabel('Excavated site: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim'));
     //Site class menu: Assigned via dropdown
     $siteclass = new Zend_Form_Element_Select('sitecontext');
     $siteclass->setLabel('Site class: ')->addMultioptions(array(null => 'Choose class of site', 'Available classes' => $siteclass_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($siteclass_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     //Landscape and topography menu: Assigned via dropdown
     $landscape_topography = new Zend_Form_Element_Select('landscapetopography');
     $landscape_topography->setLabel('Landscape and topography: ')->addMultioptions(array(null => 'Choose landscape term', 'Available terms' => $landscape_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($landscape_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     ## SITE DATING ##
     //Broad period
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Broad period: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose broadperiod', 'Available periods' => $periodword_options))->addErrorMessage('You must enter a broad period.')->addValidator('InArray', false, array(array_keys($periodword_options)))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Sub period from: Assigned via dropdown
     $sitesubperiod1 = new Zend_Form_Element_Select('subperiod1');
     $sitesubperiod1->setLabel('Sub period from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a subperiod', 'Valid sub periods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->setAttribs(array('class' => 'selectpicker show-menu-arrow'));
     //Period from: Assigned via dropdown
     $siteperiod1 = new Zend_Form_Element_Select('period1');
     $siteperiod1->setLabel('Period from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a period from', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Sub period to: Assigned via dropdown
     $sitesubperiod2 = new Zend_Form_Element_Select('subperiod2');
     $sitesubperiod2->setLabel('Sub period to: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a subperiod', 'Valid sub periods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->addValidator('Digits')->setAttribs(array('class' => 'selectpicker show-menu-arrow'));
     //Period to: Assigned via dropdown
     $siteperiod2 = new Zend_Form_Element_Select('period2');
     $siteperiod2->setLabel('Period to: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Date from: Free text Integer +ve or -ve
     $numdate1 = new Zend_Form_Element_Text('sitedateyear1');
     $numdate1->setLabel('Date from: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     //Date to: Free text Integer +ve or -ve
     $numdate2 = new Zend_Form_Element_Text('sitedateyear2');
     $numdate2->setLabel('Date to: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     ## CONTEXT DETAILS ##
     //Archaeological context: Assigned via dropdown
     $arch_context = new Zend_Form_Element_Select('sitetype');
     $arch_context->setLabel('Context: ')->addMultioptions(array(null => 'Choose a context', 'Available contexts' => $context_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($context_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     //Archaeological feature: Assigned via dropdown
     $arch_feature = new Zend_Form_Element_Select('feature');
     $arch_feature->setLabel('Feature: ')->addMultioptions(array(null => 'Choose a feature', 'Available features' => $feature_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($feature_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     //Feature date from: Free text Integer +ve or -ve
     $featuredate1 = new Zend_Form_Element_Text('featuredateyear1');
     $featuredate1->setLabel('Feature date from: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     //Feature date to: Free text Integer +ve or -ve
     $featuredate2 = new Zend_Form_Element_Text('featuredateyear2');
     $featuredate2->setLabel('Feature date to: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     ## RECOVERY INFORMATION ##
     //Recovery method: Assigned via dropdown
     $recmethod = new Zend_Form_Element_Select('recmethod');
     $recmethod->setLabel('Recovery method: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addValidator('inArray', true, array(array_keys($rec_options)))->addMultiOptions(array(null => 'Choose method of discovery', 'Available methods' => $rec_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     //First excavation year: Free text Integer +ve or -ve
     $excavationyear1 = new Zend_Form_Element_Text('yearexc1');
     $excavationyear1->setLabel('First excavation year: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY', 'class' => 'input-large'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     //Second excavation year: Free text Integer +ve or -ve
     $excavationyear2 = new Zend_Form_Element_Text('yearexc2');
     $excavationyear2->setLabel('Second excavation year: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     ## ARCHAEOLOGICAL DETAILS ##
     //Archaeology description: free text field
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Archaeology description: ')->setRequired(false)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     //Contextual data quality rating: Assigned via dropdown
     $contextualdataquality = new Zend_Form_Element_Select('contextualrating');
     $contextualdataquality->setLabel('Context data quality rating: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a rating', 'Available ratings' => $qualityrating_options))->addValidator('InArray', false, array(array_keys($qualityrating_options)))->setAttrib('class', 'input-large selectpicker show-menu-arrow')->setDescription('This data quality field can only be completed by hoards project staff')->addValidator('Int');
     ## ARCHIVE LOCATION ##
     //Archive location: free text field
     $archive_loc = new Zend_Form_Element_Text('archiveloc');
     $archive_loc->setLabel('Archive location: ')->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim'));
     ## SUBMIT BUTTON ##
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($knownsite, $excavated, $siteclass, $landscape_topography, $broadperiod, $sitesubperiod1, $siteperiod1, $sitesubperiod2, $siteperiod2, $numdate1, $numdate2, $arch_context, $arch_feature, $featuredate1, $featuredate2, $recmethod, $excavationyear1, $excavationyear2, $description, $contextualdataquality, $archive_loc, $submit));
     $this->addDisplayGroup(array('knownsite', 'excavated', 'sitecontext', 'landscapetopography'), 'siteinfo');
     $this->siteinfo->setLegend('Site information');
     $this->addDisplayGroup(array('broadperiod', 'subperiod1', 'period1', 'subperiod2', 'period2', 'sitedateyear1', 'sitedateyear2'), 'sitedating');
     $this->sitedating->setLegend('Site dating');
     $this->addDisplayGroup(array('sitetype', 'feature', 'featuredateyear1', 'featuredateyear2'), 'contextdetails');
     $this->contextdetails->setLegend('Context details');
     $this->addDisplayGroup(array('recmethod', 'yearexc1', 'yearexc2'), 'recoveryinfo');
     $this->recoveryinfo->setLegend('Recovery information');
     $this->addDisplayGroup(array('description', 'contextualrating'), 'archaeologicaldetails');
     $this->archaeologicaldetails->setLegend('Archaeological details');
     $this->addDisplayGroup(array('archiveloc'), 'archivelocation');
     $this->archivelocation->setLegend('Archive location');
     $this->addDisplayGroup(array('submit'), 'buttons');
     $person = new Pas_User_Details();
     $role = $person->getRole();
     $projectTeam = array('hoard', 'admin');
     if (!in_array($role, $projectTeam)) {
         $contextualdataquality->disabled = true;
     }
     parent::init();
 }