public function __construct($options = null) { $reeces = new Reeces(); $reeces_options = $reeces->getRevTypes(); 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('reversetype'); $type = new Zend_Form_Element_Text('type'); $type->setLabel('Reverse type inscription: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter an inscription.')->setDecorators($decorators)->setAttrib('size', 70); $translation = new Zend_Form_Element_Text('translation'); $translation->setLabel('Translation: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a translation.')->setDecorators($decorators)->setAttrib('size', 70); $description = new Zend_Form_Element_Text('description'); $description->setLabel('Description: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a translation.')->setDecorators($decorators)->setAttrib('size', 70); $gendate = new Zend_Form_Element_Text('gendate'); $gendate->setLabel('General date for reverse type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->addErrorMessage('You must enter a general date for this reverse type.')->setDecorators($decorators)->setAttrib('size', 30); $reeceID = new Zend_Form_Element_Select('reeceID'); $reeceID->setLabel('Reece period: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL, 'Choose reason' => $reeces_options))->addValidator('InArray', false, array(array_keys($reeces_options)))->setDecorators($decorators); $common = new Zend_Form_Element_Radio('common'); $common->setLabel('Is this reverse type commonly found: ')->setRequired(false)->addMultiOptions(array('1' => 'Yes', '2' => 'No'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setOptions(array('separator' => ''))->setDecorators($decorators); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag'); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800); $this->addElements(array($type, $gendate, $description, $translation, $reeceID, $common, $submit, $hash)); $this->addDisplayGroup(array('type', 'translation', 'description', 'gendate', 'reeceID', 'common', 'submit'), 'details'); $this->details->setLegend('Reverse type details: '); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->setLegend('Issuer or ruler details: '); $this->details->removeDecorator('DtDdWrapper'); $this->details->removeDecorator('HtmlTag'); }
/** The form constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { $reeces = new Reeces(); $reeces_options = $reeces->getOptions(); $rulers = new Rulers(); $rulers_options = $rulers->getOptions(); $dynasties = new Dynasties(); $dynasties_options = $dynasties->getOptions(); parent::__construct($options); $this->setName('EmperorDetails'); $name = new Zend_Form_Element_Text('name'); $name->setLabel('Emperor\'s name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('Enter an emperor name!'); $reeceID = new Zend_Form_Element_Select('reeceID'); $reeceID->setLabel('Reece period assigned: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a Reece period', 'Available periods' => $reeces_options))->addValidator('InArray', false, array(array_keys($reeces_options)))->addValidator('Int'); $pasID = new Zend_Form_Element_Select('pasID'); $pasID->setLabel('Database ID: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($rulers_options)))->addMultiOptions(array(null => 'Choose a database id', 'Available ids' => $rulers_options))->addValidator('Int')->addErrorMessage('You must assign the bio to an existing entry'); $date_from = new Zend_Form_Element_Text('date_from'); $date_from->setLabel('Issued coins from: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter a date for the start of reign'); $date_to = new Zend_Form_Element_Text('date_to'); $date_to->setLabel('Issued coins until: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter a date for the end of reign'); $biography = new Pas_Form_Element_CKEditor('biography'); $biography->setLabel('Biography: ')->setRequired(true)->addFilters(array('StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph'))->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400))->setAttrib('ToolbarSet', 'Finds')->addErrorMessage('You must enter a biography'); $dynasty = new Zend_Form_Element_Select('dynasty'); $dynasty->setLabel('Dynastic grouping: ')->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($dynasties_options)))->addMultiOptions(array(null => 'Choose a dynasty', 'Available dynasties' => $dynasties_options))->addErrorMessage('You must select a dynastic grouping'); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_salt)->setTimeout(4800); $submit = new Zend_Form_Element_Submit('submit'); $this->addElements(array($name, $reeceID, $pasID, $date_from, $date_to, $biography, $dynasty, $submit, $hash)); $this->addDisplayGroup(array('name', 'reeceID', 'pasID', 'date_from', 'date_to', 'biography', 'dynasty', 'submit'), 'details'); parent::init(); }
/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { $reeces = new Reeces(); $reeces_options = $reeces->getRevTypes(); parent::__construct($options); $this->setName('reversetype'); $type = new Zend_Form_Element_Text('type'); $type->setLabel('Reverse type inscription: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter an inscription.')->setAttrib('size', 70); $translation = new Zend_Form_Element_Text('translation'); $translation->setLabel('Translation: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a translation.')->setAttrib('size', 70); $description = new Zend_Form_Element_Text('description'); $description->setLabel('Description: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a translation.')->setAttrib('size', 70); $gendate = new Zend_Form_Element_Text('gendate'); $gendate->setLabel('General date for reverse type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a general date for this reverse type.')->setAttrib('size', 30); $reeceID = new Zend_Form_Element_Select('reeceID'); $reeceID->setLabel('Reece period: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a Reece period', 'Available Reece period' => $reeces_options))->addValidator('InArray', false, array(array_keys($reeces_options))); $common = new Zend_Form_Element_Radio('common'); $common->setLabel('Is this reverse type commonly found: ')->setRequired(false)->addMultiOptions(array('1' => 'Yes', '2' => 'No'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setOptions(array('separator' => '')); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_salt)->setTimeout(4800); $this->addElements(array($type, $gendate, $description, $translation, $reeceID, $common, $submit, $hash)); $this->addDisplayGroup(array('type', 'translation', 'description', 'gendate', 'reeceID', 'common', 'submit'), 'details'); $this->details->setLegend('Reverse type details: '); $this->details->setLegend('Issuer or ruler details: '); parent::init(); }
/** Set up the individual period * @access public * @return void * @throws Pas_Exception_Param */ public function periodAction() { if ($this->getParam('id', false)) { $id = (int) $this->getParam('id'); $this->view->periods = $this->_reeces->getReecePeriodDetail($id); $emperors = new Emperors(); $this->view->reeces = $emperors->getReeceDetail($id); $reverses = new RevTypes(); $this->view->reverses = $reverses->getRevTypeReece($id); } else { throw new Pas_Exception_Param($this->_missingParameter, 500); } }
/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { $periods = new Reeces(); $period_actives = $periods->getReeces(); parent::__construct($options); $this->setName('reeceEmpeor'); $reece_period = new Zend_Form_Element_Select('reeceperiod_id'); $reece_period->setLabel('Reece Period: ')->setRequired(true)->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose period', 'Available periods:' => $period_actives))->addValidator('InArray', false, array(array_keys($period_actives))); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_salt)->setTimeout(4800); $this->addElements(array($reece_period, $hash, $submit)); $this->addDisplayGroup(array('reeceperiod_id', 'period', 'valid', 'submit'), 'details'); $this->details->setLegend('Reece period to emperor: '); parent::init(); }
public function __construct($options = null) { $reeces = new Reeces(); $reeces_options = $reeces->getOptions(); $rulers = new Rulers(); $rulers_options = $rulers->getOptions(); $dynasties = new Dynasties(); $dynasties_options = $dynasties->getOptions(); 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('EmperorDetails'); $name = new Zend_Form_Element_Text('name'); $name->setLabel('Emperor\'s name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addErrorMessage('Come on it\'s not that hard, enter a firstname!')->setDecorators($decorators); $reeceID = new Zend_Form_Element_Select('reeceID'); $reeceID->setLabel('Reece period assigned: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose a Reece period' => $reeces_options))->addValidator('InArray', false, array(array_keys($reeces_options)))->addValidator('Int')->setDecorators($decorators); $pasID = new Zend_Form_Element_Select('pasID'); $pasID->setLabel('Database ID: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($rulers_options)))->addMultiOptions(array(NULL => NULL, 'Choose a database id' => $rulers_options))->addValidator('Int')->addErrorMessage('You must assign the bio to an existing entry')->setDecorators($decorators); $date_from = new Zend_Form_Element_Text('date_from'); $date_from->setLabel('Issued coins from: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter a date for the start of reign')->setDecorators($decorators); $date_to = new Zend_Form_Element_Text('date_to'); $date_to->setLabel('Issued coins until: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter a date for the end of reign')->setDecorators($decorators); $biography = new Pas_Form_Element_RTE('biography'); $biography->setLabel('Biography: ')->setRequired(true)->addFilters('StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addErrorMessage('You must enter a biography')->addDecorator('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')); $dynasty = new Zend_Form_Element_Select('dynasty'); $dynasty->setLabel('Dynastic grouping: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($dynasties_options)))->addMultiOptions(array(NULL => NULL, 'Choose a dynasty' => $dynasties_options))->addErrorMessage('You must select a dynastic grouping')->setDecorators($decorators); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag'); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60); $this->addElement($hash); $this->addElements(array($name, $reeceID, $pasID, $date_from, $date_to, $biography, $dynasty, $submit)); $this->addDisplayGroup(array('name', 'reeceID', 'pasID', 'date_from', 'date_to', 'biography', 'dynasty', 'submit'), 'details'); $this->details->addDecorators(array(array('HtmlTag', array('tag' => 'ul')))); $this->details->removeDecorator('HtmlTag'); $this->details->removeDecorator('DtDdWrapper'); $this->details->removeDecorator('HtmlTag'); }
/** Delete a reece period * @access public * @return void */ public function deletereeceperiodAction() { if ($this->_request->isPost()) { $id = (int) $this->_request->getPost('id'); $del = $this->_request->getPost('del'); if ($del == 'Yes' && $id > 0) { $reeces = new Reeces(); $where = 'id = ' . $id; $reeces->delete($where); } $this->redirect($this->_redirectUrl . 'reeceperiods/'); $this->getFlash()->addMessage('Reece Period details deleted! This cannot be undone.'); } else { $id = (int) $this->_request->getParam('id'); if ($id > 0) { $reeces = new Reeces(); $this->view->reece = $reeces->fetchRow('id =' . $id); } } }
public function __construct($options = null) { // Construct the select menu data $denominations = new Denominations(); $denomination_options = $denominations->getOptionsRoman(); $statuses = new Statuses(); $status_options = $statuses->getCoinStatus(); $dies = new Dieaxes(); $die_options = $dies->getAxes(); $wears = new Weartypes(); $wear_options = $wears->getWears(); $rulers = new Rulers(); $ro = $rulers->getRomanRulers(); $mints = new Mints(); $mo = $mints->getRomanMints(); $reeces = new Reeces(); $reece = $reeces->getOptions(); parent::__construct($options); $this->setAttrib('accept-charset', 'UTF-8'); $this->addPrefixPath('Pas_Form_Decorator', 'Pas/Form/Decorator/', 'decorator'); $this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element/', 'element'); $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('romancoin'); $denomination = new Zend_Form_Element_Select('denomination'); $denomination->setLabel('Denomination: ')->setRequired(true)->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options)))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a denomination'); $denomination_qualifier = new Zend_Form_Element_Radio('denomination_qualifier'); $denomination_qualifier->setLabel('Denomination qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $ruler = new Zend_Form_Element_Select('ruler_id'); $ruler->setLabel('Ruler: ')->setDecorators($decorators)->addMultiOptions(array(NULL => NULL, 'Choose a ruler' => $ro))->addValidator('InArray', false, array(array_keys($ro))); $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier'); $ruler_qualifier->setLabel('Ruler qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $mint_id = new Zend_Form_Element_Select('mint_id'); $mint_id->setLabel('Issuing mint: ')->setDecorators($decorators)->addMultiOptions(array(NULL => NULL, 'Choose a mint' => $mo))->addValidator('InArray', false, array(array_keys($mo)))->addFilters(array('StripTags', 'StringTrim')); $mint_qualifier = new Zend_Form_Element_Radio('mint_qualifier'); $mint_qualifier->setLabel('Mint qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $reeceID = new Zend_Form_Element_Select('reeceID'); $reeceID->setLabel('Reece period: ')->setDecorators($decorators)->addMultiOptions(array(NULL => NULL, 'Choose period' => $reece))->addValidator('InArray', false, array(array_keys($reece)))->addFilters(array('StripTags', 'StringTrim')); $moneyer = new Zend_Form_Element_Select('moneyer'); $moneyer->setLabel('Republican Moneyer: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim')); $moneyer_qualifier = new Zend_Form_Element_Radio('moneyer_qualifier'); $moneyer_qualifier->setLabel('Republican Moneyer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $revtypeID = new Zend_Form_Element_Select('revtypeID'); $revtypeID->setLabel('Reverse type: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim')); $revTypeID_qualifier = new Zend_Form_Element_Radio('revTypeID_qualifier'); $revTypeID_qualifier->setLabel('Reverse type qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $status = new Zend_Form_Element_Select('status'); $status->setLabel('Status: ')->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $wear_options))->addValidator('InArray', false, array(array_keys($wear_options)))->setDecorators($decorators); $status_qualifier = new Zend_Form_Element_Radio('status_qualifier'); $status_qualifier->setLabel('Status qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $degree_of_wear = new Zend_Form_Element_Select('degree_of_wear'); $degree_of_wear->setLabel('Degree of wear: ')->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $wear_options))->addValidator('InArray', false, array(array_keys($wear_options)))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim')); $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription'); $obverse_inscription->setLabel('Obverse inscription: ')->setAttrib('size', 50)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim')); $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription'); $reverse_inscription->setLabel('Reverse inscription: ')->setAttrib('size', 50)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim')); $obverse_description = new Zend_Form_Element_Textarea('obverse_description'); $obverse_description->setLabel('Obverse description: ')->setAttribs(array('rows' => 3, 'cols' => 80))->addFilters(array('StripTags', 'StringTrim')); $reverse_description = new Zend_Form_Element_Textarea('reverse_description'); $reverse_description->setLabel('Reverse description: ')->setAttribs(array('rows' => 3, 'cols' => 80))->addFilters(array('StripTags', 'StringTrim')); $reverse_mintmark = new Zend_Form_Element_Textarea('reverse_mintmark'); $reverse_mintmark->setLabel('Reverse mintmark: ')->setAttribs(array('rows' => 3, 'cols' => 80))->addFilters(array('StripTags', 'StringTrim')); $die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement'); $die_axis_measurement->setLabel('Die axis measurement: ')->addMultiOptions(array(NULL => NULL, 'Choose die axis' => $die_options))->addValidator('InArray', false, array(array_keys($die_options)))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim')); $die_axis_certainty = new Zend_Form_Element_Radio('die_axis_certainty'); $die_axis_certainty->setLabel('Die axis certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large'); $action = Zend_Controller_Front::getInstance()->getRequest()->getActionName(); if ($action == 'editcoin') { $rulers = new Rulers(); $ruler_options = $rulers->getRomanRulers(); $ruler->addMultiOptions(array(NULL => NULL, 'Choose ruler' => $ruler_options))->addValidator('InArray', false, array(array_keys($ruler_options))); $mints = new Mints(); $mint_options = $mints->getRomanMints(); $mint_id->addMultiOptions(array(NULL => NULL, 'Choose Roman mint' => $mint_options))->addValidator('InArray', false, array(array_keys($mint_options))); $reeces = new Reeces(); $reece_options = $reeces->getReeces(); $reeceID->addMultiOptions(array(NULL => NULL, 'Choose Reece period' => $reece_options))->addValidator('InArray', false, array(array_keys($reece_options))); } $this->addElements(array($ruler, $denomination, $moneyer, $mint_id, $reeceID, $status, $revtypeID, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $mint_qualifier, $ruler_qualifier, $denomination_qualifier, $status_qualifier, $revTypeID_qualifier, $reverse_mintmark, $submit, $hash)); $this->addDisplayGroup(array('denomination', 'denomination_qualifier', 'ruler_id', 'ruler_qualifier', 'mint_id', 'mint_qualifier', 'reeceID', 'revtypeID', 'revTypeID_qualifier', 'moneyer', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'reverse_mintmark', 'die_axis_measurement', 'die_axis_certainty'), 'details'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->removeDecorator('DtDdWrapper'); $this->addDisplayGroup(array('submit'), 'submit'); }
public function __construct($options = null) { $institutions = new Institutions(); $inst_options = $institutions->getInsts(); //Get data to form select menu for primary and secondary material $primaries = new Materials(); $primary_options = $primaries->getPrimaries(); //Get data to form select menu for periods //Get Rally data $rallies = new Rallies(); $rally_options = $rallies->getRallies(); //Get Hoard data $hoards = new Hoards(); $hoard_options = $hoards->getHoards(); $counties = new Counties(); $county_options = $counties->getCountyName2(); $rulers = new Rulers(); $ruler_options = $rulers->getRulersByzantine(); $denominations = new Denominations(); $denomination_options = $denominations->getDenomsByzantine(); $mints = new Mints(); $mint_options = $mints->getMintsByzantine(); $axis = new Dieaxes(); $axis_options = $axis->getAxes(); $reece = new Reeces(); $reece_options = $reece->getReeces(); $regions = new Regions(); $region_options = $regions->getRegionName(); parent::__construct($options); $this->setAttrib('accept-charset', 'UTF-8'); $this->clearDecorators(); $decorator = array('SimpleInput'); $decoratorButton = array('NormalDecButton'); $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li'))); $this->setName('byzantine-search'); $old_findID = new Zend_Form_Element_Text('old_findID'); $old_findID->setLabel('Find number: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addErrorMessage('Please enter a valid number!')->setDecorators($decorators)->setDisableTranslator(true); $description = new Zend_Form_Element_Text('description'); $description->setLabel('Object description contains: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addErrorMessage('Please enter a valid term')->setDecorators($decorators)->setDisableTranslator(true); $workflow = new Zend_Form_Element_Select('workflow'); $workflow->setLabel('Workflow stage: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addMultiOptions(array(NULL => NULL, 'Choose Worklow stage' => array('1' => 'Quarantine', '2' => 'On review', '3' => 'Awaiting validation', '4' => 'Published')))->setDecorators($decorators)->setDisableTranslator(true); //Rally details $rally = new Zend_Form_Element_Checkbox('rally'); $rally->setLabel('Rally find: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->setUncheckedValue(NULL)->setDecorators($decorators)->setDisableTranslator(true); $rallyID = new Zend_Form_Element_Select('rallyID'); $rallyID->setLabel('Found at this rally: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addMultiOptions(array(NULL => NULL, 'Choose rally name' => $rally_options))->setDecorators($decorators)->setDisableTranslator(true); $hoard = new Zend_Form_Element_Checkbox('hoard'); $hoard->setLabel('Hoard find: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->setUncheckedValue(NULL)->setDecorators($decorators); $hoardID = new Zend_Form_Element_Select('hID'); $hoardID->setLabel('Part of this hoard: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose rally name' => $hoard_options))->setDecorators($decorators); $county = new Zend_Form_Element_Select('county'); $county->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty'))->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->setDecorators($decorators); $district = new Zend_Form_Element_Select('district'); $district->setLabel('District: ')->addMultiOptions(array(NULL => 'Choose district after county'))->setRegisterInArrayValidator(false)->setDecorators($decorators)->disabled = true; $parish = new Zend_Form_Element_Select('parish'); $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose parish after county'))->setDecorators($decorators)->disabled = true; $regionID = new Zend_Form_Element_Select('regionID'); $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a region for a wide result', 'Choose region' => $region_options))->setDecorators($decorators); $gridref = new Zend_Form_Element_Text('gridref'); $gridref->setLabel('Grid reference: ')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'ValidGridRef'))->setDecorators($decorators); $fourFigure = new Zend_Form_Element_Text('fourFigure'); $fourFigure->setLabel('Four figure grid reference: ')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'ValidGridRef'))->setDecorators($decorators); ### ##Numismatic data ### //Denomination $denomination = new Zend_Form_Element_Select('denomination'); $denomination->setLabel('Denomination: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose denomination type' => $denomination_options))->setDecorators($decorators); //Primary ruler $ruler = new Zend_Form_Element_Select('ruler'); $ruler->setLabel('Ruler / issuer: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose primary ruler' => $ruler_options))->setDecorators($decorators); //Mint $mint = new Zend_Form_Element_Select('mint'); $mint->setLabel('Issuing mint: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose denomination type' => $mint_options))->setDecorators($decorators); //Obverse inscription $obverseinsc = new Zend_Form_Element_Text('obverseLegend'); $obverseinsc->setLabel('Obverse inscription contains: ')->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators); //Obverse description $obversedesc = new Zend_Form_Element_Text('obverseDescription'); $obversedesc->setLabel('Obverse description contains: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term')->setDecorators($decorators); //reverse inscription $reverseinsc = new Zend_Form_Element_Text('reverseLegend'); $reverseinsc->setLabel('Reverse inscription contains: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term')->setDecorators($decorators); //reverse description $reversedesc = new Zend_Form_Element_Text('reverseDescription'); $reversedesc->setLabel('Reverse description contains: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term')->setDecorators($decorators); //Die axis $axis = new Zend_Form_Element_Select('axis'); $axis->setLabel('Die axis measurement: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose measurement' => $axis_options))->setDecorators($decorators); $institution = new Zend_Form_Element_Select('institution'); $institution->setLabel('Recording institution: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose institution' => $inst_options))->setDecorators($decorators); $objecttype = new Zend_Form_Element_Hidden('objecttype'); $objecttype->setValue('coin'); $objecttype->removeDecorator('HtmlTag')->addFilters(array('StripTags', 'StringTrim'))->removeDecorator('DtDdWrapper')->removeDecorator('label'); $broadperiod = new Zend_Form_Element_Hidden('broadperiod'); $broadperiod->setValue('Byzantine')->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->removeDecorator('label'); // Submit button $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large'); $this->addElements(array($old_findID, $description, $workflow, $rally, $rallyID, $hoard, $hoardID, $county, $regionID, $district, $parish, $fourFigure, $gridref, $denomination, $ruler, $mint, $axis, $obverseinsc, $obversedesc, $reverseinsc, $reversedesc, $objecttype, $broadperiod, $institution, $submit)); $this->addDisplayGroup(array('denomination', 'ruler', 'mint', 'moneyer', 'axis', 'obverseLegend', 'obverseDescription', 'reverseLegend', 'reverseDescription'), 'numismatics'); $this->addDisplayGroup(array('old_findID', 'description', 'rally', 'rallyID', 'hoard', 'hID', 'workflow'), 'details'); $this->addDisplayGroup(array('county', 'regionID', 'district', 'parish', 'gridref', 'fourFigure', 'institution'), 'spatial'); $this->numismatics->setLegend('Numismatic details'); $this->numismatics->removeDecorator('DtDdWrapper'); $this->numismatics->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->setLegend('Artefact details'); $this->details->removeDecorator('DtDdWrapper'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->spatial->setLegend('Spatial details'); $this->spatial->removeDecorator('DtDdWrapper'); $this->spatial->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->addDisplayGroup(array('submit'), 'submit'); $this->addDecorator('FormElements')->addDecorator('Form')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'div')); $this->removeDecorator('DtDdWrapper'); }
/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { // Construct the select menu data $denominations = new Denominations(); $denomination_options = $denominations->getOptionsRoman(); $statuses = new Statuses(); $status_options = $statuses->getCoinStatus(); $dies = new Dieaxes(); $die_options = $dies->getAxes(); $wears = new WearTypes(); $wear_options = $wears->getWears(); $rulers = new Rulers(); $ro = $rulers->getRomanRulers(); $mints = new Mints(); $mo = $mints->getRomanMints(); $reeces = new Reeces(); $reece = $reeces->getOptions(); $money = new Moneyers(); $moneyers = $money->getRepublicMoneyers(); $reverse = new RevTypes(); $reverses = $reverse->getRevTypes(); parent::__construct($options); $this->setName('romancoin'); $denomination = new Zend_Form_Element_Select('denomination'); $denomination->setLabel('Denomination: ')->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose denomination', 'Valid denominations' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options)))->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a denomination'); $denomination_qualifier = new Zend_Form_Element_Radio('denomination_qualifier'); $denomination_qualifier->setLabel('Denomination qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => '')); $ruler = new Zend_Form_Element_Select('ruler_id'); $ruler->setLabel('Ruler: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a ruler', 'Valid rulers' => $ro))->addValidator('InArray', false, array(array_keys($ro))); $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier'); $ruler_qualifier->setLabel('Ruler qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => '')); $ricID = new Zend_Form_Element_Select('ricID'); $ricID->setLabel('Roman Imperial Coinage ID number: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Imperial')->addMultiOptions(array(null => 'Choose RIC type from Nomisma'))->setDescription('These identifiers are dynamically drawn from Nomisma.org. They have not parsed all volumes of RIC yet and it may take a short while to load.')->setRegisterInArrayValidator(false); $mint_id = new Zend_Form_Element_Select('mint_id'); $mint_id->setLabel('Issuing mint: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a mint', 'Valid mints' => $mo))->addValidator('InArray', false, array(array_keys($mo)))->addFilters(array('StripTags', 'StringTrim')); $mint_qualifier = new Zend_Form_Element_Radio('mint_qualifier'); $mint_qualifier->setLabel('Mint qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => '')); $reeceID = new Zend_Form_Element_Select('reeceID'); $reeceID->setLabel('Reece period: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a Reece period', 'Valid periods' => $reece))->addValidator('InArray', false, array(array_keys($reece)))->addFilters(array('StripTags', 'StringTrim')); $moneyer = new Zend_Form_Element_Select('moneyer'); $moneyer->setLabel('Republican Moneyer: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a moneyer', 'Valid moneyers' => $moneyers))->addValidator('InArray', false, array(array_keys($moneyers)))->addFilters(array('StripTags', 'StringTrim')); $moneyer_qualifier = new Zend_Form_Element_Radio('moneyer_qualifier'); $moneyer_qualifier->setLabel('Republican Moneyer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => '')); $rrcID = new Zend_Form_Element_Select('rrcID'); $rrcID->setLabel('Roman Republican Coinage ID number: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Republican')->addMultiOptions(array(null => 'Choose RRC type from Nomisma'))->setDescription('These identifiers are dynamically drawn from Nomisma.org and there maybe a short delay loading them.')->setRegisterInArrayValidator(false); $revtypeID = new Zend_Form_Element_Select('revtypeID'); $revtypeID->setLabel('Reverse type: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a reverse type', 'Valid reverses' => $reverses))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($reverses))); $revTypeID_qualifier = new Zend_Form_Element_Radio('revTypeID_qualifier'); $revTypeID_qualifier->setLabel('Reverse type qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => '')); $status = new Zend_Form_Element_Select('status'); $status->setLabel('Status: ')->setValue(1)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose coin status', 'Valid options' => $status_options))->addValidator('InArray', false, array(array_keys($status_options))); $status_qualifier = new Zend_Form_Element_Radio('status_qualifier'); $status_qualifier->setLabel('Status qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => '')); $degree_of_wear = new Zend_Form_Element_Select('degree_of_wear'); $degree_of_wear->setLabel('Degree of wear: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose coin wear status', 'Valid options' => $wear_options))->addValidator('InArray', false, array(array_keys($wear_options)))->addFilters(array('StripTags', 'StringTrim')); $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription'); $obverse_inscription->setLabel('Obverse inscription: ')->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim')); $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription'); $reverse_inscription->setLabel('Reverse inscription: ')->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim')); $obverse_description = new Zend_Form_Element_Textarea('obverse_description'); $obverse_description->setLabel('Obverse description: ')->setAttribs(array('rows' => 3, 'cols' => 80, 'class' => 'span6'))->addFilters(array('StripTags', 'StringTrim')); $reverse_description = new Zend_Form_Element_Textarea('reverse_description'); $reverse_description->setLabel('Reverse description: ')->setAttribs(array('rows' => 3, 'cols' => 80, 'class' => 'span6'))->addFilters(array('StripTags', 'StringTrim')); $reverse_mintmark = new Zend_Form_Element_Textarea('reverse_mintmark'); $reverse_mintmark->setLabel('Reverse mint mark: ')->setAttribs(array('rows' => 3, 'cols' => 80, 'class' => 'span6'))->addFilters(array('StripTags', 'StringTrim')); $die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement'); $die_axis_measurement->setLabel('Die axis measurement: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose die axis', 'Available axes' => $die_options))->addValidator('InArray', false, array(array_keys($die_options)))->addFilters(array('StripTags', 'StringTrim')); $die_axis_certainty = new Zend_Form_Element_Radio('die_axis_certainty'); $die_axis_certainty->setLabel('Die axis certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => '')); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $this->addElements(array($ruler, $denomination, $moneyer, $mint_id, $reeceID, $status, $revtypeID, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $mint_qualifier, $ruler_qualifier, $denomination_qualifier, $status_qualifier, $revTypeID_qualifier, $reverse_mintmark, $rrcID, $ricID, $submit)); $this->addDisplayGroup(array('denomination', 'denomination_qualifier', 'ruler_id', 'ruler_qualifier', 'ricID', 'mint_id', 'mint_qualifier', 'reeceID', 'revtypeID', 'revTypeID_qualifier', 'moneyer', 'rrcID', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'reverse_mintmark', 'die_axis_measurement', 'die_axis_certainty'), 'details'); $this->addDisplayGroup(array('submit'), 'buttons'); parent::init(); }
/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { $institutions = new Institutions(); $inst_options = $institutions->getInsts(); $rulers = new Rulers(); $ruler_options = $rulers->getRomanRulers(); $discs = new DiscoMethods(); $disc_options = $discs->getOptions(); $periods = new Periods(); $period_options = $periods->getPeriodFrom(); $periods = new Periods(); $periodword_options = $periods->getPeriodFromWords(); $reasons = new Findofnotereasons(); $reason_options = $reasons->getReasons(); $rallies = new Rallies(); $rally_options = $rallies->getRallies(); $counties = new OsCounties(); $county_options = $counties->getCountiesID(); $regions = new OsRegions(); $region_options = $regions->getRegionsID(); $terminalDates = new TerminalReasons(); $termOptions = $terminalDates->getReasons(); $qualityRatings = new DataQuality(); $qualityStreet = $qualityRatings->getRatings(); $current_year = date('Y'); $years = range(1650, $current_year); $years_list = array_combine($years, $years); $reeces = new Reeces(); $reece_options = $reeces->getReeces(); $siteclasses = new ArchaeologicalSiteClass(); $siteclass_options = $siteclasses->getOptions(); $contexts = new ArchaeologicalContexts(); $context_options = $contexts->getOptions(); $features = new ArchaeologicalFeatures(); $feature_options = $features->getOptions(); parent::__construct($options); $this->setName('AdvancedHoards'); $old_findID = new Zend_Form_Element_Text('old_findID'); $old_findID->setLabel('Find number: ')->addFilters(array('StringTrim', 'StripTags'))->addValidator('StringLength', false, array(3, 20))->addErrorMessage('Please enter a valid number!'); $objecttype = new Zend_Form_Element_Hidden('objecttype'); $objecttype->setValue('HOARD')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Please enter a valid object type!'); $description = new Zend_Form_Element_Text('description'); $description->setLabel('Hoard description contains: ')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Please enter a valid term'); //Find of note $findofnote = new Zend_Form_Element_Checkbox('note'); $findofnote->setLabel('Find of Note: ')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null); //Reason for find of note $findofnotereason = new Zend_Form_Element_Select('reason'); $findofnotereason->setLabel('Reason for noteworthy status: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose reason', 'Available reasons' => $reason_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow')); //Institution $institution = new Zend_Form_Element_Select('institution'); $institution->setLabel('Recording institution: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose institution', 'Available institutions' => $inst_options))->setAttribs(array('class' => 'input-medium selectpicker show-menu-arrow')); $notes = new Zend_Form_Element_Text('notes'); $notes->setLabel('Notes: ')->addFilters(array('StringTrim', 'StripTags')); $broadperiod = new Zend_Form_Element_Select('broadperiod'); $broadperiod->setLabel('Broad period: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $periodword_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $objdate1subperiod = new Zend_Form_Element_Select('fromsubperiod'); $objdate1subperiod->setLabel('Sub period from: ')->addMultiOptions(array(null => 'Choose sub-period from', 'Available sub period from' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => ''))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Period from: Assigned via dropdown $objdate1period = new Zend_Form_Element_Select('periodFrom'); $objdate1period->setLabel('Period from: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $objdate2subperiod = new Zend_Form_Element_Select('tosubperiod'); $objdate2subperiod->setLabel('Sub period to: ')->addMultiOptions(array(null => 'Choose sub-period from', 'Available subperiods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->setDisableTranslator(true)->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => ''))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Period to: Assigned via dropdown $objdate2period = new Zend_Form_Element_Select('periodTo'); $objdate2period->setLabel('Period to: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $from = new Zend_Form_Element_Text('fromdate'); $from->setLabel('Start date: ')->addFilters(array('StringTrim', 'StripTags'))->addValidators(array('NotEmpty', 'Int'))->addErrorMessage('Please enter a valid date')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC'))->setDescription('If you want to search for a date range, ' . 'enter a start date in this box and and end in the ' . 'box below. You do not need to add AD or BC'); $to = new Zend_Form_Element_Text('todate'); $to->setLabel('End date: ')->addFilters(array('StringTrim', 'StripTags'))->addValidators(array('NotEmpty', 'Int'))->addErrorMessage('Please enter a valid date')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $workflow = new Zend_Form_Element_Select('workflow'); $workflow->setLabel('Workflow stage: ')->addFilters(array('StringTrim', 'StripTags'))->addValidator('Int')->setAttribs(array('class' => 'input-medium selectpicker show-menu-arrow')); if (in_array($this->_role, $this->_higherlevel)) { $workflow->addMultiOptions(array(null => 'Available Workflow stages', 'Choose Worklow stage' => array('1' => 'Quarantine', '2' => 'On review', '4' => 'Awaiting validation', '3' => 'Published'))); } if (in_array($this->_role, $this->_restricted)) { $workflow->addMultiOptions(array(null => 'Available Workflow stages', 'Choose Worklow stage' => array('4' => 'Awaiting validation', '3' => 'Published'))); } $treasure = new Zend_Form_Element_Checkbox('treasure'); $treasure->setLabel('Treasure find: ')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null); $treasureID = new Zend_Form_Element_Text('TID'); $treasureID->setLabel('Treasure ID number: ')->addFilters(array('StringTrim', 'StripTags')); //Rally details $rally = new Zend_Form_Element_Checkbox('rally'); $rally->setLabel('Rally find: ')->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null); $rallyID = new Zend_Form_Element_Select('rallyID'); $rallyID->setLabel('Found at this rally: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose a rally', 'Available rallies' => $rally_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $other_ref = new Zend_Form_Element_Text('otherRef'); $other_ref->setLabel('Other reference: ')->addFilters(array('StringTrim', 'StripTags')); $smrRef = new Zend_Form_Element_Text('smrRef'); $smrRef->setLabel('SMR reference: ')->addFilters(array('StringTrim', 'StripTags')); $county = new Zend_Form_Element_Select('countyID'); $county->setLabel('County: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose county', 'Available counties' => $county_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow')); $district = new Zend_Form_Element_Select('districtID'); $district->setLabel('District: ')->addMultiOptions(array(null => 'Choose district after county'))->setRegisterInArrayValidator(false)->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow')); $parish = new Zend_Form_Element_Select('parishID'); $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose parish after county'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow')); $regionID = new Zend_Form_Element_Select('regionID'); $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->addValidator('Int')->addMultiOptions(array(null => 'Choose a region for a wide result', 'Choose region' => $region_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $gridref = new Zend_Form_Element_Text('gridref'); $gridref->setLabel('Grid reference: ')->addValidators(array('NotEmpty', 'ValidGridRef'))->addFilters(array('StringTrim', 'StripTags')); $fourFigure = new Zend_Form_Element_Text('fourFigure'); $fourFigure->setLabel('Four figure grid reference: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags')); $idBy = new Zend_Form_Element_Text('idBy'); $idBy->setLabel('Primary identifier: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags')); $identifierID = new Zend_Form_Element_Hidden('identifierID'); $identifierID->addFilters(array('StringTrim', 'StripTags')); $created = new Zend_Form_Element_Text('createdBefore'); $created->setLabel('Date record created on or before: ')->addFilters(array('StringTrim', 'StripTags')); $created2 = new Zend_Form_Element_Text('createdAfter'); $created2->setLabel('Date record created on or after: ')->addFilters(array('StringTrim', 'StripTags')); $updated = new Zend_Form_Element_Text('updatedBefore'); $updated->setLabel('Date record updated on or before: ')->addFilters(array('StringTrim', 'StripTags')); $updated2 = new Zend_Form_Element_Text('updatedAfter'); $updated2->setLabel('Date record updated on or after: ')->addFilters(array('StringTrim', 'StripTags')); $finder = new Zend_Form_Element_Text('finder'); $finder->setLabel('Found by: ')->addFilters(array('StringTrim', 'StripTags')); $finderID = new Zend_Form_Element_Hidden('finderID'); $finderID->addFilters(array('StringTrim', 'StripTags')); $recordby = new Zend_Form_Element_Text('recordername'); $recordby->setLabel('Recorded by: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'))->setAttrib('autoComplete', 'true'); $recorderID = new Zend_Form_Element_Hidden('recorderID'); $recorderID->addFilters(array('StringTrim', 'StripTags')); $discoverydate = new Zend_Form_Element_Select('discovered'); $discoverydate->setLabel('Year of discovery')->setMultiOptions(array(null => 'Choose a year of discovery', 'Date range' => $years_list))->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel('Submit your search'); $woeid = new Zend_Form_Element_Text('woeid'); $woeid->setLabel('Where on earth ID: ')->addValidator('Int')->addFilters(array('StripTags', 'StringTrim')); $elevation = new Zend_Form_Element_Text('elevation'); $elevation->setLabel('Elevation: ')->addValidator('Int')->addFilters(array('StripTags', 'StringTrim')); $lastRulerID = new Zend_Form_Element_Select('lastRulerID'); $lastRulerID->setLabel('Last Ruler: ')->addValidator('Int')->addMultiOptions(array(null => 'Choose primary ruler', 'Available rulers' => $ruler_options))->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setDescription('You need to pick a broad period first')->setRegisterInArrayValidator(false); $termDate1 = new Zend_Form_Element_Text('fromTerminalYear'); $termDate1->setLabel('Terminal year from: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $termDate2 = new Zend_Form_Element_Text('toTerminalYear'); $termDate2->setLabel('Terminal year to: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $qualityRatingNum = new Zend_Form_Element_Select('qualityRatingNumismatic'); $qualityRatingNum->setLabel('Coin data quality rating: ')->addMultiOptions(array(null => 'Choose quality rating', 'Available options' => $qualityStreet))->addValidator('Int')->addValidator('InArray', false, array(array_keys($qualityStreet)))->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $qualityRatingArch = new Zend_Form_Element_Select('qualityRatingArchaeological'); $qualityRatingArch->setLabel('Archaeology data quality rating: ')->addMultiOptions(array(null => 'Choose quality rating', 'Available options' => $qualityStreet))->addValidator('Int')->addValidator('InArray', false, array(array_keys($qualityStreet)))->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $qualityRatingFindspot = new Zend_Form_Element_Select('qualityRatingFindspot'); $qualityRatingFindspot->setLabel('Findspot data quality rating: ')->addMultiOptions(array(null => 'Choose quality rating', 'Available options' => $qualityStreet))->addValidator('Int')->addValidator('InArray', false, array(array_keys($qualityStreet)))->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $terminalReasonID = new Zend_Form_Element_Select('terminalReasonID'); $terminalReasonID->setLabel('Terminal date reasoning: ')->addMultiOptions(array(null => 'Choose terminal reasoning', 'Available options' => $termOptions))->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $excavatedYear1 = new Zend_Form_Element_Text('excavatedYear1'); $excavatedYear1->setLabel('Excavated year first date: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $excavatedYear2 = new Zend_Form_Element_Text('excavatedYear2'); $excavatedYear2->setLabel('Excavated year end date: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $archaeologicalDescription = new Zend_Form_Element_Text('archaeologyDescription'); $archaeologicalDescription->setLabel('Archaeological description contains: '); //Period from: Assigned via dropdown $archdate1period = new Zend_Form_Element_Select('archaeologyPeriodFrom'); $archdate1period->setLabel('Period from: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); //Period to: Assigned via dropdown $archdate2period = new Zend_Form_Element_Select('archaeologyPeriodTo'); $archdate2period->setLabel('Period to: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow')); $siteDateYear1 = new Zend_Form_Element_Text('siteDateYear1'); $siteDateYear1->setLabel('Site date from: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $siteDateYear2 = new Zend_Form_Element_Text('siteDateYear2'); $siteDateYear2->setLabel('Site date to: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $featureDateYear1 = new Zend_Form_Element_Text('featureDateYear1'); $featureDateYear1->setLabel('Feature date from: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $featureDateYear2 = new Zend_Form_Element_Text('featureDateYear2'); $featureDateYear2->setLabel('Feature date to: ')->setAttribs(array('placeholder' => 'Positive for AD, negative for BC')); $knownSite = new Zend_Form_Element_Checkbox('knownSite'); $knownSite->setLabel('Known site: ')->setUncheckedValue(null); $excavated = new Zend_Form_Element_Checkbox('excavated'); $excavated->setLabel('Excavated: ')->setUncheckedValue(null); $siteclass = new Zend_Form_Element_Select('siteClassID'); $siteclass->setLabel('Site class: ')->addMultioptions(array(null => 'Choose class of site', 'Available classes' => $siteclass_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($siteclass_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow'); $arch_context = new Zend_Form_Element_Select('siteContextID'); $arch_context->setLabel('Context: ')->addMultioptions(array(null => 'Choose a context', 'Available contexts' => $context_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($context_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow'); $arch_feature = new Zend_Form_Element_Select('featureID'); $arch_feature->setLabel('Feature: ')->addMultioptions(array(null => 'Choose a feature', 'Available features' => $feature_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($feature_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow'); $quantityCoins = new Zend_Form_Element_Text('quantityCoins'); $quantityCoins->setLabel('Quantity of coins in hoard: '); $quantityCoins->setDescription('This searches for an exact quantity. ' . 'To search for a range use advanced search syntax in the simple ' . 'search box'); $quantityArtefacts = new Zend_Form_Element_Text('quantityArtefacts'); $quantityArtefacts->setLabel('Quantity of artefacts in hoard: '); $quantityArtefacts->setDescription('This searches for an exact quantity. ' . 'To search for a range use advanced search syntax in the simple ' . 'search box'); $quantityContainers = new Zend_Form_Element_Text('quantityContainers'); $quantityContainers->setLabel('Quantity of containers in hoard: '); $quantityContainers->setDescription('This searches for an exact quantity. ' . 'To search for a range use advanced search syntax in the simple ' . 'search box'); $legacyID = new Zend_Form_Element_Text('legacyID'); $legacyID->setLabel('Legacy hoard database number: '); //Reece $reece = new Zend_Form_Element_Select('reeceID'); $reece->setLabel('Reece period: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose Reece period', 'Available Reece periods' => $reece_options))->addValidator('InArray', false, array(array_keys($reece_options)))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow'); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_salt)->setTimeout(4800); if (in_array($this->_role, $this->_restricted)) { $this->addElements(array($old_findID, $objecttype, $broadperiod, $description, $from, $to, $workflow, $findofnote, $findofnotereason, $rally, $rallyID, $other_ref, $notes, $objdate1period, $termDate1, $objdate2period, $county, $regionID, $district, $parish, $fourFigure, $treasure, $treasureID, $discoverydate, $created, $created2, $updated, $updated2, $submit, $elevation, $woeid, $institution, $hash, $smrRef, $lastRulerID, $termDate2, $terminalReasonID, $qualityRatingNum, $qualityRatingArch, $qualityRatingFindspot, $archaeologicalDescription, $excavatedYear1, $excavatedYear2, $featureDateYear1, $featureDateYear2, $knownSite, $excavated, $siteclass, $arch_context, $arch_feature, $quantityArtefacts, $quantityCoins, $quantityContainers, $legacyID, $reece, $archdate1period, $archdate2period)); } else { $this->addElements(array($old_findID, $objecttype, $broadperiod, $description, $from, $to, $workflow, $findofnote, $findofnotereason, $rally, $rallyID, $other_ref, $notes, $objdate1period, $objdate2period, $county, $regionID, $district, $parish, $fourFigure, $elevation, $woeid, $treasure, $treasureID, $discoverydate, $created, $created2, $updated, $updated2, $idBy, $finder, $finderID, $recordby, $recorderID, $identifierID, $lastRulerID, $submit, $institution, $archaeologicalDescription, $smrRef, $hash, $termDate1, $termDate2, $terminalReasonID, $qualityRatingNum, $qualityRatingArch, $qualityRatingFindspot, $excavatedYear1, $excavatedYear2, $featureDateYear1, $featureDateYear2, $siteclass, $arch_context, $arch_feature, $knownSite, $excavated, $quantityArtefacts, $quantityCoins, $quantityContainers, $legacyID, $reece, $archdate1period, $archdate2period)); } $this->addDisplayGroup(array('old_findID', 'objecttype', 'description', 'notes', 'note', 'reason', 'treasure', 'TID', 'rally', 'rallyID', 'workflow', 'otherRef', 'smrRef', 'quantityArtefacts', 'quantityCoins', 'quantityContainers'), 'details'); $this->details->setLegend('Main details: '); $this->addDisplayGroup(array('broadperiod', 'periodFrom', 'periodTo', 'fromdate', 'todate'), 'temporaldetails'); $this->temporaldetails->setLegend('Dates and periods: '); $this->addDisplayGroup(array('lastRulerID', 'reeceID', 'fromTerminalYear', 'toTerminalYear', 'terminalReasonID', 'legacyID', 'qualityRatingNumismatic'), 'numismatics'); $this->numismatics->setLegend('Numismatic analysis: '); $this->addDisplayGroup(array('knownSite', 'excavated', 'archaeologyPeriodFrom', 'archaeologyPeriodTo', 'archaeologyDescription', 'excavatedYear1', 'excavatedYear2', 'siteClassID', 'siteContextID', 'featureID', 'featureDateYear1', 'featureDateYear2', 'qualityRatingArchaeological'), 'archaeology'); $this->archaeology->setLegend('Archaeological context: '); $this->addDisplayGroup(array('countyID', 'regionID', 'districtID', 'parishID', 'fourFigure', 'elevation', 'woeid', 'qualityRatingFindspot'), 'Spatial'); $this->Spatial->setLegend('Spatial details: '); if (in_array($this->_role, $this->_restricted)) { $this->addDisplayGroup(array('institution', 'createdAfter', 'createdBefore', 'updatedAfter', 'updatedBefore', 'discovered'), 'Discovery'); } else { $this->addDisplayGroup(array('institution', 'finder', 'idBy', 'identifierID', 'recordername', 'recorderID', 'createdAfter', 'createdBefore', 'updatedAfter', 'updatedBefore', 'discovered'), 'Discovery'); } $this->Discovery->setLegend('Discovery details: '); $this->addDisplayGroup(array('submit'), 'buttons'); parent::init(); }
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 reeceAction() { if ($this->_getParam('term', false)) { $reeces = new Reeces(); $reece_options = $reeces->getRulerReece($this->_getParam('term')); $reeces2 = new Reeces(); $reece2_options = $reeces->getReeceUnassigned(); if ($reece_options) { echo Zend_Json::encode($reece_options); } else { echo Zend_Json::encode($reece2_options); } } else { $error = array(array('id' => NULL, 'term' => 'No ruler specified')); echo Zend_Json::encode($error); } }
public function __construct($options = null) { $primaries = new Materials(); $primary_options = $primaries->getPrimaries(); $institutions = new Institutions(); $inst_options = $institutions->getInsts(); $rallies = new Rallies(); $rally_options = $rallies->getRallies(); $hoards = new Hoards(); $hoard_options = $hoards->getHoards(); $counties = new Counties(); $county_options = $counties->getCountyName2(); $rulers = new Rulers(); $ruler_options = $rulers->getEarlyMedRulers(); $denominations = new Denominations(); $denomination_options = $denominations->getOptionsEarlyMedieval(); $mints = new Mints(); $mint_options = $mints->getEarlyMedievalMints(); $axis = new Dieaxes(); $axis_options = $axis->getAxes(); $reece = new Reeces(); $reece_options = $reece->getReeces(); $cats = new CategoriesCoins(); $cat_options = $cats->getPeriodEarlyMed(); $regions = new Regions(); $region_options = $regions->getRegionName(); 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('earlymedsearch'); $old_findID = new Zend_Form_Element_Text('old_findID'); $old_findID->setLabel('Find number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->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))->setDecorators($decorators); $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 => NULL, 'Choose rally name' => $hoard_options))->setDecorators($decorators); $county = new Zend_Form_Element_Select('county'); $county->setLabel('County: ')->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators); $district = new Zend_Form_Element_Select('district'); $district->setLabel('District: ')->addMultiOptions(array(NULL => 'Choose district after county'))->addFilters(array('StripTags', 'StringTrim'))->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)->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'))->addValidator('ValidGridRef')->setDecorators($decorators); $fourFigure = new Zend_Form_Element_Text('fourFigure'); $fourFigure->setLabel('Four figure grid reference: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('ValidGridRef')->setDecorators($decorators); $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' => $denomination_options))->setDecorators($decorators); $cat = new Zend_Form_Element_Select('category'); $cat->setLabel('Category: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose an Early Medieval category', 'Available categories' => $cat_options))->setDecorators($decorators); $type = new Zend_Form_Element_Select('typeID'); $type->setLabel('Coin type: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators); //Primary ruler $ruler = new Zend_Form_Element_Select('ruler'); $ruler->setLabel('Ruler / issuer: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose primary ruler', 'Available options' => $ruler_options))->setDecorators($decorators); //Mint $mint = new Zend_Form_Element_Select('mint'); $mint->setLabel('Issuing mint: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose issuing mint', 'Available mints' => $mint_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: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a die axis measurement', 'Available options' => $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('Early Medieval')->setAttrib('class', 'none')->removeDecorator('label')->addFilter('StringToUpper')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper'); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->setLabel('Submit'); $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, $institution)); $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('category', 'ruler', 'typeID', 'denomination', 'mint', 'moneyer', 'axis', 'obverseLegend', 'obverseDescription', 'reverseLegend', 'reverseDescription'), '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->addDecorator('FormElements')->addDecorator('Form')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'div')); }
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']) . ' » '; } } //Broadperiod if (array_key_exists('broadperiod', $params)) { if (!is_null($params['broadperiod'])) { echo 'Broadperiod: ' . $this->view->escape($params['broadperiod']) . ' » '; } } //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']) . ' » '; } } //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']) . ' » '; } } } 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']) . ' » '; } } } if (array_key_exists('parish', $params)) { if (!is_null($params['parish'])) { echo 'Parish: ' . $this->view->escape($params['parish']) . ' » '; } } if (array_key_exists('district', $params)) { if (!is_null($params['district'])) { echo '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) { echo 'Denomination type: ' . $this->view->escape($denom['denomination']) . ' » '; } } if (array_key_exists('description', $params)) { if (!is_null($params['description'])) { echo 'Description contained: ' . $this->view->escape($params['description']) . ' » '; } } if (array_key_exists('fourFigure', $params)) { if (!is_null($params['fourFigure'])) { echo 'Four figure grid reference: ' . $this->view->escape($params['fourFigure']) . ' » '; } } if (array_key_exists('old_findID', $params)) { if (!is_null($params['old_findID'])) { echo 'Find reference number: ' . $this->view->escape($params['old_findID']) . ' » '; } } if (array_key_exists('fromsubperiod', $params)) { if (!is_null($params['fromsubperiod'])) { $sub = $params['fromsubperiod']; if ($sub == 1) { echo 'Subperiod: Early' . ' » '; } else { if ($sub == 2) { echo 'Subperiod: Middle' . ' » '; } else { if ($sub == 3) { echo 'Subperiod: Late' . ' » '; } } } } } if (array_key_exists('tosubperiod', $params)) { if (!is_null($params['tosubperiod'])) { $sub = $params['tosubperiod']; if ($sub == 1) { echo 'Subperiod: Early' . ' » '; } else { if ($sub == 2) { echo 'Subperiod: Middle' . ' » '; } else { if ($sub == 3) { echo '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) { echo '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) { echo 'Period to: ' . $this->view->escape($period['term']) . ' » '; } } } // 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']) . ' » '; } } } if (array_key_exists('class', $params)) { if (!is_null($params['class'])) { echo 'Classification term like: ' . $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); } } echo 'Date from greater or equal to: ' . (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); } } echo 'Date from smaller or equal to: ' . $date . ' » '; } } //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']) . ' » '; } } //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']) . ' » '; } } } //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']) . ' » '; } } } //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']) . ' » '; } } } //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']) . ' » '; } } } 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'])) . ' » '; } } 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'])) . ' » '; } } if (array_key_exists('hoard', $params)) { if ((int) $params['hoard'] == (int) 1) { echo '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) { echo 'Part of the ' . $this->view->escape($hid['term']) . ' hoard.' . ' » '; } } } 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']) . ' » '; } } } 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']) . ' » '; } } } 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']) . ' » '; } } } //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'] . ')' . ' » '; } } } //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']) . ' » '; } } } 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'] . ' » '; } } } //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>' . ' » '; } } } //End of function echo '</ul>'; } }
/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { ## GET OPTIONS TO POPULATE MENUS ## //Get periods for select menu $periods = new Periods(); $period_options = $periods->getPeriodFrom(); $periodword_options = $periods->getPeriodFromWords(); //Get terminal reasons for select menu $terminalreasons = new TerminalReasons(); $terminalreason_options = $terminalreasons->getReasons(); //Get coin data quality ratings for select menu $qualityrating = new DataQuality(); $qualityrating_options = $qualityrating->getRatings(); //Get Find of note reason options for select menu $reasons = new Findofnotereasons(); $reason_options = $reasons->getReasons(); //Get primary materials for multiselect $primarymaterials = new Materials(); $materials_options = $primarymaterials->getPrimaries(); //Get discovery methods for select menu $discs = new DiscoMethods(); $disc_options = $discs->getOptions(); //Get Rally data for select menu $rallies = new Rallies(); $rally_options = $rallies->getRallies(); //Get Subsequent actions for select menu $actions = new SubsequentActions(); $actionsDD = $actions->getSubActionsDD(); //Get the reece periods for inclusion $reece = new Reeces(); $reeces = $reece->getReeces(); //End of select options construction $this->addElementPrefixPath('Pas_Filter', 'Pas/Filter/', 'filter'); parent::__construct($options); $this->setName('hoards'); ## UNIQUE ID FIELDS ## $secuid = new Zend_Form_Element_Hidden('secuid'); $secuid->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum'); $old_hoardID = new Zend_Form_Element_Hidden('hoardID'); $old_hoardID->addFilters(array('StripTags', 'StringTrim')); ## HOARD DATING ## //Broadperiod: $broadperiod = new Zend_Form_Element_Select('broadperiod'); $broadperiod->setLabel('Broad period: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose broadperiod', 'Available periods' => $periodword_options))->addErrorMessage('You must enter a broad period.')->addValidator('InArray', false, array(array_keys($periodword_options)))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(1); //Sub period from: Assigned via dropdown $hoardsubperiod1 = new Zend_Form_Element_Select('subperiod1'); $hoardsubperiod1->setLabel('Sub period from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a subperiod', 'Valid sub periods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->setAttribs(array('class' => 'selectpicker show-menu-arrow'))->setOrder(2); //Period from: Assigned via dropdown $hoardperiod1 = new Zend_Form_Element_Select('period1'); $hoardperiod1->setLabel('Period from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a period from', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(3); //Sub period to: Assigned via dropdown $hoardsubperiod2 = new Zend_Form_Element_Select('subperiod2'); $hoardsubperiod2->setLabel('Sub period to: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a subperiod', 'Valid sub periods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->addValidator('Digits')->setAttribs(array('class' => 'selectpicker show-menu-arrow'))->setOrder(4); //Period to: Assigned via dropdown $hoardperiod2 = new Zend_Form_Element_Select('period2'); $hoardperiod2->setLabel('Period to: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(5); //Date from: Free text Integer +ve or -ve $numdate1 = new Zend_Form_Element_Text('numdate1'); $numdate1->setLabel('Date from: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(6); //Date to: Free text Integer +ve or -ve $numdate2 = new Zend_Form_Element_Text('numdate2'); $numdate2->setLabel('Date to: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(7); ## COIN DATING ## //Ruler of latest coins in hoard: $lastruler = new Zend_Form_Element_Select('lastrulerID'); $lastruler->setLabel('Last ruler: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose ruler after broad period'))->setRegisterInArrayValidator(false)->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(8); //Ruler of latest coins in hoard: $lastreeceperiod = new Zend_Form_Element_Select('reeceID'); $lastreeceperiod->setLabel('Last Reece period: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose Reece period', 'Available periods' => $reeces))->setRegisterInArrayValidator(false)->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(9); //Date from: Free text Integer +ve or -ve $terminaldate1 = new Zend_Form_Element_Text('terminalyear1'); $terminaldate1->setLabel('Terminal date from: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(10); //Date to: Free text Integer +ve or -ve $terminaldate2 = new Zend_Form_Element_Text('terminalyear2'); $terminaldate2->setLabel('Terminal date to: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(11); //Reason for terminal coin dating $terminalreason = new Zend_Form_Element_Select('terminalreason'); $terminalreason->setLabel('Terminal reason: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a reasoning', 'Available reasons' => $terminalreason_options))->addValidator('InArray', false, array(array_keys($terminalreason_options)))->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow')->addValidator('Int')->setOrder(12); ## HOARD DETAILS ## //Hoard description $description = new Pas_Form_Element_CKEditor('description'); $description->setLabel('Hoard description: ')->setRequired(false)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->setOrder(13); //Object notes $notes = new Pas_Form_Element_CKEditor('notes'); $notes->setLabel('Notes: ')->setRequired(false)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->setOrder(14); //Coin data quality rating $coindataquality = new Zend_Form_Element_Select('qualityrating'); $coindataquality->setLabel('Coin data quality rating: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a rating', 'Available ratings' => $qualityrating_options))->addValidator('InArray', false, array(array_keys($qualityrating_options)))->setAttrib('class', 'input-large selectpicker show-menu-arrow')->setDescription('This data quality field can only be completed by hoards project staff')->addValidator('Int')->setOrder(15); //Find of note $findofnote = new Zend_Form_Element_Checkbox('findofnote'); $findofnote->setLabel('Find of Note: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('NotEmpty', 'Int')->setOrder(16); //Reason for find of note $findofnotereason = new Zend_Form_Element_Select('findofnotereason'); $findofnotereason->setLabel('Why this find is considered noteworthy: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a reasoning', 'Available reasons' => $reason_options))->addValidator('InArray', false, array(array_keys($reason_options)))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Int')->setOrder(17); //Treasure: enumerator 1/0 $treasure = new Zend_Form_Element_Checkbox('treasure'); $treasure->setLabel('Treasure: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(18); //Treasure ID $treasureID = new Zend_Form_Element_Text('treasureID'); $treasureID->setLabel('Treasure number: ')->setRequired(false)->setAttribs(array('placeholder' => 'T numbers are in the format of YYYYT1234', 'class' => 'span6'))->addValidator('Alnum', false, array('allowWhiteSpace' => false))->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'))->setOrder(19); ## QUANTITIES ## $quantityCoins = new Zend_Form_Element_Text('quantityCoins'); $quantityCoins->setLabel('Quantity of coins: ')->addValidator('Int')->setOrder(20); $quantityArtefacts = new Zend_Form_Element_Text('quantityArtefacts'); $quantityArtefacts->setLabel('Quantity of artefacts: ')->addValidator('Int')->setOrder(21); $quantityContainers = new Zend_Form_Element_Text('quantityContainers'); $quantityContainers->setLabel('Quantity of containers: ')->addValidator('Int')->setOrder(22); ## MATERIALS ## //Materials $materials = new Zend_Form_Element_Multiselect('materials'); $materials->setLabel('Primary materials: ')->addMultiOptions($materials_options)->setAttrib('class', 'multiselect')->setDescription('Primary materials of coins and artefacts in the hoard')->addFilters(array('Null'))->setOrder(23); ## RECORDING DETAILS ## //Recorder $recorderID = new Zend_Form_Element_Hidden('recorderID'); $recorderID->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(24); $recordername = new Zend_Form_Element_Text('recordername'); $recordername->setLabel('Recorded by: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(25); //Primary Identifier $idBy = new Zend_Form_Element_Text('idBy'); $idBy->setLabel('Primary identifier: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(26); $identifier1ID = new Zend_Form_Element_Hidden('identifier1ID'); $identifier1ID->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(27); $id2by = new Zend_Form_Element_Text('id2by'); $id2by->setLabel('Secondary Identifier: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(28); //Secondary Identifier $identifier2ID = new Zend_Form_Element_Hidden('identifier2ID'); $identifier2ID->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(29); ## DISCOVERER DETAILS ## //Finder $finder1ID = new Zend_Form_Element_Hidden('finder1ID'); $finder1ID->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(30); $hiddenfield = new Zend_Form_Element_Hidden('hiddenfield'); $hiddenfield->setValue(2)->setOrder(31); $finder1 = new Zend_Form_Element_Text('finder1'); $finder1->setLabel('Found by: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setDescription('To make a new finder/identifier appear, you ' . 'first need to create them from the people menu on ' . 'the left hand side')->setOrder(32); $addFinderButton = new Zend_Form_Element_Button('addFinder'); $addFinderButton->setLabel('Add Additional Finder')->setAttribs(array('class' => 'btn btn-info')); $addFinderButton->setOrder(50); $removeFinderButton = new Zend_Form_Element_Button('removeFinder'); $removeFinderButton->setLabel('Remove Last Finder')->setAttribs(array('class' => 'btn btn-warning hidden')); $removeFinderButton->setOrder(51); ## DISCOVERY INFORMATION ## //Discovery method $discmethod = new Zend_Form_Element_Select('discmethod'); $discmethod->setLabel('Discovery method: ')->setRequired(false)->setValue(1)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->addValidator('inArray', true, array(array_keys($disc_options)))->addMultiOptions(array(null => 'Choose method of discovery', 'Available methods' => $disc_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->setOrder(52); //Discovery circumstances $disccircum = new Zend_Form_Element_Text('disccircum'); $disccircum->setLabel('Discovery circumstances: ')->setAttrib('size', 50)->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(53); //Date found from $datefound1 = new Zend_Form_Element_Text('datefound1'); $datefound1->setLabel('First discovery date: ')->setAttrib('size', 10)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(54); //Date found to $datefound2 = new Zend_Form_Element_Text('datefound2'); $datefound2->setLabel('Second discovery date: ')->setAttrib('size', 10)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(55); //Rally details $rally = new Zend_Form_Element_Checkbox('rally'); $rally->setLabel('Rally find: ')->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(56); $rallyID = new Zend_Form_Element_Select('rallyID'); $rallyID->setLabel('Found at this rally: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose rally name', 'Available rallies' => $rally_options))->addValidator('InArray', false, array(array_keys($rally_options)))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->addValidator('Int')->setOrder(57); ## OTHER REFERENCE NUMBERS ## //Legacy hoard ID $legacy_ref = new Zend_Form_Element_Text('legacyID'); $legacy_ref->setLabel('Legacy hoard ID: ')->setAttrib('size', 5)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(58)->disabled = true; //Other reference number $other_ref = new Zend_Form_Element_Text('other_ref'); $other_ref->setLabel('Other reference: ')->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(59); //HER reference number $smrrefno = new Zend_Form_Element_Text('smrrefno'); $smrrefno->setLabel('Historic Environment Record number: ')->setAttrib('size', 30)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(60); //Museum accession number $musaccno = new Zend_Form_Element_Text('musaccno'); $musaccno->setLabel('Museum accession number: ')->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(61); //Current location of object $curr_loc = new Zend_Form_Element_Text('curr_loc'); $curr_loc->setLabel('Current location: ')->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(62); //Current location of object $subs_action = new Zend_Form_Element_Select('subs_action'); $subs_action->setLabel('Subsequent action: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setAttrib('class', 'span6')->addMultiOptions(array(null => 'Choose a subsequent action', 'Available options' => $actionsDD))->setValue(1)->addValidator('InArray', false, array(array_keys($actionsDD)))->addValidator('Int')->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->setOrder(63); ## Quantities ## $quantityCoins = new Zend_Form_Element_Text('quantityCoins'); $quantityCoins->setLabel('Quantity of coins: ')->addValidator('Int')->setValue(null); $quantityArtefacts = new Zend_Form_Element_Text('quantityArtefacts'); $quantityArtefacts->setLabel('Quantity of artefacts: ')->addValidator('Int')->setValue(null); $quantityContainers = new Zend_Form_Element_Text('quantityContainers'); $quantityContainers->setLabel('Quantity of containers: ')->addValidator('Int')->setValue(null); ## SUBMIT BUTTON ## $submit = new Zend_Form_Element_Submit('submit'); $submit->setOrder(67); $this->addElements(array($secuid, $old_hoardID, $broadperiod, $hoardperiod1, $hoardperiod2, $hoardsubperiod1, $hoardsubperiod2, $numdate1, $numdate2, $lastruler, $lastreeceperiod, $terminaldate1, $terminaldate2, $terminalreason, $description, $notes, $coindataquality, $findofnote, $findofnotereason, $treasure, $treasureID, $quantityArtefacts, $quantityCoins, $quantityContainers, $materials, $recorderID, $recordername, $idBy, $id2by, $identifier1ID, $identifier2ID, $finder1, $finder1ID, $hiddenfield, $addFinderButton, $removeFinderButton, $discmethod, $disccircum, $datefound1, $datefound2, $rally, $rallyID, $legacy_ref, $other_ref, $smrrefno, $musaccno, $curr_loc, $subs_action, $submit)); $this->addDisplayGroup(array('broadperiod', 'subperiod1', 'period1', 'subperiod2', 'period2', 'numdate1', 'numdate2'), 'hoarddating'); $this->hoarddating->setLegend('Hoard dating'); $this->addDisplayGroup(array('lastrulerID', 'reeceID', 'terminalyear1', 'terminalyear2', 'terminalreason'), 'coindating'); $this->coindating->setLegend('Coin dating'); $this->addDisplayGroup(array('description', 'notes', 'qualityrating', 'findofnote', 'findofnotereason', 'treasure', 'treasureID'), 'hoarddetails'); $this->hoarddetails->setLegend('Hoard details'); $this->addDisplayGroup(array('quantityCoins', 'quantityArtefacts', 'quantityContainers'), 'quantities'); $this->quantities->setLegend('Quantities'); $this->addDisplayGroup(array('materials'), 'primarymaterials'); $this->primarymaterials->setLegend('Materials'); $this->addDisplayGroup(array('recordername', 'recorderID', 'idBy', 'identifier1ID', 'id2by', 'identifier2ID'), 'recorders'); $this->recorders->setLegend('Recording details'); $this->addDisplayGroup(array('finder1', 'finder1ID', 'hiddenfield', 'addFinder', 'removeFinder'), 'discoverers'); $this->discoverers->setLegend('Discoverer details'); $this->addDisplayGroup(array('disccircum', 'discmethod', 'datefound1', 'datefound2', 'rally', 'rallyID'), 'discovery'); $this->discovery->setLegend('Discovery details'); $this->addDisplayGroup(array('legacyID', 'other_ref', 'smrrefno', 'musaccno', 'curr_loc', 'subs_action'), 'references'); $this->references->setLegend('Reference numbers'); $this->addDisplayGroup(array('submit'), 'buttons'); parent::init(); $addFinderButton->removeDecorator('Label'); $addFinderButtonDecorator = $addFinderButton->getDecorator('HtmlTag'); $addFinderButtonDecorator->setOption('id', 'addFinderDiv'); $removeFinderButton->removeDecorator('Label'); $person = new Pas_User_Details(); $role = $person->getRole(); $projectTeam = array('hoard', 'admin'); if (!in_array($role, $projectTeam)) { $coindataquality->disabled = true; } }
/** The configuration * @access public * @return void */ public function configurationAction() { $content = new Content(); $this->view->conservation = $content->getConservationNotes(); $this->view->treasure = $content->getTreasureContent(); $denoms = new Denominations(); $this->view->romanDenoms = $denoms->getDenominationsSitemap('21'); $this->view->ironageDenoms = $denoms->getDenominationsSitemap('16'); $this->view->earlymedDenoms = $denoms->getDenominationsSitemap('47'); $this->view->medievalDenoms = $denoms->getDenominationsSitemap('29'); $this->view->byzantineDenoms = $denoms->getDenominationsSitemap('67'); $this->view->greekDenoms = $denoms->getDenominationsSitemap('66'); $this->view->postMedDenoms = $denoms->getDenominationsSitemap('36'); $emperors = new Emperors(); $this->view->emperors = $emperors->getEmperorsSiteMap(); $rulers = new Rulers(); $this->view->medrulers = $rulers->getMedievalRulersList(); $this->view->earlymedrulers = $rulers->getEarlyMedievalRulersList(); $this->view->postmedrulers = $rulers->getPostMedievalRulersList(); $this->view->ironagerulers = $rulers->getIARulersList(); $this->view->byzantinerulers = $rulers->getByzRulersList(); $this->view->greekrulers = $rulers->getGreekRulersList(); $mints = new Mints(); $this->view->romanMints = $mints->getMintsSiteMap(21); $this->view->ironageMints = $mints->getMintsSiteMap(16); $this->view->byzantineMints = $mints->getMintsSiteMap(67); $this->view->earlymedMints = $mints->getMintsSiteMap(47); $this->view->medMints = $mints->getMintsSiteMap(29); $this->view->postmedMints = $mints->getMintsSiteMap(36); $this->view->greekMints = $mints->getMintsSiteMap(66); $reeces = new Reeces(); $this->view->reeces = $reeces->getSiteMap(); $types = new MedievalTypes(); $this->view->medtypes = $types->getTypesSiteMap(29); $this->view->postmedtypes = $types->getTypesSiteMap(36); $this->view->earlymedtypes = $types->getTypesSiteMap(47); $cats = new CategoriesCoins(); $this->view->medcats = $cats->getCatsSiteMap(29); $this->view->earlymedcats = $cats->getCatsSiteMap(47); $this->view->postmedcats = $cats->getCatsSiteMap(36); $tribes = new Tribes(); $this->view->tribes = $tribes->getSitemap(); $news = new News(); $this->view->news = $news->getSitemapNews(); }