/** Construct the class
  * @access public
  * @return string|Pas_Exception
  */
 public function __construct()
 {
     $person = new Pas_User_Details();
     if ($person) {
         $this->_inst = $person->getPerson()->institution;
     } else {
         throw new Pas_Exception('No user credentials found');
     }
 }
Ejemplo n.º 2
0
 /** Get the role of the user
  * @access public
  * @return string
  */
 public function getRole()
 {
     $user = new Pas_User_Details();
     $person = $user->getPerson();
     if ($person) {
         $this->_role = $person->role;
     }
     return $this->_role;
 }
Ejemplo n.º 3
0
 /** Get the user role
  * @access public
  * @return string $_role;
  */
 public function getRole()
 {
     $person = new Pas_User_Details();
     $details = $person->getPerson();
     if ($details) {
         $this->_role = $details->role;
     }
     return $this->_role;
 }
Ejemplo n.º 4
0
 /** Get the role of the user
  * @access public
  * @return string
  */
 public function getRole()
 {
     $user = new Pas_User_Details();
     $person = $user->getPerson();
     if ($person) {
         return $person->role;
     } else {
         return 'public';
     }
 }
Ejemplo n.º 5
0
 /** Get the identity of user
  * @access public
  * @return integer
  * @throws Zend_Exception
  */
 protected function _getIdentity()
 {
     $user = new Pas_User_Details();
     $person = $user->getPerson();
     if ($person) {
         return $person->id;
     } else {
         throw new Zend_Exception('No user credentials found', 500);
     }
 }
Ejemplo n.º 6
0
 /** Construct the user object
  *
  */
 public function __construct()
 {
     $user = new Pas_User_Details();
     $this->_user = $user->getPerson();
     if ($this->_user) {
         $this->_role = $this->_user->role;
     } else {
         $this->_role = 'public';
     }
 }
 /** Get the user role
  * @access public
  */
 public function getRole()
 {
     $user = new Pas_User_Details();
     if ($user->getPerson()) {
         $role = $user->getPerson()->role;
     } else {
         $role = NULL;
     }
     return $role;
 }
Ejemplo n.º 8
0
 /** Get the user account
  * @access protected
  * @return string
  * @throws Pas_Exception
  */
 protected function _getAccount()
 {
     $user = new Pas_User_Details();
     $person = $user->getPerson();
     if ($person) {
         return $person->institution;
     } else {
         throw new Pas_Exception('User credentials missing', 500);
     }
 }
Ejemplo n.º 9
0
 /** Get the role of the user
  * @access protected
  * @return mixed
  */
 protected function getRole()
 {
     $user = new Pas_User_Details();
     $person = $user->getPerson();
     if ($person) {
         return $person->role;
     } else {
         return null;
     }
 }
Ejemplo n.º 10
0
 /** Work out who created the error
  * @access public
  * @return string
  */
 public function whois()
 {
     $user = new Pas_User_Details();
     if (is_null($user->getPerson())) {
         $string = 'Public user';
     } else {
         $name = $user->getPerson()->fullname;
         $account = $user->getPerson()->username;
         $string = $name . ' with the account username of ' . $account;
     }
     return $string;
 }
Ejemplo n.º 11
0
 /** The form constructor
  * @access public
  */
 public function __construct()
 {
     $this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element', 'element');
     $this->addElementPrefixPath('Pas_Filter', 'Pas/Filter/', 'filter');
     $this->addElementPrefixPath('Pas_Validate', 'Pas/Validate/', 'validate');
     $this->setAttrib('class', 'form-horizontal');
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->clearDecorators();
     $person = new Pas_User_Details();
     $details = $person->getPerson();
     if ($details) {
         $this->_role = $details->role;
     } else {
         $this->_role = 'public';
     }
     parent::__construct();
 }
Ejemplo n.º 12
0
 /** Construct the form
  * @access public
  */
 public function __construct()
 {
     $this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element', 'element');
     $this->addElementPrefixPath('Pas_Filter', 'Pas/Filter/', 'filter');
     $this->addElementPrefixPath('Pas_Validate', 'Pas/Validate/', 'validate');
     $this->setAttrib('class', 'form-horizontal');
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->clearDecorators();
     $this->_view = Zend_Layout::getMvcInstance()->getView();
     $this->_view->jQuery()->addJavascriptFile($this->_view->baseUrl() . '/js/select2.min.js', $type = 'text/javascript');
     $this->_view->jQuery()->addJavascriptFile($this->_view->baseUrl() . '/js/selectPrettify.js', $type = 'text/javascript');
     $this->_view->headLink()->appendStylesheet($this->_view->baseUrl() . '/css/select2.css', $type = 'screen');
     $this->_view->headLink()->appendStylesheet($this->_view->baseUrl() . '/css/bootstrap-multiselect.css', $type = 'screen');
     $person = new Pas_User_Details();
     $details = $person->getPerson();
     if ($details) {
         $this->_role = $details->role;
     } else {
         $this->_role = 'public';
     }
     parent::__construct();
 }
Ejemplo n.º 13
0
 /** Get the current user to check
  * @access public
  * @return object
  */
 public function getUser()
 {
     $person = new Pas_User_Details();
     return $person->getPerson();
 }
Ejemplo n.º 14
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     ## GET OPTIONS TO POPULATE MENUS ##
     //Get periods for select menu
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     $periodword_options = $periods->getPeriodFromWords();
     //Get terminal reasons for select menu
     $terminalreasons = new TerminalReasons();
     $terminalreason_options = $terminalreasons->getReasons();
     //Get coin data quality ratings for select menu
     $qualityrating = new DataQuality();
     $qualityrating_options = $qualityrating->getRatings();
     //Get Find of note reason options for select menu
     $reasons = new Findofnotereasons();
     $reason_options = $reasons->getReasons();
     //Get primary materials for multiselect
     $primarymaterials = new Materials();
     $materials_options = $primarymaterials->getPrimaries();
     //Get discovery methods for select menu
     $discs = new DiscoMethods();
     $disc_options = $discs->getOptions();
     //Get Rally data for select menu
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     //Get Subsequent actions for select menu
     $actions = new SubsequentActions();
     $actionsDD = $actions->getSubActionsDD();
     //Get the reece periods for inclusion
     $reece = new Reeces();
     $reeces = $reece->getReeces();
     //End of select options construction
     $this->addElementPrefixPath('Pas_Filter', 'Pas/Filter/', 'filter');
     parent::__construct($options);
     $this->setName('hoards');
     ## UNIQUE ID FIELDS ##
     $secuid = new Zend_Form_Element_Hidden('secuid');
     $secuid->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum');
     $old_hoardID = new Zend_Form_Element_Hidden('hoardID');
     $old_hoardID->addFilters(array('StripTags', 'StringTrim'));
     ## HOARD DATING ##
     //Broadperiod:
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Broad period: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose broadperiod', 'Available periods' => $periodword_options))->addErrorMessage('You must enter a broad period.')->addValidator('InArray', false, array(array_keys($periodword_options)))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(1);
     //Sub period from: Assigned via dropdown
     $hoardsubperiod1 = new Zend_Form_Element_Select('subperiod1');
     $hoardsubperiod1->setLabel('Sub period from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a subperiod', 'Valid sub periods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->setAttribs(array('class' => 'selectpicker show-menu-arrow'))->setOrder(2);
     //Period from: Assigned via dropdown
     $hoardperiod1 = new Zend_Form_Element_Select('period1');
     $hoardperiod1->setLabel('Period from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a period from', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(3);
     //Sub period to: Assigned via dropdown
     $hoardsubperiod2 = new Zend_Form_Element_Select('subperiod2');
     $hoardsubperiod2->setLabel('Sub period to: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a subperiod', 'Valid sub periods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->addValidator('Digits')->setAttribs(array('class' => 'selectpicker show-menu-arrow'))->setOrder(4);
     //Period to: Assigned via dropdown
     $hoardperiod2 = new Zend_Form_Element_Select('period2');
     $hoardperiod2->setLabel('Period to: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(5);
     //Date from: Free text Integer +ve or -ve
     $numdate1 = new Zend_Form_Element_Text('numdate1');
     $numdate1->setLabel('Date from: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(6);
     //Date to: Free text Integer +ve or -ve
     $numdate2 = new Zend_Form_Element_Text('numdate2');
     $numdate2->setLabel('Date to: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(7);
     ## COIN DATING ##
     //Ruler of latest coins in hoard:
     $lastruler = new Zend_Form_Element_Select('lastrulerID');
     $lastruler->setLabel('Last ruler: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose ruler after broad period'))->setRegisterInArrayValidator(false)->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(8);
     //Ruler of latest coins in hoard:
     $lastreeceperiod = new Zend_Form_Element_Select('reeceID');
     $lastreeceperiod->setLabel('Last Reece period: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose Reece period', 'Available periods' => $reeces))->setRegisterInArrayValidator(false)->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(9);
     //Date from: Free text Integer +ve or -ve
     $terminaldate1 = new Zend_Form_Element_Text('terminalyear1');
     $terminaldate1->setLabel('Terminal date from: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(10);
     //Date to: Free text Integer +ve or -ve
     $terminaldate2 = new Zend_Form_Element_Text('terminalyear2');
     $terminaldate2->setLabel('Terminal date to: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(11);
     //Reason for terminal coin dating
     $terminalreason = new Zend_Form_Element_Select('terminalreason');
     $terminalreason->setLabel('Terminal reason: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a reasoning', 'Available reasons' => $terminalreason_options))->addValidator('InArray', false, array(array_keys($terminalreason_options)))->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow')->addValidator('Int')->setOrder(12);
     ## HOARD DETAILS ##
     //Hoard description
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Hoard description: ')->setRequired(false)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->setOrder(13);
     //Object notes
     $notes = new Pas_Form_Element_CKEditor('notes');
     $notes->setLabel('Notes: ')->setRequired(false)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->setOrder(14);
     //Coin data quality rating
     $coindataquality = new Zend_Form_Element_Select('qualityrating');
     $coindataquality->setLabel('Coin data quality rating: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a rating', 'Available ratings' => $qualityrating_options))->addValidator('InArray', false, array(array_keys($qualityrating_options)))->setAttrib('class', 'input-large selectpicker show-menu-arrow')->setDescription('This data quality field can only be completed by hoards project staff')->addValidator('Int')->setOrder(15);
     //Find of note
     $findofnote = new Zend_Form_Element_Checkbox('findofnote');
     $findofnote->setLabel('Find of Note: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('NotEmpty', 'Int')->setOrder(16);
     //Reason for find of note
     $findofnotereason = new Zend_Form_Element_Select('findofnotereason');
     $findofnotereason->setLabel('Why this find is considered noteworthy: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a reasoning', 'Available reasons' => $reason_options))->addValidator('InArray', false, array(array_keys($reason_options)))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Int')->setOrder(17);
     //Treasure: enumerator 1/0
     $treasure = new Zend_Form_Element_Checkbox('treasure');
     $treasure->setLabel('Treasure: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(18);
     //Treasure ID
     $treasureID = new Zend_Form_Element_Text('treasureID');
     $treasureID->setLabel('Treasure number: ')->setRequired(false)->setAttribs(array('placeholder' => 'T numbers are in the format of YYYYT1234', 'class' => 'span6'))->addValidator('Alnum', false, array('allowWhiteSpace' => false))->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'))->setOrder(19);
     ## QUANTITIES ##
     $quantityCoins = new Zend_Form_Element_Text('quantityCoins');
     $quantityCoins->setLabel('Quantity of coins: ')->addValidator('Int')->setOrder(20);
     $quantityArtefacts = new Zend_Form_Element_Text('quantityArtefacts');
     $quantityArtefacts->setLabel('Quantity of artefacts: ')->addValidator('Int')->setOrder(21);
     $quantityContainers = new Zend_Form_Element_Text('quantityContainers');
     $quantityContainers->setLabel('Quantity of containers: ')->addValidator('Int')->setOrder(22);
     ## MATERIALS ##
     //Materials
     $materials = new Zend_Form_Element_Multiselect('materials');
     $materials->setLabel('Primary materials: ')->addMultiOptions($materials_options)->setAttrib('class', 'multiselect')->setDescription('Primary materials of coins and artefacts in the hoard')->addFilters(array('Null'))->setOrder(23);
     ## RECORDING DETAILS ##
     //Recorder
     $recorderID = new Zend_Form_Element_Hidden('recorderID');
     $recorderID->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(24);
     $recordername = new Zend_Form_Element_Text('recordername');
     $recordername->setLabel('Recorded by: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(25);
     //Primary Identifier
     $idBy = new Zend_Form_Element_Text('idBy');
     $idBy->setLabel('Primary identifier: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(26);
     $identifier1ID = new Zend_Form_Element_Hidden('identifier1ID');
     $identifier1ID->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(27);
     $id2by = new Zend_Form_Element_Text('id2by');
     $id2by->setLabel('Secondary Identifier: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(28);
     //Secondary Identifier
     $identifier2ID = new Zend_Form_Element_Hidden('identifier2ID');
     $identifier2ID->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(29);
     ## DISCOVERER DETAILS ##
     //Finder
     $finder1ID = new Zend_Form_Element_Hidden('finder1ID');
     $finder1ID->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(30);
     $hiddenfield = new Zend_Form_Element_Hidden('hiddenfield');
     $hiddenfield->setValue(2)->setOrder(31);
     $finder1 = new Zend_Form_Element_Text('finder1');
     $finder1->setLabel('Found by: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setDescription('To make a new finder/identifier appear, you ' . 'first need to create them from the people menu on ' . 'the left hand side')->setOrder(32);
     $addFinderButton = new Zend_Form_Element_Button('addFinder');
     $addFinderButton->setLabel('Add Additional Finder')->setAttribs(array('class' => 'btn btn-info'));
     $addFinderButton->setOrder(50);
     $removeFinderButton = new Zend_Form_Element_Button('removeFinder');
     $removeFinderButton->setLabel('Remove Last Finder')->setAttribs(array('class' => 'btn btn-warning hidden'));
     $removeFinderButton->setOrder(51);
     ## DISCOVERY INFORMATION ##
     //Discovery method
     $discmethod = new Zend_Form_Element_Select('discmethod');
     $discmethod->setLabel('Discovery method: ')->setRequired(false)->setValue(1)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->addValidator('inArray', true, array(array_keys($disc_options)))->addMultiOptions(array(null => 'Choose method of discovery', 'Available methods' => $disc_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->setOrder(52);
     //Discovery circumstances
     $disccircum = new Zend_Form_Element_Text('disccircum');
     $disccircum->setLabel('Discovery circumstances: ')->setAttrib('size', 50)->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(53);
     //Date found from
     $datefound1 = new Zend_Form_Element_Text('datefound1');
     $datefound1->setLabel('First discovery date: ')->setAttrib('size', 10)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(54);
     //Date found to
     $datefound2 = new Zend_Form_Element_Text('datefound2');
     $datefound2->setLabel('Second discovery date: ')->setAttrib('size', 10)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(55);
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(56);
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose rally name', 'Available rallies' => $rally_options))->addValidator('InArray', false, array(array_keys($rally_options)))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->addValidator('Int')->setOrder(57);
     ## OTHER REFERENCE NUMBERS ##
     //Legacy hoard ID
     $legacy_ref = new Zend_Form_Element_Text('legacyID');
     $legacy_ref->setLabel('Legacy hoard ID: ')->setAttrib('size', 5)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(58)->disabled = true;
     //Other reference number
     $other_ref = new Zend_Form_Element_Text('other_ref');
     $other_ref->setLabel('Other reference: ')->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(59);
     //HER reference number
     $smrrefno = new Zend_Form_Element_Text('smrrefno');
     $smrrefno->setLabel('Historic Environment Record number: ')->setAttrib('size', 30)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(60);
     //Museum accession number
     $musaccno = new Zend_Form_Element_Text('musaccno');
     $musaccno->setLabel('Museum accession number: ')->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(61);
     //Current location of object
     $curr_loc = new Zend_Form_Element_Text('curr_loc');
     $curr_loc->setLabel('Current location: ')->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(62);
     //Current location of object
     $subs_action = new Zend_Form_Element_Select('subs_action');
     $subs_action->setLabel('Subsequent action: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setAttrib('class', 'span6')->addMultiOptions(array(null => 'Choose a subsequent action', 'Available options' => $actionsDD))->setValue(1)->addValidator('InArray', false, array(array_keys($actionsDD)))->addValidator('Int')->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->setOrder(63);
     ## Quantities ##
     $quantityCoins = new Zend_Form_Element_Text('quantityCoins');
     $quantityCoins->setLabel('Quantity of coins: ')->addValidator('Int')->setValue(null);
     $quantityArtefacts = new Zend_Form_Element_Text('quantityArtefacts');
     $quantityArtefacts->setLabel('Quantity of artefacts: ')->addValidator('Int')->setValue(null);
     $quantityContainers = new Zend_Form_Element_Text('quantityContainers');
     $quantityContainers->setLabel('Quantity of containers: ')->addValidator('Int')->setValue(null);
     ## SUBMIT BUTTON ##
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setOrder(67);
     $this->addElements(array($secuid, $old_hoardID, $broadperiod, $hoardperiod1, $hoardperiod2, $hoardsubperiod1, $hoardsubperiod2, $numdate1, $numdate2, $lastruler, $lastreeceperiod, $terminaldate1, $terminaldate2, $terminalreason, $description, $notes, $coindataquality, $findofnote, $findofnotereason, $treasure, $treasureID, $quantityArtefacts, $quantityCoins, $quantityContainers, $materials, $recorderID, $recordername, $idBy, $id2by, $identifier1ID, $identifier2ID, $finder1, $finder1ID, $hiddenfield, $addFinderButton, $removeFinderButton, $discmethod, $disccircum, $datefound1, $datefound2, $rally, $rallyID, $legacy_ref, $other_ref, $smrrefno, $musaccno, $curr_loc, $subs_action, $submit));
     $this->addDisplayGroup(array('broadperiod', 'subperiod1', 'period1', 'subperiod2', 'period2', 'numdate1', 'numdate2'), 'hoarddating');
     $this->hoarddating->setLegend('Hoard dating');
     $this->addDisplayGroup(array('lastrulerID', 'reeceID', 'terminalyear1', 'terminalyear2', 'terminalreason'), 'coindating');
     $this->coindating->setLegend('Coin dating');
     $this->addDisplayGroup(array('description', 'notes', 'qualityrating', 'findofnote', 'findofnotereason', 'treasure', 'treasureID'), 'hoarddetails');
     $this->hoarddetails->setLegend('Hoard details');
     $this->addDisplayGroup(array('quantityCoins', 'quantityArtefacts', 'quantityContainers'), 'quantities');
     $this->quantities->setLegend('Quantities');
     $this->addDisplayGroup(array('materials'), 'primarymaterials');
     $this->primarymaterials->setLegend('Materials');
     $this->addDisplayGroup(array('recordername', 'recorderID', 'idBy', 'identifier1ID', 'id2by', 'identifier2ID'), 'recorders');
     $this->recorders->setLegend('Recording details');
     $this->addDisplayGroup(array('finder1', 'finder1ID', 'hiddenfield', 'addFinder', 'removeFinder'), 'discoverers');
     $this->discoverers->setLegend('Discoverer details');
     $this->addDisplayGroup(array('disccircum', 'discmethod', 'datefound1', 'datefound2', 'rally', 'rallyID'), 'discovery');
     $this->discovery->setLegend('Discovery details');
     $this->addDisplayGroup(array('legacyID', 'other_ref', 'smrrefno', 'musaccno', 'curr_loc', 'subs_action'), 'references');
     $this->references->setLegend('Reference numbers');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
     $addFinderButton->removeDecorator('Label');
     $addFinderButtonDecorator = $addFinderButton->getDecorator('HtmlTag');
     $addFinderButtonDecorator->setOption('id', 'addFinderDiv');
     $removeFinderButton->removeDecorator('Label');
     $person = new Pas_User_Details();
     $role = $person->getRole();
     $projectTeam = array('hoard', 'admin');
     if (!in_array($role, $projectTeam)) {
         $coindataquality->disabled = true;
     }
 }
Ejemplo n.º 15
0
 /** Get the person logged in
  * @return string
  */
 public function getPerson()
 {
     $user = new Pas_User_Details();
     return $user->getPerson();
 }
Ejemplo n.º 16
0
 public function __construct()
 {
     $user = new Pas_User_Details();
     $this->_user = $user->getPerson();
     $this->_dateTime = Zend_Date::now()->toString('yyyyMMddHHmmss');
     $backendOptions = array('cache_dir' => APPLICATION_PATH . '/tmp');
     $this->_memory = Zend_Memory::factory('File', $backendOptions);
     $params = Zend_Controller_Front::getInstance()->getRequest()->getParams();
     $this->_params = $this->_cleanParams($params);
     $this->_search = new Pas_Solr_Handler();
 }
Ejemplo n.º 17
0
 /** Get the role
  * @access public
  * @return type
  */
 public function getRole()
 {
     $person = new Pas_User_Details();
     $this->_role = $person->getRole();
     return $this->_role;
 }
Ejemplo n.º 18
0
 public function getUser()
 {
     $user = new Pas_User_Details();
     if ($user) {
         $this->_user = $user->getPerson();
     } else {
         throw new Pas_Exception('No user credentials found', 500);
     }
     return $this->_user;
 }
Ejemplo n.º 19
0
 /** Get the user's details
  * @access public
  * @return string
  */
 public function getUser()
 {
     $user = new Pas_User_Details();
     return $user->getPerson()->fullname;
 }
Ejemplo n.º 20
0
 /** Get the user's role
  * @access protected
  * @return string
  */
 protected function _getRole()
 {
     $role = new Pas_User_Details();
     return $role->getPerson()->role;
 }
Ejemplo n.º 21
0
 /** Get the user id to query
  * @access public   
  * @return integer
  */
 public function getRole()
 {
     $user = new Pas_User_Details();
     $this->_role = $user->getRole();
     return $this->_role;
 }
Ejemplo n.º 22
0
 /** Construct the class
  * @access public
  * @return void
  */
 public function __construct()
 {
     $person = new Pas_User_Details();
     $this->_id = $person->getIdentityForForms();
 }
Ejemplo n.º 23
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  *
  */
 public function __construct(array $options = null)
 {
     ## GET OPTIONS TO POPULATE MENUS ##
     //Get site class options for select menu
     $siteclasses = new ArchaeologicalSiteClass();
     $siteclass_options = $siteclasses->getOptions();
     //Get archaeological landscape and topography options for select menu
     $landscapes = new ArchaeologicalLandscape();
     $landscape_options = $landscapes->getOptions();
     //Get periods for select menu
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     $periodword_options = $periods->getPeriodFromWords();
     //Get archaeological context options for select menu
     $contexts = new ArchaeologicalContexts();
     $context_options = $contexts->getOptions();
     //Get archaeological feature options for select menu
     $features = new ArchaeologicalFeatures();
     $feature_options = $features->getOptions();
     //Get recovery methods for select menu
     $recoveries = new RecoveryMethods();
     $rec_options = $recoveries->getOptions();
     //Get contextual data quality ratings for select menu
     $qualityrating = new DataQuality();
     $qualityrating_options = $qualityrating->getRatings();
     //End of select options construction
     $this->addElementPrefixPath('Pas_Filter', 'Pas/Filter/', 'filter');
     parent::__construct($options);
     $this->setName('archaeology');
     ## SITE INFORMATION ##
     //Known site checkbox
     $knownsite = new Zend_Form_Element_Checkbox('knownsite');
     $knownsite->setLabel('Known site: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim'));
     //Excavated checkbox
     $excavated = new Zend_Form_Element_Checkbox('excavated');
     $excavated->setLabel('Excavated site: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim'));
     //Site class menu: Assigned via dropdown
     $siteclass = new Zend_Form_Element_Select('sitecontext');
     $siteclass->setLabel('Site class: ')->addMultioptions(array(null => 'Choose class of site', 'Available classes' => $siteclass_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($siteclass_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     //Landscape and topography menu: Assigned via dropdown
     $landscape_topography = new Zend_Form_Element_Select('landscapetopography');
     $landscape_topography->setLabel('Landscape and topography: ')->addMultioptions(array(null => 'Choose landscape term', 'Available terms' => $landscape_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($landscape_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     ## SITE DATING ##
     //Broad period
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Broad period: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose broadperiod', 'Available periods' => $periodword_options))->addErrorMessage('You must enter a broad period.')->addValidator('InArray', false, array(array_keys($periodword_options)))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Sub period from: Assigned via dropdown
     $sitesubperiod1 = new Zend_Form_Element_Select('subperiod1');
     $sitesubperiod1->setLabel('Sub period from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a subperiod', 'Valid sub periods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->setAttribs(array('class' => 'selectpicker show-menu-arrow'));
     //Period from: Assigned via dropdown
     $siteperiod1 = new Zend_Form_Element_Select('period1');
     $siteperiod1->setLabel('Period from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a period from', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Sub period to: Assigned via dropdown
     $sitesubperiod2 = new Zend_Form_Element_Select('subperiod2');
     $sitesubperiod2->setLabel('Sub period to: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a subperiod', 'Valid sub periods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->addValidator('Digits')->setAttribs(array('class' => 'selectpicker show-menu-arrow'));
     //Period to: Assigned via dropdown
     $siteperiod2 = new Zend_Form_Element_Select('period2');
     $siteperiod2->setLabel('Period to: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'));
     //Date from: Free text Integer +ve or -ve
     $numdate1 = new Zend_Form_Element_Text('sitedateyear1');
     $numdate1->setLabel('Date from: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     //Date to: Free text Integer +ve or -ve
     $numdate2 = new Zend_Form_Element_Text('sitedateyear2');
     $numdate2->setLabel('Date to: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     ## CONTEXT DETAILS ##
     //Archaeological context: Assigned via dropdown
     $arch_context = new Zend_Form_Element_Select('sitetype');
     $arch_context->setLabel('Context: ')->addMultioptions(array(null => 'Choose a context', 'Available contexts' => $context_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($context_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     //Archaeological feature: Assigned via dropdown
     $arch_feature = new Zend_Form_Element_Select('feature');
     $arch_feature->setLabel('Feature: ')->addMultioptions(array(null => 'Choose a feature', 'Available features' => $feature_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($feature_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     //Feature date from: Free text Integer +ve or -ve
     $featuredate1 = new Zend_Form_Element_Text('featuredateyear1');
     $featuredate1->setLabel('Feature date from: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     //Feature date to: Free text Integer +ve or -ve
     $featuredate2 = new Zend_Form_Element_Text('featuredateyear2');
     $featuredate2->setLabel('Feature date to: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     ## RECOVERY INFORMATION ##
     //Recovery method: Assigned via dropdown
     $recmethod = new Zend_Form_Element_Select('recmethod');
     $recmethod->setLabel('Recovery method: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addValidator('inArray', true, array(array_keys($rec_options)))->addMultiOptions(array(null => 'Choose method of discovery', 'Available methods' => $rec_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     //First excavation year: Free text Integer +ve or -ve
     $excavationyear1 = new Zend_Form_Element_Text('yearexc1');
     $excavationyear1->setLabel('First excavation year: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY', 'class' => 'input-large'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     //Second excavation year: Free text Integer +ve or -ve
     $excavationyear2 = new Zend_Form_Element_Text('yearexc2');
     $excavationyear2->setLabel('Second excavation year: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     ## ARCHAEOLOGICAL DETAILS ##
     //Archaeology description: free text field
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Archaeology description: ')->setRequired(false)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     //Contextual data quality rating: Assigned via dropdown
     $contextualdataquality = new Zend_Form_Element_Select('contextualrating');
     $contextualdataquality->setLabel('Context data quality rating: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a rating', 'Available ratings' => $qualityrating_options))->addValidator('InArray', false, array(array_keys($qualityrating_options)))->setAttrib('class', 'input-large selectpicker show-menu-arrow')->setDescription('This data quality field can only be completed by hoards project staff')->addValidator('Int');
     ## ARCHIVE LOCATION ##
     //Archive location: free text field
     $archive_loc = new Zend_Form_Element_Text('archiveloc');
     $archive_loc->setLabel('Archive location: ')->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim'));
     ## SUBMIT BUTTON ##
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($knownsite, $excavated, $siteclass, $landscape_topography, $broadperiod, $sitesubperiod1, $siteperiod1, $sitesubperiod2, $siteperiod2, $numdate1, $numdate2, $arch_context, $arch_feature, $featuredate1, $featuredate2, $recmethod, $excavationyear1, $excavationyear2, $description, $contextualdataquality, $archive_loc, $submit));
     $this->addDisplayGroup(array('knownsite', 'excavated', 'sitecontext', 'landscapetopography'), 'siteinfo');
     $this->siteinfo->setLegend('Site information');
     $this->addDisplayGroup(array('broadperiod', 'subperiod1', 'period1', 'subperiod2', 'period2', 'sitedateyear1', 'sitedateyear2'), 'sitedating');
     $this->sitedating->setLegend('Site dating');
     $this->addDisplayGroup(array('sitetype', 'feature', 'featuredateyear1', 'featuredateyear2'), 'contextdetails');
     $this->contextdetails->setLegend('Context details');
     $this->addDisplayGroup(array('recmethod', 'yearexc1', 'yearexc2'), 'recoveryinfo');
     $this->recoveryinfo->setLegend('Recovery information');
     $this->addDisplayGroup(array('description', 'contextualrating'), 'archaeologicaldetails');
     $this->archaeologicaldetails->setLegend('Archaeological details');
     $this->addDisplayGroup(array('archiveloc'), 'archivelocation');
     $this->archivelocation->setLegend('Archive location');
     $this->addDisplayGroup(array('submit'), 'buttons');
     $person = new Pas_User_Details();
     $role = $person->getRole();
     $projectTeam = array('hoard', 'admin');
     if (!in_array($role, $projectTeam)) {
         $contextualdataquality->disabled = true;
     }
     parent::init();
 }
Ejemplo n.º 24
0
 /** Construct the object
  * @access public
  * @param array $fields
  */
 public function __construct($fields)
 {
     $this->_fields = $fields;
     $user = new Pas_User_Details();
     $this->_role = $user->getPerson()->role;
 }
Ejemplo n.º 25
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  *
  */
 public function __construct(array $options = null)
 {
     $counties = new OsCounties();
     $county_options = $counties->getCountiesID();
     $regionModel = new OsRegions();
     $regions = $regionModel->getRegionsID();
     $origins = new MapOrigins();
     $origin_options = $origins->getValidOrigins();
     $landusevalues = new Landuses();
     $landuse_options = $landusevalues->getUsesValid();
     $landusecodes = new Landuses();
     $landcodes_options = $landusecodes->getCodesValid();
     //Get findspot data quality ratings for select menu
     $qualityrating = new DataQuality();
     $qualityrating_options = $qualityrating->getRatings();
     $this->addElementPrefixPath('Pas_Filter', 'Pas/Filter/', 'filter');
     parent::__construct($options);
     $this->setName('findspots');
     // Object specifics
     $countyID = new Zend_Form_Element_Select('countyID');
     $countyID->setLabel('County/Unitary Authority or Metropolitan District: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose county', 'Available counties' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $districtID = new Zend_Form_Element_Select('districtID');
     $districtID->setLabel('District: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose district after county'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $parishID = new Zend_Form_Element_Select('parishID');
     $parishID->setLabel('Parish: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose parish after district'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->addValidator('Digits')->addMultiOptions(array(null => 'Choose region', 'Available regions' => $regions))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->setRequired(false)->addValidators(array('NotEmpty', 'ValidGridRef'))->addFilters(array('StripTags', 'StringTrim', 'StringToUpper', 'StripSpaces'))->setAttribs(array('placeholder' => 'In the format of SU123123', 'class' => 'span4'));
     $gridrefsrc = new Zend_Form_Element_Select('gridrefsrc');
     $gridrefsrc->setLabel('Grid reference source: ')->addMultioptions(array(null => 'Choose a grid reference source', 'Choose source' => $origin_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($origin_options)))->addValidator('Int')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     $gridrefcert = new Zend_Form_Element_Radio('gridrefcert');
     $gridrefcert->setLabel('Grid reference certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''));
     if ($action === 'edit') {
         $fourFigure = new Zend_Form_Element_Text('fourFigure');
         $fourFigure->setLabel('Four figure grid reference: ')->addValidator('NotEmpty', 'ValidGridRef')->addValidator('Alnum')->addFilters(array('StripTags', 'StringTrim'))->disabled = true;
         $easting = new Zend_Form_Element_Text('easting');
         $easting->setLabel('Easting: ')->addValidator('NotEmpty', 'Digits')->addFilters(array('StripTags', 'StringTrim'))->disabled = true;
         $northing = new Zend_Form_Element_Text('northing');
         $northing->setLabel('Northing: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Digits')->disabled = true;
         $map10k = new Zend_Form_Element_Text('map10k');
         $map10k->setLabel('10 km map: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Alnum')->disabled = true;
         $map25k = new Zend_Form_Element_Text('map25k');
         $map25k->setLabel('25 km map: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Alnum')->disabled = true;
         $declong = new Zend_Form_Element_Text('declong');
         $declong->setLabel('Longitude: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Float')->disabled = true;
         $declat = new Zend_Form_Element_Text('declat');
         $declat->setLabel('Latitude: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Float')->disabled = true;
         $declong4 = new Zend_Form_Element_Text('fourFigureLon');
         $declong4->setLabel('Four figure longitude: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Float')->disabled = true;
         $declat4 = new Zend_Form_Element_Text('fourFigureLat');
         $declat4->setLabel('Four figure latitude: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Float')->disabled = true;
         $woeid = new Zend_Form_Element_Text('woeid');
         $woeid->setLabel('Where on Earth ID: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Digits')->disabled = true;
         $elevation = new Zend_Form_Element_Text('elevation');
         $elevation->setLabel('Elevation: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Digits')->disabled = true;
         $gridLen = new Zend_Form_Element_Text('gridlen');
         $gridLen->setLabel('Grid reference length: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Digits')->disabled = true;
         $what3words = new Zend_Form_Element_Text('what3words');
         $what3words->setLabel('What3words identifier: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Digits')->disabled = true;
     }
     $depthdiscovery = new Zend_Form_Element_Select('depthdiscovery');
     $depthdiscovery->setLabel('Depth of discovery')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Digits')->addMultiOptions(array(null => 'Depth levels', 'Approximate depth' => array('10' => '0 - 10cm', '20' => '10 - 20cm', '30' => '20 - 30cm', '40' => '30 - 40cm', '50' => '40 - 50cm', '60' => 'Over 60 cm')))->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     $soiltype = new Zend_Form_Element_Select('soiltype');
     $soiltype->setLabel('Type of soil around findspot: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Digits')->addMultiOptions(array(null => null));
     $landusevalue = new Zend_Form_Element_Select('landusevalue');
     $landusevalue->setLabel('Landuse type: ')->addValidators(array('NotEmpty'))->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose landuse', 'Valid landuses' => $landuse_options))->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     $landusecode = new Zend_Form_Element_Select('landusecode');
     $landusecode->setLabel('Specific landuse: ')->setRegisterInArrayValidator(false)->addValidators(array('NotEmpty'))->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Specific landuse will be enabled after type'))->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     $address = new Zend_Form_Element_Textarea('address');
     $address->setLabel('Address: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 5)->setAttrib('cols', 40)->addFilters(array('BasicHtml', 'StringTrim', 'EmptyParagraph'))->setAttribs(array('placeholder' => 'This data is not shown to the public'))->setAttrib('class', 'privatedata span6');
     $postcode = new Zend_Form_Element_Text('postcode');
     $postcode->setLabel('Postcode: ')->addValidators(array('NotEmpty', 'ValidPostCode'))->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'));
     $knownas = new Zend_Form_Element_Text('knownas');
     $knownas->setLabel('Findspot to be known as: ')->setAttribs(array('placeholder' => 'If you fill in this, it will hide the grid references and parish', 'class' => 'span6 privatedata'))->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     $alsoknownas = new Zend_Form_Element_Text('alsoknownas');
     $alsoknownas->setLabel('Also known as: ')->setAttribs(array('placeholder' => 'Use this for old names the findspot used to be known by', 'class' => 'span6'))->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->setDescription('Separate different names with semi-colons, e.g. Near Westbury; Gloucestershire; Severn');
     $landownername = new Zend_Form_Element_Text('landownername');
     $landownername->setLabel('Landowner: ')->addValidators(array('NotEmpty'))->setAttribs(array('placeholder' => 'This data is not shown to the public', 'data-provide' => 'typeahead', 'class' => 'privatedata span6'))->addFilters(array('StripTags', 'StringTrim'));
     $landowner = new Zend_Form_Element_Hidden('landowner');
     $landowner->addFilters(array('StripTags', 'StringTrim'));
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Findspot description: ')->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400, 'class' => 'privatedata span6'))->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $comments = new Pas_Form_Element_CKEditor('comments');
     $comments->setLabel('Findspot comments: ')->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400, 'class' => 'privatedata span6'))->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     //Findspot data quality rating
     $findspotdataquality = new Zend_Form_Element_Select('qualityrating');
     $findspotdataquality->setLabel('Findspot data quality rating: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a rating', 'Available ratings' => $qualityrating_options))->addValidator('InArray', false, array(array_keys($qualityrating_options)))->setAttrib('class', 'input-large selectpicker show-menu-arrow')->setDescription('This data quality field can only be completed by hoards project staff')->addValidator('Int');
     $submit = new Zend_Form_Element_Submit('submit');
     if ($action === 'edit') {
         $this->addElements(array($countyID, $districtID, $parishID, $knownas, $alsoknownas, $description, $comments, $findspotdataquality, $regionID, $gridref, $fourFigure, $easting, $northing, $map10k, $map25k, $declong, $declat, $declong4, $declat4, $gridLen, $woeid, $elevation, $what3words, $address, $gridrefsrc, $gridrefcert, $depthdiscovery, $postcode, $landusevalue, $landusecode, $landownername, $landowner, $submit));
     } else {
         $this->addElements(array($countyID, $districtID, $parishID, $knownas, $alsoknownas, $depthdiscovery, $description, $findspotdataquality, $comments, $regionID, $gridref, $gridrefsrc, $gridrefcert, $address, $postcode, $landusevalue, $landusecode, $landownername, $landowner, $submit));
     }
     $this->addDisplayGroup(array('countyID', 'regionID', 'districtID', 'parishID', 'knownas', 'alsoknownas', 'address', 'postcode', 'landownername', 'landowner'), 'details');
     $this->details->setLegend('Findspot information');
     if ($action == 'edit') {
         $this->addDisplayGroup(array('gridref', 'gridrefcert', 'gridrefsrc', 'fourFigure', 'easting', 'northing', 'map25k', 'map10k', 'declat', 'declong', 'fourFigureLat', 'fourFigureLon', 'woeid', 'what3words', 'elevation', 'gridlen', 'landusevalue', 'landusecode', 'depthdiscovery'), 'spatial');
     } else {
         $this->addDisplayGroup(array('gridref', 'gridrefcert', 'gridrefsrc', 'landusevalue', 'landusecode', 'depthdiscovery', 'soiltype'), 'spatial');
     }
     $this->spatial->setLegend('Spatial information');
     $this->addDisplayGroup(array('description', 'comments', 'qualityrating'), 'commentary');
     $this->commentary->setLegend('Findspot comments');
     $this->addDisplayGroup(array('submit'), 'buttons');
     $person = new Pas_User_Details();
     $role = $person->getRole();
     $projectTeam = array('hoard', 'admin');
     if (!in_array($role, $projectTeam)) {
         $findspotdataquality->disabled = true;
     }
     parent::init();
 }