コード例 #1
0
ファイル: Participant.php プロジェクト: br00k/tnc-web
 public function init()
 {
     parent::init();
     $this->setAction('/core/feedback/participant');
     $id = new Zend_Form_Element_Hidden('id');
     $id->setRequired(true)->setLabel('id')->addValidators(array('Int'))->setDecorators(array('Composite'));
     $country = new TA_Form_Element_Country('country');
     $country->setLabel('Please select the country in which you work as primary place of employment.')->setDecorators(array('Composite'));
     $orgType = new Zend_Form_Element_Select('org_type');
     $orgType->setLabel('Please select the type of organisation that most closely resembles your primary place of employment.')->setAttrib('class', 'medium')->setMultiOptions(array('0' => '---', 'nren' => 'National Research and Education Network (NREN)', 'high' => 'Higher / Further Education Institute (universities / college / polytechnic...)', 'ari' => 'Academic Research Institute', 'project' => 'Research project', 'admin' => 'Administrative departments of academic institutions', 'local' => 'Local / regional / central government department', 'cultural' => 'Cultural organisation (galeries, librairies, museums, etc.)', 'comm' => 'Commercial organisation', 'other' => 'Other non-profit (specify)'))->setDecorators(array('Composite'));
     $orgOther = new Zend_Form_Element_Text('org_type_other');
     $orgOther->setDescription('Other, please specify')->setAttrib('class', 'medium')->setDecorators(array('Composite'));
     $occupation = new Zend_Form_Element_Select('occupation');
     $occupation->setLabel('Please select the title that most closely resembles your primary role in the organisation.')->setAttrib('class', 'medium')->setMultiOptions(array('0' => '---', 'director' => 'Director (responsible for overall organisational management)', 'manager' => 'Technical Manager', 'admin' => 'Administrative / Operational Manager', 'tech' => 'Technical staff / Engineer', 'res' => 'Researcher / Scientist', 'prof' => 'Professor / Teacher', 'pr' => 'Public Relations / Communications', 'bizz' => 'Business Development', 'stud' => 'Student', 'other' => 'Other (specify)'))->setDecorators(array('Composite'));
     $occOther = new Zend_Form_Element_Text('occupation_other');
     $occOther->setDescription('Other, please specify')->setAttrib('class', 'medium')->setDecorators(array('Composite'));
     $interest = new Zend_Form_Element_MultiCheckbox('interest');
     $interest->setLabel('Please select your main areas of interest. Up to three selections are possible.')->setAttrib('class', 'tiny')->setMultiOptions(array('sec' => 'Network security (incident, prevention and response)', 'nom' => 'Network operations management', 'clouds' => 'Storage and clouds', 'grids' => 'Grids', 'media' => 'Media management and distribution', 'auth' => 'Authentication and Authorisation systems and federations', 'wireless' => 'Fixed & mobile wireless and roaming technologies', 'vid' => 'Video / web-based conferencing', 'reg' => 'Regulatory issues including privacy', 'pr' => 'PR / communications / business development', 'strat' => 'Strategic development: European policy setting and / or organisational management', 'other' => 'Other (specify)'))->addValidator('Callback', true, array('callback' => function ($value, $arr) {
         return count($arr['interest']) > 3 ? false : true;
     }, 'messages' => array(Zend_Validate_Callback::INVALID_VALUE => "Please don't select more than three options")))->setDecorators(array('Composite'));
     $intOther = new Zend_Form_Element_Text('interest_other');
     $intOther->setDescription('Other, please specify')->setAttrib('class', 'medium')->setDecorators(array('Composite'));
     $this->addElements(array($id, $country, $orgType, $orgOther, $occupation, $occOther, $interest, $intOther));
     $this->addElement('submit', 'submit', array('decorators' => $this->_buttonElementDecorator));
 }
コード例 #2
0
ファイル: Programme.php プロジェクト: GEANT/CORE
 public function init()
 {
     parent::init();
     $this->setAction('/core/feedback/programme');
     $id = new Zend_Form_Element_Hidden('id');
     $id->setRequired(true)->setLabel('id')->addValidators(array('Int'))->setDecorators(array('Composite'));
     $best = new Zend_Form_Element_Textarea('best_stuff');
     $best->setLabel('Which sessions or presentations were the best – and why?')->setAttrib('class', 'medium')->setDescription('Please limit your comments to 1000 characters')->setRequired(false)->addValidator('StringLength', true, array(1, 5000, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer comment', Zend_Validate_StringLength::TOO_LONG => 'Your comment is too long')))->setDecorators(array('Composite'));
     $worst = clone $best;
     $worst->setName('worst_stuff')->setLabel('Which sessions or presentations were the worst – and why?');
     $comments = clone $best;
     $comments->setName('comments')->setLabel('Comments on the programme');
     $this->addElements(array($id, $best, $worst));
     $elements = array('exhibition' => 'How useful did you find the exhibitions and demos?', 'meetings' => 'How useful did you find the meetings / workshops around the conference?', 'lightning' => 'How useful did you find the lightning talks?', 'poster' => 'How useful did you find the poster presentations?');
     // add all elements in loop, since they are all the same
     foreach ($elements as $name => $label) {
         $newSelect = new Zend_Form_Element_Radio($name);
         $newSelect->setLabel($label)->setAttrib('class', 'tiny')->setMultiOptions($this->_getFieldValues('rating', 'feedback'))->setDecorators(array('Composite'));
         $newText = new Zend_Form_Element_Text('remarks_' . $name);
         $newText->setDescription('Comments')->setAttrib('class', 'medium')->setDecorators(array('Composite'));
         $this->addElements(array($newSelect, $newText));
     }
     $this->addElement($comments);
     $this->addElement('submit', 'submit', array('decorators' => $this->_buttonElementDecorator));
 }
コード例 #3
0
ファイル: User.php プロジェクト: br00k/tnc-web
 public function init()
 {
     parent::init();
     $this->setAction('/core/session/chairs');
     $submissionId = new Zend_Form_Element_Hidden('session_id');
     $submissionId->setRequired(true)->addValidators(array('Int'))->setDecorators(array('Composite'));
     $users = new TA_Form_Element_User('user_id');
     $users->setTaController('session')->populateElement('chair')->setAttrib('onchange', "this.form.submit()");
     $this->addElements(array($submissionId, $users));
 }
コード例 #4
0
ファイル: Mailto.php プロジェクト: GEANT/CORE
 public function init()
 {
     parent::init();
     $this->setAction('/core/feedback/mailto');
     $this->setAttrib('id', 'mailtoform');
     $email = new Zend_Form_Element_Text('email');
     $email->setLabel('Email address')->setRequired(true)->setAttrib('class', 'medium')->addValidators(array(array('EmailAddress', true)))->setDecorators(array('Composite'));
     $this->addElements(array($email));
     $this->addElement('submit', 'submit', array('label' => 'Send email', 'decorators' => $this->_buttonElementDecorator));
 }
コード例 #5
0
ファイル: Mail.php プロジェクト: GEANT/CORE
 public function init()
 {
     parent::init();
     $this->setAction('/core/review/mail');
     $this->setAttrib('id', 'mailform');
     $dummy = new Zend_Form_Element_Checkbox('dummy');
     $dummy->setLabel('Do a test run (does not send emails)')->setChecked(true)->setDecorators(array('Composite'));
     $this->addElements(array($dummy));
     $this->addElement('submit', 'submit', array('label' => 'Send emails (this may take a while)', 'decorators' => $this->_buttonElementDecorator));
 }
コード例 #6
0
ファイル: Role.php プロジェクト: GEANT/CORE
 public function init()
 {
     parent::init();
     $this->setAction('/core/user/roles');
     $id = new Zend_Form_Element_Hidden('user_id');
     $id->setRequired(true)->addValidators(array('Int'))->setDecorators(array('Composite'));
     $userModel = new Core_Model_User();
     $roles = new Zend_Form_Element_Select('role_id');
     $roles->setAttrib('class', 'large')->setAttrib('onchange', 'this.form.submit()')->setMultiOptions($userModel->getRolesForSelect())->setDecorators(array('Composite'));
     $this->addElements(array($id, $roles));
 }
コード例 #7
0
ファイル: User.php プロジェクト: br00k/tnc-web
 public function init()
 {
     parent::init();
     $this->setAction('/core/presentation/speakers');
     $id = new Zend_Form_Element_Hidden('presentation_id');
     $id->setRequired(true)->addValidators(array('Int'))->setDecorators(array('Composite'));
     $presentationModel = new Core_Model_Presentation();
     $users = new TA_Form_Element_User('user_id');
     $users->setTaController('presentation')->populateElement('presenter')->setAttrib('onchange', "this.form.submit()");
     $this->addElements(array($id, $users));
 }
コード例 #8
0
ファイル: Presentation.php プロジェクト: GEANT/CORE
 public function init()
 {
     parent::init();
     $this->setAction('/core/session/show');
     $conference = Zend_Registry::get('conference');
     $sessionId = new Zend_Form_Element_Hidden('session_id');
     $sessionId->setRequired(true)->addValidators(array('Int'))->setDecorators(array('Composite'));
     $presentationModel = new Core_Model_Presentation();
     $select = new Zend_Form_Element_Select('presentation_id');
     $select->setAttrib('onchange', 'this.form.submit()')->setMultiOptions($presentationModel->getPresentationsForSelect('--- attach presentation ---'))->setRegisterInArrayValidator(false)->setDecorators(array('Composite'));
     $this->addElements(array($sessionId, $select));
 }
コード例 #9
0
ファイル: User.php プロジェクト: br00k/tnc-web
 public function init()
 {
     parent::init();
     $this->setAction('/core/submit/reviewers');
     $submissionId = new Zend_Form_Element_Hidden('submission_id');
     $submissionId->setRequired(true)->addValidators(array('Int'))->setDecorators(array('Composite'));
     $users = new TA_Form_Element_User('user_id');
     $users->setTaController('submit')->populateElement('reviewer')->setAttrib('onchange', "this.form.submit()");
     // use custom decorator for this element
     $users->removeDecorator('User');
     $users->addDecorator('Userreviewer', array('placement' => 'prepend'));
     $this->addElements(array($submissionId, $users));
 }
コード例 #10
0
ファイル: Evaluation.php プロジェクト: br00k/tnc-web
 public function init()
 {
     parent::init();
     $this->setAction('/core/session/evaluate/format/html');
     $this->setAttrib('id', 'evaluateform');
     $evaluationId = new Zend_Form_Element_Hidden('session_evaluation_id');
     $evaluationId->addValidator('Int')->addFilter('Null')->setDecorators(array('Composite'));
     $sessionId = new Zend_Form_Element_Hidden('session_id');
     $sessionId->setRequired(true)->addValidator('Int')->setDecorators(array('Composite'));
     $comments = new Zend_Form_Element_Textarea('comments');
     $comments->setLabel('Comments')->setAttrib('class', 'small')->setRequired(true)->setDecorators(array('Composite'));
     $attendees = new Zend_Form_Element_Text('attendees');
     $attendees->setLabel('Attendees')->setAttrib('class', 'tiny')->addValidator('Int')->addFilter('Null')->setRequired(false)->setDecorators(array('Composite'));
     $this->addElements(array($evaluationId, $sessionId, $comments, $attendees));
     $this->addElement('submit', 'submit', array('label' => 'Submit', 'decorators' => $this->_buttonElementDecorator));
 }
コード例 #11
0
ファイル: Files.php プロジェクト: br00k/tnc-web
 public function init()
 {
     parent::init();
     $this->setAction('/core/session/files');
     $this->setAttrib('enctype', 'multipart/form-data');
     $id = new Zend_Form_Element_Hidden('session_id');
     $id->setRequired(true)->addValidators(array('Int'))->setDecorators(array('Composite'));
     // the name of this form element must be of an existing filetype
     $file1 = new TA_Form_Element_MagicFile('slides');
     $file1->setLabel('Session slide')->setDescription('')->addDecorators($this->_magicFileElementDecorator)->setValueDisabled(true)->addValidators(array(array('Count', true, 1), array('Size', true, array('max' => '4Mb'))));
     $subForm = new Zend_Form_SubForm();
     $subForm->addElements(array($file1))->setDecorators(array('FormElements'));
     $this->addSubForm($subForm, 'files');
     $this->addElements(array($id));
     $this->addElement('submit', 'submit', array('label' => 'Submit', 'decorators' => $this->_buttonElementDecorator));
 }
コード例 #12
0
ファイル: Status.php プロジェクト: GEANT/CORE
 public function init()
 {
     parent::init();
     $this->setAction('/core/review/list/');
     $this->setAttrib('id', 'statusform');
     $submissionId = new Zend_Form_Element_Hidden('submission_id');
     $submissionId->setRequired(true)->setLabel('submission_id')->addValidators(array('Int'))->setDecorators(array('Composite'));
     // todo: replace with 'new' way of doing this
     $statusOptions = Zend_Registry::get('formconfig')->formdefaults->submit->status->toArray();
     $status = new Zend_Form_Element_Select('status');
     $status->setLabel('Status')->setAttrib('class', 'small')->addFilter('Null')->addMultiOptions($statusOptions)->setDecorators(array('Composite'));
     $sessionModel = new Core_Model_Session();
     $sessions = $sessionModel->getSessionsForSelect('');
     $session = new Zend_Form_Element_Select('session_id');
     $session->setLabel('Proposed Session')->setAttrib('class', 'small')->addMultiOption('', '--- select a session ---')->addFilter('Null')->addMultiOptions($sessions)->setDecorators(array('Composite'));
     $this->addElements(array($submissionId, $status, $session));
     $this->addElement('submit', 'submit', array('label' => 'Submit', 'decorators' => $this->_buttonElementDecorator));
 }
コード例 #13
0
ファイル: Timeslots.php プロジェクト: br00k/tnc-web
 public function init()
 {
     parent::init();
     $this->setAction('/core/conference/timeslots');
     $conferenceId = new Zend_Form_Element_Hidden('conference_id');
     $conferenceId->setRequired(true)->addValidators(array('Int'))->setDecorators($this->_hiddenElementDecorator);
     $timeslot = new TA_Form_Element_Timeslot('timeslot_1');
     $timeslot->clearDecorators()->addDecorator(new TA_Form_Decorator_Timeslot())->setIgnore(true)->setAttrib('class', 'hidden');
     // since this element will be used as a template, hide it!
     // add timeslot elements to subform so in isValid() I only have to loop over that form
     $subform = new Zend_Form_SubForm();
     $subform->setDecorators(array('FormElements'));
     $subform->addElements(array($timeslot));
     $this->addSubForm($subform, 'dynamic');
     $this->addElements(array($conferenceId));
     $this->addElement('button', 'add', array('label' => 'Add new timeslot', 'decorators' => $this->_buttonElementDecorator));
     $this->addElement('submit', 'submit', array('label' => 'Submit', 'decorators' => $this->_buttonElementDecorator));
 }
コード例 #14
0
ファイル: Files.php プロジェクト: GEANT/CORE
 public function init()
 {
     parent::init();
     $this->setAttrib('enctype', 'multipart/form-data');
     $id = new Zend_Form_Element_Hidden('presentation_id');
     $id->setRequired(true)->addValidators(array('Int'))->setDecorators(array('Composite'));
     $paper = new TA_Form_Element_MagicFile('paper');
     $paper->setLabel('Paper')->setDescription('OpenOffice, PDF, and Microsoft Word are acceptable formats.')->addDecorators($this->_magicFileElementDecorator)->setValueDisabled(true)->addValidators(array(array('Count', true, 1), array('Size', true, array('max' => '64Mb'))));
     $slides = new TA_Form_Element_MagicFile('slides');
     $slides->setLabel('Slides')->setDescription('Microsoft Powerpoint, OpenOffice, and PDF are acceptable formats.')->addDecorators($this->_magicFileElementDecorator)->setValueDisabled(true)->addValidators(array(array('Count', true, 1), array('Size', true, array('max' => '64Mb'))));
     $file1 = new TA_Form_Element_MagicFile('misc');
     $file1->setLabel('Extra file')->setDescription('')->addDecorators($this->_magicFileElementDecorator)->setValueDisabled(true)->addValidators(array(array('Count', true, 1), array('Size', true, array('max' => '64Mb'))));
     $subForm = new Zend_Form_SubForm();
     $subForm->addElements(array($paper, $slides, $file1))->setDecorators(array('FormElements'));
     $this->addSubForm($subForm, 'files');
     $this->addElements(array($id));
     $this->addElement('submit', 'submit', array('label' => 'Submit', 'decorators' => $this->_buttonElementDecorator));
 }
コード例 #15
0
ファイル: Import.php プロジェクト: br00k/tnc-web
 public function init()
 {
     parent::init();
     $this->setAction('/core/presentation/import');
     $status = new Zend_Form_Element_Select('status');
     $status->setLabel('With status')->setAttrib('class', 'small')->setAttrib('disabled', 'disabled')->addMultiOptions($this->_getFieldValues('status', 'submit'))->setDecorators(array('Composite'));
     $submitStart = new Zend_Form_Element_Text('submit_start');
     $submitStart->setLabel('From')->setDescription('dd/mm/yy')->setAttrib('class', 'small')->setRequired(true)->setDecorators(array('Composite'));
     $submitEnd = new Zend_Form_Element_Text('submit_end');
     $submitEnd->setLabel('To')->setDescription('dd/mm/yy')->setAttrib('class', 'small')->setRequired(true)->setDecorators(array('Composite'));
     $setRole = new Zend_Form_Element_Checkbox('set_role');
     $setRole->setLabel('Give user \'presenter\' role')->setRequired(false)->setChecked(true)->setDecorators(array('Composite'));
     $setLink = new Zend_Form_Element_Checkbox('set_link');
     $setLink->setLabel('Make user a speaker for this presentation')->setRequired(false)->setChecked(true)->setDecorators(array('Composite'));
     $sessions = new Zend_Form_Element_Checkbox('link_sessions');
     $sessions->setLabel('Link sessions to presentations')->setRequired(false)->setChecked(true)->setDecorators(array('Composite'));
     $overwrite = new Zend_Form_Element_Checkbox('_overwrite');
     $overwrite->setLabel('Overwrite exsiting presentations')->setRequired(false)->setChecked(false)->setDecorators(array('Composite'));
     $fileLink = new Zend_Form_Element_Checkbox('link_files');
     $fileLink->setLabel('Link files to presentations')->setRequired(false)->setChecked(true)->setDecorators(array('Composite'));
     $this->addElements(array($status, $submitStart, $submitEnd, $setRole, $setLink, $sessions, $fileLink, $overwrite));
     $this->addElement('submit', 'submit', array('label' => 'Submit', 'decorators' => $this->_buttonElementDecorator));
 }
コード例 #16
0
ファイル: General.php プロジェクト: GEANT/CORE
 public function init()
 {
     parent::init();
     $this->setAction('/core/feedback/general');
     $id = new Zend_Form_Element_Hidden('id');
     $id->setRequired(true)->setLabel('id')->addValidators(array('Int'))->setDecorators(array('Composite'));
     $confRating = new Zend_Form_Element_Radio('rating');
     $confRating->setLabel('How would you rate the conference overall?')->setAttrib('class', 'tiny')->setMultiOptions($this->_getFieldValues('rating', 'feedback'))->setDecorators(array('Composite'));
     $partReasons = new Zend_Form_Element_MultiCheckbox('part_reasons');
     $partReasons->setLabel('Please select your top three reasons for participating in the TERENA conference')->setAttrib('class', 'tiny')->setMultiOptions(array('networking' => 'Networking opportunities (i.e. opportunities to form new professional contacts)', 'collaboration' => 'Collaboration opportunities (i.e. opportunities to work together with others on a common area of interest)', 'interesting' => 'Interesting topic/speaker that could help me in my job', 'exposure' => 'Visibility/exposure within the Research & Education Community', 'management' => 'It is encouraged by my management', 'support' => 'To support the ongoing development of the research & education community as a whole', 'other' => 'Other'))->setDecorators(array('Composite'));
     $partOther = new Zend_Form_Element_Text('why_other_spec');
     $partOther->setDescription('Other, please specify')->setAttrib('class', 'medium')->setDecorators(array('Composite'));
     $confHear = new Zend_Form_Element_MultiCheckbox('conf_hear');
     $confHear->setLabel('How did you hear about the conference? (check all that apply)')->setAttrib('class', 'tiny')->setMultiOptions(array('last' => 'During the last conference', 'pp' => 'Printed promotion', 'email' => 'Email', 'col' => 'Colleagues', 'web' => 'TERENA or NREN website', 'sns' => 'Social networking site (Facebook, Linkedin, Twitter...etc)', 'other' => 'Other'))->setDecorators(array('Composite'));
     $hearOther = new Zend_Form_Element_Text('heard_other_spec');
     $hearOther->setDescription('Other, please specify')->setAttrib('class', 'medium')->setDecorators(array('Composite'));
     $beenBefore = new Zend_Form_Element_Radio('been_before');
     $beenBefore->setLabel('Have you been to a TERENA conference before?')->setAttrib('class', 'tiny')->setMultiOptions(array('no' => 'No', 'yesone' => 'Yes, once', 'yestwice' => 'Yes, twice', 'yesthree' => 'Yes, three times and more'))->setDecorators(array('Composite'));
     $comeAgain = new Zend_Form_Element_Radio('come_again');
     $comeAgain->setLabel('Will you come to the TERENA conference again?')->setAttrib('class', 'tiny')->setMultiOptions(array('yes' => 'Yes, definitely', 'maybe' => 'Yes, maybe', 'un' => 'Undecided', 'probnot' => 'Probably not', 'no' => 'No'))->setDecorators(array('Composite'));
     $this->addElements(array($id, $confRating, $partReasons, $partOther, $confHear, $hearOther, $beenBefore, $comeAgain));
     $this->addElement('submit', 'submit', array('decorators' => $this->_buttonElementDecorator));
 }
コード例 #17
0
ファイル: Logistics.php プロジェクト: br00k/tnc-web
 public function init()
 {
     parent::init();
     $this->setAction('/core/feedback/logistics');
     $id = new Zend_Form_Element_Hidden('id');
     $id->setRequired(true)->setLabel('id')->addValidators(array('Int'))->setDecorators(array('Composite'));
     $elements = array('website' => 'Conference website', 'core' => 'Conference software (CORE) usability', 'social_media' => 'Conference social media (usefulness)', 'registration' => 'Registration / payment procedures', 'hotel_booking' => 'Hotel booking procedures', 'doc_during' => 'Onsite information', 'venue' => 'Venue', 'network' => 'Networking facilities', 'catering' => 'Catering', 'social_events' => 'Social events');
     // add all elements in loop, since they are all the same
     foreach ($elements as $name => $label) {
         $newSelect = new Zend_Form_Element_Radio($name);
         $newSelect->setLabel($label)->setAttrib('class', 'tiny')->setMultiOptions($this->_getFieldValues('rating', 'feedback'))->setDecorators(array('Composite'));
         $newText = new Zend_Form_Element_Text('remarks_' . $name);
         $newText->setDescription('Comments')->setAttrib('class', 'medium')->setDecorators(array('Composite'));
         $this->addElements(array($newSelect, $newText));
     }
     $accomodation = new Zend_Form_Element_Radio('vfm_accomodation');
     $accomodation->setLabel('Accommodation')->setAttrib('class', 'tiny')->setMultiOptions(array('good' => 'Good value for money', 'reasonable' => 'Reasonable value for money', 'poor' => 'Poor value for money'))->setDecorators(array('Composite'));
     $regfee = clone $accomodation;
     $regfee->setName('vfm_regfee')->setLabel('Registration fee');
     $comments = new Zend_Form_Element_Textarea('comments');
     $comments->setLabel('Comments on the logistical arrangements')->setAttrib('class', 'medium')->setDescription('Please limit your comments to 1000 characters')->setRequired(false)->addValidator('StringLength', true, array(1, 5000, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer comment', Zend_Validate_StringLength::TOO_LONG => 'Your comment is too long')))->setDecorators(array('Composite'));
     $this->addElements(array($id, $accomodation, $regfee, $comments));
     $this->addElement('submit', 'submit', array('decorators' => $this->_buttonElementDecorator));
 }