Ejemplo n.º 1
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $cats = new CategoriesCoins();
     $cat_options = $cats->getPeriodEarlyMed();
     $denominations = new Denominations();
     $denomination_options = $denominations->getOptionsEarlyMedieval();
     $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->getEarlyMedRulers();
     $mints = new Mints();
     $mo = $mints->getEarlyMedievalMints();
     parent::__construct($options);
     $this->setName('earlymedievalcoin');
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->addValidators(array('NotEmpty'))->addMultiOptions(array(null => 'Choose denomination', 'Available denominations' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options)))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow');
     $denomination_qualifier = new Zend_Form_Element_Radio('denomination_qualifier');
     $denomination_qualifier->setLabel('Denomination qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addValidator('Int');
     $categoryID = new Zend_Form_Element_Select('categoryID');
     $categoryID->setLabel('Category of coin: ')->addValidators(array('NotEmpty'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose category', 'Available categories' => $cat_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $ruler_id = new Zend_Form_Element_Select('ruler_id');
     $ruler_id->setLabel('Ruler: ')->addValidator('InArray', false, array(array_keys($ro)))->addMultiOptions(array(null => 'Choose a ruler', 'Available rulers' => $ro))->addValidator('Int')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'));
     $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier');
     $ruler_qualifier->setLabel('Issuer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setOptions(array('separator' => ''));
     $mint_id = new Zend_Form_Element_Select('mint_id');
     $mint_id->setLabel('Issuing mint: ')->addValidator('InArray', false, array(array_keys($mo)))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Please choose a mint', 'Available mints' => $mo));
     $status = new Zend_Form_Element_Select('status');
     $status->setLabel('Status: ')->setRegisterInArrayValidator(false)->setValue(1)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addMultiOptions(array(null => 'Choose coin status', 'Available status' => $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'))->addValidator('Int')->setOptions(array('separator' => ''));
     $degree_of_wear = new Zend_Form_Element_Select('degree_of_wear');
     $degree_of_wear->setLabel('Degree of wear: ')->setRegisterInArrayValidator(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a degree of wear', 'Available options' => $wear_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $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' => 5, 'cols' => 40, 'class' => 'span6'))->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim'))->addFilters(array('StripTags', 'StringTrim'));
     $reverse_description = new Zend_Form_Element_Textarea('reverse_description');
     $reverse_description->setLabel('Reverse description: ')->setAttribs(array('rows' => 5, 'cols' => 40, 'class' => 'span6'))->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim'));
     $rev_mm = new Zend_Form_Element_Textarea('reverse_mintmark');
     $rev_mm->setLabel('Reverse mint mark: ')->setAttribs(array('rows' => 5, 'cols' => 40, 'class' => 'span6'))->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim'));
     $initial = new Zend_Form_Element_Textarea('initial_mark');
     $initial->setLabel('Initial mark: ')->addValidators(array('NotEmpty'))->setAttribs(array('rows' => 5, 'cols' => 40, 'class' => 'span6'))->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim'));
     $die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement');
     $die_axis_measurement->setLabel('Die axis measurement: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose die axis', 'Available options' => $die_options));
     $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' => ''))->addValidator('Int');
     $typeID = new Zend_Form_Element_Select('typeID');
     $typeID->setLabel('Coin type: ')->setRegisterInArrayValidator(false)->addValidator('Int')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'));
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($ruler_id, $ruler_qualifier, $denomination, $denomination_qualifier, $mint_id, $typeID, $status, $categoryID, $status_qualifier, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $submit, $rev_mm, $initial));
     $this->addDisplayGroup(array('categoryID', 'ruler_id', 'typeID', 'ruler_qualifier', 'denomination', 'denomination_qualifier', 'mint_id', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'reverse_mintmark', 'initial_mark', 'die_axis_measurement', 'die_axis_certainty'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Ejemplo n.º 2
0
 public function __construct($options = null)
 {
     // Construct the select menu data
     $rulers = new Rulers();
     $ruler_options = $rulers->getRulersByzantine();
     $denominations = new Denominations();
     $denomination_options = $denominations->getDenomsByzantine();
     $mints = new Mints();
     $mint_options = $mints->getMintsByzantine();
     $statuses = new Statuses();
     $status_options = $statuses->getCoinStatus();
     $dies = new Dieaxes();
     $die_options = $dies->getAxes();
     $wears = new Weartypes();
     $wear_options = $wears->getWears();
     parent::__construct($options);
     $this->setName('romancoin');
     $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')));
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->addValidators(array('NotEmpty', 'Int'))->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $denomination_options))->setRegisterInArrayValidator(false)->addValidator()->setDecorators($decorators);
     $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'))->addValidator('Int')->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators);
     $ruler = new Zend_Form_Element_Select('ruler');
     $ruler->setLabel('Ruler: ')->addValidators(array('NotEmpty', 'Int'))->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $ruler_options))->setRegisterInArrayValidator(false)->setDecorators($decorators);
     $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier');
     $ruler_qualifier->setLabel('Issuer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Integer'))->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: ')->addValidators(array('NotEmpty', 'Integer'))->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $mint_options))->setRegisterInArrayValidator(false)->setDecorators($decorators);
     $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'))->addValidators(array('NotEmpty', 'Integer'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators);
     $status = new Zend_Form_Element_Select('status');
     $status->setLabel('Status: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Integer'))->setValue(1)->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $status_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'))->addValidators(array('NotEmpty', 'Integer'))->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: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Integer'))->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $wear_options))->setDecorators($decorators);
     $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription');
     $obverse_inscription->setLabel('Obverse inscription: ')->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription');
     $reverse_inscription->setLabel('Reverse inscription: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->setDecorators($decorators);
     $obverse_description = new Zend_Form_Element_Textarea('obverse_description');
     $obverse_description->setLabel('Obverse description: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 8)->setAttrib('cols', 80)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'expanding');
     $reverse_description = new Zend_Form_Element_Textarea('reverse_description');
     $reverse_description->setLabel('Reverse description: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 8)->setAttrib('cols', 80)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'expanding');
     $die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement');
     $die_axis_measurement->setLabel('Die axis measurement: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Int'))->addMultiOptions(array(NULL => NULL, 'Choose die axis' => $die_options))->setDecorators($decorators);
     $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'))->addValidators(array('NotEmpty', 'Int'))->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(60);
     $this->addElement($hash);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($ruler, $denomination, $mint_ID, $status, $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, $submit));
     $this->addDisplayGroup(array('denomination', 'denomination_qualifier', 'ruler', 'ruler_qualifier', 'mint_id', 'mint_qualifier', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', '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');
 }
 /** Individual denomination page details
  * @access Public
  * @throws Pas_Exception_Param
  */
 public function denominationAction()
 {
     if ($this->getParam('id', false)) {
         $this->view->denomination = $this->_denominations->getDenom($this->getParam('id'), (int) $this->_period);
         $this->view->rulers = $this->_denominations->getRulerDenomination($this->getParam('id'));
     } else {
         throw new Pas_Exception_Param($this->_missingParameter, 500);
     }
 }
 /** Display individual denomination
  */
 public function denominationAction()
 {
     if ($this->_getParam('id', false)) {
         $denoms = new Denominations();
         $this->view->denoms = $denoms->getDenom((int) $this->_getParam('id'), (int) $this->_period);
     } else {
         throw new Pas_Exception_Param($this->_missingParameter);
     }
 }
 /** Set up the individual denominations
  */
 public function denominationAction()
 {
     if ($this->_getParam('id', false)) {
         $id = $this->_getParam('id');
         $denoms = new Denominations();
         $this->view->denoms = $denoms->getDenom($id, (int) 21);
         $emps = new Emperors();
         $this->view->emps = $emps->getDenomEmperor($id);
     } else {
         throw new Pas_Exception_Param($this->_missingParameter);
     }
 }
 /** An individual denomination's entry details
  * @access public
  * @return void
  * @throws Pas_Exception_Param
  */
 public function denominationAction()
 {
     if ($this->getParam('id', false)) {
         $id = $this->getParam('id');
         $this->view->id = $id;
         $this->view->denoms = $this->_denominations->getDenom($id, $this->_period);
         $regions = new Geography();
         $this->view->regions = $regions->getIronAgeDenomGeog($id);
     } else {
         throw new Pas_Exception_Param($this->_missingParameter, 500);
     }
 }
Ejemplo n.º 7
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     // Construct the select menu data
     $rulers = new Rulers();
     $ruler_options = $rulers->getRulersGreek();
     $denominations = new Denominations();
     $denomination_options = $denominations->getDenomsGreek();
     $mints = new Mints();
     $mint_options = $mints->getMintsGreek();
     $statuses = new Statuses();
     $status_options = $statuses->getCoinStatus();
     $dies = new Dieaxes();
     $die_options = $dies->getAxes();
     $wears = new WearTypes();
     $wear_options = $wears->getWears();
     parent::__construct($options);
     $this->setName('greekcoin');
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->addMultiOptions(array(null => 'Choose a denomination', 'Valid denominations' => $denomination_options))->addFilters(array('StringTrim', 'StripTags'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($denomination_options)));
     $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('StringTrim', 'StripTags'))->setOptions(array('separator' => ''));
     $ruler = new Zend_Form_Element_Select('ruler_id');
     $ruler->setLabel('Ruler: ')->addValidators(array('NotEmpty', 'Int'))->addFilters(array('StringTrim', 'StripTags'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a ruler', 'Valid coin issuers' => $ruler_options))->addValidator('InArray', false, array(array_keys($ruler_options)));
     $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier');
     $ruler_qualifier->setLabel('Issuer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => ''));
     $mint_ID = new Zend_Form_Element_Select('mint_id');
     $mint_ID->setLabel('Issuing mint: ')->addValidators(array('NotEmpty', 'Int'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose denomination', 'Available options' => $mint_options))->addValidator('InArray', false, array(array_keys($mint_options)));
     $mint_qualifier = new Zend_Form_Element_Radio('mint_qualifier');
     $mint_qualifier->setLabel('Mint qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StringTrim', 'StripTags'))->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('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose coin status', 'Available 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('StringTrim', 'StripTags'))->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 degree of wear', 'Available options' => $wear_options))->addValidator('InArray', false, array(array_keys($wear_options)))->addFilters(array('StringTrim', 'StripTags'));
     $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription');
     $obverse_inscription->setLabel('Obverse inscription: ')->setAttrib('class', 'span6')->addFilters(array('StringTrim', 'StripTags', 'BasicHtml', 'EmptyParagraph'));
     $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription');
     $reverse_inscription->setLabel('Reverse inscription: ')->setAttrib('class', 'span6')->addFilters(array('StringTrim', 'StripTags', 'BasicHtml', 'EmptyParagraph'));
     $obverse_description = new Zend_Form_Element_Textarea('obverse_description');
     $obverse_description->setLabel('Obverse description: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 8)->setAttrib('cols', 60)->setAttrib('class', 'span6')->addFilters(array('StringTrim', 'StripTags', 'BasicHtml', 'EmptyParagraph'));
     $reverse_description = new Zend_Form_Element_Textarea('reverse_description');
     $reverse_description->setLabel('Reverse description: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 8)->setAttrib('cols', 60)->setAttrib('class', 'span6')->addFilters(array('StringTrim', 'StripTags', 'BasicHtml', 'EmptyParagraph'));
     $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 options' => $die_options))->addValidator('InArray', false, array(array_keys($die_options)))->addFilters(array('StringTrim', 'StripTags'));
     $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('StringTrim', 'StripTags'))->setOptions(array('separator' => ''));
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($ruler, $denomination, $mint_ID, $status, $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, $submit));
     $this->addDisplayGroup(array('denomination', 'denomination_qualifier', 'ruler_id', 'ruler_qualifier', 'mint_id', 'mint_qualifier', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'die_axis_measurement', 'die_axis_certainty'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
 /** Get details of each individual denomination
  * @param int $id denomination number 
  */
 public function denominationAction()
 {
     if ($this->_getParam('id', false)) {
         $id = (int) $this->_getParam('id');
         $this->view->id = $id;
         $denoms = new Denominations();
         $this->view->denoms = $denoms->getDenom($id, (int) $this->_period);
         $rulers = new Denominations();
         $this->view->rulers = $rulers->getRulerDenomination((int) $id);
     } else {
         throw new Pas_Exception_Param($this->_missingParameter);
     }
 }
Ejemplo n.º 9
0
 /** Set up the individual emperor
  * @access public
  * @return void
  * @throws Pas_Exception_Param
  */
 public function emperorAction()
 {
     if ($this->getParam('id', false)) {
         $id = (int) $this->getParam('id');
         $this->view->emps = $this->_emperors->getEmperorDetails($id);
         $denoms = new Denominations();
         $this->view->denoms = $denoms->getEmperorDenom($id);
         $mints = new Mints();
         $this->view->mints = $mints->getMintEmperorList($id);
     } else {
         throw new Pas_Exception_Param($this->_missingParameter, 500);
     }
 }
Ejemplo n.º 10
0
 /** Individual region's details
  * @access public
  * @throws Pas_Exception_Param
  *
  */
 public function regionAction()
 {
     if ($this->getParam('id', false)) {
         $this->view->regions = $this->_geography->getIronAgeRegion($this->getParam('id'));
         $id = $this->getParam('id');
         $denominations = new Denominations();
         $this->view->denominations = $denominations->getDenByPeriod($this->_period);
         $rulers = new Rulers();
         $this->view->rulers = $rulers->getIronAgeRulerToRegion($id);
     } else {
         throw new Pas_Exception_Param($this->_missingParameter, 500);
     }
 }
Ejemplo n.º 11
0
 /** Set up the individual page per ruler with examples, map and types
  */
 public function rulerAction()
 {
     if ($this->_getParam('id', false)) {
         $id = $this->_getParam('id');
         $this->view->rulers = $this->_rulers->getRulerImage($id);
         $this->view->monarchs = $this->_rulers->getRulerProfileMed($id);
         $denominations = new Denominations();
         $this->view->denominations = $denominations->getEarlyMedRulerToDenomination($id);
         $types = new MedievalTypes();
         $this->view->types = $types->getEarlyMedievalTypeToRuler($id);
         $mints = new Mints();
         $this->view->mints = $mints->getMedMintRuler($id);
     } else {
         throw new Pas_Exception_Param($this->_missingParameter);
     }
 }
Ejemplo n.º 12
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $institutions = new Institutions();
     $inst_options = $institutions->getInsts();
     $rulers = new Rulers();
     $ruler_options = $rulers->getRulersByzantine();
     $denominations = new Denominations();
     $denomination_options = $denominations->getDenomsByzantine();
     $mints = new Mints();
     $mint_options = $mints->getMintsByzantine();
     $periods = new Periods();
     $periodword_options = $periods->getPeriodsHoards();
     parent::__construct($options);
     $this->setName('coinsummary-search');
     $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'))->setOrder(1);
     ###
     ##Numismatic data
     ###
     //Denomination
     $denomination = new Zend_Form_Element_Select('denominationID');
     $denomination->setLabel('Denomination: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->addMultiOptions(array(null => 'Choose denomination type', 'Available denominations' => $denomination_options))->setOrder(2);
     //Primary ruler
     $ruler = new Zend_Form_Element_Select('rulerID');
     $ruler->setLabel('Ruler / issuer: ')->setRegisterInArrayValidator(false)->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose primary ruler', 'Available rulers' => $ruler_options))->setOrder(3);
     //Mint
     $mint = new Zend_Form_Element_Select('mintID');
     $mint->setLabel('Issuing mint: ')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose denomination type', 'Available mints' => $mint_options))->setOrder(4);
     $institution = new Zend_Form_Element_Select('institution');
     $institution->setLabel('Recording institution: ')->setRequired(false)->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose institution', 'Choose institution' => $inst_options))->setOrder(5);
     $quantity = new ZendX_JQuery_Form_Element_Spinner('quantity');
     $quantity->setLabel('Quantity in hoard')->setJQueryParams(array('defaultValue' => 1, 'min' => 1, 'max' => 50000))->setAttribs(array('class' => 'input-large'))->addValidators(array('Int'))->setOrder(6);
     $fromDate = new Zend_Form_Element_Text('fromDate');
     $fromDate->setLabel('Date from: ')->setValidators(array('Int'))->setAttribs(array('placeholder' => 'YYYY', 'class' => 'input-small'))->setOrder(7);
     $toDate = new Zend_Form_Element_Text('toDate');
     $toDate->setLabel('Date to: ')->setValidators(array('Int'))->setAttribs(array('placeholder' => 'YYYY', 'class' => 'input-small'))->setOrder(8);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Search summaries');
     $this->addElements(array($broadperiod, $denomination, $mint, $institution, $ruler, $quantity, $fromDate, $toDate, $submit));
     $this->addDisplayGroup(array('broadperiod', 'denominationID', 'rulerID', 'mintID', 'fromDate', 'toDate', 'quantity', 'institution'), 'numismatics');
     $this->numismatics->setLegend('Summary details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     ZendX_JQuery::enableForm($this);
     parent::init();
 }
Ejemplo n.º 13
0
 /** Set up the individual emperor
  */
 public function emperorAction()
 {
     if ($this->_getParam('id', false)) {
         $this->view->inlineScript()->appendFile('http://maps.google.com/maps?file=api&v=2.x&key=' . $this->_googleapikey, $type = 'text/javascript');
         $id = (int) $this->_getParam('id');
         $emps = new Emperors();
         $this->view->emps = $emps->getEmperorDetails($id);
         $denoms = new Denominations();
         $this->view->denoms = $denoms->getEmperorDenom($id);
         $mints = new Mints();
         $this->view->mints = $mints->getMintEmperorList($id);
         $counts = new Finds();
         $this->view->counts = $counts->getCountEmperor($this->_getParam('id'));
         $images = new Slides();
         $this->view->images = $images->getExamplesCoinsEmperors($id, 4);
     } else {
         throw new Pas_Exception_Param($this->_missingParameter);
     }
 }
 /** add and clone last record
  * @access public
  * @param array $coinDataFlat
  * @return void
  */
 public function optionsAddClone($coinData)
 {
     if (array_key_exists('ruler_id', $coinData)) {
         $rulers = new Rulers();
         $this->_view->form->ruler_id->addMultiOptions(array(NULL => 'Please choose a ruler', 'Available rulers' => $rulers->getLastRulersPairs($coinData['broadperiod'])));
     }
     if (array_key_exists('denomination', $coinData)) {
         $denominations = new Denominations();
         $this->_view->form->denomination->addMultiOptions(array(NULL => 'Please choose a denomination', 'Available choices' => $denominations->getDenominationByBroadPeriodPairs($coinData['broadperiod'])));
     }
     if (array_key_exists('mint_id', $coinData)) {
         $mints = new Mints();
         $this->_view->form->mint_id->addMultiOptions(array(NULL => 'Please choose a mint', 'Available choices' => $mints->getMintbyBroadperiodPairs($coinData['broadperiod'])));
     }
     if (array_key_exists('broadperiod', $coinData)) {
         if ($coinData['broadperiod'] == 'IRON AGE') {
             $geography = new Geography();
             $this->_view->form->geographyID->addMultiOptions(array(NULL => 'Please choose a geography if applicable', 'Available choices' => $geography->getIronAgeGeographyDD()));
         }
     }
 }
Ejemplo n.º 15
0
 /** Display list of denominations
  */
 public function denominationsAction()
 {
     $denominations = new Denominations();
     $denomsList = $denominations->getDenomsValid($this->_getAllParams());
     if (in_array($this->_helper->contextSwitch()->getCurrentContext(), $this->_contexts)) {
         $data = array('pageNumber' => $denomsList->getCurrentPageNumber(), 'total' => number_format($denomsList->getTotalItemCount(), 0), 'itemsReturned' => $denomsList->getCurrentItemCount(), 'totalPages' => number_format($denomsList->getTotalItemCount() / $denomsList->getCurrentItemCount(), 0));
         $this->view->data = $data;
         $denoms = NULL;
         foreach ($denomsList as $k) {
             $action = $k['temporal'];
             switch ($action) {
                 case $action == strtoupper('Roman'):
                     $actionset = 'denomination';
                     $module = 'romancoins';
                     break;
                 case $action == strtoupper('Byzantine'):
                     $module = 'byzantinecoins';
                     $actionset = 'denomination';
                     break;
                 case $action == strtoupper('Greek and Roman Provincial'):
                     $module = 'greekromancoins';
                     $actionset = 'denomination';
                     break;
                 case $action == strtoupper('Post Medieval'):
                     $module = 'postmedievalcoins';
                     $actionset = 'denomination';
                     break;
                 case $action == strtoupper('Early Medieval'):
                     $module = 'earlymedievalcoins';
                     $actionset = 'denomination';
                     break;
                 case $action == strtoupper('Iron Age'):
                     $module = 'ironagecoins';
                     $actionset = 'denomination';
                     break;
                 case $action == strtoupper('medieval'):
                     $module = 'medievalcoins';
                     $actionset = 'denomination';
                     break;
                 default:
                     $actionset = 'denomination';
                     $module = 'medievalcoins';
             }
             $denoms[] = array('id' => $k['id'], 'name' => $k['denomination'], 'period' => $k['temporal'], 'url' => 'http://finds.org.uk' . $this->view->url(array('module' => $module, 'controller' => $actionset . 's', 'action' => $actionset, 'id' => $k['id']), null, true));
         }
         $this->view->denominations = $denoms;
     } else {
         $this->view->denominations = $denomsList;
     }
 }
Ejemplo n.º 16
0
 /** 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();
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     $counties = new OsCounties();
     $county_options = $counties->getCountiesID();
     $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();
     $types = new MedievalTypes();
     $type_options = $types->getMedievalTypesForm(47);
     $cats = new CategoriesCoins();
     $cat_options = $cats->getPeriodEarlyMed();
     $regions = new OsRegions();
     $region_options = $regions->getRegionsID();
     parent::__construct($options);
     $this->setName('earlymedsearch');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid number!');
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Object description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term');
     $workflow = new Zend_Form_Element_Select('workflow');
     $workflow->setLabel('Workflow stage: ')->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StringTrim', 'StripTags'))->addValidator('Int');
     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')));
     }
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->setRequired(false)->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null);
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose a rally', 'Available rallies' => $rally_options));
     $county = new Zend_Form_Element_Select('countyID');
     $county->setLabel('County: ')->addValidators(array('NotEmpty'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose county', 'Available counties' => $county_options));
     $district = new Zend_Form_Element_Select('districtID');
     $district->setLabel('District: ')->addMultiOptions(array(null => 'Choose district after county'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRegisterInArrayValidator(false)->addFilters(array('StringTrim', 'StripTags'))->setDisableTranslator(true);
     $parish = new Zend_Form_Element_Select('parishID');
     $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose parish after county'))->setDisableTranslator(true);
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Int')->addMultiOptions(array(null => 'Choose a region for a wide result', 'Choose region' => $region_options));
     $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'));
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Int')->addMultiOptions(array(null => 'Choose denomination type', 'Available denominations' => $denomination_options));
     $cat = new Zend_Form_Element_Select('category');
     $cat->setLabel('Category: ')->setRequired(false)->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose an Early Medieval category', 'Available categories' => $cat_options));
     $type = new Zend_Form_Element_Select('type');
     $type->setLabel('Coin type: ')->setRequired(false)->addValidator('Int')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose type after choosing ruler', 'Available types' => $type_options))->addValidator('InArray', false, array(array_keys($type_options)));
     //Primary ruler
     $ruler = new Zend_Form_Element_Select('ruler');
     $ruler->setLabel('Ruler / issuer: ')->setRequired(false)->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose primary ruler', 'Available options' => $ruler_options))->addValidator('InArray', false, array(array_keys($ruler_options)));
     //Mint
     $mint = new Zend_Form_Element_Select('mint');
     $mint->setLabel('Issuing mint: ')->setRequired(false)->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose issuing mint', 'Available mints' => $mint_options));
     //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');
     //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');
     //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');
     //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');
     //Die axis
     $axis = new Zend_Form_Element_Select('axis');
     $axis->setLabel('Die axis measurement: ')->setRegisterInArrayValidator(false)->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addMultiOptions(array(null => 'Choose a die axis measurement', 'Available options' => $axis_options));
     $objecttype = new Zend_Form_Element_Hidden('objecttype');
     $objecttype->setValue('coin')->addFilter('StringToUpper');
     $broadperiod = new Zend_Form_Element_Hidden('broadperiod');
     $broadperiod->setValue('Early Medieval')->addFilter('StringToUpper');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $institution = new Zend_Form_Element_Select('institution');
     $institution->setLabel('Recording institution: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Alpha', true)->addMultiOptions(array(null => 'Choose an institution', 'Available institutions' => $inst_options));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($old_findID, $type, $description, $workflow, $rally, $rallyID, $county, $regionID, $district, $parish, $fourFigure, $gridref, $denomination, $ruler, $mint, $axis, $obverseinsc, $obversedesc, $reverseinsc, $reversedesc, $objecttype, $broadperiod, $cat, $submit, $institution, $hash));
     $this->addDisplayGroup(array('category', 'ruler', 'type', 'denomination', 'mint', 'moneyer', 'axis', 'obverseLegend', 'obverseDescription', 'reverseLegend', 'reverseDescription'), 'numismatics');
     $this->numismatics->setLegend('Numismatic details: ');
     $this->addDisplayGroup(array('old_findID', 'description', 'rally', 'rallyID', 'workflow'), 'details');
     $this->details->setLegend('Object details: ');
     $this->addDisplayGroup(array('countyID', 'regionID', 'districtID', 'parishID', 'gridref', 'fourFigure', 'institution'), 'spatial');
     $this->spatial->setLegend('Spatial details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Ejemplo n.º 18
0
 /** 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->getOptionsIronAge();
     $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->getIronAgeRulers();
     $mints = new Mints();
     $mint_options = $mints->getIronAgeMints();
     $tribes = new Tribes();
     $to = $tribes->getTribes();
     $atypes = new AllenTypes();
     $atypelist = $atypes->getATypes();
     $vatypes = new VanArsdellTypes();
     $vatypelist = $vatypes->getVATypesDD();
     $macktypes = new MackTypes();
     $macktypelist = $macktypes->getMackTypesDD();
     $abc = new AbcNumbers();
     $abclist = $abc->getTerms();
     $regions = new Geography();
     $ia_geog = $regions->getIronAgeGeographyDD();
     parent::__construct($options);
     $this->setName('ironagecoin');
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose denomination', 'Available options' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options)))->addValidator('Int');
     $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'))->addValidator('Digits')->setOptions(array('separator' => ''));
     $geographyID = new Zend_Form_Element_Select('geographyID');
     $geographyID->setLabel('Geographic area: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose geography', 'Available options' => $ia_geog))->addValidator('InArray', false, array(array_keys($ia_geog)))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $geography_qualifier = new Zend_Form_Element_Radio('geography_qualifier');
     $geography_qualifier->setLabel('Geographic qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setOptions(array('separator' => ''));
     $ruler_id = new Zend_Form_Element_Select('ruler_id');
     $ruler_id->setLabel('Ruler: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->addMultiOptions(array(null => 'Choose primary ruler', 'Available rulers' => $ro));
     $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier');
     $ruler_qualifier->setLabel('Issuer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setOptions(array('separator' => ''));
     $ruler2_id = new Zend_Form_Element_Select('ruler2_id');
     $ruler2_id->setLabel('Secondary ruler: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addMultiOptions(array(null => 'Choose issuing secondary ruler', 'Available rulers' => $ro))->addValidator('InArray', false, array(array_keys($ro)));
     $ruler2_qualifier = new Zend_Form_Element_Radio('ruler2_qualifier');
     $ruler2_qualifier->setLabel('Secondary issuer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setOptions(array('separator' => ''));
     $mint_id = new Zend_Form_Element_Select('mint_id');
     $mint_id->setLabel('Issuing mint: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addMultiOptions(array(null => 'Choose issuing mint', 'Available options' => $mint_options))->addValidator('InArray', false, array(array_keys($mint_options)));
     $tribe = new Zend_Form_Element_Select('tribe');
     $tribe->setLabel('Tribe: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setRegisterInArrayValidator(false)->addMultiOptions(array(null => 'Choose tribe', 'Available options' => $to))->addValidator('InArray', false, array(array_keys($to)));
     $tribe_qualifier = new Zend_Form_Element_Radio('tribe_qualifier');
     $tribe_qualifier->setLabel('Tribe qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setOptions(array('separator' => ''));
     $status = new Zend_Form_Element_Select('status');
     $status->setLabel('Status: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Int')->setValue(1)->addMultiOptions(array(null => 'Choose coin status', 'Available 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'))->addValidator('Digits')->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')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->addMultiOptions(array(null => 'Choose wear status', 'Available options' => $wear_options))->addValidator('InArray', false, array(array_keys($wear_options)));
     $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription');
     $obverse_inscription->setLabel('Obverse inscription: ')->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('rows' => 8, 'cols' => 80, 'class' => 'span6'));
     $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription');
     $reverse_inscription->setLabel('Reverse inscription: ')->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('rows' => 8, 'cols' => 80, 'class' => 'span6'));
     $obverse_description = new Zend_Form_Element_Textarea('obverse_description');
     $obverse_description->setLabel('Obverse description: ')->setAttribs(array('rows' => 8, 'cols' => 80, 'class' => 'span6'))->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'EmptyParagraph'));
     $reverse_description = new Zend_Form_Element_Textarea('reverse_description');
     $reverse_description->setLabel('Reverse description: ')->setAttribs(array('rows' => 8, 'cols' => 80, 'class' => 'span6'))->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'EmptyParagraph'));
     $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 options' => $die_options))->addValidator('InArray', false, array(array_keys($die_options)));
     $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'))->addValidator('Int')->setOptions(array('separator' => ''));
     $mack_type = new Zend_Form_Element_Select('mack_type');
     $mack_type->setLabel('Mack Type: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a Mack type', 'Valid types' => $macktypelist))->addValidator('InArray', false, array(array_keys($macktypelist)));
     $bmc_type = new Zend_Form_Element_Text('bmc_type');
     $bmc_type->setLabel('British Museum catalogue number: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     $allen_type = new Zend_Form_Element_Select('allen_type');
     $allen_type->setLabel('Allen Type: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose an Allen type', 'Valid types' => $atypelist))->addValidator('InArray', false, array(array_keys($atypelist)));
     $va_type = new Zend_Form_Element_Select('va_type');
     $va_type->setLabel('Van Arsdell Number: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose Van Arsdell type', 'Valid types' => $vatypelist))->addValidator('InArray', false, array(array_keys($vatypelist)));
     $cciNumber = new Zend_Form_Element_Text('cciNumber');
     $cciNumber->setLabel('Celtic Coin Index Number: ')->setAttrib('size', 12)->addFilters(array('StripTags', 'StringTrim'))->setDescription('This is the coin\'s unique CCI number, not a ' . 'comparison field.  Numbers are issued by the CCI.');
     $rudd_type = new Zend_Form_Element_Select('rudd_type');
     $rudd_type->setLabel('Ancient British Coinage number: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addMultiOptions(array(null => 'Choose ABC number', 'Valid types' => $abclist))->addValidator('InArray', false, array(array_keys($abclist)));
     $phase_date_1 = new Zend_Form_Element_Text('phase_date_1');
     $phase_date_1->setLabel('Phase date 1: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     $phase_date_2 = new Zend_Form_Element_Text('phase_date_2');
     $phase_date_2->setLabel('Phase date 2: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     $context = new Zend_Form_Element_Text('context');
     $context->setLabel('Context of coins: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     $depositionDate = new Zend_Form_Element_Text('depositionDate');
     $depositionDate->setLabel('Date of deposition: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     $numChiab = new Zend_Form_Element_Text('numChiab');
     $numChiab->setLabel('Coin hoards of Iron Age Britain number: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($ruler_id, $ruler_qualifier, $denomination, $denomination_qualifier, $mint_id, $ruler2_id, $ruler2_qualifier, $geographyID, $geography_qualifier, $status, $status_qualifier, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $tribe, $tribe_qualifier, $bmc_type, $mack_type, $allen_type, $va_type, $rudd_type, $cciNumber, $numChiab, $context, $depositionDate, $phase_date_1, $phase_date_2, $submit));
     $this->addDisplayGroup(array('denomination', 'denomination_qualifier', 'geographyID', 'geography_qualifier', 'tribe', 'tribe_qualifier', 'ruler_id', 'ruler_qualifier', 'ruler2_id', 'ruler2_qualifier', 'mint_id', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'die_axis_measurement', 'die_axis_certainty', 'bmc_type', 'va_type', 'allen_type', 'rudd_type', 'mack_type', 'cciNumber', 'numChiab', 'context', 'phase_date_1', 'phase_date_2', 'depositionDate'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Ejemplo n.º 19
0
 /** 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();
 }
Ejemplo n.º 20
0
 public function rulerdenomearlymedAction()
 {
     if ($this->_getParam('term', false)) {
         $denominations = new Denominations();
         $denom_options = $denominations->getEarlyMedRulerDenom($this->_getParam('term'));
         if ($denom_options) {
             echo Zend_Json::encode($denom_options);
         } else {
             $data = array(array('id' => '', 'term' => 'No options available'));
             echo Zend_Json::encode($data);
         }
     } else {
         $response = array(array('id' => NULL, 'term' => 'No ruler specified'));
         echo Zend_Json::encode($response);
     }
 }
Ejemplo n.º 21
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $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();
     $counties = new OsCounties();
     $county_options = $counties->getCountiesID();
     $rulers = new Rulers();
     $ruler_options = $rulers->getRulersByzantine();
     $denominations = new Denominations();
     $denomination_options = $denominations->getDenomsGreek();
     $mints = new Mints();
     $mint_options = $mints->getMintsGreek();
     $axis = new Dieaxes();
     $axis_options = $axis->getAxes();
     $regions = new OsRegions();
     $region_options = $regions->getRegionsID();
     parent::__construct($options);
     $this->setName('greek-search');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Please enter a valid number!');
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Object description contains: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Please enter a valid term');
     $workflow = new Zend_Form_Element_Select('workflow');
     $workflow->setLabel('Workflow stage: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow');
     if (in_array($this->_role, $this->_higherlevel)) {
         $workflow->addMultiOptions(array(null => 'Choose a workflow stage', 'Available workflow stages' => array('1' => 'Quarantine', '2' => 'On review', '4' => 'Awaiting validation', '3' => 'Published')));
     }
     if (in_array($this->_role, $this->_restricted)) {
         $workflow->addMultiOptions(array(null => 'Choose a workflow stage', 'Available workflow stages' => array('4' => 'Awaiting validation', '3' => 'Published')));
     }
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null);
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StringTrim', 'StripTags'))->addValidator('Int')->addValidator('InArray', false, array(array_keys($rally_options)));
     $county = new Zend_Form_Element_Select('countyID');
     $county->setLabel('County: ')->addFilters(array('StringTrim', 'StripTags'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose county', 'Available counties' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)));
     $district = new Zend_Form_Element_Select('districtID');
     $district->setLabel('District: ')->setRegisterInArrayValidator(false)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose district after county'));
     $parish = new Zend_Form_Element_Select('parishID');
     $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose parish after county'));
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->addMultiOptions(array(null => 'Choose a region for a wide result', 'Choose region' => $region_options))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Digits')->addFilters(array('StringTrim', 'StripTags'));
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->addValidators(array('NotEmpty', 'ValidGridRef', 'Alnum'))->addFilters(array('StringTrim', 'StripTags'));
     $fourFigure = new Zend_Form_Element_Text('fourfigure');
     $fourFigure->setLabel('Four figure grid reference: ')->addValidators(array('NotEmpty', 'ValidGridRef', 'Alnum'))->addFilters(array('StringTrim', 'StripTags'));
     ###
     ##Numismatic data
     ###
     //Denomination
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose denomination type', 'Available denominations' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options)));
     //Primary ruler
     $ruler = new Zend_Form_Element_Select('ruler');
     $ruler->setLabel('Ruler / issuer: ')->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose primary ruler', 'Available rulers' => $ruler_options))->addValidator('InArray', false, array(array_keys($ruler_options)));
     //Mint
     $mint = new Zend_Form_Element_Select('mint');
     $mint->setLabel('Issuing mint: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose issuing mint', 'Available mints' => $mint_options))->addValidator('InArray', false, array(array_keys($mint_options)));
     //Obverse inscription
     $obverseinsc = new Zend_Form_Element_Text('obverseLegend');
     $obverseinsc->setLabel('Obverse inscription contains: ')->setRequired(false)->setAttrib('size', 50)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Please enter a valid term');
     //Obverse description
     $obversedesc = new Zend_Form_Element_Text('obverseDescription');
     $obversedesc->setLabel('Obverse description contains: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('size', 50)->addErrorMessage('Please enter a valid term');
     //reverse inscription
     $reverseinsc = new Zend_Form_Element_Text('reverseLegend');
     $reverseinsc->setLabel('Reverse inscription contains: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('size', 50)->addErrorMessage('Please enter a valid term');
     //reverse description
     $reversedesc = new Zend_Form_Element_Text('reverseDescription');
     $reversedesc->setLabel('Reverse description contains: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('size', 50)->addErrorMessage('Please enter a valid term');
     //Die axis
     $axis = new Zend_Form_Element_Select('axis');
     $axis->setLabel('Die axis measurement: ')->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose measurement', 'Available axes' => $axis_options))->addValidator('InArray', false, array(array_keys($axis_options)));
     $objecttype = new Zend_Form_Element_Hidden('objecttype');
     $objecttype->setValue('coin');
     $objecttype->removeDecorator('HtmlTag')->addFilters(array('StringTrim', 'StripTags', 'StringToUpper'));
     $broadperiod = new Zend_Form_Element_Hidden('broadperiod');
     $broadperiod->setValue('Greek and Roman Provincial')->addFilters(array('StringTrim', 'StripTags', 'StringToUpper'))->removeDecorator('label');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Search..');
     $this->addElements(array($old_findID, $description, $workflow, $rally, $rallyID, $county, $regionID, $district, $parish, $fourFigure, $gridref, $denomination, $ruler, $mint, $axis, $obverseinsc, $obversedesc, $reverseinsc, $reversedesc, $objecttype, $broadperiod, $submit));
     $this->addDisplayGroup(array('denomination', 'ruler', 'mint', 'moneyer', 'axis', 'obverseLegend', 'obverseDescription', 'reverseLegend', 'reverseDescription'), 'numismatics');
     $this->addDisplayGroup(array('old_findID', 'description', 'rally', 'rallyID', 'workflow'), 'details');
     $this->addDisplayGroup(array('countyID', 'regionID', 'districtID', 'parishID', 'gridref', 'fourfigure'), 'spatial');
     $this->numismatics->setLegend('Numismatic details');
     $this->details->setLegend('Artefact details');
     $this->spatial->setLegend('Spatial details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Ejemplo n.º 22
0
 public function __construct($options = null)
 {
     // Construct the select menu data
     $denominations = new Denominations();
     $denomination_options = $denominations->getOptionsIronAge();
     $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->getIronAgeRulers();
     $mints = new Mints();
     $mint_options = $mints->getIronAgeMints();
     $tribes = new Tribes();
     $to = $tribes->getTribes();
     $atypes = new AllenTypes();
     $atypelist = $atypes->getATypes();
     $vatypes = new VanArsdellTypes();
     $vatypelist = $vatypes->getVATypesDD();
     $macktypes = new MackTypes();
     $macktypelist = $macktypes->getMackTypesDD();
     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('ironagecoin');
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options)))->addValidator('Int')->setDecorators($decorators);
     $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'))->addValidator('Digits')->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators);
     $geographyID = new Zend_Form_Element_Select('geographyID');
     $geographyID->setLabel('Geographic area: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $geography_qualifier = new Zend_Form_Element_Radio('geography_qualifier');
     $geography_qualifier->setLabel('Geographic qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators);
     $ruler_id = new Zend_Form_Element_Select('ruler');
     $ruler_id->setLabel('Ruler: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->addMultiOptions(array(NULL => 'Choose primary ruler', 'Available rulers' => $ro))->addValidator('InArray', false, array(array_keys($ro)));
     $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier');
     $ruler_qualifier->setLabel('Issuer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators);
     $ruler2_id = new Zend_Form_Element_Select('ruler2_id');
     $ruler2_id->setLabel('Secondary ruler: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setDecorators($decorators)->addMultiOptions(array(NULL => NULL, 'Choose issuing secondary ruler' => $ro))->addValidator('InArray', false, array(array_keys($denomination_options)));
     $ruler2_qualifier = new Zend_Form_Element_Radio('ruler2_qualifier');
     $ruler2_qualifier->setLabel('Secondary issuer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->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: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->addMultiOptions(array(NULL => NULL, 'Choose issuing mint' => $mint_options))->setDecorators($decorators)->addValidator('InArray', false, array(array_keys($mint_options)));
     $tribe = new Zend_Form_Element_Select('tribe');
     $tribe->setLabel('Tribe: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addMultiOptions(array(NULL => NULL, 'Choose tribe' => $to))->addValidator('InArray', false, array(array_keys($to)));
     $tribe_qualifier = new Zend_Form_Element_Radio('tribe_qualifier');
     $tribe_qualifier->setLabel('Tribe qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators);
     $status = new Zend_Form_Element_Select('status');
     $status->setLabel('Status: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setValue(1)->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $status_options))->setDecorators($decorators)->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'))->addValidator('Digits')->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: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $wear_options))->setDecorators($decorators)->addValidator('InArray', false, array(array_keys($wear_options)));
     $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription');
     $obverse_inscription->setLabel('Obverse inscription: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->setDecorators($decorators);
     $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription');
     $reverse_inscription->setLabel('Reverse inscription: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->setDecorators($decorators);
     $obverse_description = new Zend_Form_Element_Textarea('obverse_description');
     $obverse_description->setLabel('Obverse description: ')->setAttrib('rows', 8)->setAttrib('cols', 80)->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'EmptyParagraph'))->setAttrib('class', 'expanding');
     $reverse_description = new Zend_Form_Element_Textarea('reverse_description');
     $reverse_description->setLabel('Reverse description: ')->setAttrib('rows', 8)->setAttrib('cols', 80)->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'EmptyParagraph'))->setAttrib('class', 'expanding');
     $die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement');
     $die_axis_measurement->setLabel('Die axis measurement: ')->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $die_options))->setDecorators($decorators)->addValidator('InArray', false, array(array_keys($die_options)));
     $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'))->addValidator('Digits')->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators);
     $mack_type = new Zend_Form_Element_Select('mack_type');
     $mack_type->setLabel('Mack Type: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addMultiOptions(array(NULL => 'Choose a Mack type', 'Valid types' => $macktypelist))->setDecorators($decorators)->setDecorators($decorators)->addValidator('InArray', false, array(array_keys($macktypelist)));
     $bmc_type = new Zend_Form_Element_Text('bmc_type');
     $bmc_type->setLabel('British Museum catalogue number: ')->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $allen_type = new Zend_Form_Element_Select('allen_type');
     $allen_type->setLabel('Allen Type: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addMultiOptions(array(NULL => 'Choose an Allen type', 'Valid types' => $atypelist))->setDecorators($decorators);
     $va_type = new Zend_Form_Element_Select('va_type');
     $va_type->setLabel('Van Arsdell Number: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addMultiOptions(array(NULL => 'Choose Van Arsdell type', 'Valid types' => $vatypelist))->setDecorators($decorators);
     $cciNumber = new Zend_Form_Element_Text('cciNumber');
     $cciNumber->setLabel('Celtic Coin Index Number: ')->setAttrib('size', 12)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDescription('This is the coin\'s unique CCI number, not a comparison field!')->setDecorators($decorators);
     $rudd_type = new Zend_Form_Element_Text('rudd_type');
     $rudd_type->setLabel('Ancient British Coinage number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $phase_date_1 = new Zend_Form_Element_Text('phase_date_1');
     $phase_date_1->setLabel('Phase date 1: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $phase_date_2 = new Zend_Form_Element_Text('phase_date_2');
     $phase_date_2->setLabel('Phase date 2: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $context = new Zend_Form_Element_Text('context');
     $context->setLabel('Context of coins: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $depositionDate = new Zend_Form_Element_Text('depositionDate');
     $depositionDate->setLabel('Date of deposition: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Date');
     $numChiab = new Zend_Form_Element_Text('numChiab');
     $numChiab->setLabel('Coin hoards of Iron Age Britain number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($ruler_id, $ruler_qualifier, $denomination, $denomination_qualifier, $mint_id, $ruler2_id, $ruler2_qualifier, $geographyID, $geography_qualifier, $status, $status_qualifier, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $tribe, $tribe_qualifier, $bmc_type, $mack_type, $allen_type, $va_type, $rudd_type, $cciNumber, $numChiab, $context, $depositionDate, $phase_date_1, $phase_date_2, $submit));
     $this->addDisplayGroup(array('denomination', 'denomination_qualifier', 'geographyID', 'geography_qualifier', 'tribe', 'tribe_qualifier', 'ruler', 'ruler_qualifier', 'ruler2_id', 'ruler2_qualifier', 'mint_id', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'die_axis_measurement', 'die_axis_certainty', 'bmc_type', 'va_type', 'allen_type', 'rudd_type', 'mack_type', 'cciNumber', 'numChiab', 'context', 'phase_date_1', 'phase_date_2', 'depositionDate'), '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');
 }
Ejemplo n.º 24
0
 public function __construct($options = null)
 {
     // Construct the select menu data
     $cats = new CategoriesCoins();
     $cat_options = $cats->getPeriodEarlyMed();
     $denominations = new Denominations();
     $denomination_options = $denominations->getOptionsEarlyMedieval();
     $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->getEarlyMedRulers();
     $mints = new Mints();
     $mo = $mints->getEarlyMedievalMints();
     parent::__construct($options);
     $this->setName('earlymedievalcoin');
     $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')));
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->addValidators(array('NotEmpty'))->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $denomination_options))->setDecorators($decorators);
     $denomination_qualifier = new Zend_Form_Element_Radio('denomination_qualifier');
     $denomination_qualifier->setLabel('Denomination 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)->addValidator('Int');
     $categoryID = new Zend_Form_Element_Select('categoryID');
     $categoryID->setLabel('Category of coin: ')->addValidators(array('NotEmpty'))->addMultiOptions(array(NULL => NULL, 'Choose category' => $cat_options))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $ruler_id = new Zend_Form_Element_Select('ruler');
     $ruler_id->setLabel('Ruler: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addMultiOptions(array(NULL => NULL, 'Please choose a ruler' => $ro))->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'));
     $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier');
     $ruler_qualifier->setLabel('Issuer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->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: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addMultiOptions(array(NULL => NULL, 'Please choose a mint' => $mo));
     $status = new Zend_Form_Element_Select('status');
     $status->setLabel('Status: ')->setRegisterInArrayValidator(false)->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $status_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'))->addValidator('Int')->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: ')->setRegisterInArrayValidator(false)->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $wear_options))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription');
     $obverse_inscription->setLabel('Obverse inscription: ')->setDecorators($decorators)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'));
     $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription');
     $reverse_inscription->setLabel('Reverse inscription: ')->setDecorators($decorators)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'));
     $obverse_description = new Zend_Form_Element_Textarea('obverse_description');
     $obverse_description->setLabel('Obverse description: ')->setAttrib('rows', 3)->setAttrib('cols', 80)->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim'))->setAttrib('class', 'expanding')->addFilters(array('StripTags', 'StringTrim'));
     $reverse_description = new Zend_Form_Element_Textarea('reverse_description');
     $reverse_description->setLabel('Reverse description: ')->setAttrib('rows', 3)->setAttrib('cols', 80)->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim'))->setAttrib('class', 'expanding');
     $rev_mm = new Zend_Form_Element_Textarea('reverse_mintmark');
     $rev_mm->setLabel('Reverse mintmark: ')->setAttrib('rows', 3)->setAttrib('cols', 80)->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim'))->setAttrib('class', 'expanding');
     $initial = new Zend_Form_Element_Textarea('initial_mark');
     $initial->setLabel('Initial mark: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 3)->setAttrib('cols', 80)->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim'))->setAttrib('class', 'expanding');
     $die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement');
     $die_axis_measurement->setLabel('Die axis measurement: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $die_options))->setDecorators($decorators);
     $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' => ''))->addValidator('Int')->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators);
     $typeID = new Zend_Form_Element_Select('typeID');
     $typeID->setLabel('Coin type: ')->setRegisterInArrayValidator(false)->setRequired(false)->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $this->addElements(array($ruler_id, $ruler_qualifier, $denomination, $denomination_qualifier, $mint_id, $typeID, $status, $categoryID, $status_qualifier, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $submit, $rev_mm, $initial));
     $this->addDisplayGroup(array('categoryID', 'ruler', 'typeID', 'ruler_qualifier', 'denomination', 'denomination_qualifier', 'mint_id', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'reverse_mintmark', 'initial_mark', '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');
     $action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
     if ($action == 'editcoin') {
         $rulers = new Rulers();
         $ruler_options = $rulers->getEarlyMedRulers();
         $ruler_id->addMultiOptions(array(NULL => NULL, 'Choose ruler' => $ruler_options));
         $mints = new Mints();
         $mint_options = $mints->getEarlyMedievalMints();
         $mint_id->addMultiOptions(array(NULL => NULL, 'Choose Medieval mint' => $mint_options));
     }
 }
Ejemplo n.º 25
0
 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)
 {
     //Get data to form select menu for primary and secondary material
     $primaries = new Materials();
     $primary_options = $primaries->getPrimaries();
     //Get Rally data
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     //Get Hoard data
     $hoards = new Hoards();
     $hoard_options = $hoards->getHoards();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $denominations = new Denominations();
     $denom_options = $denominations->getOptionsRoman();
     $rulers = new Rulers();
     $ruler_options = $rulers->getRomanRulers();
     $mints = new Mints();
     $mint_options = $mints->getRomanMints();
     $axis = new Dieaxes();
     $axis_options = $axis->getAxes();
     $reece = new Reeces();
     $reece_options = $reece->getReeces();
     $regions = new Regions();
     $region_options = $regions->getRegionName();
     $moneyers = new Moneyers();
     $money = $moneyers->getRepublicMoneyers();
     $institutions = new Institutions();
     $inst_options = $institutions->getInsts();
     parent::__construct($options);
     $decorator = array('SimpleInput');
     $decoratorSelect = array('SelectInput');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'requiredSuffix' => ' *')), array('HtmlTag', array('tag' => 'li')));
     $decoratorsHide = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'class' => 'hideme')), array('HtmlTag', array('tag' => 'li')));
     $decoratorsRally = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'class' => 'hiderally')), array('HtmlTag', array('tag' => 'li')));
     $decoratorsHoard = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'class' => 'hidehoard')), array('HtmlTag', array('tag' => 'li')));
     $decoratorsNote = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'class' => 'hidenote')), array('HtmlTag', array('tag' => 'li')));
     $this->setName('search-roman-coins');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid number!')->setDecorators($decorators);
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Object description contains: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     $workflow = new Zend_Form_Element_Select('workflow');
     $workflow->setLabel('Workflow stage: ')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     if (in_array($this->getRole(), $this->_higherlevel)) {
         $workflow->addMultiOptions(array(NULL => NULL, 'Available worklow stage' => array('1' => 'Quarantine', '2' => 'On review', '4' => 'Awaiting validation', '3' => 'Published')));
     }
     if (in_array($this->getRole(), $this->_restricted)) {
         $workflow->addMultiOptions(array(NULL => 'Choose a workflow stage', 'Available worklow stage' => array('4' => 'Awaiting validation', '3' => 'Published')));
     }
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElement($hash);
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->addFilters(array('StripTags', 'StringTrim'))->setUncheckedValue(NULL)->setDecorators($decorators);
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose rally name', 'Available rallies' => $rally_options))->addValidator('InArray', false, array(array_keys($rally_options)))->setDecorators($decorators);
     $hoard = new Zend_Form_Element_Checkbox('hoard');
     $hoard->setLabel('Hoard find: ')->addFilters(array('StripTags', 'StringTrim'))->setUncheckedValue(NULL)->setDecorators($decorators);
     $hoardID = new Zend_Form_Element_Select('hID');
     $hoardID->setLabel('Part of this hoard: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose hoard name', 'Available hoards' => $hoard_options))->addValidator('InArray', false, array(array_keys($hoard_options)))->setDecorators($decorators);
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addValidators(array('NotEmpty'))->addMultiOptions(array(NULL => 'Choose county first', 'Available counties' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)))->setDecorators($decorators);
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->addMultiOptions(array(NULL => 'Choose district after county'))->setRegisterInArrayValidator(false)->setDecorators($decorators)->disabled = true;
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->addMultiOptions(array(NULL => 'Choose parish after county'))->setDecorators($decorators)->disabled = true;
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose a region for a wide result', 'Choose region' => $region_options))->addValidator('InArray', false, array(array_keys($region_options)))->addFilters(array('StripTags', 'StringTrim'));
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->addValidators(array('ValidGridRef'))->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $fourFigure = new Zend_Form_Element_Text('fourFigure');
     $fourFigure->setLabel('Four figure grid reference: ')->addValidators(array('ValidGridRef'))->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     ###
     ##Numismatic data
     ###
     //Denomination
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose denomination type', 'Available denominations' => $denom_options))->addValidator('InArray', false, array(array_keys($denom_options)))->setDecorators($decorators);
     //Primary ruler
     $ruler = new Zend_Form_Element_Select('ruler');
     $ruler->setLabel('Ruler / issuer: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose primary ruler', 'Available rulers' => $ruler_options))->addValidator('InArray', false, array(array_keys($ruler_options)))->setDecorators($decorators);
     //Mint
     $mint = new Zend_Form_Element_Select('mint');
     $mint->setLabel('Issuing mint: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose issuing mint', 'Available mints' => $mint_options))->addValidator('InArray', false, array(array_keys($mint_options)))->setDecorators($decorators);
     //Reece
     $reece = new Zend_Form_Element_Select('reeceID');
     $reece->setLabel('Reece period: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose Reece period', 'Available Reece periods' => $reece_options))->addValidator('InArray', false, array(array_keys($reece_options)))->setDecorators($decorators);
     //Reverse type
     $reverse = new Zend_Form_Element_Select('revtypeID');
     $reverse->setLabel('Fourth Century reverse type: ')->setDescription('This field is only applicable for fourth century AD coins.')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->addMultiOptions(array(NULL => 'Only available after choosing a 4th century issuer'));
     //Moneyer
     $moneyer = new Zend_Form_Element_Select('moneyer');
     $moneyer->setLabel('Republican moneyers: ')->setDescription('This field is only applicable for Republican coins.')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->addMultiOptions(array(NULL => 'Only available after choosing a Republican issuer'))->addValidator('InArray', false, array(array_keys($money)));
     //Obverse inscription
     $obverseinsc = new Zend_Form_Element_Text('obverseLegend');
     $obverseinsc->setLabel('Obverse inscription contains: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //Obverse description
     $obversedesc = new Zend_Form_Element_Text('obverseDescription');
     $obversedesc->setLabel('Obverse description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //reverse inscription
     $reverseinsc = new Zend_Form_Element_Text('reverseLegend');
     $reverseinsc->setLabel('Reverse inscription contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setAttrib('size', 60)->setDecorators($decorators);
     //reverse description
     $reversedesc = new Zend_Form_Element_Text('reverseDescription');
     $reversedesc->setLabel('Reverse description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setAttrib('size', 60)->setDecorators($decorators);
     //Die axis
     $axis = new Zend_Form_Element_Select('axis');
     $axis->setLabel('Die axis measurement: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose measurement' => $axis_options))->addValidator('InArray', false, array(array_keys($axis_options)))->setDecorators($decorators);
     $objecttype = new Zend_Form_Element_Hidden('objecttype');
     $objecttype->setValue('coin')->setAttrib('class', 'none')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $broadperiod = new Zend_Form_Element_Hidden('broadperiod');
     $broadperiod->setValue('Roman')->setAttrib('class', 'none')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addFilters(array('StringToUpper', 'StripTags', 'StringTrim'))->addValidator('Alpha');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setLabel('Submit your search ..')->setAttrib('class', 'large');
     $institution = new Zend_Form_Element_Select('institution');
     $institution->setLabel('Recording institution: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose institution' => $inst_options))->setDecorators($decorators);
     $this->addElements(array($old_findID, $description, $workflow, $rally, $rallyID, $hoard, $hoardID, $county, $regionID, $district, $parish, $fourFigure, $gridref, $denomination, $ruler, $mint, $axis, $reece, $reverse, $obverseinsc, $obversedesc, $reverseinsc, $reversedesc, $moneyer, $objecttype, $broadperiod, $submit, $hash, $institution));
     $this->addDisplayGroup(array('denomination', 'ruler', 'mint', 'moneyer', 'axis', 'reeceID', 'revtypeID', 'obverseLegend', 'obverseDescription', 'reverseLegend', 'reverseDescription'), 'numismatics')->removeDecorator('HtmlTag');
     $this->numismatics->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->numismatics->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('old_findID', 'description', 'rally', 'rallyID', 'hoard', 'hID', 'workflow'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('county', 'regionID', 'district', 'parish', 'gridref', 'fourFigure', 'institution'), 'spatial')->removeDecorator('HtmlTag');
     $this->spatial->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->spatial->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->numismatics->setLegend('Numismatic details');
     $this->details->setLegend('Artefact details');
     $this->spatial->setLegend('Spatial details');
 }
 public function __construct($options = null)
 {
     $primaries = new Materials();
     $primary_options = $primaries->getPrimaries();
     //Get data to form select menu for periods
     //Get Rally data
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     //Get Hoard data
     $hoards = new Hoards();
     $hoard_options = $hoards->getHoards();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $rulers = new Rulers();
     $ruler_options = $rulers->getMedievalRulers();
     $denominations = new Denominations();
     $denomination_options = $denominations->getOptionsMedieval();
     $mints = new Mints();
     $mint_options = $mints->getMedievalMints();
     $axis = new Dieaxes();
     $axis_options = $axis->getAxes();
     $cats = new CategoriesCoins();
     $cat_options = $cats->getPeriodMed();
     $regions = new Regions();
     $region_options = $regions->getRegionName();
     $institutions = new Institutions();
     $inst_options = $institutions->getInsts();
     $axis = new Dieaxes();
     $axis_options = $axis->getAxes();
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'requiredSuffix' => ' *')), array('HtmlTag', array('tag' => 'li')));
     $this->setName('medNumismaticsSearch');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid number!')->setDecorators($decorators);
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Object description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     $workflow = new Zend_Form_Element_Select('workflow');
     $workflow->setLabel('Workflow stage: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose Worklow stage' => array('1' => 'Quarantine', '2' => 'On review', '3' => 'Awaiting validation', '4' => 'Published')))->setDecorators($decorators);
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setUncheckedValue(NULL)->setDecorators($decorators);
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose rally name' => $rally_options))->addValidator('InArray', false, array(array_keys($rally_options)))->setDecorators($decorators);
     $hoard = new Zend_Form_Element_Checkbox('hoard');
     $hoard->setLabel('Hoard find: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setUncheckedValue(NULL)->setDecorators($decorators);
     $hoardID = new Zend_Form_Element_Select('hID');
     $hoardID->setLabel('Part of this hoard: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose rally name' => $hoard_options))->addValidator('InArray', false, array(array_keys($hoard_options)))->setDecorators($decorators);
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)))->setDecorators($decorators);
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->addMultiOptions(array(NULL => 'Choose district after county'))->setRegisterInArrayValidator(false)->setDecorators($decorators);
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->addMultiOptions(array(NULL => 'Choose parish after county'))->setDecorators($decorators);
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->addMultiOptions(array(NULL => 'Choose a region for a wide result', 'Choose region' => $region_options))->setDecorators($decorators);
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->addValidators(array('NotEmpty', 'ValidGridRef'))->setDecorators($decorators);
     $fourFigure = new Zend_Form_Element_Text('fourFigure');
     $fourFigure->setLabel('Four figure grid reference: ')->addValidators(array('NotEmpty', 'ValidGridRef'))->setDecorators($decorators);
     ###
     ##Numismatic data
     ###
     //	Denomination
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a denomination', 'Available denominations' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options)))->setDecorators($decorators);
     $cat = new Zend_Form_Element_Select('category');
     $cat->setLabel('Category: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a category', 'Available categories' => $cat_options))->addValidator('InArray', false, array(array_keys($cat_options)))->setDecorators($decorators);
     $type = new Zend_Form_Element_Select('typeID');
     $type->setLabel('Coin type: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     //Primary ruler
     $ruler = new Zend_Form_Element_Select('ruler');
     $ruler->setLabel('Ruler / issuer: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a ruler', 'Available issuers' => $ruler_options))->addValidator('InArray', false, array(array_keys($ruler_options)))->setDecorators($decorators);
     //Mint
     $mint = new Zend_Form_Element_Select('mint');
     $mint->setLabel('Issuing mint: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addMultiOptions(array(NULL => 'Choose a mint', 'Available mints' => $mint_options))->addValidator('InArray', false, array(array_keys($mint_options)))->setDecorators($decorators);
     //Obverse inscription
     $obverseinsc = new Zend_Form_Element_Text('obinsc');
     $obverseinsc->setLabel('Obverse inscription contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //Obverse description
     $obversedesc = new Zend_Form_Element_Text('obdesc');
     $obversedesc->setLabel('Obverse description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //reverse inscription
     $reverseinsc = new Zend_Form_Element_Text('revinsc');
     $reverseinsc->setLabel('Reverse inscription contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //reverse description
     $reversedesc = new Zend_Form_Element_Text('revdesc');
     $reversedesc->setLabel('Reverse description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //Die axis
     $axis = new Zend_Form_Element_Select('axis');
     $axis->setLabel('Die axis measurement: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose an axis', 'Available measurements' => $axis_options))->addValidator('InArray', false, array(array_keys($axis_options)))->setDecorators($decorators);
     $objecttype = new Zend_Form_Element_Hidden('objecttype');
     $objecttype->setValue('COIN')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'none')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addValidator('Alpha');
     $broadperiod = new Zend_Form_Element_Hidden('broadperiod');
     $broadperiod->setValue('MEDIEVAL')->setAttrib('class', 'none')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setLabel('Submit')->setAttrib('class', 'large');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElement($hash);
     $institution = new Zend_Form_Element_Select('institution');
     $institution->setLabel('Recording institution: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => 'Choose an institution', 'Available institutions' => $inst_options))->setDecorators($decorators);
     $this->addElements(array($old_findID, $type, $description, $workflow, $rally, $rallyID, $hoard, $hoardID, $county, $regionID, $district, $parish, $fourFigure, $gridref, $denomination, $ruler, $mint, $axis, $obverseinsc, $obversedesc, $reverseinsc, $reversedesc, $objecttype, $broadperiod, $cat, $submit, $hash, $institution));
     $this->addDisplayGroup(array('category', 'ruler', 'typeID', 'denomination', 'mint', 'moneyer', 'axis', 'obinsc', 'obdesc', 'revinsc', 'revdesc'), 'numismatics')->removeDecorator('HtmlTag');
     $this->numismatics->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->numismatics->removeDecorator('DtDdWrapper');
     $this->numismatics->setLegend('Numismatic details: ');
     $this->addDisplayGroup(array('old_findID', 'description', 'rally', 'rallyID', 'hoard', 'hID', 'workflow'), 'details')->removeDecorator('HtmlTag');
     $this->details->setLegend('Object details:');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('county', 'regionID', 'district', 'parish', 'gridref', 'fourFigure', 'institution'), 'spatial')->removeDecorator('HtmlTag');
     $this->spatial->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->spatial->removeDecorator('DtDdWrapper');
     $this->spatial->setLegend('Spatial details: ');
     $this->setLegend('Perform an advanced search on our database: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
Ejemplo n.º 28
0
 /** Get the denominations
  * @access public
  */
 public function getdenominationsAction()
 {
     if ($this->getParam('term', false)) {
         $denominations = new Denominations();
         $data = $denominations->getDenominationByBroadPeriod($this->getParam('term'));
         if (empty($data)) {
             $data = array(array('id' => null, 'term' => 'No Options'));
         }
     } else {
         $data = array(null => 'You must choose a broad period first');
     }
     echo Zend_Json::encode($data);
 }
 public function __construct($options = null)
 {
     //Get data to form select menu for primary and secondary material
     $primaries = new Materials();
     $primary_options = $primaries->getPrimaries();
     //Get data to form select menu for periods
     //Get Rally data
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     //Get Hoard data
     $hoards = new Hoards();
     $hoard_options = $hoards->getHoards();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $denominations = new Denominations();
     $denom_options = $denominations->getOptionsIronAge();
     $rulers = new Rulers();
     $ruler_options = $rulers->getIronAgeRulers();
     $mints = new Mints();
     $mint_options = $mints->getIronAgeMints();
     $axis = new Dieaxes();
     $axis_options = $axis->getAxes();
     $geog = new Geography();
     $geog_options = $geog->getIronAgeGeographyDD();
     $regions = new Regions();
     $region_options = $regions->getRegionName();
     $tribes = new Tribes();
     $tribe_options = $tribes->getTribes();
     $institutions = new Institutions();
     $inst_options = $institutions->getInsts();
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('Advanced');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid number!')->setDecorators($decorators);
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Object description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     $workflow = new Zend_Form_Element_Select('workflow');
     $workflow->setLabel('Workflow stage: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     if (in_array($this->getRole(), $this->_higherlevel)) {
         $workflow->addMultiOptions(array(NULL => 'Choose a workflow stage', 'Available workflow stages' => array('1' => 'Quarantine', '2' => 'On review', '4' => 'Awaiting validation', '3' => 'Published')));
     }
     if (in_array($this->getRole(), $this->_restricted)) {
         $workflow->addMultiOptions(array(NULL => 'Choose a workflow stage', 'Available workflow stages' => array('4' => 'Awaiting validation', '3' => 'Published')));
     }
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setUncheckedValue(NULL)->setDecorators($decorators);
     $geographyID = new Zend_Form_Element_Select('geographyID');
     $geographyID->setLabel('Geographic area: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a geography', 'Available geographies' => $geog_options))->addValidator('inArray', false, array(array_keys($geog_options)))->addValidator('Int');
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a rally', 'Available rallies' => $rally_options))->setDecorators($decorators)->addValidator('inArray', false, array(array_keys($rally_options)))->addValidator('Int');
     $hoard = new Zend_Form_Element_Checkbox('hoard');
     $hoard->setLabel('Hoard find: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setUncheckedValue(NULL)->setDecorators($decorators);
     $hoardID = new Zend_Form_Element_Select('hID');
     $hoardID->setLabel('Part of this hoard: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a hoard', 'Available hoards' => $hoard_options))->setDecorators($decorators)->addValidator('inArray', false, array(array_keys($hoard_options)))->addValidator('Int');
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a county', 'Available counties' => $county_options))->addValidator('inArray', false, array(array_keys($county_options)))->setDecorators($decorators);
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose district after county'))->setDecorators($decorators)->disabled = true;
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose parish after county'))->setDecorators($decorators)->disabled = true;
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose a region for a wide result', 'Available regions' => $region_options))->addValidator('Int');
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->setDecorators($decorators)->addValidator('ValidGridRef')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum');
     $fourFigure = new Zend_Form_Element_Text('fourFigure');
     $fourFigure->setLabel('Four figure grid reference: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('ValidGridRef')->addValidator('Alnum');
     ###
     ##Numismatic data
     ###
     //	Denomination
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose denomination type', 'Available denominations' => $denom_options))->addValidator('inArray', false, array(array_keys($denom_options)))->setDecorators($decorators);
     //Primary ruler
     $ruler = new Zend_Form_Element_Select('ruler');
     $ruler->setLabel('Ruler / issuer: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose primary ruler', 'Available rulers' => $ruler_options))->addValidator('inArray', false, array(array_keys($denom_options)))->setDecorators($decorators);
     //Mint
     $mint = new Zend_Form_Element_Select('mint');
     $mint->setLabel('Issuing mint: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose issuing mint', 'Available mints' => $mint_options))->addValidator('inArray', false, array(array_keys($mint_options)))->setDecorators($decorators);
     //Secondary ruler
     $ruler2 = new Zend_Form_Element_Select('ruler2');
     $ruler2->setLabel('Secondary ruler / issuer: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose secondary ruler', 'Available rulers' => $ruler_options))->addValidator('inArray', false, array(array_keys($ruler_options)))->setDecorators($decorators);
     //Obverse inscription
     $obverseinsc = new Zend_Form_Element_Text('obverseLegend');
     $obverseinsc->setLabel('Obverse inscription contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //Obverse description
     $obversedesc = new Zend_Form_Element_Text('obverseDescription');
     $obversedesc->setLabel('Obverse description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //reverse inscription
     $reverseinsc = new Zend_Form_Element_Text('reverseLegend');
     $reverseinsc->setLabel('Reverse inscription contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //reverse description
     $reversedesc = new Zend_Form_Element_Text('reverseDescription');
     $reversedesc->setLabel('Reverse description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //Die axis
     $axis = new Zend_Form_Element_Select('axis');
     $axis->setLabel('Die axis measurement: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose measurement', 'Available die axes' => $axis_options))->addValidator('inArray', false, array(array_keys($axis_options)))->addErrorMessage('That option is not a valid choice')->addValidator('Int')->setDecorators($decorators);
     //Tribe
     $tribe = new Zend_Form_Element_Select('tribe');
     $tribe->setLabel('Iron Age tribe: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a tribe', 'Available tribes' => $tribe_options))->addValidator('inArray', false, array(array_keys($tribe_options)))->addErrorMessage('That option is not a valid choice')->addValidator('Int')->setDecorators($decorators);
     $objecttype = new Zend_Form_Element_Hidden('objecttype');
     $objecttype->setValue('COIN')->setAttrib('class', 'none')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha', false, array('allowWhiteSpace' => true))->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label');
     $broadperiod = new Zend_Form_Element_Hidden('broadperiod');
     $broadperiod->setValue('IRON AGE')->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setAttrib('class', 'none')->addFilters(array('StripTags', 'StringTrim'))->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label');
     $mack_type = new Zend_Form_Element_Text('mackType');
     $mack_type->setLabel('Mack Type: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $bmc_type = new Zend_Form_Element_Text('bmc');
     $bmc_type->setLabel('British Museum catalogue number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $allen_type = new Zend_Form_Element_Text('allenType');
     $allen_type->setLabel('Allen Type: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $va_type = new Zend_Form_Element_Text('vaType');
     $va_type->setLabel('Van Arsdell Number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $rudd_type = new Zend_Form_Element_Text('ruddType');
     $rudd_type->setLabel('Ancient British Coinage number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $phase_date_1 = new Zend_Form_Element_Text('phase_date_1');
     $phase_date_1->setLabel('Phase date 1: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $phase_date_2 = new Zend_Form_Element_Text('phase_date_2');
     $phase_date_2->setLabel('Phase date 2: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $context = new Zend_Form_Element_Text('context');
     $context->setLabel('Context of coins: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $depositionDate = new Zend_Form_Element_Text('depositionDate');
     $depositionDate->setLabel('Date of deposition: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $numChiab = new Zend_Form_Element_Text('numChiab');
     $numChiab->setLabel('Coin hoards of Iron Age Britain number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->setLabel('Submit your search...');
     $institution = new Zend_Form_Element_Select('institution');
     $institution->setLabel('Recording institution: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose institution' => $inst_options))->setDecorators($decorators);
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElement($hash);
     $this->addElements(array($old_findID, $description, $workflow, $rally, $rallyID, $hoard, $hoardID, $county, $regionID, $district, $parish, $fourFigure, $gridref, $denomination, $ruler, $mint, $axis, $obverseinsc, $obversedesc, $reverseinsc, $reversedesc, $ruler2, $tribe, $objecttype, $broadperiod, $geographyID, $bmc_type, $mack_type, $allen_type, $va_type, $rudd_type, $numChiab, $context, $depositionDate, $phase_date_1, $phase_date_2, $submit, $institution));
     $this->addDisplayGroup(array('denomination', 'geographyID', 'ruler', 'ruler2', 'tribe', 'mint', 'axis', 'obverseLegend', 'obverseDescription', 'reverseLegend', 'reverseDescription', 'bmc', 'vaType', 'allenType', 'ruddType', 'mackType', 'numChiab', 'context', 'phase_date_1', 'phase_date_2', 'depositionDate'), 'numismatics')->removeDecorator('HtmlTag');
     $this->numismatics->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->numismatics->removeDecorator('DtDdWrapper');
     $this->numismatics->setLegend('Numismatic details: ');
     $this->addDisplayGroup(array('old_findID', 'description', 'rally', 'rallyID', 'hoard', 'hID', 'workflow'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Object details: ');
     $this->addDisplayGroup(array('county', 'regionID', 'district', 'parish', 'gridref', 'fourFigure', 'institution'), 'spatial')->removeDecorator('HtmlTag');
     $this->spatial->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->spatial->removeDecorator('DtDdWrapper');
     $this->spatial->setLegend('Spatial details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
Ejemplo n.º 30
0
 /** Link a ruler to a denomination
  * @access public
  * @return void
  *
  */
 public function rulertodenominationAction()
 {
     $form = new AddDenomToRulerForm();
     $rulerid = $this->getParam('rulerid');
     $period = $this->getParam('period');
     $denoms = new Denominations();
     $denomsList = $denoms->getDenomsAdd($period);
     $form->ruler_id->setValue($rulerid);
     $form->period_id->setValue($period);
     $form->denomination_id->addMultiOptions($denomsList);
     $this->view->form = $form;
     if ($this->_request->isPost()) {
         if ($form->isValid($this->_request->getPost())) {
             $denoms = new DenomRulers();
             $denoms->add($form->getValues());
             $this->getFlash()->addMessage('A new denomination has been added.');
             if ($period == 21) {
                 $this->redirect($this->redirectUrl . 'romanruler/id/' . $rulerid);
             } else {
                 $this->redirect($this->redirectUrl . 'medruler/id/' . $rulerid);
             }
         } else {
             $this->getFlash()->addMessage($this->_formErrors);
             $form->populate($this->_request->getPost());
         }
     }
 }