Esempio n. 1
0
 /** Initialise the form
  * @access public
  * @return void
  */
 public function init()
 {
     $roles = new Roles();
     $role_options = $roles->getRoles();
     $inst = new Institutions();
     $inst_options = $inst->getInsts();
     $username = $this->addElement('text', 'username', array('label' => 'Username: '******'StripTags', 'StringTrim'))->setRequired(true);
     $firstName = $this->addElement('text', 'first_name', array('label' => 'First Name', 'size' => '30'))->first_name;
     $firstName->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('You must enter a firstname');
     $lastName = $this->addElement('text', 'last_name', array('label' => 'Last Name', 'size' => '30'))->last_name;
     $lastName->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('You must enter a surname');
     $preferred_name = $this->addElement('text', 'preferred_name', array('label' => 'Preferred Name: ', 'size' => '30'))->preferred_name;
     $preferred_name->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('You must enter your preferred name');
     $fullname = $this->addElement('text', 'fullname', array('label' => 'Full name: ', 'size' => '30'))->fullname;
     $fullname->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('You must enter your preferred name');
     $email = $this->addElement('text', 'email', array('label' => 'Email Address', 'size' => '30'))->email;
     $email->addValidator('EmailAddress')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setRequired(true)->addErrorMessage('Please enter a valid address!');
     $password = $this->addElement('password', 'password', array('label' => 'Change password: '******'size' => '30'))->password;
     $password->setRequired(false);
     $institution = $this->addElement('select', 'institution', array('label' => 'Recording institution: '))->institution;
     $institution->addMultiOptions(array(null => 'Choose institution', 'Available institutions' => $inst_options))->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     $canRecord = $this->addElement('checkbox', 'canRecord', array('label' => 'Allowed to record: '))->canRecord;
     $role = $this->addElement('select', 'role', array('label' => 'Site role: '))->role;
     $role->addMultiOptions(array(null => 'Choose a role', 'Available roles' => $role_options))->setAttrib('class', 'input-medium selectpicker show-menu-arrow');
     $person = $this->addElement('text', 'person', array('label' => 'Personal details attached: '))->person;
     $peopleID = $this->addElement('hidden', 'peopleID', array())->peopleID;
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElement($submit);
     $this->addDisplayGroup(array('username', 'first_name', 'last_name', 'fullname', 'preferred_name', 'email', 'institution', 'role', 'password', 'person', 'peopleID', 'canRecord'), 'userdetails');
     $this->addDisplayGroup(array('submit'), 'buttons');
     $this->setLegend('Edit account details: ');
     parent::init();
 }
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $finds = new Findspots();
     $schema = $finds->info();
     $fields = array_flip($schema['cols']);
     $remove = array('updated', 'created', 'updatedBy', 'createdBy', 'institution', 'findID', 'address', 'fourFigure', 'gridlen', 'postcode', 'easting', 'northing', 'declong', 'declat', 'fourFigureLat', 'fourFigureLon', 'woeid', 'geonamesID', 'osmNode', 'elevation', 'geohash', 'country', 'map25k', 'map10k', 'soiltype', 'smrref', 'otherref', 'id', 'accuracy', 'secuid', 'old_occupierid', 'occupier', 'old_findspotid', 'date');
     foreach ($remove as $rem) {
         unset($fields[$rem]);
     }
     $labels = array('gridrefcert' => 'Grid reference certainty', 'gridref' => 'Grid reference', 'knownas' => 'Known as', 'disccircum' => 'Discovery circumstances', 'gridrefsrc' => 'Grid reference source', 'landusevalue' => 'Land use value', 'landusecode' => 'Land use code', 'depthdiscovery' => 'Depth of discovery', 'Highsensitivity' => 'High sensitivity');
     parent::__construct($options);
     $this->setName('configureFindSpotCopy');
     $elements = array();
     foreach (array_keys($fields) as $field) {
         $label = $field;
         $field = new Zend_Form_Element_Checkbox($field);
         if (array_key_exists($label, $labels)) {
             $clean = ucfirst($labels[$label]);
         } else {
             $clean = ucfirst($label);
         }
         $field->setLabel($clean)->setRequired(false)->addValidator('NotEmpty', 'boolean');
         $elements[] = $field;
         $this->addElement($field);
     }
     $this->addDisplayGroup($elements, 'details');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Submit find spot configuration');
     $this->addElement($submit);
     $this->details->setLegend('Choose fields: ');
     parent::init();
 }
Esempio n. 3
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     parent::__construct($options);
     $this->setName('period');
     $term = new Zend_Form_Element_Text('term');
     $term->setLabel('Period name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'))->addValidator('Alpha', false, array('allowWhiteSpace' => true))->setAttrib('size', 60)->addErrorMessage('You must enter a period name');
     $fromdate = new Zend_Form_Element_Text('fromdate');
     $fromdate->setLabel('Date period starts: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter a start date');
     $todate = new Zend_Form_Element_Text('todate');
     $todate->setLabel('Date period ends: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter an end date');
     $notes = new Pas_Form_Element_CKEditor('notes');
     $notes->setLabel('Period notes: ')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Period is currently in use: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter a status');
     $parent = new Zend_Form_Element_Select('parent');
     $parent->setLabel('Period belongs to: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($term, $fromdate, $todate, $valid, $notes, $parent, $submit, $hash));
     $this->addDisplayGroup(array('term', 'fromdate', 'todate', 'parent', 'notes', 'valid'), 'details');
     $this->details->setLegend('Period details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Esempio n. 4
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('comments');
     $comment_author = new Zend_Form_Element_Text('comment_author');
     $comment_author->setLabel('Enter your name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty')->addErrorMessage('Please enter a valid name!')->setDescription('If you are offering us SEO services, you will be added to the akismet spam list.');
     $comment_author_email = new Zend_Form_Element_Text('comment_author_email');
     $comment_author_email->setLabel('Enter your email address: ')->setRequired(true)->addValidator('EmailAddress')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addErrorMessage('Please enter a valid email address!')->setDescription('* This will not be displayed to the public.');
     $comment_author_url = new Zend_Form_Element_Text('comment_author_url');
     $comment_author_url->setLabel('Enter your web address: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('NotEmpty')->addErrorMessage('Please enter a valid address!')->setDescription('Not compulsory');
     $comment_content = new Pas_Form_Element_CKEditor('comment_content');
     $comment_content->setLabel('Enter your comment: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->addErrorMessage('Please enter something in the comments box!');
     $captcha = new Zend_Form_Element_Captcha('captcha', array('captcha' => 'ReCaptcha', 'label' => 'Please fill in this reCaptcha to prove human life exists at your end!', 'captchaOptions' => array('captcha' => 'ReCaptcha', 'privKey' => $this->_privateKey, 'pubKey' => $this->_pubKey, 'theme' => 'clean', 'ssl' => true)));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large')->setLabel('Submit your query');
     $auth = Zend_Auth::getInstance();
     if (!$auth->hasIdentity()) {
         $this->addElements(array($comment_author, $comment_author_email, $comment_content, $comment_author_url, $captcha, $submit, $hash));
         $this->addDisplayGroup(array('comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'captcha'), 'details');
         $this->details->setLegend('Enter your comments: ');
     } else {
         $user = $auth->getIdentity();
         $comment_author->setValue($user->fullname);
         $comment_author_email->setValue($user->email);
         $this->addElements(array($comment_author, $comment_author_email, $comment_content, $comment_author_url, $submit, $hash));
         $this->addDisplayGroup(array('comment_author', 'comment_author_email', 'comment_author_url', 'comment_content'), 'details');
         $this->details->setLegend('Enter your comments: ');
     }
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Esempio n. 5
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setName('research');
     $investigator = new Zend_Form_Element_Text('investigator');
     $investigator->setLabel('Principal work conducted by: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a lead for this project.');
     $level = new Zend_Form_Element_Select('level');
     $level->setLabel('Level of research: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => null, 'Choose type of research' => $projectype_list))->addValidator('inArray', false, array(array_keys($projectype_list)));
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Project title: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->setAttrib('size', 60)->addErrorMessage('Choose title for the project.');
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Short description of project: ')->setRequired(false)->setAttribs(array('cols' => 80, 'rows' => 10))->addFilters(array('BasicHtml', 'StringTrim', 'EmptyParagraph'));
     $startDate = new ZendX_JQuery_Form_Element_DatePicker('startDate');
     $startDate->setLabel('Start date of project')->setAttrib('size', 20)->setJQueryParam('dateFormat', 'yy-mm-dd')->setRequired(false)->addErrorMessage('You must enter a start date for this project');
     $endDate = new ZendX_JQuery_Form_Element_DatePicker('endDate');
     $endDate->setLabel('End date of project')->setAttrib('size', 20)->setJQueryParam('dateFormat', 'yy-mm-dd')->setRequired(false)->addErrorMessage('You must enter an end date for this project');
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Make public: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($title, $description, $level, $startDate, $endDate, $valid, $investigator, $submit));
     $this->addDisplayGroup(array('title', 'investigator', 'level', 'description', 'startDate', 'endDate', 'valid'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('comments');
     $commentType = new Zend_Form_Element_Hidden('comment_type');
     $commentType->addFilters(array('StripTags', 'StringTrim'));
     $comment_findID = new Zend_Form_Element_Hidden('contentID');
     $comment_findID->addFilters(array('StripTags', 'StringTrim'));
     $comment_author = new Zend_Form_Element_Text('comment_author');
     $comment_author->setLabel('Enter your name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addErrorMessage('Please enter a valid name!');
     $comment_author_email = new Zend_Form_Element_Text('comment_author_email');
     $comment_author_email->setLabel('Enter your email address: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('EmailAddress', false, array('mx' => true))->addErrorMessage('Please enter a valid email address!')->setDescription('* This will not be displayed to the public.');
     $comment_author_url = new Zend_Form_Element_Text('comment_author_url');
     $comment_author_url->setLabel('Enter your web address: ')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addErrorMessage('Please enter a valid address!')->addValidator('Url')->setDescription('* Not compulsory');
     $comment_content = new Pas_Form_Element_CKEditor('comment_content');
     $comment_content->setLabel('Enter your comment: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $status = new Zend_Form_Element_Radio('commentStatus');
     $status->setLabel('Message status:')->addMultiOptions(array('isspam' => 'Set as spam', 'isham' => 'Submit ham?', 'notspam' => 'Spam free'))->setValue('notSpam')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setOptions(array('separator' => ''));
     $commentApproval = new Zend_Form_Element_Radio('comment_approved');
     $commentApproval->setLabel('Approval:')->addMultiOptions(array('moderation' => 'Moderation', 'approved' => 'Approved'))->setValue('approved')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setOptions(array('separator' => ''));
     $this->addElements(array($comment_author, $comment_author_email, $comment_content, $comment_author_url, $comment_findID, $commentApproval, $commentType, $status, $hash, $submit));
     $this->addDisplayGroup(array('comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'commentStatus', 'comment_approved', 'contentID', 'comment_type'), 'details');
     $this->details->setLegend('Enter your comments: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
 /** The form constructor
  * @access public
  * @param array $options
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('accountupgrades');
     $researchOutline = new Pas_Form_Element_CKEditor('researchOutline');
     $researchOutline->setLabel('Research outline: ')->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400))->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->addErrorMessage('Outline must be present.')->setDescription('Use this text area to tell us whether you want to
                 become a research level user and why. We would also like to know 
                 the probable length of time for this project so that we can 
                 inform our research board of progress. We need a good idea,
                 as we have to respect privacy of find spots and
                 landowner/finder personal data');
     $reference = $this->addElement('Text', 'reference', array('label' => 'Please provide a referee:', 'size' => '40', 'description' => 'We ask you to provide a referee who can
                     substantiate your request for higher level access.
                     Ideally they will be an archaeologist of good standing.'))->reference;
     $reference->setRequired(false)->addFilters(array('StripTags', 'StringTrim'));
     $referenceEmail = $this->addElement('Text', 'referenceEmail', array('label' => 'Please provide an email address for your referee:', 'size' => '40'))->referenceEmail;
     $referenceEmail->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('EmailAddress');
     $already = new Zend_Form_Element_Radio('already');
     $already->setLabel('Is your topic already listed on our research register?: ')->addMultiOptions(array(1 => 'Yes it is', 0 => 'No it isn\'t'))->setRequired(true)->setOptions(array('separator' => ''));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Submit request');
     $this->addElements(array($researchOutline, $submit, $already));
     $this->addDisplayGroup(array('researchOutline', 'reference', 'referenceEmail', 'already'), 'details');
     $this->details->setLegend('Details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Esempio n. 8
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $staffregions = new StaffRegions();
     $staffregions_options = $staffregions->getOptions();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setName('vacancies');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Role title: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a title for this vacancy.')->setAttrib('size', 60);
     $salary = new Zend_Form_Element_Text('salary');
     $salary->setLabel('Salary: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('size', 20)->addErrorMessage('You must enter a salary.');
     $specification = new Pas_Form_Element_CKEditor('specification');
     $specification->setLabel('Job specification: ')->setRequired(true)->addFilters(array('BasicHtml', 'StringTrim'))->setAttribs(array('cols' => 50, 'rows' => 10, 'Height' => 400))->addErrorMessage('You must enter a job description.');
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('Location of role: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addValidator('InArray', false, array(array_keys($staffregions_options)))->addMultiOptions(array(null => 'Choose region', 'Available regions' => $staffregions_options))->addErrorMessage('You must choose a region');
     $live = new ZendX_JQuery_Form_Element_DatePicker('live');
     $live->setLabel('Date for advert to go live: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->setJQueryParam('maxDate', '+1y')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20);
     $expire = new ZendX_JQuery_Form_Element_DatePicker('expire');
     $expire->setLabel('Date for advert to expire: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->setJQueryParam('maxDate', '+1y')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20);
     $status = new Zend_Form_Element_Select('status');
     $status->SetLabel('Publish status: ')->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a status', 2 => 'Publish', 1 => 'Draft'))->setValue(2)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must choose a status');
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($title, $salary, $specification, $regionID, $live, $expire, $status, $submit, $hash));
     $this->addDisplayGroup(array('title', 'salary', 'specification', 'regionID'), 'details');
     $this->details->setLegend('Vacancy details');
     $this->addDisplayGroup(array('live', 'expire', 'status'), 'dates');
     $this->dates->setLegend('Publication details');
     $this->setLegend('Vacancy details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
 /** Construct the form
  * @access public
  * @param type $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $cats = new CategoriesCoins();
     $cat_options = $cats->getCategoriesAll();
     $rulers = new Rulers();
     $ruler_options = $rulers->getAllMedRulers();
     parent::__construct($options);
     $this->setName('MedievalType');
     $type = new Zend_Form_Element_Text('type');
     $type->setLabel('Medieval type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('class' => 'textInput', 'class' => 'span8'));
     $broadperiod = new Zend_Form_Element_Select('periodID');
     $broadperiod->setLabel('Broadperiod for type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->addMultioptions(array(null => 'Choose broadperiod', 'Available options' => array(47 => 'Early Medieval', 29 => 'Medieval', 36 => 'Post Medieval')));
     $category = new Zend_Form_Element_Select('categoryID');
     $category->setLabel('Coin category: ')->setAttribs(array('class' => 'textInput'))->addFilter('StringTrim')->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->addMultioptions(array(null => 'Choose a category', 'Available options' => $cat_options))->addValidator('InArray', false, array(array_keys($cat_options)));
     $ruler = new Zend_Form_Element_Select('rulerID');
     $ruler->setLabel('Ruler assigned to: ')->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->addFilter('StringTrim')->addMultioptions(array(null => 'Choose a ruler', 'Available options' => $ruler_options))->addValidator('inArray', false, array(array_keys($ruler_options)));
     $datefrom = new Zend_Form_Element_Text('datefrom');
     $datefrom->setLabel('Date type in use from: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'));
     $dateto = new Zend_Form_Element_Text('dateto');
     $dateto->setLabel('Date type in use until: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Submit details for medieval coin type');
     $this->addElements(array($type, $broadperiod, $category, $ruler, $datefrom, $dateto, $submit))->setLegend('Add an active type of Medieval coin')->setMethod('post');
     parent::init();
 }
Esempio n. 10
0
 /** the constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $periods = new Periods();
     $period_options = $periods->getCoinsPeriod();
     parent::__construct($options);
     $this->setName('moneyers');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Moneyer\'s name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('Enter a moneyer\'s name');
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Broad period: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a period for this type')->addMultioptions(array(null => 'Choose a period', 'Available Options' => $period_options));
     $date_1 = new Zend_Form_Element_Text('date_1');
     $date_1->setLabel('Issued coins from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a date for the start of moneyer period');
     $date_2 = new Zend_Form_Element_Text('date_2');
     $date_2->setLabel('Issued coins until: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a date for the end of moneyer period');
     $appear = new Zend_Form_Element_Text('appear');
     $appear->setLabel('Appearance on coins: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'));
     $RRC = new Zend_Form_Element_Text('RRC');
     $RRC->setLabel('RRC ID number: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'));
     $bio = new Pas_Form_Element_CKEditor('bio');
     $bio->setLabel('Biography: ')->setRequired(true)->addFilters(array('StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph'))->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400))->setAttrib('ToolbarSet', 'Finds')->addErrorMessage('You must enter a biography');
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Is this term valid?: ');
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($period, $name, $date_1, $date_2, $bio, $appear, $RRC, $valid, $submit));
     $this->addDisplayGroup(array('name', 'period', 'date_1', 'date_2', 'appear', 'RRC', 'bio', 'valid', 'submit'), 'details');
     parent::init();
 }
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFromWords();
     $activities = new PrimaryActivities();
     $activities_options = $activities->getTerms();
     $counties = new OsCounties();
     $county_options = $counties->getCountiesID();
     parent::__construct($options);
     $this->setName('filterpeople');
     $name = new Zend_Form_Element_Text('organisation');
     $name->setLabel('Filter by name')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->setAttrib('size', 40);
     $contact = new Zend_Form_Element_Text('contact');
     $contact->setLabel('Filter by contact person: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Enter a valid organisation')->setAttrib('size', 20);
     $contactpersonID = new Zend_Form_Element_Hidden('contactpersonID');
     $contactpersonID->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum');
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Filter by county')->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->addMultiOptions(array(null => 'Choose a county', 'Available counties' => $county_options))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($county_options)));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Filter');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($name, $county, $contact, $contactpersonID, $submit, $hash));
     parent::init();
 }
Esempio n. 12
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $periods = new Periods();
     $period_options = $periods->getCoinsPeriod();
     parent::__construct($options);
     $this->setName('ruler');
     $issuer = new Zend_Form_Element_Text('issuer');
     $issuer->setLabel('Ruler or issuer name: ')->setRequired(true)->addErrorMessage('Please enter a name for this issuer or ruler.')->setAttrib('size', 70)->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     $date1 = new Zend_Form_Element_Text('date1');
     $date1->setLabel('Date issued from: ')->setRequired(true)->addErrorMessage('You must enter a date for the start of their issue.')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $date2 = new Zend_Form_Element_Text('date2');
     $date2->setLabel('Date issued to: ')->setRequired(true)->addErrorMessage('You must enter a date for the end of their issue.')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->SetLabel('Is this ruler or issuer currently valid: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Broad period attributed to: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a period', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addErrorMessage('You must enter a period for this ruler/issuer');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($issuer, $date1, $date2, $period, $valid, $submit, $hash));
     $this->addDisplayGroup(array('issuer', 'date1', 'date2', 'period', 'valid', 'submit'), 'details');
     $this->details->setLegend('Issuer or ruler details: ');
     parent::init();
 }
Esempio n. 13
0
 /** The form constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $reeces = new Reeces();
     $reeces_options = $reeces->getOptions();
     $rulers = new Rulers();
     $rulers_options = $rulers->getOptions();
     $dynasties = new Dynasties();
     $dynasties_options = $dynasties->getOptions();
     parent::__construct($options);
     $this->setName('EmperorDetails');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Emperor\'s name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('Enter an emperor name!');
     $reeceID = new Zend_Form_Element_Select('reeceID');
     $reeceID->setLabel('Reece period assigned: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a Reece period', 'Available periods' => $reeces_options))->addValidator('InArray', false, array(array_keys($reeces_options)))->addValidator('Int');
     $pasID = new Zend_Form_Element_Select('pasID');
     $pasID->setLabel('Database ID: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($rulers_options)))->addMultiOptions(array(null => 'Choose a database id', 'Available ids' => $rulers_options))->addValidator('Int')->addErrorMessage('You must assign the bio to an existing entry');
     $date_from = new Zend_Form_Element_Text('date_from');
     $date_from->setLabel('Issued coins from: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter a date for the start of reign');
     $date_to = new Zend_Form_Element_Text('date_to');
     $date_to->setLabel('Issued coins until: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter a date for the end of reign');
     $biography = new Pas_Form_Element_CKEditor('biography');
     $biography->setLabel('Biography: ')->setRequired(true)->addFilters(array('StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph'))->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400))->setAttrib('ToolbarSet', 'Finds')->addErrorMessage('You must enter a biography');
     $dynasty = new Zend_Form_Element_Select('dynasty');
     $dynasty->setLabel('Dynastic grouping: ')->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($dynasties_options)))->addMultiOptions(array(null => 'Choose a dynasty', 'Available dynasties' => $dynasties_options))->addErrorMessage('You must select a dynastic grouping');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($name, $reeceID, $pasID, $date_from, $date_to, $biography, $dynasty, $submit, $hash));
     $this->addDisplayGroup(array('name', 'reeceID', 'pasID', 'date_from', 'date_to', 'biography', 'dynasty', 'submit'), 'details');
     parent::init();
 }
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $finds = new Finds();
     $schema = $finds->info();
     $fields = array_flip($schema['cols']);
     $remove = array('id', 'secuid', 'old_findID', 'updated', 'created', 'updatedBy', 'createdBy', 'institution', 'secwfstage', 'secowner', 'sectag', 'old_candidate', 'old_finderID', 'objdate2subperiod_old', 'objdate1subperiod_old', 'finder2ID', 'datefound2flag', 'datefound1flag', 'hoardID');
     $labels = array('finderID' => 'Finder name', 'smr_ref' => 'SMR reference', 'other_ref' => 'Other reference', 'datefound1qual' => 'First date found qualifier', 'datefound1' => 'First date found', 'datefound2' => 'Second date found', 'datefound2qual' => 'Second date found qualifier', 'culture' => 'Ascribed culture', 'discmethod' => 'Discovery method', 'disccircum' => 'Discovery circumstances', 'objecttype' => 'Object type', 'objecttypecert' => 'Object type certainty', 'subclass' => 'Sub-classification', 'objdate1cert' => 'Object period certainty from', 'objdate2cert' => 'Object period certainty to', 'objdate1period' => 'Object period from', 'objdate2period' => 'Object period to', 'objdate1subperiod' => 'Object sub-period from', 'objdate2subperiod' => 'Object sub-period to', 'numdate1qual' => 'Date from qualifier', 'numdate2qual' => 'Date to qualifier', 'numdate1' => 'Date from', 'numdate2' => 'Date to', 'material1' => 'Primary material', 'material2' => 'Secondary material', 'manmethod' => 'Manufacture method', 'decmethod' => 'Decoration method', 'surftreat' => 'Surface treatment', 'decstyle' => 'Decoration style', 'reuse_period' => 'Period of reuse', 'curr_loc' => 'Current location', 'recorderID' => 'Recorder', 'identifier1ID' => 'Primary identifier', 'identifier2ID' => 'Secondary identifier', 'musaccno' => 'Museum accession number', 'subs_action' => 'Subsequent action', 'findofnote' => 'Find of note', 'findofnotereason' => 'Find of note reasoning', 'treasureID' => 'Treasure ID number');
     foreach ($remove as $rem) {
         unset($fields[$rem]);
     }
     parent::__construct($options);
     $this->setName('configureFindCopy');
     $elements = array();
     foreach (array_keys($fields) as $field) {
         $label = $field;
         $field = new Zend_Form_Element_Checkbox($field);
         if (array_key_exists($label, $labels)) {
             $clean = ucfirst($labels[$label]);
         } else {
             $clean = ucfirst($label);
         }
         $field->setLabel($clean)->setRequired(false)->addValidator('NotEmpty', 'boolean');
         $elements[] = $field;
         $this->addElement($field);
     }
     $this->addDisplayGroup($elements, 'details');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Submit find form configuration');
     $this->addElement($submit);
     $this->details->setLegend('Choose fields: ');
     parent::init();
 }
Esempio n. 15
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $periods = new Periods();
     $period_options = $periods->getMedievalCoinsPeriodList();
     $cats = new CategoriesCoins();
     $cat_options = $cats->getCategoriesAll();
     $rulers = new Rulers();
     $ruler_options = $rulers->getAllMedRulers();
     parent::__construct($options);
     $this->setName('medievaltype');
     $type = new Zend_Form_Element_Text('type');
     $type->setLabel('Coin type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('You must enter a type name.');
     $periodID = new Zend_Form_Element_Select('periodID');
     $periodID->setLabel('Medieval period: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addErrorMessage('You must enter a period for this type')->addMultioptions(array(null => 'Choose a period', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int');
     $rulerID = new Zend_Form_Element_Select('rulerID');
     $rulerID->setLabel('Ruler assigned: ')->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addMultioptions(array(null => 'Choose a ruler', 'Available rulers' => $ruler_options))->addValidator('InArray', false, array(array_keys($ruler_options)))->addValidator('Int');
     $datefrom = new Zend_Form_Element_Text('datefrom');
     $datefrom->setLabel('Date in use from: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $dateto = new Zend_Form_Element_Text('dateto');
     $dateto->setLabel('Date in use until: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $categoryID = new Zend_Form_Element_Select('categoryID');
     $categoryID->setLabel('Coin category: ')->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a category', 'Available categories' => $cat_options))->addValidator('InArray', false, array(array_keys($cat_options)))->addValidator('Int');
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($type, $rulerID, $periodID, $categoryID, $datefrom, $dateto, $submit));
     $this->addDisplayGroup(array('periodID', 'type', 'categoryID', 'rulerID', 'datefrom', 'dateto', 'submit'), 'details');
     $this->details->setLegend('Medieval type details: ');
     parent::init();
 }
 /** Init the form
  * @return void
  * @access public
  */
 public function init()
 {
     $this->setMethod('post')->setAttrib('id', 'resetpassword');
     $username = $this->addElement('Text', 'username', array('label' => 'Username: '******'username')->setRequired(true)->addErrorMessage('You must enter a username')->addFilters(array('StringTrim', 'StripTags', 'Purifier'))->addValidator('Db_RecordExists', false, array('table' => 'users', 'field' => 'username'));
     $activationKey = $this->addElement('Text', 'activationKey', array('label' => 'Reset password key'));
     $activationKey = $this->getElement('activationKey')->setDescription('The reset key can be found in the email you ' . 'received when asking for a new password. ' . 'Check your spam filter')->setRequired(true)->addErrorMessage('You must enter a reset key')->addFilters(array('StringTrim', 'StripTags', 'Purifier'))->addValidator('Db_RecordExists', false, array('table' => 'users', 'field' => 'activationKey'));
     $password = $this->addElement('Text', 'password', array('label' => 'New password'));
     $password = $this->getElement('password')->setRequired(true)->setDescription('Password must be longer than 6 characters
                 and must include letters and numbers i.e. p4ssw0rd')->addFilters(array('StringTrim', 'StripTags', 'Purifier'))->addValidator('StringLength', true, array(6))->addValidator('Regex', true, array('/^(?=.*\\d)(?=.*[a-zA-Z]).{6,}$/'))->setRequired(true)->addErrorMessage('Please enter a valid password!');
     $password->getValidator('StringLength')->setMessage('Password is too short');
     $password->getValidator('Regex')->setMessage('Password does not contain letters and numbers');
     $email = $this->addElement('Text', 'email', array('label' => 'Email Address: ', 'size' => '30'))->email;
     $email->addValidator('EmailAddress')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Please enter a valid address!')->addValidator('Db_RecordExists', false, array('table' => 'users', 'field' => 'email'));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElement($hash);
     $recaptcha = new Zend_Service_ReCaptcha($this->_pubKey, $this->_privateKey);
     $captcha = new Zend_Form_Element_Captcha('captcha', array('captcha' => 'ReCaptcha', 'label' => 'Prove you are not a robot/spammer', 'captchaOptions' => array('captcha' => 'ReCaptcha', 'service' => $recaptcha, 'theme' => 'clean', 'ssl' => true)));
     $captcha->setDescription('Due to the surge in robotic activity, we have
         had to introduce this software. However, by filling in this captcha, 
         you help Carnegie Mellon University digitise old books.');
     $captcha->setDecorators(array(array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li'))));
     $captcha->addErrorMessage('You have not solved the captcha');
     $this->addElement($captcha);
     $submit = $this->addElement('submit', 'submit');
     $submit = $this->getElement('submit')->setLabel('Change my password');
     $this->addDisplayGroup(array('username', 'email', 'password', 'activationKey', 'captcha', 'submit'), 'details');
     $this->setLegend('Reset my password: ');
     parent::init();
 }
Esempio n. 17
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $periods = new Periods();
     $period_options = $periods->getPeriodFromWords();
     $counties = new OsCounties();
     $counties_options = $counties->getCountiesID();
     parent::__construct($options);
     $this->setName('whatwherewhen');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addErrorMessage('Please enter a valid string!');
     //Objecttype - autocomplete from thesaurus
     $objecttype = new Zend_Form_Element_Text('objecttype');
     $objecttype->setLabel('What: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addErrorMessage('Please enter a valid string!');
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('When: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $period_options))->addValidator('InArray', false, array($period_options));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Where: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose county', 'Available counties' => $counties_options))->addValidator('InArray', false, array($counties_options));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Search!');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($old_findID, $objecttype, $county, $broadperiod, $submit, $hash));
     $this->addDisplayGroup(array('old_findID', 'objecttype', 'broadperiod', 'county', 'submit'), 'Search');
     $this->Search->setLegend('What/Where/When search');
     parent::init();
 }
Esempio n. 18
0
 /** Initalise the form
  * 
  */
 public function init()
 {
     $username = $this->addElement('text', 'username', array('label' => 'Username: '******'StripTags', 'StringTrim'))->addValidator('StringLength', true, array('max' => 40))->setRequired(true);
     $username->getValidator('StringLength')->setMessage('Username is too long');
     $password = $this->addElement('password', 'password', array('label' => 'Password'))->password;
     $password->addValidator('StringLength', true, array(6))->addValidator('Regex', true, array('/^(?=.*\\d)(?=.*[a-zA-Z]).{6,}$/'))->setRequired(true)->addErrorMessage('Please enter a valid password!');
     $password->getValidator('StringLength')->setMessage('Password is too short');
     $password->getValidator('Regex')->setMessage('Password does not contain letters and numbers');
     $firstName = $this->addElement('text', 'first_name', array('label' => 'First Name', 'size' => '30'))->first_name;
     $firstName->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a firstname');
     $lastName = $this->addElement('text', 'last_name', array('label' => 'Last Name', 'size' => '30'))->last_name;
     $lastName->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a surname');
     $fullname = $this->addElement('text', 'fullname', array('label' => 'Preferred Name: ', 'size' => '30'))->fullname;
     $fullname->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter your preferred name');
     $email = $this->addElement('text', 'email', array('label' => 'Email Address', 'size' => '30'))->email;
     $email->addValidator('EmailAddress')->setRequired(true)->addFilters(array('StringToLower', 'StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid address!');
     $institution = $this->addElement('text', 'institution', array('label' => 'Recording institution: ', 'size' => '30'))->institution;
     $researchOutline = $this->addElement('textArea', 'research_outline', array('label' => 'Outline your research', 'rows' => 10, 'cols' => 40))->research_outline;
     $researchOutline->setRequired(false)->addFilter('HtmlBody')->addFilter('EmptyParagraph');
     $reference = $this->addElement('text', 'reference', array('label' => 'Please provide a referee:', 'size' => '40'))->reference;
     $reference->setRequired(false)->addFilters(array('StripTags', 'StringTrim'));
     $referenceEmail = $this->addElement('text', 'reference_email', array('label' => 'Please provide an email address for your referee:', 'size' => '40'))->reference_email;
     $referenceEmail->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('EmailAddress');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Set my account up on Beowulf');
     $this->addElements(array($submit));
     $this->addDisplayGroup(array('username', 'password', 'first_name', 'last_name', 'fullname', 'email', 'institution', 'research_outline', 'reference', 'reference_email'), 'userdetails');
     $this->addDisplayGroup(array('submit'), 'buttons');
     $this->setLegend('Edit account details: ');
     parent::init();
 }
Esempio n. 19
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     $authors = new Users();
     $authorOptions = $authors->getAuthors();
     parent::__construct($options);
     $this->setName('activity');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Project title: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('Choose title for the project.');
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Short description of project: ')->setRequired(true)->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400))->setAttrib('ToolbarSet', 'Basic')->addFilters(array('BasicHtml', 'EmptyParagraph', 'StringTrim'));
     $length = new Zend_Form_Element_Text('length');
     $length->setLabel('Length of project: ')->setAttrib('size', 12)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a duration for this project in months')->addValidator('Digits')->setDescription('Enter length in months');
     $managedBy = new Zend_Form_Element_Select('managedBy');
     $managedBy->setLabel('Managed by: ')->addMultiOptions(array('Choose an author' => $authorOptions))->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($authorOptions)))->addErrorMessage('You must enter a manager for this project.');
     $suitableFor = new Zend_Form_Element_Select('suitableFor');
     $suitableFor->setLabel('Suitable for: ')->addMultiOptions(array(null => 'Choose type of research', 'Available types' => $projectype_list))->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($projectype_list)))->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter suitability for this task.');
     $location = new Zend_Form_Element_Text('location');
     $location->setLabel('Where would this be located?: ')->setAttrib('size', 12)->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a location for the task.');
     $valid = new Zend_Form_Element_Checkbox('status');
     $valid->setLabel('Publish this task? ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'));
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(480);
     $this->addElements(array($title, $description, $length, $valid, $managedBy, $suitableFor, $location, $submit, $hash));
     $this->addDisplayGroup(array('title', 'description', 'length', 'location', 'suitableFor', 'managedBy', 'status', 'submit'), 'details');
     $this->details->setLegend('Activity details: ');
     parent::init();
 }
Esempio n. 20
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $reeces = new Reeces();
     $reeces_options = $reeces->getRevTypes();
     parent::__construct($options);
     $this->setName('reversetype');
     $type = new Zend_Form_Element_Text('type');
     $type->setLabel('Reverse type inscription: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter an inscription.')->setAttrib('size', 70);
     $translation = new Zend_Form_Element_Text('translation');
     $translation->setLabel('Translation: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a translation.')->setAttrib('size', 70);
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Description: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a translation.')->setAttrib('size', 70);
     $gendate = new Zend_Form_Element_Text('gendate');
     $gendate->setLabel('General date for reverse type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a general date for this reverse type.')->setAttrib('size', 30);
     $reeceID = new Zend_Form_Element_Select('reeceID');
     $reeceID->setLabel('Reece period: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a Reece period', 'Available Reece period' => $reeces_options))->addValidator('InArray', false, array(array_keys($reeces_options)));
     $common = new Zend_Form_Element_Radio('common');
     $common->setLabel('Is this reverse type commonly found: ')->setRequired(false)->addMultiOptions(array('1' => 'Yes', '2' => 'No'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setOptions(array('separator' => ''));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($type, $gendate, $description, $translation, $reeceID, $common, $submit, $hash));
     $this->addDisplayGroup(array('type', 'translation', 'description', 'gendate', 'reeceID', 'common', 'submit'), 'details');
     $this->details->setLegend('Reverse type details: ');
     $this->details->setLegend('Issuer or ruler details: ');
     parent::init();
 }
Esempio n. 21
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     parent::__construct($options);
     $this->setName('suggested');
     $level = new Zend_Form_Element_Select('level');
     $level->setLabel('Level of research: ')->setRequired(true)->addMultiOptions(array(null => 'Please choose a level', 'Research levels' => $projectype_list))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($projectype_list)))->addFilters(array('StringTrim', 'StripTags'));
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Broad research period: ')->setRequired(true)->addMultiOptions(array(null => 'Please choose a period', 'Periods available' => $period_options))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($period_options)))->addFilters(array('StringTrim', 'StripTags'));
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Project title: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Choose title for the project.');
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Short description of project: ')->setRequired(false)->setAttribs(array('cols' => 80, 'rows' => 10))->addFilters(array('BasicHtml', 'StringTrim', 'EmptyParagraph'));
     $valid = new Zend_Form_Element_Checkbox('taken');
     $valid->setLabel('Is the topic taken: ')->setRequired(true)->addValidator('Int');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($title, $level, $period, $description, $valid, $submit, $hash));
     $this->addDisplayGroup(array('title', 'level', 'period', 'description', 'taken'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Esempio n. 22
0
 /** The constructor 
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $roles = new Roles();
     $role_options = $roles->getRoles();
     $inst = new Institutions();
     $inst_options = $inst->getInsts();
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     $this->setName('emailsearch');
     ZendX_JQuery::enableForm($this);
     $message = new Zend_Form_Element_Textarea('messageToUser');
     $message->setLabel('Message to user: '******'StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph'))->setAttribs(array('rows' => 10))->addFilter('BasicHtml')->addErrorMessage('You must enter a message to your recipient.');
     $fullname = new Zend_Form_Element_Text('fullname');
     $fullname->setLabel('Send this to: ')->addFilters(array('StringTrim', 'StripTags', 'Purifier'))->setAttrib('size', 30);
     $email = $this->addElement('text', 'email', array('label' => 'Their email Address', 'size' => '30'))->email;
     $email->addValidator('EmailAddress')->addFilters(array('StringTrim', 'StripTags', 'StringToLower'))->setRequired(true)->addErrorMessage('Please enter a valid address!');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(60);
     $this->addElement($hash);
     $this->addElements(array($fullname, $submit, $message));
     $this->addDisplayGroup(array('fullname', 'email', 'messageToUser'), 'details');
     $this->details->setLegend('Details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Esempio n. 23
0
 /** Initialise form
  * @access public
  * @return void
  */
 public function init()
 {
     $email = $this->addElement('Text', 'email', array('label' => 'Email Address: ', 'size' => '30'))->email;
     $email->addValidator('emailAddress')->setRequired(true)->addErrorMessage('Please enter a valid address!')->addValidator('Db_RecordExists', false, array('table' => 'users', 'field' => 'email'))->addFilters(array('StringTrim', 'StripTags'));
     $submit = $this->addElement('submit', 'submit');
     $this->addDisplayGroup(array('email', 'submit'), 'details');
     $this->setLegend('Reset my password: ');
     parent::init();
 }
Esempio n. 24
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('TypeToRuler');
     $type = new Zend_Form_Element_Select('type');
     $type->setLabel('Medieval coin type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $ruler_id = new Zend_Form_Element_Hidden('ruler_id');
     $ruler_id->setRequired(true)->addValidator('Int');
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($type, $ruler_id, $submit))->setLegend('Add a new type')->setMethod('post');
     parent::init();
 }
Esempio n. 25
0
 /** Construct the form
  * @access public
  * @param array $options
  * @return void 
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setAttrib('enctype', 'multipart/form-data');
     $this->setName('AddAvatar');
     $avatar = new Zend_Form_Element_File('avatar');
     $avatar->setLabel('Upload an avatar: ')->setRequired(true)->setDestination('./images/avatars/')->addValidator('NotEmpty')->addValidator('Size', false, 512000)->addValidator('Extension', false, 'jpeg,tif,jpg,png,gif')->setMaxFileSize(512000)->setAttribs(array('class' => 'textInput'))->addValidator('Count', false, array('min' => 1, 'max' => 1));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Upload an avatar')->setAttribs(array('class' => 'large'));
     $this->addElements(array($avatar, $submit));
     parent::init();
 }
 /** 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();
 }
Esempio n. 27
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('contentSearch');
     $q = new Zend_Form_Element_Text('q');
     $q->setLabel('Search: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addErrorMessage('Please enter a search term');
     //
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Search!');
     $this->addElements(array($q, $submit));
     $this->addDisplayGroup(array('q', 'section', 'submit'), 'Search');
     parent::init();
 }
Esempio n. 28
0
 /** The form constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $roles = new Roles();
     $role_options = $roles->getRoles();
     $inst = new Institutions();
     $inst_options = $inst->getInsts();
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     $this->setName('acceptupgrades');
     ZendX_JQuery::enableForm($this);
     $level = new Zend_Form_Element_Select('level');
     $level->setLabel('Level of research: ')->setRequired(true)->addMultiOptions(array(null => 'Choose type of research', 'Available types' => $projectype_list))->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must set the level of research')->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Project title: ')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('size', 60)->addErrorMessage('This project needs a title.');
     $researchOutline = new Pas_Form_Element_CKEditor('researchOutline');
     $researchOutline->setLabel('Research outline: ')->setRequired(true)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->addErrorMessage('Outline must be present.');
     $reference = new Zend_Form_Element_Text('reference');
     $reference->setLabel('Referee\'s name: ')->setAttrib('size', 30)->addFilters(array('StringTrim', 'StripTags'));
     $referenceEmail = new Zend_Form_Element_Text('referenceEmail');
     $referenceEmail->setLabel('Referee\'s email address: ')->setAttrib('size', 30)->addValidator('EmailAddress')->addFilters(array('StringToLower', 'StringTrim', 'StripTags'));
     $message = new Pas_Form_Element_CKEditor('message');
     $message->setLabel('Message to user: '******'rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->addErrorMessage('You must enter a message for the user to ' . 'know they have been approved.');
     $fullname = new Zend_Form_Element_Text('fullname');
     $fullname->setLabel('Fullname: ')->setAttrib('size', 30)->addFilter('StringTrim')->addFilter('StripTags');
     $institution = $this->addElement('select', 'institution', array('label' => 'Recording institution: '))->institution;
     $institution->addMultiOptions(array(null => 'Available institutions', 'Choose institution' => $inst_options));
     $institution->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $role = $this->addElement('select', 'role', array('label' => 'Site role: '))->role;
     $role->addMultiOptions(array(null => 'Available roles', 'Choose role' => $role_options));
     $role->removeMultiOption('admin');
     $role->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $startDate = new ZendX_JQuery_Form_Element_DatePicker('startDate');
     $startDate->setLabel('Start date of project: ')->setAttrib('size', 12)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilter('StringTrim')->addFilter('StripTags')->setRequired(false)->addErrorMessage('You must enter a valid start date for this project');
     $endDate = new ZendX_JQuery_Form_Element_DatePicker('endDate');
     $endDate->setLabel('End date of project: ')->addFilter('StringTrim')->addFilter('StripTags')->setJQueryParam('dateFormat', 'yy-mm-dd')->setAttrib('size', 12)->setRequired(false)->addErrorMessage('You must enter a valid end date for this project');
     $email = $this->addElement('text', 'email', array('label' => 'Email Address', 'size' => '30'))->email;
     $email->addValidator('emailAddress')->setRequired(true)->addFilter('StringToLower')->addErrorMessage('Please enter a valid address!');
     $already = new Zend_Form_Element_Radio('already');
     $already->setLabel('Is your topic already listed on our research register?: ')->addMultiOptions(array(1 => 'Yes it is', 0 => 'No it is not'))->setRequired(true)->setOptions(array('separator' => ''));
     $insert = new Zend_Form_Element_Checkbox('insert');
     $insert->setLabel('Insert details into research register: ')->setCheckedValue(1);
     $valid = new Zend_Form_Element_Radio('higherLevel');
     $valid->setLabel('Approve?: ')->addMultiOptions(array(1 => 'Unauthorised', 0 => 'Authorised'))->setRequired(true)->setOptions(array('separator' => ''));
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($reference, $referenceEmail, $researchOutline, $startDate, $endDate, $fullname, $valid, $level, $title, $submit, $already, $insert, $message));
     $this->addDisplayGroup(array('fullname', 'username', 'email', 'institution', 'level', 'role', 'reference', 'referenceEmail', 'message', 'researchOutline', 'title', 'startDate', 'endDate', 'already', 'higherLevel', 'insert'), 'details');
     $this->details->setLegend('Details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Esempio n. 29
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('filterruler');
     $ruler = new Zend_Form_Element_Text('ruler');
     $ruler->setLabel('Filter by name')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20);
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Filter');
     $this->addElements(array($ruler, $submit, $hash));
     parent::init();
 }
Esempio n. 30
0
 /** The constructor
  * @access public
  * @param array $options
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('segments');
     $segments = new Zend_Form_Element_Select('segment');
     $segments->setLabel('Apply a segment')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->addMultiOptions(array(null => 'Available segments', 'Choose a segment' => array('allvisits' => 'All visits (default)', 'newvisitors' => 'New visitors', 'returning' => 'Returning visitors', 'paidsearch' => 'Paid search (we do not do this!)', 'unpaidsearch' => 'Unpaid search traffic', 'searchtraffic' => 'Search traffic', 'directtraffic' => 'Direct traffic', 'referredtraffic' => 'Referred traffic', 'conversions' => 'Conversion visits', 'mobiles' => 'Mobile traffic', 'nobounces' => 'Visits without a bounce', 'tablets' => 'Tablet traffic')));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Apply segment:');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(60000);
     $this->addElement($hash);
     $this->addElements(array($segments, $submit));
     parent::init();
 }