/** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     //Get the coins columns from the table's schema
     $finds = new Hoards();
     $schema = $finds->info();
     //Flip the array of columns
     $fields = array_flip($schema['cols']);
     //Which fields to remove from this as they aren't editable by the staff
     $remove = array('id', 'secuid', 'old_findID', 'updated', 'created', 'updatedBy', 'createdBy', 'institution', 'secwfstage', 'secowner', 'sectag', 'old_candidate', 'old_finderID', 'objdate2subperiod_old', 'objdate1subperiod_old', 'finder2ID', 'datefound2flag', 'datefound1flag', 'findID', 'phase_date_1', 'phase_date_2', 'context', 'depositionDate', 'volume', 'reference', 'classification', 'hoardID');
     //What are the friendly labels?
     $labels = array('geographyID' => 'Iron Age geographical region', 'geography_qualifier' => 'Geographical qualifier', 'greekstateID' => 'Greek state', 'ruler_id' => 'Primary ruler', 'ruler2_id' => 'Secondary ruler', 'ruler_qualifier' => 'primary ruler qualifier', 'ruler2_qualifier' => 'Secondary ruler qualifier', 'tribe_qualifier' => 'Ascribed culture', 'denomination_qualifier' => 'Denomination qualifier', 'mint_id' => 'Mint', 'mint_qualifier' => 'Mint qualifier', 'categoryID' => 'Medieval category', 'typeID' => 'Medieval type', 'status_qualifier' => 'Status qualifier', 'obverse_description' => 'Obverse description', 'obverse_inscription' => 'Obverse inscription', 'initial_mark' => 'Initial mark', 'reverse_description' => 'Reverse description', 'reverse_inscription' => 'Reverse inscription', 'reverse_mintmark' => 'Reverse mintmark', 'revtypeID' => 'Reverse type', 'revTypeID_qualifier' => 'Reverse type qualifier', 'degree_of_wear' => 'Degree of wear', 'die_axis_measurement' => 'Die axis', 'die_axis_certainty' => 'Die axis certainty', 'cciNumber' => 'CCI number', 'allen_type' => 'Allen type', 'mack_type' => 'Mack type', 'bmc_type' => 'BMC type', 'rudd_type' => 'Ancient British Coinage type', 'va_type' => 'Van Arsdell type', 'numChiab' => 'CHIAB number', 'reeceID' => 'Reece period');
     //Remove the unwanted fields from the array of fields
     foreach ($remove as $rem) {
         unset($fields[$rem]);
     }
     parent::__construct($options);
     $this->setName('configureHoardCopy');
     $elements = array();
     $view = Zend_Layout::getMvcInstance()->getView();
     foreach (array_keys($fields) as $field) {
         $label = $view->fieldNamesDb()->setField($field);
         $field = new Zend_Form_Element_Checkbox($field);
         if (!is_null($label)) {
             if (array_key_exists((string) $label, $labels)) {
                 $clean = ucfirst($labels[$label]);
             } else {
                 $clean = ucfirst($label);
             }
         }
         $field->setLabel($clean)->setRequired(false)->addValidator('NotEmpty', 'boolean');
         $elements[] = $field;
         $this->addElement($field);
     }
     $this->addDisplayGroup($elements, 'details');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Submit hoard form configuration');
     $this->addElement($submit);
     $this->details->setLegend('Choose fields: ');
     parent::init();
 }
 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)
 {
     $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');
 }
Ejemplo n.º 4
0
 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');
 }
 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');
 }
 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');
 }
Ejemplo n.º 7
0
 public function SearchParams($params = NULL)
 {
     $html = '';
     if (!is_null($params)) {
         $html .= '<p>You searched for: </p>';
         $html .= '<ul>';
         //Objecttype
         if (array_key_exists('objecttype', $params)) {
             if (!s_null($params['objecttype'])) {
                 $html .= '<li>Object type: ' . $this->view->escape($params['objecttype']) . '</li>';
                 $this->view->headTitle(' > Object type: ' . $this->view->escape($params['objecttype']));
             }
         }
         //	Broadperiod
         if (array_key_exists('broadperiod', $params)) {
             if (!is_null($params['broadperiod'])) {
                 $html .= '<li>Broadperiod: ' . $this->view->escape($params['broadperiod']) . '</li>';
                 $this->view->headTitle(' > Broadperiod: ' . $this->view->escape($params['broadperiod']));
             }
         }
         //County
         if (array_key_exists('county', $params)) {
             if (!is_null($params['county'])) {
                 $html .= '<li>County: ' . $this->view->escape($params['county']) . '</li>';
                 $this->view->headTitle(' > County: ' . $this->view->escape($params['county']));
             }
         }
         //region
         if (array_key_exists('regionID', $params)) {
             if (!is_null($params['regionID'])) {
                 $region = $params['regionID'];
                 $regions = new Regions();
                 $regions = $regions->getRegion($region);
                 $this->regions = $regions;
                 foreach ($this->regions as $region) {
                     $html .= '<li>Region: ' . $this->view->escape($region['region']) . '</li>';
                     $this->view->headTitle(' > Region: ' . $this->view->escape($region['region']));
                 }
             }
         }
         if (array_key_exists('material', $params)) {
             if (!is_null($params['material'])) {
                 $mat = $params['material'];
                 $materials = new Materials();
                 $materials = $materials->getMaterialName($mat);
                 $this->materials = $materials;
                 foreach ($this->materials as $material) {
                     $html .= '<li>Primary material: ' . $this->view->escape($material['term']) . '</li>';
                     $this->view->headTitle(' > Primary material: ' . $this->view->escape($material['term']));
                 }
             }
         }
         if (array_key_exists('parish', $params)) {
             if (!is_null($params['parish'])) {
                 $html .= '<li>Parish: ' . $this->view->escape($params['parish']) . '</li>';
                 $this->view->headTitle(' > Parish: ' . $this->view->escape($params['parish']));
             }
         }
         if (array_key_exists('district', $params)) {
             if (!is_null($params['district'])) {
                 $html .= '<li>District: ' . $this->view->escape($params['district']) . '</li>';
                 $this->view->headTitle(' > District: ' . $this->view->escape($params['district']));
             }
         }
         if (array_key_exists('denomination', $params)) {
             $denomname = $params['denomination'];
             $denoms = new Denominations();
             $denoms = $denoms->getDenomName($denomname);
             $this->denoms = $denoms;
             foreach ($this->denoms as $denom) {
                 $html .= '<li>Denomination type: ' . $this->view->escape($denom['denomination']) . '</li>';
                 $this->view->headTitle(' > Denomination: ' . $this->view->escape($denom['denomination']));
             }
         }
         if (array_key_exists('description', $params)) {
             if (!is_null($params['description'])) {
                 $html .= '<li>Description contained: ' . $this->view->escape($params['description']) . '</li>';
                 $this->view->headTitle(' > Description contained: ' . $this->view->escape($params['description']));
             }
         }
         if (array_key_exists('fourFigure', $params)) {
             if (!is_null($params['fourFigure'])) {
                 $html .= '<li>Four figure grid reference: ' . $this->view->escape($params['fourFigure']) . '</li>';
                 $this->view->headTitle(' > Four figure NGR: ' . $this->view->escape($params['fourFigure']));
             }
         }
         if (array_key_exists('old_findID', $params)) {
             if (!is_null($params['old_findID'])) {
                 $html .= '<li>Find reference number: ' . $this->view->escape($params['old_findID']) . '</li>';
                 $this->view->headTitle(' > Find ID: ' . $this->view->escape($params['old_findID']));
             }
         }
         if (array_key_exists('fromsubperiod', $params)) {
             if (!is_null($params['fromsubperiod'])) {
                 $sub = $params['fromsubperiod'];
                 if ($sub == 1) {
                     $html .= '<li>Subperiod: Early</li>';
                     $this->view->headTitle(' > Subperiod: Early');
                 } else {
                     if ($sub == 2) {
                         $html .= '<li>Subperiod: Middle</li>';
                         $this->view->headTitle(' > Subperiod: Middle');
                     } else {
                         if ($sub == 3) {
                             $html .= '<li>Subperiod: Late</li>';
                             $this->view->headTitle(' > Subperiod: Late');
                         }
                     }
                 }
             }
         }
         if (array_key_exists('tosubperiod', $params)) {
             if (!is_null($params['tosubperiod'])) {
                 $sub = $params['tosubperiod'];
                 if ($sub == 1) {
                     $html .= '<li>Subperiod: Early</li>';
                     $this->view->headTitle(' > Subperiod: Early');
                 } else {
                     if ($sub == 2) {
                         $html .= '<li>Subperiod: Middle</li>';
                         $this->view->headTitle(' > Subperiod: Middle');
                     } else {
                         if ($sub == 3) {
                             $html .= '<li>Subperiod: Late</li>';
                             $this->view->headTitle(' > Subperiod: Late');
                         }
                     }
                 }
             }
         }
         if (array_key_exists('periodfrom', $params)) {
             if (!is_null($params['periodfrom'])) {
                 $period = $params['periodfrom'];
                 $periods = new Periods();
                 $periods = $periods->getPeriodName($period);
                 $this->periods = $periods;
                 foreach ($this->periods as $period) {
                     $html .= '<li>Period from: ' . $this->view->escape($period['term']) . '</li>';
                     $this->view->headTitle(' > Period from: ' . $this->view->escape($period['term']));
                 }
             }
         }
         //Period to key
         if (array_key_exists('periodto', $params)) {
             if (!is_null($params['periodto'])) {
                 $period = $params['periodto'];
                 $periods = new Periods();
                 $periods = $periods->getPeriodName($period);
                 $this->periods = $periods;
                 foreach ($this->periods as $period) {
                     $html .= '<li>Period to: ' . $this->view->escape($period['term']) . '</li>';
                     $this->view->headTitle(' > Period to: ' . $this->view->escape($params['period']));
                 }
             }
         }
         //
         if (array_key_exists('surface', $params)) {
             if (!is_null($params['surface'])) {
                 $surfaceterm = $params['surface'];
                 $surfaces = new Surftreatments();
                 $surfaces = $surfaces->getSurfaceTerm($surfaceterm);
                 $this->surfaces = $surfaces;
                 foreach ($this->surfaces as $surface) {
                     $html .= '<li>Surface treatment: ' . $this->view->escape($surface['term']) . '</li>';
                     $this->view->headTitle(' > Surface treatment: ' . $this->view->escape($surface['term']));
                 }
             }
         }
         if (array_key_exists('class', $params)) {
             if (!is_null($params['class'])) {
                 $html .= '<li>Classification term like: ' . $this->view->escape($params['class']) . '</li>';
                 $this->view->headTitle(' > Classification: ' . $this->view->escape($params['class']));
             }
         }
         //Date from starts
         if (array_key_exists('from', $params)) {
             if (!is_null($params['from'])) {
                 $from = $params['from'];
                 $suffix = "BC";
                 $prefix = "AD";
                 if ($from < 0) {
                     $date = abs($from) . ' ' . $suffix;
                 } else {
                     if ($from > 0) {
                         $date = $prefix . ' ' . abs($from);
                     }
                 }
                 $html .= '<li>Date from greater or equal to: ' . (int) $date . '</li>';
                 $this->view->headTitle(' > Date from starts: ' . (int) $date);
             }
         }
         //Date from ends
         if (array_key_exists('fromend', $params)) {
             if (!is_null($params['fromend'])) {
                 $from = $params['fromend'];
                 $suffix = "BC";
                 $prefix = "AD";
                 if ($from < 0) {
                     $date = abs($from) . ' ' . $suffix;
                 } else {
                     if ($from > 0) {
                         $date = $prefix . ' ' . abs($from);
                     }
                 }
                 $html .= '<li>Date from smaller or equal to: ' . $date . '</li>';
                 $this->view->headTitle(' > Date from ends: ' . $date);
             }
         }
         //Date to starts
         //Date to ends
         //Year found
         if (array_key_exists('discovered', $params)) {
             if (!is_null($params['discovered'])) {
                 $html .= '<li>Year of discovery where known: ' . $this->view->escape($params['discovered']) . '</li>';
                 $this->view->headTitle(' > Discovery year: ' . $this->view->escape($params['discovered']));
             }
         }
         //Found by
         if (array_key_exists('finder', $params)) {
             if (!is_null($params['finder'])) {
                 $finder = $params['finder'];
                 $peoples = new Peoples();
                 $peoples = $peoples->getName($finder);
                 $this->peoples = $peoples;
                 foreach ($this->peoples as $people) {
                     $html .= '<li>Item found by: ' . $this->view->escape($people['term']) . '</li>';
                     $this->view->headTitle(' > Finder: ' . $this->view->escape($people['term']));
                 }
             }
         }
         //Identified by
         if (array_key_exists('idby', $params)) {
             if (!is_null($params['idby'])) {
                 $finder = $params['idby'];
                 $peoples = new Peoples();
                 $peoples = $peoples->getName($finder);
                 $this->peoples = $peoples;
                 foreach ($this->peoples as $people) {
                     $html .= '<li>Identified by: ' . $this->view->escape($people['term']) . '</li>';
                     $this->view->headTitle(' > Identified by: ' . $this->view->escape($people['term']));
                 }
             }
         }
         //Recorded by
         //Identified by
         if (array_key_exists('recordby', $params)) {
             if (!is_null($params['recordby'])) {
                 $finder = $params['recordby'];
                 $peoples = new Peoples();
                 $peoples = $peoples->getName($finder);
                 $this->peoples = $peoples;
                 foreach ($this->peoples as $people) {
                     $html .= '<li>Recorded by: ' . $this->view->escape($people['term']) . '</li>';
                     $this->view->headTitle(' > Recorded by: ' . $this->view->escape($people['term']));
                 }
             }
         }
         //Issuer
         if (array_key_exists('ruler', $params)) {
             if (!is_null($params['ruler'])) {
                 $ruler = $params['ruler'];
                 $rulers = new Rulers();
                 $rulers = $rulers->getRulersName($ruler);
                 $this->rulers = $rulers;
                 foreach ($this->rulers as $ruler) {
                     $html .= '<li>Coin issued by: ' . $this->view->escape($ruler['issuer']) . '</li>';
                     $this->view->headTitle(' > Coin issued by: ' . $this->view->escape($ruler['issuer']));
                 }
             }
         }
         if (array_key_exists('note', $params)) {
             if ($params['note'] == (int) 1) {
                 $html .= '<li>Object is a find of note';
                 $this->view->headTitle(' > Object is a find of note');
             }
         }
         if (array_key_exists('treasure', $params)) {
             if ($params['treasure'] == (int) 1) {
                 $html .= '<li>Object is Treasure or potential Treasure';
                 $this->view->headTitle(' > Object is Treasure');
             }
         }
         if (array_key_exists('TID', $params)) {
             if (!is_null($params['TID'])) {
                 $html .= '<li>Treasure case number: ' . $this->view->escape($params['TID']);
                 $this->view->headTitle(' > Treasure case number: ' . $this->view->escape($params['TID']));
             }
         }
         if (array_key_exists('created', $params)) {
             if (!is_null($params['created'])) {
                 $html .= '<li>Finds entered on: ' . $this->view->escape($params['created']);
                 $this->view->headTitle(' > finds entered on: ' . $this->view->escape($params['created']));
             }
         }
         if (array_key_exists('createdBefore', $params)) {
             if (!is_null($params['createdBefore'])) {
                 $html .= '<li>Finds entered on or before: ' . $this->view->niceShortDate($this->view->escape($params['createdBefore'])) . '</li>';
                 $this->view->headTitle(' > finds entered on or before: ' . $this->view->niceShortDate($this->view->escape($params['createdAfter'])));
             }
         }
         if (array_key_exists('createdAfter', $params)) {
             if (!is_null($params['createdAfter'])) {
                 $html .= '<li>Finds entered on or after: ' . $this->view->niceShortDate($this->view->escape($params['createdAfter'])) . '</li>';
                 $this->view->headTitle(' > finds entered on or after: ' . $this->view->niceShortDate($this->view->escape($params['createdAfter'])));
             }
         }
         if (array_key_exists('hoard', $params)) {
             if ((int) $params['hoard'] == (int) 1) {
                 $html .= '<li>Object is part of a hoard.</li>';
                 $this->view->headTitle(' > Object is part of a hoard.');
             }
         }
         if (array_key_exists('hID', $params)) {
             if ((int) $params['hID']) {
                 $hID = $params['hID'];
                 $hIDs = new Hoards();
                 $hIDsList = $hIDs->getHoardDetails((int) $hID);
                 $this->hids = $hIDsList;
                 foreach ($this->hids as $hid) {
                     $html .= '<li>Part of the ' . $this->view->escape($hid['term']) . ' hoard.</li>';
                     $this->view->headTitle(' > Part of the ' . $this->view->escape($hid['term']) . ' hoard.');
                 }
             }
         }
         if (array_key_exists('otherref', $params)) {
             if (!is_null($params['otherref'])) {
                 $html .= '<li>Other reference: ' . $this->view->escape($params['otherref']);
                 $this->view->headTitle(' > Other reference: ' . $this->view->escape($params['otherref']));
             }
         }
         //Workflow
         if (array_key_exists('workflow', $params)) {
             if (!is_null($params['workflow'])) {
                 $stage = $params['workflow'];
                 $stages = new Workflows();
                 $stages = $stages->getStageName($stage);
                 $this->stages = $stages;
                 foreach ($this->stages as $stage) {
                     $html .= '<li>Workflow stage: ' . $this->view->escape($stage['workflowstage']) . '</li>';
                     $this->view->headTitle(' > Workflow stage: ' . $this->view->escape($stage['workflowstage']));
                 }
             }
         }
         if (array_key_exists('manufacture', $params)) {
             if (!is_null($params['manufacture'])) {
                 $manufacture = $params['manufacture'];
                 $manufactures = new Manufactures();
                 $manufactures = $manufactures->getManufactureDetails((int) $manufacture);
                 $this->manufactures = $manufactures;
                 foreach ($this->manufactures as $man) {
                     $html .= '<li>Manufacture type: ' . $this->view->escape($man['term']) . '</li>';
                     $this->view->headTitle(' > Manufacture type: ' . $this->view->escape($man['term']));
                 }
             }
         }
         if (array_key_exists('decoration', $params)) {
             if (!is_null($params['decoration'])) {
                 $decoration = $params['decoration'];
                 $decorations = new Decmethods();
                 $decorations = $decorations->getDecorationDetails((int) $decoration);
                 $this->decorations = $decorations;
                 foreach ($this->decorations as $dec) {
                     $html .= '<li>Decoration type: ' . $this->view->escape($dec['term']) . '</li>';
                     $this->view->headTitle(' > Decoration type: ' . $this->view->escape($dec['term']));
                 }
             }
         }
         //Mint
         if (array_key_exists('mint', $params)) {
             if (!is_null($params['mint'])) {
                 $id = $params['mint'];
                 $mints = new Mints();
                 $mints = $mints->getMintName($id);
                 $this->mints = $mints;
                 foreach ($this->mints as $mint) {
                     $html .= '<li>Mint issuing coins: ' . $this->view->escape($mint['mint_name']) . ' (' . $mint['term'] . ')</li>';
                     $this->view->headTitle(' > Mint issuing coins: ' . $this->view->escape($mint['mint_name']));
                 }
             }
         }
         //Category
         if (array_key_exists('category', $params)) {
             if (!is_null($params['category'])) {
                 $id = $params['category'];
                 $cats = new CategoriesCoins();
                 $cats = $cats->getCategory($id);
                 $this->cats = $cats;
                 foreach ($this->cats as $cat) {
                     $html .= '<li>Coin category: ' . $this->view->escape($cat['term']) . '</li>';
                     $this->view->headTitle(' > Coin category: ' . $this->view->escape($cat['term']));
                 }
             }
         }
         $html .= '</ul>';
     }
     return $html;
 }
Ejemplo n.º 8
0
 public function SearchParamsUsers($params = NULL)
 {
     unset($params['submit']);
     unset($params['action']);
     unset($params['controller']);
     unset($params['module']);
     if (!is_null($params)) {
         echo 'You searched for: ';
         //Objecttype
         if (array_key_exists('objecttype', $params)) {
             if (!is_null($params['objecttype'])) {
                 echo 'Object type: ' . $this->view->escape($params['objecttype']) . ' &raquo; ';
             }
         }
         //Broadperiod
         if (array_key_exists('broadperiod', $params)) {
             if (!is_null($params['broadperiod'])) {
                 echo 'Broadperiod: ' . $this->view->escape($params['broadperiod']) . ' &raquo; ';
             }
         }
         //VA type
         if (array_key_exists('vaType', $params)) {
             if (!is_null($params['vaType'])) {
                 $va = $params['vaType'];
                 echo 'Van Arsdell Type: ' . $va;
             }
         }
         if (array_key_exists('woeid', $params)) {
             if (!is_null($params['woeid'])) {
                 $woeid = $params['woeid'];
                 echo 'Where on Earth ID: ' . $woeid;
             }
         }
         if (array_key_exists('recorderID', $params)) {
             if (!is_null($params['recorderID'])) {
                 $rid = $params['recorderID'];
                 $peoples = new Peoples();
                 $people = $peoples->fetchRow($peoples->select()->where('secuid = ?', $rid));
                 echo 'Recorded by: ' . $people->fullname;
             }
         }
         //County
         if (array_key_exists('county', $params)) {
             if (!is_null($params['county'])) {
                 echo 'County: ' . $this->view->escape($params['county']) . ' &raquo; ';
             }
         }
         //Tribe for IA coins
         if (array_key_exists('tribe', $params)) {
             if (!is_null($params['tribe'])) {
                 $tribe = $params['tribe'];
                 $tribes = new Tribes();
                 $tribe = $tribes->fetchRow($tribes->select()->where('id = ?', (int) $tribe));
                 echo 'Iron Age Tribe: ' . $tribe->tribe;
             }
         }
         //region
         if (array_key_exists('regionID', $params)) {
             if (!is_null($params['regionID'])) {
                 $region = $params['regionID'];
                 $regions = new Regions();
                 $regions = $regions->getRegion($region);
                 $this->regions = $regions;
                 foreach ($this->regions as $region) {
                     echo 'Region: ' . $this->view->escape($region['region']) . ' &raquo; ';
                 }
             }
         }
         if (array_key_exists('material', $params)) {
             if (!is_null($params['material'])) {
                 $mat = $params['material'];
                 $materials = new Materials();
                 $materials = $materials->getMaterialName($mat);
                 $this->materials = $materials;
                 foreach ($this->materials as $material) {
                     echo 'Primary material: ' . $this->view->escape($material['term']) . ' &raquo; ';
                 }
             }
         }
         if (array_key_exists('parish', $params)) {
             if (!is_null($params['parish'])) {
                 echo 'Parish: ' . $this->view->escape($params['parish']) . ' &raquo; ';
             }
         }
         if (array_key_exists('district', $params)) {
             if (!is_null($params['district'])) {
                 echo 'District: ' . $this->view->escape($params['district']) . ' &raquo; ';
             }
         }
         if (array_key_exists('denomination', $params)) {
             $denomname = $params['denomination'];
             $denoms = new Denominations();
             $denoms = $denoms->getDenomName($denomname);
             $this->denoms = $denoms;
             foreach ($this->denoms as $denom) {
                 echo 'Denomination type: ' . $this->view->escape($denom['denomination']) . ' &raquo; ';
             }
         }
         if (array_key_exists('description', $params)) {
             if (!is_null($params['description'])) {
                 echo 'Description contained: ' . $this->view->escape($params['description']) . ' &raquo; ';
             }
         }
         if (array_key_exists('fourFigure', $params)) {
             if (!is_null($params['fourFigure'])) {
                 echo 'Four figure grid reference: ' . $this->view->escape($params['fourFigure']) . ' &raquo; ';
             }
         }
         if (array_key_exists('old_findID', $params)) {
             if (!is_null($params['old_findID'])) {
                 echo 'Find reference number: ' . $this->view->escape($params['old_findID']) . ' &raquo; ';
             }
         }
         if (array_key_exists('fromsubperiod', $params)) {
             if (!is_null($params['fromsubperiod'])) {
                 $sub = $params['fromsubperiod'];
                 if ($sub == 1) {
                     echo 'Subperiod: Early' . ' &raquo; ';
                 } else {
                     if ($sub == 2) {
                         echo 'Subperiod: Middle' . ' &raquo; ';
                     } else {
                         if ($sub == 3) {
                             echo 'Subperiod: Late' . ' &raquo; ';
                         }
                     }
                 }
             }
         }
         if (array_key_exists('tosubperiod', $params)) {
             if (!is_null($params['tosubperiod'])) {
                 $sub = $params['tosubperiod'];
                 if ($sub == 1) {
                     echo 'Subperiod: Early' . ' &raquo; ';
                 } else {
                     if ($sub == 2) {
                         echo 'Subperiod: Middle' . ' &raquo; ';
                     } else {
                         if ($sub == 3) {
                             echo 'Subperiod: Late' . ' &raquo; ';
                         }
                     }
                 }
             }
         }
         if (array_key_exists('periodfrom', $params)) {
             if (!is_null($params['periodfrom'])) {
                 $period = $params['periodfrom'];
                 $periods = new Periods();
                 $periods = $periods->getPeriodName($period);
                 $this->periods = $periods;
                 foreach ($this->periods as $period) {
                     echo 'Period from: ' . $this->view->escape($period['term']) . ' &raquo; ';
                 }
             }
         }
         //Period to key
         if (array_key_exists('periodto', $params)) {
             if (!is_null($params['periodto'])) {
                 $period = $params['periodto'];
                 $periods = new Periods();
                 $periods = $periods->getPeriodName($period);
                 $this->periods = $periods;
                 foreach ($this->periods as $period) {
                     echo 'Period to: ' . $this->view->escape($period['term']) . ' &raquo; ';
                 }
             }
         }
         //
         if (array_key_exists('surface', $params)) {
             if (!is_null($params['surface'])) {
                 $surfaceterm = $params['surface'];
                 $surfaces = new Surftreatments();
                 $surfaces = $surfaces->getSurfaceTerm($surfaceterm);
                 $this->surfaces = $surfaces;
                 foreach ($this->surfaces as $surface) {
                     echo 'Surface treatment: ' . $this->view->escape($surface['term']) . ' &raquo; ';
                 }
             }
         }
         if (array_key_exists('class', $params)) {
             if (!is_null($params['class'])) {
                 echo 'Classification term like: ' . $this->view->escape($params['class']) . ' &raquo; ';
             }
         }
         //Date from starts
         if (array_key_exists('from', $params)) {
             if (!is_null($params['from'])) {
                 $from = $params['from'];
                 $suffix = "BC";
                 $prefix = "AD";
                 if ($from < 0) {
                     $date = abs($from) . ' ' . $suffix;
                 } else {
                     if ($from > 0) {
                         $date = $prefix . ' ' . abs($from);
                     }
                 }
                 echo 'Date from greater or equal to: ' . (int) $date . ' &raquo; ';
             }
         }
         //Date from ends
         if (array_key_exists('fromend', $params)) {
             if (!is_null($params['fromend'])) {
                 $from = $params['fromend'];
                 $suffix = "BC";
                 $prefix = "AD";
                 if ($from < 0) {
                     $date = abs($from) . ' ' . $suffix;
                 } else {
                     if ($from > 0) {
                         $date = $prefix . ' ' . abs($from);
                     }
                 }
                 echo 'Date from smaller or equal to: ' . $date . ' &raquo; ';
             }
         }
         //Date to starts
         //Date to ends
         //Year found
         if (array_key_exists('discovered', $params)) {
             if (!is_null($params['discovered'])) {
                 echo 'Year of discovery where known: ' . $this->view->escape($params['discovered']) . ' &raquo; ';
             }
         }
         //Found by
         if (array_key_exists('finder', $params)) {
             if (!is_null($params['finder'])) {
                 $finder = $params['finder'];
                 $peoples = new Peoples();
                 $peoples = $peoples->getName($finder);
                 $this->peoples = $peoples;
                 foreach ($this->peoples as $people) {
                     echo 'Item found by: ' . $this->view->escape($people['term']) . ' &raquo; ';
                 }
             }
         }
         //Identified by
         if (array_key_exists('idby', $params)) {
             if (!is_null($params['idby'])) {
                 $finder = $params['idby'];
                 $peoples = new Peoples();
                 $peoples = $peoples->getName($finder);
                 $this->peoples = $peoples;
                 foreach ($this->peoples as $people) {
                     echo 'Identified by: ' . $this->view->escape($people['term']) . ' &raquo; ';
                 }
             }
         }
         //Recorded by
         //Identified by
         if (array_key_exists('recordby', $params)) {
             if (!is_null($params['recordby'])) {
                 $finder = $params['recordby'];
                 $peoples = new Peoples();
                 $peoples = $peoples->getName($finder);
                 $this->peoples = $peoples;
                 foreach ($this->peoples as $people) {
                     echo 'Recorded by: ' . $this->view->escape($people['term']) . ' &raquo; ';
                 }
             }
         }
         //Issuer
         if (array_key_exists('ruler', $params)) {
             if (!is_null($params['ruler'])) {
                 $ruler = $params['ruler'];
                 $rulers = new Rulers();
                 $rulers = $rulers->getRulersName($ruler);
                 $this->rulers = $rulers;
                 foreach ($this->rulers as $ruler) {
                     echo 'Coin issued by: ' . $this->view->escape($ruler['issuer']) . ' &raquo; ';
                 }
             }
         }
         if (array_key_exists('note', $params)) {
             if ($params['note'] == (int) 1) {
                 echo 'Object is a find of note';
             }
         }
         if (array_key_exists('treasure', $params)) {
             if ($params['treasure'] == (int) 1) {
                 echo 'Object is Treasure or potential Treasure';
             }
         }
         if (array_key_exists('TID', $params)) {
             if (!is_null($params['TID'])) {
                 echo 'Treasure case number: ' . $this->view->escape($params['TID']);
             }
         }
         if (array_key_exists('created', $params)) {
             if (!is_null($params['created'])) {
                 echo 'Finds entered on: ' . $this->view->escape($params['created']);
             }
         }
         if (array_key_exists('createdBefore', $params)) {
             if (!is_null($params['createdBefore'])) {
                 echo 'Finds entered on or before: ' . $this->view->niceShortDate($this->view->escape($params['createdBefore'])) . ' &raquo; ';
             }
         }
         if (array_key_exists('createdAfter', $params)) {
             if (!is_null($params['createdAfter'])) {
                 echo 'Finds entered on or after: ' . $this->view->niceShortDate($this->view->escape($params['createdAfter'])) . ' &raquo; ';
             }
         }
         if (array_key_exists('hoard', $params)) {
             if ((int) $params['hoard'] == (int) 1) {
                 echo 'Object is part of a hoard.' . ' &raquo; ';
             }
         }
         if (array_key_exists('hID', $params)) {
             if ((int) $params['hID']) {
                 $hID = $params['hID'];
                 $hIDs = new Hoards();
                 $hIDsList = $hIDs->getHoardDetails((int) $hID);
                 $this->hids = $hIDsList;
                 foreach ($this->hids as $hid) {
                     echo 'Part of the ' . $this->view->escape($hid['term']) . ' hoard.' . ' &raquo; ';
                 }
             }
         }
         if (array_key_exists('otherref', $params)) {
             if (!is_null($params['otherref'])) {
                 echo 'Other reference: ' . $this->view->escape($params['otherref']);
             }
         }
         //Workflow
         if (array_key_exists('workflow', $params)) {
             if (!is_null($params['workflow'])) {
                 $stage = $params['workflow'];
                 $stages = new Workflows();
                 $stages = $stages->getStageName($stage);
                 $this->stages = $stages;
                 foreach ($this->stages as $stage) {
                     echo 'Workflow stage: ' . $this->view->escape($stage['workflowstage']) . ' &raquo; ';
                 }
             }
         }
         if (array_key_exists('manufacture', $params)) {
             if (!is_null($params['manufacture'])) {
                 $manufacture = $params['manufacture'];
                 $manufactures = new Manufactures();
                 $manufactures = $manufactures->getManufactureDetails((int) $manufacture);
                 $this->manufactures = $manufactures;
                 foreach ($this->manufactures as $man) {
                     echo 'Manufacture type: ' . $this->view->escape($man['term']) . ' &raquo; ';
                 }
             }
         }
         if (array_key_exists('decoration', $params)) {
             if (!is_null($params['decoration'])) {
                 $decoration = $params['decoration'];
                 $decorations = new Decmethods();
                 $decorations = $decorations->getDecorationDetails((int) $decoration);
                 $this->decorations = $decorations;
                 foreach ($this->decorations as $dec) {
                     echo 'Decoration type: ' . $this->view->escape($dec['term']) . ' &raquo; ';
                 }
             }
         }
         //Mint
         if (array_key_exists('mint', $params)) {
             if (!is_null($params['mint'])) {
                 $id = $params['mint'];
                 $mints = new Mints();
                 $mints = $mints->getMintName($id);
                 $this->mints = $mints;
                 foreach ($this->mints as $mint) {
                     echo 'Mint issuing coins: ' . $this->view->escape($mint['mint_name']) . ' (' . $mint['term'] . ')' . ' &raquo; ';
                 }
             }
         }
         //Category
         if (array_key_exists('category', $params)) {
             if (!is_null($params['category'])) {
                 $id = $params['category'];
                 $cats = new CategoriesCoins();
                 $cats = $cats->getCategory($id);
                 $this->cats = $cats;
                 foreach ($this->cats as $cat) {
                     echo 'Coin category: ' . $this->view->escape($cat['term']) . ' &raquo; ';
                 }
             }
         }
         if (array_key_exists('reeceID', $params)) {
             if (!is_null($params['reeceID'])) {
                 $id = $params['reeceID'];
                 $reeces = new Reeces();
                 $rs = $reeces->getReecePeriodDetail($id);
                 foreach ($rs as $r) {
                     echo 'Reece Period: ' . $this->view->escape($r['period_name']) . ' ' . $r['date_range'] . ' &raquo; ';
                 }
             }
         }
         //Workflow
         if (array_key_exists('createdby', $params)) {
             if (!is_null($params['createdby'])) {
                 $createdby = $params['createdby'];
                 $users = new Users();
                 $names = $users->getCreatedBy($createdby);
                 $this->names = $names;
                 foreach ($this->names as $name) {
                     echo 'Record created by: <a href="' . $this->view->baseUrl() . '/contacts/staff/profile/id/' . $name['i'] . '" title="View profile for ' . $name['fullname'] . '">' . $name['fullname'] . '</a>' . ' &raquo; ';
                 }
             }
         }
         //End of function
         echo '</ul>';
     }
 }
Ejemplo n.º 9
0
 /** Delete a particular hoard
  */
 public function deleteAction()
 {
     if ($this->_getParam('id', false)) {
         $this->_flashMessenger->addMessage($this->_noChange);
         if ($this->_request->isPost()) {
             $id = (int) $this->_request->getPost('id');
             $del = $this->_request->getPost('del');
             if ($del == 'Yes' && $id > 0) {
                 $hoards = new Hoards();
                 $where = 'id = ' . $id;
                 $hoards->delete($where);
             }
             $this->_flashMessenger->addMessage('Record for rally deleted!');
             $this->_redirect(self::REDIRECT);
         } else {
             $id = (int) $this->_request->getParam('id');
             if ($id > 0) {
                 $hoards = new Hoards();
                 $this->view->hoard = $hoards->fetchRow('id=' . $id);
             }
         }
     } else {
         throw new Pas_Exception_Param($this->_missingParameter);
     }
 }