/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { $institutions = new Institutions(); $inst_options = $institutions->getInsts(); $discs = new DiscoMethods(); $disc_options = $discs->getOptions(); $mans = new Manufactures(); $man_options = $mans->getOptions(); $primaries = new Materials(); $primary_options = $primaries->getPrimaries(); $periods = new Periods(); $period_options = $periods->getPeriodFrom(); $primaries = new Materials(); $primary_options = $primaries->getPrimaries(); $periods = new Periods(); $periodword_options = $periods->getPeriodFromWords(); $cultures = new Cultures(); $culture_options = $cultures->getCultures(); $surfaces = new SurfaceTreatments(); $surface_options = $surfaces->getSurfaces(); $decorations = new DecStyles(); $decoration_options = $decorations->getStyles(); $decmeths = new DecMethods(); $decmeth_options = $decmeths->getDecmethods(); $reasons = new Findofnotereasons(); $reason_options = $reasons->getReasons(); $preserves = new Preservations(); $preserve_options = $preserves->getPreserves(); $rallies = new Rallies(); $rally_options = $rallies->getRallies(); $counties = new OsCounties(); $county_options = $counties->getCountiesID(); $regions = new OsRegions(); $region_options = $regions->getRegionsID(); $current_year = date('Y'); $years = range(1850, $current_year); $years_list = array_combine($years, $years); parent::__construct($options); $this->setName('Advanced'); $old_findID = new Zend_Form_Element_Text('old_findID'); $old_findID->setLabel('Find number: ')->addFilters(array('StringTrim', 'StripTags'))->addValidator('StringLength', false, array(3, 20))->addErrorMessage('Please enter a valid number!'); $objecttype = new Zend_Form_Element_Text('objecttype'); $objecttype->setLabel('Object type: ')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Please enter a valid object type!'); $description = new Zend_Form_Element_Text('description'); $description->setLabel('Object description contains: ')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Please enter a valid term'); //Find of note $findofnote = new Zend_Form_Element_Checkbox('note'); $findofnote->setLabel('Find of Note: ')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null); //Reason for find of note $findofnotereason = new Zend_Form_Element_Select('reason'); $findofnotereason->setLabel('Reason for noteworthy status: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose reason', 'Available reasons' => $reason_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow')); //Institution $institution = new Zend_Form_Element_Select('institution'); $institution->setLabel('Recording institution: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose institution', 'Available institutions' => $inst_options))->setAttribs(array('class' => 'input-medium selectpicker show-menu-arrow')); $notes = new Zend_Form_Element_Text('notes'); $notes->setLabel('Notes: ')->addFilters(array('StringTrim', 'StripTags')); $broadperiod = new Zend_Form_Element_Select('broadperiod'); $broadperiod->setLabel('Broad period: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $periodword_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $objdate1subperiod = new Zend_Form_Element_Select('fromsubperiod'); $objdate1subperiod->setLabel('Sub period from: ')->addMultiOptions(array(null => 'Choose sub-period from', 'Available sub period from' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => ''))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Period from: Assigned via dropdown $objdate1period = new Zend_Form_Element_Select('periodFrom'); $objdate1period->setLabel('Period from: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $objdate2subperiod = new Zend_Form_Element_Select('tosubperiod'); $objdate2subperiod->setLabel('Sub period to: ')->addMultiOptions(array(null => 'Choose sub-period from', 'Available subperiods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->setDisableTranslator(true)->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => ''))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Period to: Assigned via dropdown $objdate2period = new Zend_Form_Element_Select('periodTo'); $objdate2period->setLabel('Period to: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $culture = new Zend_Form_Element_Select('culture'); $culture->setLabel('Ascribed culture: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose ascribed culture', 'Available cultures' => $culture_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $from = new Zend_Form_Element_Text('fromdate'); $from->setLabel('Start date: ')->addFilters(array('StringTrim', 'StripTags'))->addValidators(array('NotEmpty', 'Int'))->addErrorMessage('Please enter a valid date')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'))->setDescription('If you want to search for a date range, ' . 'enter a start date in this box and and end in the ' . 'box below. You do not need to add AD or BC'); $to = new Zend_Form_Element_Text('todate'); $to->setLabel('End date: ')->addFilters(array('StringTrim', 'StripTags'))->addValidators(array('NotEmpty', 'Int'))->addErrorMessage('Please enter a valid date')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $workflow = new Zend_Form_Element_Select('workflow'); $workflow->setLabel('Workflow stage: ')->addFilters(array('StringTrim', 'StripTags'))->addValidator('Int')->setAttribs(array('class' => 'input-medium selectpicker show-menu-arrow')); if (in_array($this->_role, $this->_higherlevel)) { $workflow->addMultiOptions(array(null => 'Available Workflow stages', 'Choose Worklow stage' => array('1' => 'Quarantine', '2' => 'On review', '4' => 'Awaiting validation', '3' => 'Published'))); } if (in_array($this->_role, $this->_restricted)) { $workflow->addMultiOptions(array(null => 'Available Workflow stages', 'Choose Worklow stage' => array('4' => 'Awaiting validation', '3' => 'Published'))); } $treasure = new Zend_Form_Element_Checkbox('treasure'); $treasure->setLabel('Treasure find: ')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null); $treasureID = new Zend_Form_Element_Text('TID'); $treasureID->setLabel('Treasure ID number: ')->addFilters(array('StringTrim', 'StripTags')); //Rally details $rally = new Zend_Form_Element_Checkbox('rally'); $rally->setLabel('Rally find: ')->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null); $rallyID = new Zend_Form_Element_Select('rallyID'); $rallyID->setLabel('Found at this rally: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose a rally', 'Available rallies' => $rally_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $other_ref = new Zend_Form_Element_Text('otherRef'); $other_ref->setLabel('Other reference: ')->addFilters(array('StringTrim', 'StripTags')); $smrRef = new Zend_Form_Element_Text('smrRef'); $smrRef->setLabel('SMR reference: ')->addFilters(array('StringTrim', 'StripTags')); //Manufacture method $manmethod = new Zend_Form_Element_Select('manufacture'); $manmethod->setLabel('Manufacture method: ')->addFilters(array('StringTrim', 'StripTags'))->addValidator('Int')->addMultiOptions(array(null => 'Choose method of manufacture', 'Available methods' => $man_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Decoration method $decmethod = new Zend_Form_Element_Select('decoration'); $decmethod->setLabel('Decoration method: ')->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose decoration method', 'Available decorative methods' => $decmeth_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Surface treatment $surftreat = new Zend_Form_Element_Select('surface'); $surftreat->setLabel('Surface Treatment: ')->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose surface treatment', 'Available surface treatments' => $surface_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //decoration style $decstyle = new Zend_Form_Element_Select('decstyle'); $decstyle->setLabel('Decorative style: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose decorative style', 'Available decorative options' => $decoration_options))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Preservation of object $preservation = new Zend_Form_Element_Select('preservation'); $preservation->setLabel('Preservation: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addMultiOptions(array(null => 'Choose level of preservation', 'Available options' => $preserve_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $county = new Zend_Form_Element_Select('countyID'); $county->setLabel('County: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose county', 'Available counties' => $county_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow')); $district = new Zend_Form_Element_Select('districtID'); $district->setLabel('District: ')->addMultiOptions(array(null => 'Choose district after county'))->setRegisterInArrayValidator(false)->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow')); $parish = new Zend_Form_Element_Select('parishID'); $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose parish after county'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow')); $regionID = new Zend_Form_Element_Select('regionID'); $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->addValidator('Int')->addMultiOptions(array(null => 'Choose a region for a wide result', 'Choose region' => $region_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $gridref = new Zend_Form_Element_Text('gridref'); $gridref->setLabel('Grid reference: ')->addValidators(array('NotEmpty', 'ValidGridRef'))->addFilters(array('StringTrim', 'StripTags')); $fourFigure = new Zend_Form_Element_Text('fourFigure'); $fourFigure->setLabel('Four figure grid reference: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags')); $idBy = new Zend_Form_Element_Text('idBy'); $idBy->setLabel('Primary identifier: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags')); $identifierID = new Zend_Form_Element_Hidden('identifierID'); $identifierID->addFilters(array('StringTrim', 'StripTags')); $created = new Zend_Form_Element_Text('createdBefore'); $created->setLabel('Date record created on or before: ')->addFilters(array('StringTrim', 'StripTags')); $created2 = new Zend_Form_Element_Text('createdAfter'); $created2->setLabel('Date record created on or after: ')->addFilters(array('StringTrim', 'StripTags')); $updated = new Zend_Form_Element_Text('updatedBefore'); $updated->setLabel('Date record updated on or before: ')->addFilters(array('StringTrim', 'StripTags')); $updated2 = new Zend_Form_Element_Text('updatedAfter'); $updated2->setLabel('Date record updated on or after: ')->addFilters(array('StringTrim', 'StripTags')); $finder = new Zend_Form_Element_Text('finder'); $finder->setLabel('Found by: ')->addFilters(array('StringTrim', 'StripTags')); $finderID = new Zend_Form_Element_Hidden('finderID'); $finderID->addFilters(array('StringTrim', 'StripTags')); $recordby = new Zend_Form_Element_Text('recordername'); $recordby->setLabel('Recorded by: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'))->setAttrib('autoComplete', 'true'); $recorderID = new Zend_Form_Element_Hidden('recorderID'); $recorderID->addFilters(array('StringTrim', 'StripTags')); $discoverydate = new Zend_Form_Element_Select('discovered'); $discoverydate->setLabel('Year of discovery')->setMultiOptions(array(null => 'Choose a year of discovery', 'Date range' => $years_list))->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel('Submit your search'); $material1 = new Zend_Form_Element_Select('material'); $material1->setLabel('Primary material: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose primary material', 'Available options' => $primary_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $woeid = new Zend_Form_Element_Text('woeid'); $woeid->setLabel('Where on earth ID: ')->addValidator('Int')->addFilters(array('StripTags', 'StringTrim')); $elevation = new Zend_Form_Element_Text('elevation'); $elevation->setLabel('Elevation: ')->addValidator('Int')->addFilters(array('StripTags', 'StringTrim')); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_salt)->setTimeout(4800); if (in_array($this->_role, $this->_restricted)) { $this->addElements(array($old_findID, $objecttype, $broadperiod, $description, $from, $to, $workflow, $findofnote, $findofnotereason, $rally, $rallyID, $other_ref, $manmethod, $notes, $objdate1period, $objdate2period, $county, $regionID, $district, $parish, $fourFigure, $objdate1subperiod, $objdate2subperiod, $treasure, $treasureID, $discoverydate, $created, $created2, $updated, $updated2, $culture, $surftreat, $submit, $material1, $elevation, $woeid, $institution, $hash, $smrRef)); } else { $this->addElements(array($old_findID, $objecttype, $broadperiod, $description, $from, $to, $workflow, $findofnote, $findofnotereason, $rally, $rallyID, $other_ref, $manmethod, $notes, $objdate1period, $objdate2period, $county, $regionID, $district, $parish, $fourFigure, $elevation, $woeid, $objdate1subperiod, $objdate2subperiod, $treasure, $treasureID, $discoverydate, $created, $created2, $updated, $updated2, $idBy, $finder, $finderID, $recordby, $recorderID, $identifierID, $culture, $surftreat, $submit, $material1, $institution, $smrRef, $hash)); } $this->addDisplayGroup(array('old_findID', 'objecttype', 'description', 'notes', 'note', 'reason', 'treasure', 'TID', 'rally', 'rallyID', 'workflow', 'otherRef', 'smrRef', 'material', 'manufacture', 'surface'), 'details'); $this->details->setLegend('Main details: '); $this->addDisplayGroup(array('broadperiod', 'fromsubperiod', 'periodFrom', 'tosubperiod', 'periodTo', 'culture', 'fromdate', 'todate'), 'Temporaldetails'); $this->Temporaldetails->setLegend('Dates and periods: '); $this->addDisplayGroup(array('countyID', 'regionID', 'districtID', 'parishID', 'fourFigure', 'elevation', 'woeid'), 'Spatial'); $this->Spatial->setLegend('Spatial details: '); if (in_array($this->_role, $this->_restricted)) { $this->addDisplayGroup(array('institution', 'createdAfter', 'createdBefore', 'updatedAfter', 'updatedBefore', 'discovered'), 'Discovery'); } else { $this->addDisplayGroup(array('institution', 'finder', 'idBy', 'identifierID', 'recordername', 'recorderID', 'createdAfter', 'createdBefore', 'updatedAfter', 'updatedBefore', 'discovered'), 'Discovery'); } $this->Discovery->setLegend('Discovery details: '); $this->addDisplayGroup(array('submit'), 'buttons'); parent::init(); }
/** Delete a decorative method * @access public * @return void */ public function deletedecorationmethodAction() { if ($this->_request->isPost()) { $id = (int) $this->_request->getPost('id'); $del = $this->_request->getPost('del'); if ($del == 'Yes' && $id > 0) { $decs = new DecMethods(); $where = 'id = ' . $id; $decs->delete($where); } $this->getFlash()->addMessage(self::DELETED); $this->redirect($this->_redirectUrl . 'decorationmethods'); } else { $id = (int) $this->_request->getParam('id'); if ($id > 0) { $decs = new DecMethods(); $this->view->dec = $decs->fetchRow('id=' . $id); } } }
/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { $discs = new DiscoMethods(); $disc_options = $discs->getOptions(); //Get data to form select menu for manufacture methods $mans = new Manufactures(); $man_options = $mans->getOptions(); //Get data to form select menu for primary and secondary material $primaries = new Materials(); $primary_options = $primaries->getPrimaries(); //Get data to form select menu for periods $periods = new Periods(); $period_options = $periods->getPeriodFrom(); //Get data to form select menu for cultures $cultures = new Cultures(); $culture_options = $cultures->getCultures(); //Get data to form Surface treatments menu $surfaces = new SurfaceTreatments(); $surface_options = $surfaces->getSurfaces(); //Get data to form Decoration styles menu $decorations = new DecStyles(); $decoration_options = $decorations->getStyles(); //Get data to form Decoration methods menu $decmeths = new DecMethods(); $decmeth_options = $decmeths->getDecmethods(); //Get Find of note reason data $reasons = new Findofnotereasons(); $reason_options = $reasons->getReasons(); //Get Preservation data $preserves = new Preservations(); $preserve_options = $preserves->getPreserves(); //Get Rally data $rallies = new Rallies(); $rally_options = $rallies->getRallies(); $periods = new Periods(); $periodword_options = $periods->getPeriodFromWords(); $circa = new DateQualifiers(); $circa_o = $circa->getTerms(); $actions = new SubsequentActions(); $actionsDD = $actions->getSubActionsDD(); //End of select options construction $this->addElementPrefixPath('Pas_Filter', 'Pas/Filter/', 'filter'); parent::__construct($options); $this->setName('finds'); $secuid = new Zend_Form_Element_Hidden('secuid'); $secuid->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum'); // Object specifics $old_findID = new Zend_Form_Element_Hidden('old_findID'); $old_findID->addFilters(array('StripTags', 'StringTrim')); //Objecttype - autocomplete from thesaurus $objecttype = new Zend_Form_Element_Text('objecttype'); $objecttype->setLabel('Object type: ')->setRequired(true)->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'))->addValidator('ValidObjectType'); $objecttypecert = new Zend_Form_Element_Radio('objecttypecert'); $objecttypecert->setLabel('Object type certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setOptions(array('separator' => '')); //Object description $description = new Pas_Form_Element_CKEditor('description'); $description->setLabel('Object description: ')->setRequired(false)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars')); //Object notes $notes = new Pas_Form_Element_CKEditor('notes'); $notes->setLabel('Notes: ')->setRequired(false)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars')); //Find of note $findofnote = new Zend_Form_Element_Checkbox('findofnote'); $findofnote->setLabel('Find of Note: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Int'); //Reason for find of note $findofnotereason = new Zend_Form_Element_Select('findofnotereason'); $findofnotereason->setLabel('Why this find is considered noteworthy: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a reasoning', 'Available reasons' => $reason_options))->addValidator('InArray', false, array(array_keys($reason_options)))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Int'); //Find classification $class = new Zend_Form_Element_Text('classification'); $class->setLabel('Classification: ')->setAttrib('size', 60)->setRequired(false)->setAttribs(array('class' => 'span6', 'placeholder' => 'Do not put numismatic information here ' . '(such as penny), it is the wrong place for it.'))->addFilters(array('StripTags', 'StringTrim', 'Purifier')); //Find subclassification $subclass = new Zend_Form_Element_Text('subclass'); $subclass->setLabel('Sub-classification: ')->setRequired(false)->setAttribs(array('class' => 'span6', 'placeholder' => 'Do not put numismatic information here ' . '(such as penny), it is the wrong place for it.'))->addFilters(array('StripTags', 'StringTrim', 'Purifier')); //Inscription: Only available if !=coin $inscription = new Zend_Form_Element_Text('inscription'); $inscription->setLabel('Inscription: ')->setRequired(false)->setAttribs(array('class' => 'span6', 'placeholder' => 'This is for the inscription on objects, not coins'))->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->setAttrib('size', 60); //Treasure: enumerator 1/0 $treasure = new Zend_Form_Element_Checkbox('treasure'); $treasure->setLabel('Treasure: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim')); //Treasure: enumerator 1/0 $treasureID = new Zend_Form_Element_Text('treasureID'); $treasureID->setLabel('Treasure number: ')->setRequired(false)->setAttribs(array('placeholder' => 'T numbers are in the format of YYYYT1234', 'class' => 'span6'))->addValidator('Alnum', false, array('allowWhiteSpace' => false))->addFilters(array('StripTags', 'StringTrim', 'StringToUpper')); //Container for hoard $hoardcontainer = new Zend_Form_Element_Checkbox('hoardcontainer'); $hoardcontainer->setLabel('This find is a hoard container: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Int'); // Temporal details section // //Broadperiod: $broadperiod = new Zend_Form_Element_Select('broadperiod'); $broadperiod->setLabel('Broad period: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose broadperiod', 'Available periods' => $periodword_options))->addErrorMessage('You must enter a broad period.')->addValidator('InArray', false, array(array_keys($periodword_options)))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Period from: Assigned via dropdown $objdate1subperiod = new Zend_Form_Element_Select('objdate1subperiod'); $objdate1subperiod->setLabel('Sub period from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a subperiod', 'Valid sub periods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->setAttribs(array('class' => 'selectpicker show-menu-arrow')); //Period from: Assigned via dropdown $objdate1period = new Zend_Form_Element_Select('objdate1period'); $objdate1period->setLabel('Period from: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a period from', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $objdate1cert = new Zend_Form_Element_Radio('objdate1cert'); $objdate1cert->setLabel('Period from certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addValidator('Digits'); //Period from: Assigned via dropdown $objdate2subperiod = new Zend_Form_Element_Select('objdate2subperiod'); $objdate2subperiod->setLabel('Sub period to: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a subperiod', 'Valid sub periods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->addValidator('Digits')->setAttribs(array('class' => 'selectpicker show-menu-arrow')); //Period to: Assigned via dropdown $objdate2period = new Zend_Form_Element_Select('objdate2period'); $objdate2period->setLabel('Period to: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $objdate2cert = new Zend_Form_Element_Radio('objdate2cert'); $objdate2cert->setLabel('Period to certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addValidator('Digits'); $numdate1qual = new Zend_Form_Element_Radio('numdate1qual'); $numdate1qual->setLabel('Date certainty: ')->addMultiOptions($circa_o)->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addValidator('Digits'); //Date from: Free text Integer +ve or -ve $numdate1 = new Zend_Form_Element_Text('numdate1'); $numdate1->setLabel('Date from: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int'); $numdate2qual = new Zend_Form_Element_Radio('numdate2qual'); $numdate2qual->setLabel('Date certainty: ')->addMultiOptions($circa_o)->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addValidator('Digits'); //Date to: Free text Integer +ve or -ve $numdate2 = new Zend_Form_Element_Text('numdate2'); $numdate2->setLabel('Date to: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int'); //Ascribed culture: assigned via dropdown $culture = new Zend_Form_Element_Select('culture'); $culture->setLabel('Ascribed culture: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose ascribed culture', 'Available cultures' => $culture_options))->addValidator('InArray', false, array(array_keys($culture_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Period of reuse $reuse_period = new Zend_Form_Element_Select('reuse_period'); $reuse_period->setLabel('Period of reuse: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose period of reuse', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Evidence of reuse $reuse = new Zend_Form_Element_Text('reuse'); $reuse->setLabel('Evidence of reuse: ')->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim')); //METRICS SECTION// //Weight: grammes $weight = new Zend_Form_Element_Text('weight'); $weight->setLabel('Weight: ')->setAttrib('size', 5)->addValidator('Float')->setAttribs(array('placeholder' => 'Value in grammes - NOT kilogrammes'))->addFilters(array('StripTags', 'StringTrim')); //Height: millimetres $height = new Zend_Form_Element_Text('height'); $height->setLabel('Height: ')->setAttrib('size', 5)->addValidator('Float')->setAttribs(array('placeholder' => 'Value in millimetres'))->addFilters(array('StripTags', 'StringTrim')); //Length: millimetres $length = new Zend_Form_Element_Text('length'); $length->setLabel('Length: ')->setAttrib('size', 5)->addValidator('Float')->setAttribs(array('placeholder' => 'Value in millimetres'))->addFilters(array('StripTags', 'StringTrim')); //Diameter: millimetres $diameter = new Zend_Form_Element_Text('diameter'); $diameter->setLabel('Diameter: ')->setAttrib('size', 5)->setAttribs(array('placeholder' => 'Value in millimetres'))->addValidator('Float')->addFilters(array('StripTags', 'StringTrim')); // $width = new Zend_Form_Element_Text('width'); $width->setLabel('Width: ')->setAttrib('size', 5)->setAttribs(array('placeholder' => 'Value in millimetres'))->addValidator('Float')->addFilters(array('StripTags', 'StringTrim')); //Thickness: millimetres $thickness = new Zend_Form_Element_Text('thickness'); $thickness->setLabel('Thickness: ')->setAttrib('size', 5)->setAttribs(array('placeholder' => 'Value in millimetres'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Float'); //Quantity: positive integers only $quantity = new Zend_Form_Element_Text('quantity'); $quantity->setLabel('Quantity: ')->setRequired(true)->setValue('1')->setAttrib('size', 3)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits'); $material1 = new Zend_Form_Element_Select('material1'); $material1->setLabel('Primary material: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose primary material', 'Available materials' => $primary_options))->addValidator('InArray', false, array(array_keys($primary_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Secondary material $material2 = new Zend_Form_Element_Select('material2'); $material2->setLabel('Secondary material: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose secondary material', 'Available materials' => $primary_options))->addValidator('InArray', false, array(array_keys($primary_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Manufacture method $manmethod = new Zend_Form_Element_Select('manmethod'); $manmethod->setLabel('Manufacture method: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose method of manufacture', 'Available methods' => $man_options))->addValidator('InArray', false, array(array_keys($man_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Decoration method $decmethod = new Zend_Form_Element_Select('decmethod'); $decmethod->setLabel('Decoration method: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose decoration method', 'Available methods' => $decmeth_options))->addValidator('InArray', false, array(array_keys($decmeth_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Surface treatment $surftreat = new Zend_Form_Element_Select('surftreat'); $surftreat->setLabel('Surface Treatment: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose surface treatment', 'Available treatments' => $surface_options))->addValidator('InArray', false, array(array_keys($surface_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //decoration style $decstyle = new Zend_Form_Element_Select('decstyle'); $decstyle->setLabel('Decorative style: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose decorative style', 'Available styles' => $decoration_options))->addValidator('InArray', false, array(array_keys($decoration_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Preservation of object $preservation = new Zend_Form_Element_Select('preservation'); $preservation->setLabel('Preservation: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addMultiOptions(array(null => 'Choose level of preservation', 'Available states' => $preserve_options))->addValidator('InArray', false, array(array_keys($preserve_options)))->addValidator('Int')->setAttribs(array('class' => 'selectpicker show-menu-arrow')); //Completeness of object $completeness = new Zend_Form_Element_Radio('completeness'); $completeness->setLabel('Completeness: ')->addMultiOptions(array('4' => 'Complete', '2' => 'Incomplete', '1' => 'Fragment', '3' => 'Uncertain'))->setValue('4')->setOptions(array('separator' => ''))->addFilters(array('StripTags', 'StringTrim')); //Rally details $rally = new Zend_Form_Element_Checkbox('rally'); $rally->setLabel('Rally find: ')->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int'); $rallyID = new Zend_Form_Element_Select('rallyID'); $rallyID->setLabel('Found at this rally: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose rally name', 'Available rallies' => $rally_options))->addValidator('InArray', false, array(array_keys($rally_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow')); ## PERSONNEL INFORMATION (or personal depending on the way you see it!) // Identifier $finder = new Zend_Form_Element_Text('finder'); $finder->setLabel('Found by: ')->addFilters(array('StripTags', 'StringTrim'))->setDescription('To make a new finder/identifier appear, you ' . 'first need to create them from the people menu on ' . 'the left hand side'); $finderID = new Zend_Form_Element_Hidden('finderID'); $finderID->setRequired(false)->addFilters(array('StripTags', 'StringTrim')); $secondfinder = new Zend_Form_Element_Text('secondfinder'); $secondfinder->setLabel('Secondary finder: ')->addFilters(array('StripTags', 'StringTrim')); //Secondary finder $finder2ID = new Zend_Form_Element_Hidden('finder2ID'); $finder2ID->addFilters(array('StripTags', 'StringTrim')); $recordername = new Zend_Form_Element_Text('recordername'); $recordername->setLabel('Recorded by: ')->addFilters(array('StripTags', 'StringTrim')); //recorder information $recorderID = new Zend_Form_Element_Hidden('recorderID'); $recorderID->addFilters(array('StripTags', 'StringTrim')); $idBy = new Zend_Form_Element_Text('idBy'); $idBy->setLabel('Primary identifier: ')->addFilters(array('StripTags', 'StringTrim')); $identifier1ID = new Zend_Form_Element_Hidden('identifier1ID'); $identifier1ID->addFilters(array('StripTags', 'StringTrim')); $id2by = new Zend_Form_Element_Text('id2by'); $id2by->setLabel('Secondary Identifier: ')->addFilters(array('StripTags', 'StringTrim')); //Secondary Identifier $identifier2ID = new Zend_Form_Element_Hidden('identifier2ID'); $identifier2ID->setRequired(false)->addFilters(array('StripTags', 'StringTrim')); ##DISCOVERY INFORMATION //Discovery method $discmethod = new Zend_Form_Element_Select('discmethod'); $discmethod->setLabel('Discovery method: ')->setRequired(true)->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addValidator('inArray', true, array(array_keys($disc_options)))->addMultiOptions(array(null => 'Choose method of discovery', 'Available methods' => $disc_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow')); //Discovery circumstances $disccircum = new Zend_Form_Element_Text('disccircum'); $disccircum->setLabel('Discovery circumstances: ')->setAttrib('size', 50)->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim')); //Date found from $datefound1 = new Zend_Form_Element_Text('datefound1'); $datefound1->setLabel('First discovery date: ')->setAttrib('size', 10)->addFilters(array('StripTags', 'StringTrim')); //Date found to $datefound2 = new Zend_Form_Element_Text('datefound2'); $datefound2->setLabel('Second discovery date: ')->setAttrib('size', 10)->addFilters(array('StripTags', 'StringTrim')); ##OTHER REFERENCE NUMBERS //Other reference number $other_ref = new Zend_Form_Element_Text('other_ref'); $other_ref->setLabel('Other reference: ')->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim')); //SMR reference number $smrrefno = new Zend_Form_Element_Text('smr_ref'); $smrrefno->setLabel('Sites and Monuments record number: ')->setAttrib('size', 30)->addFilters(array('StripTags', 'StringTrim')); //Museum accession number $musaccno = new Zend_Form_Element_Text('musaccno'); $musaccno->setLabel('Museum accession number: ')->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim')); //Current location of object $curr_loc = new Zend_Form_Element_Text('curr_loc'); $curr_loc->setLabel('Current location: ')->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim')); //Current location of object $subs_action = new Zend_Form_Element_Select('subs_action'); $subs_action->setLabel('Subsequent action: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'span6')->addMultiOptions(array(null => 'Choose a subsequent action', 'Available options' => $actionsDD))->setValue(1)->addValidator('InArray', false, array(array_keys($actionsDD)))->addValidator('Int')->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow')); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $this->addElements(array($secuid, $old_findID, $objecttype, $broadperiod, $objdate1period, $objdate1subperiod, $objdate2subperiod, $objdate2period, $numdate1, $numdate2, $culture, $inscription, $description, $notes, $findofnote, $class, $subclass, $weight, $length, $thickness, $diameter, $height, $quantity, $manmethod, $surftreat, $treasure, $treasureID, $decstyle, $recordername, $recorderID, $idBy, $identifier1ID, $id2by, $identifier2ID, $finder, $finderID, $secondfinder, $finder2ID, $discmethod, $disccircum, $datefound1, $datefound2, $reuse, $reuse_period, $material1, $material2, $curr_loc, $smrrefno, $musaccno, $other_ref, $width, $preservation, $completeness, $findofnotereason, $rally, $objecttypecert, $rallyID, $objdate1cert, $objdate2cert, $submit, $subs_action, $numdate1qual, $numdate2qual, $hoardcontainer)); $this->addDisplayGroup(array('objecttype', 'objecttypecert', 'classification', 'subclass', 'description', 'notes', 'inscription', 'findofnote', 'findofnotereason', 'treasure', 'treasureID', 'hoardcontainer'), 'objectdetails'); $this->objectdetails->setLegend('Object details'); $this->addDisplayGroup(array('broadperiod', 'objdate1period', 'objdate1cert', 'objdate1subperiod', 'objdate2period', 'objdate2cert', 'objdate2subperiod', 'numdate1qual', 'numdate1', 'numdate2qual', 'numdate2', 'culture', 'reuse_period', 'reuse'), 'date'); $this->date->setLegend('Temporal details'); $this->addDisplayGroup(array('length', 'width', 'thickness', 'height', 'diameter', 'weight', 'quantity'), 'metrics'); $this->metrics->setLegend('Measurements'); $this->addDisplayGroup(array('material1', 'material2', 'manmethod', 'surftreat', 'decstyle', 'preservation', 'completeness'), 'methods'); $this->methods->setLegend('Methods of production and decoration'); $this->addDisplayGroup(array('recordername', 'recorderID', 'idBy', 'identifier1ID', 'id2by', 'identifier2ID'), 'people'); $this->people->setLegend('Recording details'); $this->addDisplayGroup(array('finder', 'finderID', 'secondfinder', 'finder2ID'), 'discoverers'); $this->discoverers->setLegend('Discoverer details'); $this->addDisplayGroup(array('disccircum', 'discmethod', 'datefound1', 'datefound2', 'rally', 'rallyID'), 'discovery'); $this->discovery->setLegend('Discovery details'); $this->addDisplayGroup(array('other_ref', 'smr_ref', 'musaccno', 'curr_loc', 'subs_action'), 'references'); $this->references->setLegend('Reference numbers'); $this->addDisplayGroup(array('submit'), 'buttons'); parent::init(); }