<div class="leglabel">Email: </div> <div class="leg_filed"> <?php if ($itinerary->getAgencyId()) { echo $agency->getEmail(); } ?> </div> </div> <?php if ($itinerary->getId()) { $mission = MissionPeer::getAllMissionByItineraryId($itinerary->getId()); } foreach ($mission as $mission_list) { if ($mission_list->getCoordinatorId()) { $coordinator = CoordinatorPeer::retrieveByPK($mission_list->getCoordinatorId()); } if ($coordinator) { ?> <div class="legemail_box"> <div class="heading">Coordinator for Mission <?php $mission_list->getId(); ?> : <?php if ($coordinator->getMember()) { echo $coordinator->getMember()->getPerson()->getFirstName(); } ?> <?php if ($coordinator->getMember()) { echo $coordinator->getMember()->getPerson()->getLastName();
$totabaggage += $mleg->getBaggageWeight(); if ($mleg->getPilotId()) { $pilot_info = PilotPeer::retrieveByPK($mleg->getPilotId()); $pilot_person = $pilot_info->getMember()->getPerson(); $pilot_aircrafts = PilotAircraftPeer::getByMemberId($pilot_info->getMember()->getId()); } if ($mleg->getMissAssisId()) { $memberMiss = MemberPeer::retrieveByPK($mleg->getMissAssisId()); $miss_assi_persopn = $memberMiss->getPerson(); } if ($mleg->getBackupPilotId()) { $backup_pilot_info = PilotPeer::retrieveByPK($mleg->getPilotId()); $backupPilot_person = $backup_pilot_info->getMember()->getPerson(); } if ($mleg->getCoordinatorId()) { $coordinator = CoordinatorPeer::retrieveByPK($mleg->getCoordinatorId()); if ($coordinator->getMemberId()) { $coordiPerson = $coordinator->getMember()->getPerson(); } } if ($mleg->getMissAssisId()) { $memberMiss = MemberPeer::retrieveByPK($mleg->getMissAssisId()); $miss_assi_persopn = $memberMiss->getPerson(); } if ($mleg->getMissAssisId()) { $memberMiss = MemberPeer::retrieveByPK($mleg->getMissAssisId()); $miss_assi_persopn = $memberMiss->getPerson(); } if ($mleg->getFboId()) { $fbo = FboPeer::retrieveByPK($mleg->getFboId()); if ($fbo->getAirportId()) {
?> <br/> <?php } ?> </div> <div class="holder"> <h4>Lead Coordinator</h4> <?php $is_lead = CoordinatorPeer::retrieveByPK($coor->getId()); ?> <?php if ($is_lead) { ?> <?php $leader = CoordinatorPeer::retrieveByPK($coor->getId()); ?> <?php if (isset($leader)) { } ?> <?php $member = MemberPeer::retrieveByPK($leader->getMemberId()); ?> <?php $p = $member->getPerson(); ?> <?php if (isset($member)) { $person = $member->getPerson(); ?>
public static function getEmailAddressesOfPersonsRelatedToMission(Mission $mission) { $receivers = array(); // Get Passenger email address $passenger = PassengerPeer::retrieveByPK($mission->getPassengerId()); if ($passenger) { $passenger = $passenger->getPerson()->getEmail(); if (!empty($passenger)) { // $receivers['passenger_'.$mission->getId()] = $passenger; if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $passenger)) { $receivers[] = $passenger; } } } unset($passenger); // Get Requester email address $requestr = RequesterPeer::retrieveByPK($mission->getRequesterId()); if ($requestr) { $requestr = $requestr->getPerson()->getEmail(); if (!empty($requestr)) { // $receivers['requestr_'.$mission->getId()] = $requestr; if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $requestr)) { $receivers[] = $requestr; } } } unset($requestr); // Get Coordinator email address $coordinator = CoordinatorPeer::retrieveByPK($mission->getCoordinatorId()); if ($coordinator && ($coordinator = $coordinator->getMember())) { $coordinator = $coordinator->getPerson()->getEmail(); if (!empty($coordinator)) { // $receivers['coordinator_'.$mission->getId()] = $coordinator; if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $coordinator)) { $receivers[] = $coordinator; } } } unset($coordinator); // Get Other Requester email address $other_requestr = RequesterPeer::retrieveByPK($mission->getOtherRequesterId()); if ($other_requestr) { $other_requestr = $other_requestr->getPerson()->getEmail(); if (!empty($other_requestr)) { // $receivers['other_requestr_'.$mission->getId()] = $other_requestr; if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $other_requestr)) { $receivers[] = $other_requestr; } } } unset($other_requestr); // Get Other Agency email address $other_agency = AgencyPeer::retrieveByPK($mission->getOtherAgencyId()); if ($other_agency) { $other_agency = $other_agency->getEmail(); if (!empty($other_requestr)) { // $receivers['other_agency_'.$mission->getId()] = $other_agency; if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $other_agency)) { $receivers[] = $other_agency; } } } unset($other_agency); // Get Agency email address $agency = AgencyPeer::retrieveByPK($mission->getAgencyId()); if ($agency) { $agency = $agency->getEmail(); if (!empty($agency)) { // $receivers['agency_'.$mission->getId()] = $agency; if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $agency)) { $receivers[] = $agency; } } } unset($agency); return $receivers; }
public function executePrintMissionLeg(sfWebRequest $request) { #Security if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Coordinator'), false)) { $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer()); $this->redirect('dashboard/index'); } if ($request->getParameter('id')) { $this->leg = MissionLegPeer::retrieveByPK($request->getParameter('id')); if (isset($this->leg)) { $this->mission = MissionPeer::retrieveByPK($this->leg->getMissionId()); $this->requester = RequesterPeer::retrieveByPK($this->mission->getRequesterId()); $this->req_person = $this->requester->getPerson(); $this->agency = $this->requester->getAgency(); // Camp information if ($this->mission->getCampId()) { $this->camp = CampPeer::retrieveByPK($this->mission->getCampId()); } //Coordinator if ($this->mission->getCoordinatorId()) { $this->coordinator = CoordinatorPeer::retrieveByPK($this->mission->getCoordinatorId()); $this->coordiPerson = PersonPeer::retrieveByPK($this->coordinator->getMember()->getPersonId()); } if (isset($this->mission)) { $this->itinerary = ItineraryPeer::retrieveByPK($this->mission->getItineraryId()); $pass = PassengerPeer::retrieveByPK($this->mission->getPassengerId()); //Companions information $this->companions = CompanionPeer::getByPassId($this->mission->getPassengerId()); if (isset($pass) && $pass instanceof Passenger) { $this->pass = $pass; //print_r($this->pass); //die(); $this->person = PersonPeer::retrieveByPK($pass->getPersonId()); $this->itinerary = $this->mission->getItinerary(); // Pre-define addresses for ground missions $this->ground_addresses = array('patient' => '', 'facility' => '', 'lodging' => '', 'airport' => ''); $this->ground_addr_sel = sfConfig::get('app_ground_address_type', array()); if ($this->itinerary) { //$this->ground_addresses['lodging'] = $this->ground_addresses['facility'] = $this->itinerary->getDestCity().', '.$this->itinerary->getDestState(); } } else { unset($this->passenger); } } } if (isset($this->leg) && $this->leg instanceof MissionLeg) { if ($this->leg->getPilotId()) { $this->pilot = PilotPeer::retrieveByPK($this->leg->getPilotId()); $this->pilot_member = MemberPeer::retrieveByPK($this->pilot->getMemberId()); $this->copilot = PilotPeer::retrieveByPK($this->leg->getCoPilotId()); $this->mission_assistant = PilotPeer::getByMemberId($this->leg->getMissAssisId()); $this->back_up_mission_assistant = PilotPeer::retrieveByPK($this->leg->getBackupMissAssisId()); } } if ($this->getUser()->hasAttribute('pilotAddToLegview')) { $this->getUser()->setFlash("success", 'Pilot is added to this mission leg successfully !'); $this->getUser()->getAttributeHolder()->remove('pilotAddToLegview'); } } }
/** * Mission * CODE:mission_create */ public function executeEdit(sfWebRequest $request) { #security if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Coordinator'), false)) { $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer()); $this->redirect('dashboard/index'); } if ($request->getParameter('id')) { $this->mission = MissionPeer::retrieveByPK($request->getParameter('id')); } //ziyed edited $itine = ItineraryPeer::retrieveByPk($this->mission->getItineraryId()); $this->itine = $itine; $this->passenger = PassengerPeer::retrieveByPK($this->mission->getPassengerId()); $this->passenger_a = $this->passenger && $this->passenger->getPerson() ? $this->passenger->getPerson()->getName() : ''; $this->requester = RequesterPeer::retrieveByPK($this->mission->getRequesterId()); $this->requester_a = $this->requester && $this->requester->getPerson() ? $this->requester->getPerson()->getName() : ''; $this->agency = AgencyPeer::retrieveByPK($this->mission->getAgencyId()); $this->agencyName = $this->agency ? $this->agency->getName() : ''; $this->camp = CampPeer::retrieveByPK($this->mission->getCampId()); $this->campName = $this->camp ? $this->camp->getCampName() : ''; //end of ziyed $this->form = new MissionForm($this->mission); $this->referer = $request->getReferer(); if ($request->isMethod('post')) { $this->form->bind($request->getParameter('mission_edit')); $this->referer = $request->getReferer(); /*$errors = $this->form->getErrorSchema()->getErrors(); if (count($errors) > 0) echo 'List of Errors:' . '<br>'; { foreach ($errors as $name => $error) { echo $name . ': ' . $error . '<BR>'; } }*/ if ($this->form->isValid()) { $this->mission->setMissionTypeId($this->form->getValue('mission_type_id')); $this->mission->setMissionDate($this->form->getValue('mission_date')); $this->mission->setDateRequested($this->form->getValue('date_requested')); $pass = PassengerPeer::retrieveByPK($this->form->getValue('passenger_id')); if (isset($pass)) { $this->mission->setPassengerId($pass->getId()); } $req = RequesterPeer::retrieveByPK($this->form->getValue('requester_id')); if ($req) { $this->mission->setRequesterId($req->getId()); } if ($this->form->getValue('agency_id') == 0) { $this->mission->setAgencyId(null); } else { $this->mission->setAgencyId($this->form->getValue('agency_id')); } if ($this->form->getValue('camp_id') == 0) { $this->mission->setCampId(null); } else { $this->mission->setCampId($this->form->getValue('camp_id')); } $coor = CoordinatorPeer::retrieveByPK($this->form->getValue('coordinator_id')); if (isset($coor)) { $this->mission->setCoordinatorId($coor->getId()); } $itId = ItineraryPeer::retrieveByPK($this->mission->getItineraryId()); $mLeg = MissionLegPeer::getAllMissionLegByMissionId($request->getParameter('id')); $countLeg = MissionLegPeer::getMissionLegByMissionIdCount($request->getParameter('id')); $this->mission->setApptDate($this->form->getValue('appt_date')); $this->mission->setFlightTime($this->form->getValue('flight_time')); $this->mission->setTreatment($this->form->getValue('treatment')); $this->mission->setComment($this->form->getValue('comment')); $this->mission->setAppointment($this->form->getValue('appointment')); $this->mission->setMissionSpecificComments($this->form->getValue('mission_specific_comments')); if ($this->form->getValue('cancel_mission') == 0) { if (isset($countLeg)) { foreach ($mLeg as $ml) { $ml->setCancelMissionLeg(0); $ml->save(); } } } $this->mission->setCancelMission($this->form->getValue('cancel_mission')); $this->mission->save(); $this->getUser()->setFlash('success', 'Mission has succesfully edited!'); $this->redirect('@mission_view?id=' . $this->mission->getId()); } } }
/** * Unlink Lead Coordinator. * CODE: coordinator_create */ public function executeUnlinkLead(sfWebRequest $request) { if (!$this->getUser()->hasCredential(array('Administrator', 'Staff'), false)) { $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer()); $this->redirect('dashboard/index'); } $coor = CoordinatorPeer::retrieveByPK($request->getParameter('id')); $this->forward404Unless($coor); $coor->setLeadId(null); $coor->save(); $this->getUser()->setFlash('success', 'Lead Coordinator information have successfully removed!'); $this->redirect('@coordinator_view?id=' . $coor->getId()); }