public function configureWidgets()
 {
     $this->setWidget('student_id', new sfWidgetFormInputHidden());
     $this->setWidget('school_year_id', new sfWidgetFormInputHidden());
     $this->setWidget('request_date', new csWidgetFormDateInput());
     $this->setWidget('resolution_date', new csWidgetFormDateInput());
     $this->getWidget('disciplinary_sanction_type_id')->setOption('add_empty', true);
     $this->getWidget('sanction_type_id')->setOption('add_empty', true);
     $applicants_criteria = new Criteria();
     PersonPeer::doSelectOrderedCriteria($applicants_criteria);
     $results = array();
     foreach (PersonalPeer::doSelect(new Criteria()) as $personal) {
         $results[$personal->getPersonId()] = $personal->getPersonId();
     }
     foreach (TeacherPeer::doSelect(new Criteria()) as $teacher) {
         $results[$teacher->getPersonId()] = $teacher->getPersonId();
     }
     $applicants_criteria->add(PersonPeer::ID, $results, Criteria::IN);
     $this->getWidget('applicant_id')->setOption('criteria', $applicants_criteria);
     $preceptors_criteria = new Criteria();
     PersonPeer::doSelectOrderedCriteria($preceptors_criteria);
     $preceptors_criteria->addJoin(PersonPeer::ID, PersonalPeer::PERSON_ID);
     $this->getWidget('responsible_id')->setOption('criteria', $preceptors_criteria);
     $this->setWidget('document', new sfWidgetFormInputFile());
     if ($this->getObject()->getDocument()) {
         $this->setWidget('current_document', new mtWidgetFormPartial(array('module' => 'student_disciplinary_sanction', 'partial' => 'downloable_document', 'form' => $this)));
         $this->setWidget('delete_document', new sfWidgetFormInputCheckbox());
         $this->getWidgetSchema()->moveField('delete_document', sfWidgetFormSchema::BEFORE, 'document');
         $this->getWidgetSchema()->moveField('current_document', sfWidgetFormSchema::BEFORE, 'delete_document');
     }
 }
예제 #2
0
 public static function getPager($max = 10, $page = 1, $date_req = null, $pass_name = null, $req_name = null, $pass_lname = null, $req_lname = null)
 {
     $c = new Criteria();
     $c->addJoin(self::PASSENGER_ID, PassengerPeer::ID, Criteria::LEFT_JOIN);
     $c->addJoin(self::REQUESTER_ID, RequesterPeer::ID, Criteria::LEFT_JOIN);
     $c->addJoin(PassengerPeer::PERSON_ID, PersonPeer::alias('c1', PersonPeer::ID), Criteria::LEFT_JOIN);
     $c->addJoin(RequesterPeer::PERSON_ID, PersonPeer::alias('c2', PersonPeer::ID), Criteria::LEFT_JOIN);
     $c->addAlias('c1', PersonPeer::TABLE_NAME);
     $c->addAlias('c2', PersonPeer::TABLE_NAME);
     if ($date_req) {
         $c->add(self::DATE_REQUESTED, '%' . date('Y-m-d', strtotime($date_req)) . '%', Criteria::LIKE);
     }
     if ($pass_name) {
         $c->add(PersonPeer::alias("c1", PersonPeer::FIRST_NAME), $pass_name . '%', Criteria::LIKE);
     }
     if ($req_name) {
         $c->add(PersonPeer::alias("c2", PersonPeer::FIRST_NAME), $req_name . '%', Criteria::LIKE);
     }
     if ($pass_lname) {
         $c->add(PersonPeer::alias("c1", PersonPeer::LAST_NAME), $pass_lname . '%', Criteria::LIKE);
     }
     if ($req_lname) {
         $c->add(PersonPeer::alias("c2", PersonPeer::LAST_NAME), $req_lname . '%', Criteria::LIKE);
     }
     $c->addAscendingOrderByColumn(self::DATE_REQUESTED);
     $pager = new sfPropelPager('Itinerary', $max);
     $pager->setCriteria($c);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
예제 #3
0
 public function configure()
 {
     unset($this['id'], $this['releasing_physician'], $this['releasing_phone'], $this['releasing_fax1'], $this['releasing_fax1_comment'], $this['releasing_email'], $this['medical_release_requested'], $this['medical_release_received'], $this['treating_physician'], $this['treating_phone'], $this['person_id'], $this['passenger_type_id'], $this['parent'], $this['date_of_birth'], $this['weight'], $this['illness'], $this['passenger_illness_category_id'], $this['language_spoken'], $this['best_contact_method'], $this['financial'], $this['public_considerations'], $this['private_considerations'], $this['lodging_name'], $this['lodging_phone'], $this['lodging_phone_comment'], $this['facility_phone'], $this['facility_phone_comment'], $this['emergency_contact_name'], $this['emergency_contact_primary_phone'], $this['emergency_contact_primary_comment'], $this['emergency_contact_secondary_phone'], $this['emergency_contact_secondary_comment'], $this['requester_id'], $this['facility_name'], $this['camp_passenger_list'], $this['camp_pilot_passenger_list']);
     $pass_types = PassengerTypePeer::getForSelectParent();
     $persons = PersonPeer::getNotInPassenger();
     # Fields
     $this->widgetSchema['ground_transportation_comment'] = new sfWidgetFormTextarea(array());
     $this->widgetSchema['travel_history_notes'] = new sfWidgetFormTextarea(array());
     $this->widgetSchema['need_medical_release'] = new sfWidgetFormChoice(array('choices' => array('1' => 'yes', '0' => 'no'), 'expanded' => false));
     $this->widgetSchema['treating_fax1'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['treating_fax1_comment'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['treating_email'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     # Labels
     $this->widgetSchema->setLabels(array('ground_transportation_comment' => 'Ground Transportation'));
     $this->widgetSchema->setLabels(array('travel_history_notes' => 'Travel History Notes'));
     $this->widgetSchema->setLabels(array('need_medical_release' => 'Med Release Required'));
     $this->widgetSchema->setLabels(array('treating_fax1' => 'Fax Number'));
     $this->widgetSchema->setLabels(array('treating_fax1_comment' => 'Comment'));
     $this->widgetSchema->setLabels(array('treating_email' => 'Email'));
     # Validation
     $this->validatorSchema['ground_transportation_comment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['travel_history_notes'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['need_medical_release'] = new sfValidatorInteger(array('required' => false));
     $this->validatorSchema['treating_fax1'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['treating_fax1_comment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['treating_email'] = new sfValidatorEmail(array('required' => false), array('invalid' => 'Invalid email !'));
     # Descriptive message
     #help
     $this->widgetSchema->setHelp('weight', 'lbs.');
     $this->widgetSchema->setNameFormat('pass5_4[%s]');
 }
예제 #4
0
 /**
  * Retrieves an array of active Personal and ordered by Lastname.
  * @param Criteria $criteria
  * @param PropelPDO $con
  * @return <array>  Personal[]
  */
 public static function doSelectActive(Criteria $criteria, PropelPDO $con = null)
 {
     $criteria = PersonPeer::doSelectOrderedCriteria($criteria, $con);
     $criteria->add(PersonPeer::IS_ACTIVE, true);
     $criteria->addJoin(PersonPeer::ID, self::PERSON_ID);
     return self::doSelect($criteria, $con);
 }
예제 #5
0
 /**
  * Find object by primary key
  * Use instance pooling to avoid a database query if the object exists
  * <code>
  * $obj  = $c->findPk(12, $con);
  * </code>
  * @param     mixed $key Primary key to use for the query
  * @param     PropelPDO $con an optional connection object
  *
  * @return    Person|array|mixed the result, formatted by the current formatter
  */
 public function findPk($key, $con = null)
 {
     if (null !== ($obj = PersonPeer::getInstanceFromPool((string) $key)) && $this->getFormatter()->isObjectFormatter()) {
         // the object is alredy in the instance pool
         return $obj;
     } else {
         // the object has not been requested yet, or the formatter is not an object formatter
         $criteria = $this->isKeepQuery() ? clone $this : $this;
         $stmt = $criteria->filterByPrimaryKey($key)->getSelectStatement($con);
         return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
     }
 }
예제 #6
0
 public static function getForSelectParent()
 {
     $c = new Criteria();
     $c->add(PersonPeer::LAST_NAME, null, Criteria::NOT_EQUAL);
     $c->addJoin(self::PERSON_ID, PersonPeer::ID);
     $donors = PersonPeer::doSelect($c);
     $arr = array();
     $arr[0] = '-- select --';
     foreach ($donors as $donor) {
         $arr[$donor->getId()] = $donor->getLastName();
     }
     return $arr;
 }
예제 #7
0
 public function executeEdit(sfWebRequest $request)
 {
     if (!$this->getUser()->hasCredential(array('Administrator'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     $this->forward404Unless($wing_leader = WingLeaderPeer::retrieveByPk($request->getParameter('id')), sprintf('Object wing_leader does not exist (%s).', $request->getParameter('id')));
     $this->form = new WingLeaderForm($wing_leader);
     $this->wing_leader_id = $request->getParameter("id");
     if ($request->getParameter('person_id')) {
         $this->person = PersonPeer::retrieveByPK($request->getParameter('person_id'));
     }
 }
예제 #8
0
 public function configure()
 {
     unset($this['id'], $this['person_id'], $this['passenger_type_id'], $this['parent'], $this['date_of_birth'], $this['weight'], $this['illness'], $this['passenger_illness_category_id'], $this['language_spoken'], $this['best_contact_method'], $this['financial'], $this['public_considerations'], $this['private_considerations'], $this['ground_transportation_comment'], $this['travel_history_notes'], $this['releasing_physician'], $this['releasing_phone'], $this['releasing_fax1'], $this['releasing_fax1_comment'], $this['releasing_email'], $this['need_medical_release'], $this['medical_release_requested'], $this['medical_release_received'], $this['treating_physician'], $this['treating_phone'], $this['treating_fax1'], $this['treating_fax1_comment'], $this['treating_email'], $this['camp_passenger_list'], $this['camp_pilot_passenger_list']);
     $requesters = PersonPeer::getNotInRequester();
     $phone_options = array('mask' => '(999) 999-9999', 'ok_class' => 'field_ok', 'holder_class' => 'field_hold');
     # Fields
     $this->widgetSchema['lodging_name'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['lodging_phone'] = new widgetFormInputPhone($phone_options, array('class' => 'text narrow'));
     $this->widgetSchema['lodging_phone_comment'] = new sfWidgetFormTextarea(array(), array('class' => 'text class'));
     $this->widgetSchema['facility_name'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['facility_phone'] = new widgetFormInputPhone($phone_options, array('class' => 'text narrow'));
     $this->widgetSchema['facility_phone_comment'] = new sfWidgetFormTextarea(array(), array('class' => 'text class'));
     $this->widgetSchema['requester_id'] = new sfWidgetFormChoice(array('choices' => $requesters), array('class' => 'text'));
     $this->widgetSchema['emergency_contact_name'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['emergency_contact_primary_phone'] = new widgetFormInputPhone($phone_options, array('class' => 'text narrow'));
     $this->widgetSchema['emergency_contact_primary_comment'] = new sfWidgetFormTextarea(array(), array('class' => 'text class'));
     $this->widgetSchema['emergency_contact_secondary_phone'] = new widgetFormInputPhone($phone_options, array('class' => 'text narrow'));
     $this->widgetSchema['emergency_contact_secondary_comment'] = new sfWidgetFormTextarea(array(), array('class' => 'text class'));
     # Labels
     $this->widgetSchema->setLabels(array('lodging_name' => 'Name'));
     $this->widgetSchema->setLabels(array('lodging_phone' => 'Phone'));
     $this->widgetSchema->setLabels(array('lodging_phone_comment' => 'Phone Comment'));
     $this->widgetSchema->setLabels(array('facility_name' => 'Name'));
     $this->widgetSchema->setLabels(array('facility_phone' => 'Phone'));
     $this->widgetSchema->setLabels(array('facility_phone_comment' => 'Phone Comment'));
     $this->widgetSchema->setLabels(array('requester_id' => 'Requester'));
     $this->widgetSchema->setLabels(array('emergency_contact_name' => 'Emergency Contact Name'));
     $this->widgetSchema->setLabels(array('emergency_contact_primary_phone' => 'Primary Phone'));
     $this->widgetSchema->setLabels(array('emergency_contact_primary_comment' => 'Comment'));
     $this->widgetSchema->setLabels(array('emergency_contact_secondary_phone' => 'Secondary Phone'));
     $this->widgetSchema->setLabels(array('emergency_contact_secondary_comment' => 'Comment'));
     $this->widgetSchema->setLabels(array('facility_city' => 'Destination City'));
     $this->widgetSchema->setLabels(array('facility_state' => 'Destination State'));
     # Validation
     $this->validatorSchema['lodging_name'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['lodging_phone'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['facility_name'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['facility_phone'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['facility_phone_comment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['requester_id'] = new sfValidatorInteger(array('required' => false));
     $this->validatorSchema['emergency_contact_name'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['emergency_contact_primary_phone'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['emergency_contact_primary_comment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['emergency_contact_secondary_phone'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['emergency_contact_secondary_comment'] = new sfValidatorString(array('required' => false));
     # Descriptive message
     #help
     $this->widgetSchema->setHelp('weight', 'lbs.');
     $this->widgetSchema->setNameFormat('pass3[%s]');
     $this->disableCSRFProtection();
 }
예제 #9
0
 public function executeUpdate(sfWebRequest $request)
 {
     if (!$this->getUser()->hasCredential(array('Administrator'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     $this->forward404Unless($request->isMethod('post') || $request->isMethod('put'));
     $this->forward404Unless($wing_job = WingJobPeer::retrieveByPk($request->getParameter('id')), sprintf('Object wing_job does not exist (%s).', $request->getParameter('id')));
     $this->form = new WingJobForm($wing_job);
     $this->processForm($request, $this->form, 'update');
     $this->wing_role_id = $request->getParameter("id");
     if ($request->getParameter('person_id')) {
         $this->person = PersonPeer::retrieveByPK($request->getParameter('person_id'));
     }
 }
 public function configure()
 {
     $this->setWidget('student_id', new sfWidgetFormInputHidden());
     $this->setWidget('school_year_id', new sfWidgetFormInputHidden());
     unset($this['resolution_date']);
     $this->setWidget('request_date', new csWidgetFormDateInput());
     $this->setValidator('request_date', new mtValidatorDateString());
     $this->getWidgetSchema()->setLabel('request_date', 'Day');
     $this->getWidgetSchema()->setHelp('value', 'This field represents the value of the disciplinary sanction');
     $this->setValidator('value', new sfValidatorNumber(array('required' => true)));
     $this->getWidget('disciplinary_sanction_type_id')->setOption('add_empty', true);
     $this->getWidget('sanction_type_id')->setOption('add_empty', true);
     $applicants_criteria = new Criteria();
     PersonPeer::doSelectOrderedCriteria($applicants_criteria);
     $results = array();
     foreach (PersonalPeer::doSelect(new Criteria()) as $personal) {
         $results[$personal->getPersonId()] = $personal->getPersonId();
     }
     foreach (TeacherPeer::doSelect(new Criteria()) as $teacher) {
         $results[$teacher->getPersonId()] = $teacher->getPersonId();
     }
     $applicants_criteria->add(PersonPeer::ID, $results, Criteria::IN);
     $this->getWidget('applicant_id')->setOption('criteria', $applicants_criteria);
     $preceptors_criteria = new Criteria();
     PersonPeer::doSelectOrderedCriteria($preceptors_criteria);
     $preceptors_criteria->addJoin(PersonPeer::ID, PersonalPeer::PERSON_ID);
     $this->getWidget('responsible_id')->setOption('criteria', $preceptors_criteria);
     $this->setWidget('document', new sfWidgetFormInputFile());
     $this->setValidator('document', new sfValidatorFile(array('path' => StudentDisciplinarySanction::getDocumentDirectory(), 'max_size' => '2097152', 'required' => false)));
     $this->getWidgetSchema()->setHelp('document', 'The file must be of the following types: jpeg, jpg, gif, png, pdf.');
     $this->getValidator('document')->setOption('mime_categories', array('web_images' => array('image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png', 'image/gif'), 'documents' => array('application/pdf')));
     $this->getWidgetSchema()->moveField('observation', sfWidgetFormSchema::LAST);
     $this->getWidgetSchema()->moveField('document', sfWidgetFormSchema::AFTER, 'responsible_id');
     if ($this->getObject()->getDocument()) {
         $this->setWidget('current_document', new mtWidgetFormPartial(array('module' => 'student_disciplinary_sanction', 'partial' => 'downloable_document', 'form' => $this)));
         $this->setValidator('current_document', new sfValidatorPass(array('required' => false)));
         $this->setWidget('delete_document', new sfWidgetFormInputCheckbox());
         $this->setValidator('delete_document', new sfValidatorBoolean(array('required' => false)));
         $this->getWidgetSchema()->moveField('delete_document', sfWidgetFormSchema::BEFORE, 'document');
         $this->getWidgetSchema()->moveField('current_document', sfWidgetFormSchema::BEFORE, 'delete_document');
     }
 }
예제 #11
0
 private function getPersonPhoto(sfWebRequest $request, $attachment = false)
 {
     $person = PersonPeer::retrieveByPK($request->getParameter('id'));
     if ($person && $person->getPhoto()) {
         $filePath = $person->getPhotoFullPath();
         $response = $this->getResponse();
         $response->setHttpHeader('Pragma', '');
         $response->setHttpHeader('Cache-Control', '');
         $data = file_get_contents($filePath);
         $file_exploded = explode('.', $person->getPhoto());
         $file_extension = end($file_exploded);
         if ($file_extension == 'jpg') {
             $content_type = 'jpeg';
         } else {
             $content_type = $file_extension;
         }
         $response->setHttpHeader('Content-Type', 'image/' . $content_type);
         if ($attachment) {
             $response->setHttpHeader('Content-Disposition', "attachment; filename=\"" . $person->getPhoto() . "\"");
         }
         $response->setContent($data);
     }
 }
예제 #12
0
 public function configure()
 {
     unset($this['id'], $this['date_added'], $this['date_updated']);
     $affiliations = AffiliationPeer::getForSelectParent();
     $companies = CompanyPeer::getForSelectParent();
     $persons = PersonPeer::getForSelectParent();
     # Fields
     $this->widgetSchema['co_donor_id'] = new sfWidgetFormInput(array(), array('class' => 'text narrow'));
     $this->widgetSchema['affiliation_id'] = new sfWidgetFormChoice(array('choices' => $affiliations));
     $this->widgetSchema['block_mailings'] = new sfWidgetFormInputCheckbox(array(), array('value' => 1));
     $this->widgetSchema['prospect_comment'] = new sfWidgetFormTextarea(array(), array('class' => 'text'));
     $this->widgetSchema['salutation'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['company_id'] = new sfWidgetFormChoice(array('choices' => $companies));
     $this->widgetSchema['position'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['donor_potential'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['person_id'] = new sfWidgetFormChoice(array('choices' => $persons));
     $this->widgetSchema->setLabels(array('co_donor_id' => 'Co Donor Id'));
     $this->widgetSchema->setLabels(array('affiliation_id' => 'Affiliation Id'));
     $this->widgetSchema->setLabels(array('block_mailings' => 'Block mailings'));
     $this->widgetSchema->setLabels(array('prospect_comment' => 'Prospect comment'));
     $this->widgetSchema->setLabels(array('salutation' => 'Salutation'));
     $this->widgetSchema->setLabels(array('company_id' => 'Company'));
     $this->widgetSchema->setLabels(array('position' => 'Position'));
     $this->widgetSchema->setLabels(array('donor_potential' => 'Donor potential'));
     $this->widgetSchema->setLabels(array('person_id' => 'Person'));
     $this->validatorSchema['co_donor_id'] = new sfValidatorInteger(array('required' => false), array('invalid' => 'Co donor id must be in number format !'));
     $this->validatorSchema['affiliation_id'] = new sfValidatorInteger(array('required' => false));
     $this->validatorSchema['block_mailings'] = new sfValidatorInteger(array('required' => false));
     $this->validatorSchema['prospect_comment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['salutation'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['company_id'] = new sfValidatorInteger(array('required' => false));
     $this->validatorSchema['position'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['donor_potential'] = new sfValidatorInteger(array('required' => false), array('invalid' => 'Donor porential must be in number format !'));
     $this->validatorSchema['person_id'] = new sfValidatorInteger(array('required' => false));
     $this->widgetSchema->setNameFormat('donor[%s]');
 }
예제 #13
0
 public function executeProcessStep3(sfWebRequest $request)
 {
     slot('nav_menu', array('members', 'pending-renewal'));
     $this->application_temp = ApplicationTempPeer::retrieveByPk($request->getParameter('id'));
     $this->forward404Unless($this->application_temp);
     $this->application_temp->getProcessedDate();
     //Farazi
     //Get Member Class Information
     $this->member = MemberPeer::retrieveByPK($this->application_temp->getMemberId());
     $this->memberclass = MemberClassPeer::retrieveByPK($this->member->getMemberClassId());
     //echo "<pre>";
     //print_r($this->memberclass);
     $this->person = PersonPeer::retrieveByPK($this->application_temp->getPersonId());
     if ($request->isMethod('post')) {
         $this->processStep3Check($request);
     }
     $this->form1 = new ApplicationTempProcessStep1Form($this->application_temp);
     $this->form2 = new ApplicationTempProcessStep2Form($this->application_temp);
     $this->setTemplate('processSteps');
 }
예제 #14
0
         <?php 
 //endif
 ?>
       </dd>
       <dt>Requester:</dt>
       <dd>
         <a href="#">
           <?php 
 if ($itinerary->getRequesterId()) {
     ?>
             <?php 
     $requester = RequesterPeer::retrieveByPK($itinerary->getRequesterId());
     ?>
             <?php 
     if (isset($requester)) {
         $rperson = PersonPeer::retrieveByPK($requester->getPersonId());
     }
     ?>
             <?php 
     if (isset($rperson)) {
         ?>
                 <?php 
         echo $rperson->getTitle() . ' . ' . $rperson->getFirstName() . ' ' . $rperson->getLastName();
         ?>
             <?php 
     }
     ?>
           <?php 
 }
 ?>
         </a>
예제 #15
0
 public static function doSelectActivePreceptor(Criteria $criteria = null)
 {
     $criteria = is_null($criteria) ? new Criteria() : $criteria;
     $criteria->add(PersonalPeer::PERSONAL_TYPE, PersonalType::PRECEPTOR);
     PersonPeer::doSelectOrderedCriteria($criteria);
     $criteria->add(PersonPeer::IS_ACTIVE, true);
     $criteria->addJoin(PersonPeer::ID, self::PERSON_ID);
     $sf_user = sfContext::getInstance()->getUser();
     if ($sf_user->isHeadPreceptor()) {
         $personal_in = $sf_user->getPersonalIds();
         $criteria->add(self::ID, $personal_in, Criteria::IN);
     }
     return self::doSelect($criteria);
 }
예제 #16
0
 public function executeToggle(sfWebRequest $request)
 {
     $person = PersonPeer::retrieveByPK($this->getUser()->getId());
     $html = '';
     switch ($request->getParameter('name')) {
         case 'email_blocked':
             $person->setEmailBlocked($person->getEmailBlocked() == 1 ? 0 : 1);
             if ($person->getEmailBlocked() == 1) {
                 $html = 'Yesun-block email';
             } else {
                 $html = 'No block email';
             }
             break;
         case 'email_text_only':
             $person->setEmailTextOnly($person->getEmailTextOnly() == 1 ? 0 : 1);
             if ($person->getEmailTextOnly() == 1) {
                 $html = 'Yesset to any';
             } else {
                 $html = 'No set to text only';
             }
             break;
         case 'email':
             $validator = new sfValidatorEmail(array('required' => true), array('invalid' => 'Email address is invalid: %value%', 'required' => 'Email address is required'));
             try {
                 $email = $validator->clean($request->getParameter('email'));
                 $person->setEmail($email);
                 $html = $email;
             } catch (sfValidatorError $e) {
                 $html = '#' . $e->__toString();
             }
             break;
         case 'email_list':
             $email_list_person = new EmailListPerson();
             $email_list_person->setPersonId($person->getId());
             $email_list_person->setListId($request->getParameter('id'));
             $result = EmailListPersonPeer::doSelectOne($email_list_person->buildCriteria());
             if ($result instanceof EmailListPerson) {
                 $result->delete();
             } else {
                 $email_list_person->save();
             }
             if ($email_list_person->isNew()) {
                 $html = 'subscribe';
             } else {
                 $html = 'un-subscribe';
             }
             break;
     }
     $person->save();
     return $this->renderText($html);
 }
예제 #17
0
 /**
  * Populates the object using an array.
  *
  * This is particularly useful when populating an object from one of the
  * request arrays (e.g. $_POST).  This method goes through the column
  * names, checking to see whether a matching key exists in populated
  * array. If so the setByName() method is called for that column.
  *
  * You can specify the key type of the array by additionally passing one
  * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  * The default key type is the column's phpname (e.g. 'AuthorId')
  *
  * @param      array  $arr     An array to populate the object from.
  * @param      string $keyType The type of keys the array uses.
  * @return     void
  */
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = PersonPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setTitle($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setFirstName($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setLastName($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setAddress1($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setAddress2($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setCity($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setCounty($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setState($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setCountry($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setZipcode($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setDayPhone($arr[$keys[11]]);
     }
     if (array_key_exists($keys[12], $arr)) {
         $this->setDayComment($arr[$keys[12]]);
     }
     if (array_key_exists($keys[13], $arr)) {
         $this->setEveningPhone($arr[$keys[13]]);
     }
     if (array_key_exists($keys[14], $arr)) {
         $this->setEveningComment($arr[$keys[14]]);
     }
     if (array_key_exists($keys[15], $arr)) {
         $this->setMobilePhone($arr[$keys[15]]);
     }
     if (array_key_exists($keys[16], $arr)) {
         $this->setMobileComment($arr[$keys[16]]);
     }
     if (array_key_exists($keys[17], $arr)) {
         $this->setPagerPhone($arr[$keys[17]]);
     }
     if (array_key_exists($keys[18], $arr)) {
         $this->setPagerComment($arr[$keys[18]]);
     }
     if (array_key_exists($keys[19], $arr)) {
         $this->setOtherPhone($arr[$keys[19]]);
     }
     if (array_key_exists($keys[20], $arr)) {
         $this->setOtherComment($arr[$keys[20]]);
     }
     if (array_key_exists($keys[21], $arr)) {
         $this->setFaxPhone1($arr[$keys[21]]);
     }
     if (array_key_exists($keys[22], $arr)) {
         $this->setFaxComment1($arr[$keys[22]]);
     }
     if (array_key_exists($keys[23], $arr)) {
         $this->setAutoFax($arr[$keys[23]]);
     }
     if (array_key_exists($keys[24], $arr)) {
         $this->setFaxPhone2($arr[$keys[24]]);
     }
     if (array_key_exists($keys[25], $arr)) {
         $this->setFaxComment2($arr[$keys[25]]);
     }
     if (array_key_exists($keys[26], $arr)) {
         $this->setEmail($arr[$keys[26]]);
     }
     if (array_key_exists($keys[27], $arr)) {
         $this->setEmailTextOnly($arr[$keys[27]]);
     }
     if (array_key_exists($keys[28], $arr)) {
         $this->setEmailBlocked($arr[$keys[28]]);
     }
     if (array_key_exists($keys[29], $arr)) {
         $this->setUsername($arr[$keys[29]]);
     }
     if (array_key_exists($keys[30], $arr)) {
         $this->setPassword($arr[$keys[30]]);
     }
     if (array_key_exists($keys[31], $arr)) {
         $this->setComment($arr[$keys[31]]);
     }
     if (array_key_exists($keys[32], $arr)) {
         $this->setWfPolicyAgreed($arr[$keys[32]]);
     }
     if (array_key_exists($keys[33], $arr)) {
         $this->setWfPolicyAgreedDate($arr[$keys[33]]);
     }
     if (array_key_exists($keys[34], $arr)) {
         $this->setPagerEmail($arr[$keys[34]]);
     }
     if (array_key_exists($keys[35], $arr)) {
         $this->setBlockMailings($arr[$keys[35]]);
     }
     if (array_key_exists($keys[36], $arr)) {
         $this->setNewsletter($arr[$keys[36]]);
     }
     if (array_key_exists($keys[37], $arr)) {
         $this->setGender($arr[$keys[37]]);
     }
     if (array_key_exists($keys[38], $arr)) {
         $this->setDeceased($arr[$keys[38]]);
     }
     if (array_key_exists($keys[39], $arr)) {
         $this->setDeceasedComment($arr[$keys[39]]);
     }
     if (array_key_exists($keys[40], $arr)) {
         $this->setSecondaryEmail($arr[$keys[40]]);
     }
     if (array_key_exists($keys[41], $arr)) {
         $this->setDeceasedDate($arr[$keys[41]]);
     }
     if (array_key_exists($keys[42], $arr)) {
         $this->setMiddleName($arr[$keys[42]]);
     }
     if (array_key_exists($keys[43], $arr)) {
         $this->setSuffix($arr[$keys[43]]);
     }
     if (array_key_exists($keys[44], $arr)) {
         $this->setNickname($arr[$keys[44]]);
     }
     if (array_key_exists($keys[45], $arr)) {
         $this->setVeteran($arr[$keys[45]]);
     }
     if (array_key_exists($keys[46], $arr)) {
         $this->setCreatedAt($arr[$keys[46]]);
     }
 }
예제 #18
0
 /**
  * Selects a collection of Member objects pre-filled with all related objects except MemberRelatedByMasterMemberId.
  *
  * @param      Criteria  $c
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return     array Array of Member objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptMemberRelatedByMasterMemberId(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $c = clone $c;
     // Set the correct dbName if it has not been overridden
     // $c->getDbName() will return the same object if not set to another value
     // so == check is okay and faster
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     MemberPeer::addSelectColumns($c);
     $startcol2 = MemberPeer::NUM_COLUMNS - MemberPeer::NUM_LAZY_LOAD_COLUMNS;
     PersonPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (PersonPeer::NUM_COLUMNS - PersonPeer::NUM_LAZY_LOAD_COLUMNS);
     WingPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + (WingPeer::NUM_COLUMNS - WingPeer::NUM_LAZY_LOAD_COLUMNS);
     MemberClassPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + (MemberClassPeer::NUM_COLUMNS - MemberClassPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(MemberPeer::PERSON_ID), array(PersonPeer::ID), $join_behavior);
     $c->addJoin(array(MemberPeer::WING_ID), array(WingPeer::ID), $join_behavior);
     $c->addJoin(array(MemberPeer::MEMBER_CLASS_ID), array(MemberClassPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = MemberPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = MemberPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://propel.phpdb.org/trac/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $omClass = MemberPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             MemberPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined Person rows
         $key2 = PersonPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = PersonPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = PersonPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 PersonPeer::addInstanceToPool($obj2, $key2);
             }
             // if $obj2 already loaded
             // Add the $obj1 (Member) to the collection in $obj2 (Person)
             $obj2->addMember($obj1);
         }
         // if joined row is not null
         // Add objects for joined Wing rows
         $key3 = WingPeer::getPrimaryKeyHashFromRow($row, $startcol3);
         if ($key3 !== null) {
             $obj3 = WingPeer::getInstanceFromPool($key3);
             if (!$obj3) {
                 $omClass = WingPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj3 = new $cls();
                 $obj3->hydrate($row, $startcol3);
                 WingPeer::addInstanceToPool($obj3, $key3);
             }
             // if $obj3 already loaded
             // Add the $obj1 (Member) to the collection in $obj3 (Wing)
             $obj3->addMember($obj1);
         }
         // if joined row is not null
         // Add objects for joined MemberClass rows
         $key4 = MemberClassPeer::getPrimaryKeyHashFromRow($row, $startcol4);
         if ($key4 !== null) {
             $obj4 = MemberClassPeer::getInstanceFromPool($key4);
             if (!$obj4) {
                 $omClass = MemberClassPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj4 = new $cls();
                 $obj4->hydrate($row, $startcol4);
                 MemberClassPeer::addInstanceToPool($obj4, $key4);
             }
             // if $obj4 already loaded
             // Add the $obj1 (Member) to the collection in $obj4 (MemberClass)
             $obj4->addMember($obj1);
         }
         // if joined row is not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
예제 #19
0
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Kimkëlen.  If not, see <http://www.gnu.org/licenses/gpl-2.0.html>.
 */
?>
<div class="sf_admin_form_row sf_admin_text">
  <div>
    <?php 
$groups = $sf_guard_user->getsfGuardUserGroups();
?>
    <?php 
if (count($groups) > 0) {
    ?>
      <?php 
    if ($person = PersonPeer::retrieveBySfGuardUser($sf_guard_user)) {
        ?>
        <?php 
        echo 'Persona ' . $person;
        ?>
      <?php 
    }
    ?>
      <table border="1">
        <?php 
    foreach ($groups as $group) {
        ?>
          <?php 
        $group = sfGuardGroupPeer::retrieveByPk($group->getGroupId());
        ?>
          <tr><td><strong><?php 
예제 #20
0
 /**
  * Get the associated Person object
  *
  * @param      PropelPDO Optional Connection object.
  * @return     Person The associated Person object.
  * @throws     PropelException
  */
 public function getPerson(PropelPDO $con = null)
 {
     if ($this->aPerson === null && $this->person_id !== null) {
         $c = new Criteria(PersonPeer::DATABASE_NAME);
         $c->add(PersonPeer::ID, $this->person_id);
         $this->aPerson = PersonPeer::doSelectOne($c, $con);
         /* The following can be used additionally to
         		   guarantee the related object contains a reference
         		   to this object.  This level of coupling may, however, be
         		   undesirable since it could result in an only partially populated collection
         		   in the referenced object.
         		   $this->aPerson->addWingLeaders($this);
         		 */
     }
     return $this->aPerson;
 }
if ($mission_leg->getPilotId()) {
    $pilot = PilotPeer::retrieveByPK($mission_leg->getPilotId());
    $pilotMember = $pilot->getMember();
    $pilot_person = PersonPeer::retrieveByPK($pilotMember->getPersonId());
    $pilot_aircrafts = PilotAircraftPeer::getByMemberId($pilot->getMemberId());
}
// Mission Assistant
if ($mission_leg->getMissAssisId()) {
    $mission_assistant = MemberPeer::retrieveByPK($mission_leg->getMissAssisId());
    $miss_assi_persopn = PersonPeer::retrieveByPK($mission_assistant->getPersonId());
}
// Backup Pilot
if ($mission_leg->getBackupPilotId()) {
    $backupPilot = PilotPeer::retrieveByPK($mission_leg->getBackupPilotId());
    $backupPilotMember = $pilot->getMember();
    $backupPilot_person = PersonPeer::retrieveByPK($backupPilotMember->getPersonId());
}
/*
echo "<pre>";
print_r($pilotMember);
die();
//*/
//Companions information
$companions = CompanionPeer::getByPassId($passenger->getId());
if ($passenger) {
    $passenger_type = $passenger->getPassengerType();
}
$is_air = $mission_leg->getTransportation() == 'air_mission';
if ($is_air) {
    $to_airport = $mission_leg->getAirportRelatedByToAirportId();
    $from_airport = $mission_leg->getAirportRelatedByFromAirportId();
예제 #22
0
 public function addIsActiveColumnCriteria(Criteria $criteria, $field, $value)
 {
     if ($value != '') {
         $c = new Criteria();
         $c->addJoin(TeacherPeer::PERSON_ID, PersonPeer::ID);
         $c->add(PersonPeer::IS_ACTIVE, 1);
         $c->clearSelectColumns();
         $c->addSelectColumn(PersonPeer::ID);
         $stmt = PersonPeer::doSelectStmt($c);
         $ids = $stmt->fetchAll(PDO::FETCH_COLUMN);
         if ($value == '1') {
             $criteria->add(TeacherPeer::PERSON_ID, $ids, Criteria::IN);
         } else {
             $criteria->add(TeacherPeer::PERSON_ID, $ids, Criteria::NOT_IN);
         }
     }
 }
예제 #23
0
 public function executeAutoCompleteLastNon()
 {
     $this->keyword = $this->getRequestParameter('lastname');
     $this->persons = PersonPeer::getLastNames($this->keyword, "NoPassenger");
     //$this->setTemplate('AutoCompleteFirst');
 }
예제 #24
0
 /**
  * Sends new password to the requester
  * Can retrieve via Username or MemberId
  * @param sfWebRequest $request
  */
 public function executeSendPassword(sfWebRequest $request)
 {
     if ($request->isMethod('post')) {
         $request->checkCSRFProtection();
         $username = $request->getParameter('username');
         $member_id = $request->getParameter('member_id');
         if (strlen($username) > 0 || strlen($member_id) > 0) {
             $person = null;
             if ($member_id) {
                 $member = MemberPeer::retrieveByPK($member_id);
                 if ($member instanceof Member) {
                     $person = $member->getPerson();
                 }
             } elseif ($username) {
                 $person = PersonPeer::getByUsername($username);
             }
             if ($person instanceof Person) {
                 # create token for password request
                 $pr = new PasswordRequest();
                 $pr->setPerson($person);
                 $pr->setEmail($person->getEmail());
                 $pr->save();
                 if ($person->getEmail()) {
                     # send email via component
                     $this->getComponent('mail', 'sendPassword', array('person' => $person, 'token' => $pr->getToken()));
                     $this->getUser()->setFlash('success', 'Your password request has been successfully sent to your email!');
                 } else {
                     $this->getUser()->setFlash('success', 'This user doesn\'t have proper email address!');
                 }
                 # redirect to login
                 $this->redirect('secure/login');
             }
             $this->error_msg = 'Sorry! We haven\'t found any matching record!';
         } else {
             $this->error_msg = 'Please type your username OR member id!';
         }
     }
     $this->executeForgotPassword($request);
     $this->setTemplate('forgotPassword');
 }
예제 #25
0
 <?php 
 }
 ?>
 </td>
 <td class="cell-2">
 <?php 
 if ($miss->getPassengerId()) {
     ?>
 <?php 
     $passenger = PassengerPeer::retrieveByPK($miss->getPassengerId());
     ?>
 <?php 
     if ($passenger) {
         ?>
    <?php 
         $person = PersonPeer::retrieveByPK($passenger->getPersonId());
         if ($person) {
             echo ($person->getTitle() ? $person->getTitle() . ' . ' : "") . $person->getFirstName() . ' ' . $person->getLastName();
         }
         ?>
 <?php 
     }
     ?>
 <?php 
 }
 ?>
 </td>
 <td class="cell-1">
 <!--/ CHECK SECURITY-->
 <ul class="action-list">
   <li><?php 
예제 #26
0
    <td>Flight Status</td>
    <td>Action</td>
  </tr>
</thead>
<tbody>
  <?php 
    foreach ($members as $member) {
        ?>
  <?php 
        $person_id = $member->getPersonId();
        ?>
  <?php 
        if ($person_id) {
            ?>
      <?php 
            $person = PersonPeer::retrieveByPK($person_id);
            ?>
  <?php 
        }
        ?>
  
  <?php 
        $wing_id = $member->getWingId();
        ?>
  <?php 
        if ($wing_id) {
            ?>
      <?php 
            $wing = WingPeer::retrieveByPK($wing_id);
            ?>
  <?php 
예제 #27
0
 /**
  * Selects a collection of PasswordRequest objects pre-filled with all related objects.
  *
  * @param      Criteria  $c
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return     array Array of PasswordRequest objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAll(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     foreach (sfMixer::getCallables('BasePasswordRequestPeer:doSelectJoinAll:doSelectJoinAll') as $callable) {
         call_user_func($callable, 'BasePasswordRequestPeer', $c, $con);
     }
     $c = clone $c;
     // Set the correct dbName if it has not been overridden
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     PasswordRequestPeer::addSelectColumns($c);
     $startcol2 = PasswordRequestPeer::NUM_COLUMNS - PasswordRequestPeer::NUM_LAZY_LOAD_COLUMNS;
     PersonPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (PersonPeer::NUM_COLUMNS - PersonPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(PasswordRequestPeer::PERSON_ID), array(PersonPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = PasswordRequestPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = PasswordRequestPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://propel.phpdb.org/trac/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $omClass = PasswordRequestPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             PasswordRequestPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined Person rows
         $key2 = PersonPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = PersonPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = PersonPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 PersonPeer::addInstanceToPool($obj2, $key2);
             }
             // if obj2 loaded
             // Add the $obj1 (PasswordRequest) to the collection in $obj2 (Person)
             $obj2->addPasswordRequest($obj1);
         }
         // if joined row not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
예제 #28
0
 /**
  * Populates the object using an array.
  *
  * This is particularly useful when populating an object from one of the
  * request arrays (e.g. $_POST).  This method goes through the column
  * names, checking to see whether a matching key exists in populated
  * array. If so the setByName() method is called for that column.
  *
  * You can specify the key type of the array by additionally passing one
  * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  * The default key type is the column's phpname (e.g. 'AuthorId')
  *
  * @param      array  $arr     An array to populate the object from.
  * @param      string $keyType The type of keys the array uses.
  * @return     void
  */
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = PersonPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setName($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setRole($arr[$keys[2]]);
     }
 }
예제 #29
0
 if ($leg->getPilotId()) {
     ?>
   <?php 
     $pilot = PilotPeer::retrieveByPK($leg->getPilotId());
     ?>
   <?php 
     if (isset($pilot)) {
         ?>
       <?php 
         $member = MemberPeer::retrieveByPK($pilot->getMemberId());
         ?>
       <?php 
         if (isset($member)) {
             ?>
           <?php 
             $person = PersonPeer::retrieveByPK($member->getPersonId());
             ?>
           <?php 
             if (isset($person)) {
                 ?>
                <?php 
                 echo $person->getTitle() . $person->getFirstName() . ' ' . $person->getLastName() . '<br/>';
                 ?>
                <?php 
                 if ($person->getEmail()) {
                     echo mail_to($person->getEmail());
                 }
                 ?>
           <?php 
             }
             ?>
예제 #30
0
            ?>
"><a class="btn-close"
	href="javascript:close1(<?php 
            echo $leg->getId();
            ?>
)">Close</a>
<div class="wrap"><?php 
            if (isset($leg_discussions)) {
                foreach ($leg_discussions as $dis) {
                    ?>
<div class="box">
<ul>
	<li>
	<h4><?php 
                    if ($dis->getUserId()) {
                        $person = PersonPeer::retrieveByPK($dis->getUserId());
                        if (isset($person)) {
                            echo $person->getTitle() . ', ' . $person->getLastName() . ' ' . $person->getFirstName();
                        }
                    }
                    ?>
</h4>
	<?php 
                    if ($dis->getIsSplit()) {
                        ?>
		<input type="checkbox" checked="checked" disabled="disabled" />
		<label style="display:inline" for="split_mission">It is a split mission</label>
	<?php 
                    }
                    ?>
	<p><?php