echo $member->getFlightStatus();
     }
 }
 ?>
       <em class="type-note">
       <?php 
 if ($req->getMissionAssistantWanted() == 1) {
     echo 'Mission Requester wanted!.';
 }
 ?>
       </em>
     </td>
     <td class="cell-6">
     <?php 
 if (isset($member)) {
     $coordinator = CoordinatorPeer::getByMemberId($member->getId());
     if (isset($coordinator)) {
         echo $coordinator->getInitialContact();
     }
 }
 ?>
     </td>
     <td>
       <div class="status">
       <?php 
 $newtimestamp = strtotime("-1 days", strtotime($req->getDate()));
 ?>
         <strong>
         <?php 
 if (date('m/d/y', $newtimestamp) <= $req->getDate()) {
     echo 'New';
 $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()) {
示例#3
0
 /**
  * Selects a collection of Mission objects pre-filled with all related objects except Camp.
  *
  * @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 Mission objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptCamp(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);
     }
     MissionPeer::addSelectColumns($c);
     $startcol2 = MissionPeer::NUM_COLUMNS - MissionPeer::NUM_LAZY_LOAD_COLUMNS;
     MissionRequestPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (MissionRequestPeer::NUM_COLUMNS - MissionRequestPeer::NUM_LAZY_LOAD_COLUMNS);
     ItineraryPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + (ItineraryPeer::NUM_COLUMNS - ItineraryPeer::NUM_LAZY_LOAD_COLUMNS);
     MissionTypePeer::addSelectColumns($c);
     $startcol5 = $startcol4 + (MissionTypePeer::NUM_COLUMNS - MissionTypePeer::NUM_LAZY_LOAD_COLUMNS);
     PassengerPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + (PassengerPeer::NUM_COLUMNS - PassengerPeer::NUM_LAZY_LOAD_COLUMNS);
     RequesterPeer::addSelectColumns($c);
     $startcol7 = $startcol6 + (RequesterPeer::NUM_COLUMNS - RequesterPeer::NUM_LAZY_LOAD_COLUMNS);
     AgencyPeer::addSelectColumns($c);
     $startcol8 = $startcol7 + (AgencyPeer::NUM_COLUMNS - AgencyPeer::NUM_LAZY_LOAD_COLUMNS);
     RequesterPeer::addSelectColumns($c);
     $startcol9 = $startcol8 + (RequesterPeer::NUM_COLUMNS - RequesterPeer::NUM_LAZY_LOAD_COLUMNS);
     AgencyPeer::addSelectColumns($c);
     $startcol10 = $startcol9 + (AgencyPeer::NUM_COLUMNS - AgencyPeer::NUM_LAZY_LOAD_COLUMNS);
     CoordinatorPeer::addSelectColumns($c);
     $startcol11 = $startcol10 + (CoordinatorPeer::NUM_COLUMNS - CoordinatorPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(MissionPeer::REQUEST_ID), array(MissionRequestPeer::ID), $join_behavior);
     $c->addJoin(array(MissionPeer::ITINERARY_ID), array(ItineraryPeer::ID), $join_behavior);
     $c->addJoin(array(MissionPeer::MISSION_TYPE_ID), array(MissionTypePeer::ID), $join_behavior);
     $c->addJoin(array(MissionPeer::PASSENGER_ID), array(PassengerPeer::ID), $join_behavior);
     $c->addJoin(array(MissionPeer::REQUESTER_ID), array(RequesterPeer::ID), $join_behavior);
     $c->addJoin(array(MissionPeer::AGENCY_ID), array(AgencyPeer::ID), $join_behavior);
     $c->addJoin(array(MissionPeer::OTHER_REQUESTER_ID), array(RequesterPeer::ID), $join_behavior);
     $c->addJoin(array(MissionPeer::OTHER_AGENCY_ID), array(AgencyPeer::ID), $join_behavior);
     $c->addJoin(array(MissionPeer::COORDINATOR_ID), array(CoordinatorPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = MissionPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = MissionPeer::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 = MissionPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             MissionPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined MissionRequest rows
         $key2 = MissionRequestPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = MissionRequestPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = MissionRequestPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 MissionRequestPeer::addInstanceToPool($obj2, $key2);
             }
             // if $obj2 already loaded
             // Add the $obj1 (Mission) to the collection in $obj2 (MissionRequest)
             $obj2->addMission($obj1);
         }
         // if joined row is not null
         // Add objects for joined Itinerary rows
         $key3 = ItineraryPeer::getPrimaryKeyHashFromRow($row, $startcol3);
         if ($key3 !== null) {
             $obj3 = ItineraryPeer::getInstanceFromPool($key3);
             if (!$obj3) {
                 $omClass = ItineraryPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj3 = new $cls();
                 $obj3->hydrate($row, $startcol3);
                 ItineraryPeer::addInstanceToPool($obj3, $key3);
             }
             // if $obj3 already loaded
             // Add the $obj1 (Mission) to the collection in $obj3 (Itinerary)
             $obj3->addMission($obj1);
         }
         // if joined row is not null
         // Add objects for joined MissionType rows
         $key4 = MissionTypePeer::getPrimaryKeyHashFromRow($row, $startcol4);
         if ($key4 !== null) {
             $obj4 = MissionTypePeer::getInstanceFromPool($key4);
             if (!$obj4) {
                 $omClass = MissionTypePeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj4 = new $cls();
                 $obj4->hydrate($row, $startcol4);
                 MissionTypePeer::addInstanceToPool($obj4, $key4);
             }
             // if $obj4 already loaded
             // Add the $obj1 (Mission) to the collection in $obj4 (MissionType)
             $obj4->addMission($obj1);
         }
         // if joined row is not null
         // Add objects for joined Passenger rows
         $key5 = PassengerPeer::getPrimaryKeyHashFromRow($row, $startcol5);
         if ($key5 !== null) {
             $obj5 = PassengerPeer::getInstanceFromPool($key5);
             if (!$obj5) {
                 $omClass = PassengerPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj5 = new $cls();
                 $obj5->hydrate($row, $startcol5);
                 PassengerPeer::addInstanceToPool($obj5, $key5);
             }
             // if $obj5 already loaded
             // Add the $obj1 (Mission) to the collection in $obj5 (Passenger)
             $obj5->addMission($obj1);
         }
         // if joined row is not null
         // Add objects for joined Requester rows
         $key6 = RequesterPeer::getPrimaryKeyHashFromRow($row, $startcol6);
         if ($key6 !== null) {
             $obj6 = RequesterPeer::getInstanceFromPool($key6);
             if (!$obj6) {
                 $omClass = RequesterPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj6 = new $cls();
                 $obj6->hydrate($row, $startcol6);
                 RequesterPeer::addInstanceToPool($obj6, $key6);
             }
             // if $obj6 already loaded
             // Add the $obj1 (Mission) to the collection in $obj6 (Requester)
             $obj6->addMissionRelatedByRequesterId($obj1);
         }
         // if joined row is not null
         // Add objects for joined Agency rows
         $key7 = AgencyPeer::getPrimaryKeyHashFromRow($row, $startcol7);
         if ($key7 !== null) {
             $obj7 = AgencyPeer::getInstanceFromPool($key7);
             if (!$obj7) {
                 $omClass = AgencyPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj7 = new $cls();
                 $obj7->hydrate($row, $startcol7);
                 AgencyPeer::addInstanceToPool($obj7, $key7);
             }
             // if $obj7 already loaded
             // Add the $obj1 (Mission) to the collection in $obj7 (Agency)
             $obj7->addMissionRelatedByAgencyId($obj1);
         }
         // if joined row is not null
         // Add objects for joined Requester rows
         $key8 = RequesterPeer::getPrimaryKeyHashFromRow($row, $startcol8);
         if ($key8 !== null) {
             $obj8 = RequesterPeer::getInstanceFromPool($key8);
             if (!$obj8) {
                 $omClass = RequesterPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj8 = new $cls();
                 $obj8->hydrate($row, $startcol8);
                 RequesterPeer::addInstanceToPool($obj8, $key8);
             }
             // if $obj8 already loaded
             // Add the $obj1 (Mission) to the collection in $obj8 (Requester)
             $obj8->addMissionRelatedByOtherRequesterId($obj1);
         }
         // if joined row is not null
         // Add objects for joined Agency rows
         $key9 = AgencyPeer::getPrimaryKeyHashFromRow($row, $startcol9);
         if ($key9 !== null) {
             $obj9 = AgencyPeer::getInstanceFromPool($key9);
             if (!$obj9) {
                 $omClass = AgencyPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj9 = new $cls();
                 $obj9->hydrate($row, $startcol9);
                 AgencyPeer::addInstanceToPool($obj9, $key9);
             }
             // if $obj9 already loaded
             // Add the $obj1 (Mission) to the collection in $obj9 (Agency)
             $obj9->addMissionRelatedByOtherAgencyId($obj1);
         }
         // if joined row is not null
         // Add objects for joined Coordinator rows
         $key10 = CoordinatorPeer::getPrimaryKeyHashFromRow($row, $startcol10);
         if ($key10 !== null) {
             $obj10 = CoordinatorPeer::getInstanceFromPool($key10);
             if (!$obj10) {
                 $omClass = CoordinatorPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj10 = new $cls();
                 $obj10->hydrate($row, $startcol10);
                 CoordinatorPeer::addInstanceToPool($obj10, $key10);
             }
             // if $obj10 already loaded
             // Add the $obj1 (Mission) to the collection in $obj10 (Coordinator)
             $obj10->addMission($obj1);
         }
         // if joined row is not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
示例#4
0
              <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();
示例#5
0
 public function configure()
 {
     unset($this['external_id'], $this['request_id'], $this['itinerary_id'], $this['other_requester_id'], $this['other_agency_id']);
     $miss_types = MissionTypePeer::getNames();
     //$passes = PassengerPeer::getForSelectParent();
     //$reqs = RequesterPeer::getForSelectParent();
     //$agencies = AgencyPeer::getForSelectParent();
     //$camps = CampPeer::getForSelectParent();
     $coors = CoordinatorPeer::getForSelectParent();
     //return person_id
     # Fields
     $this->widgetSchema['mission_type_id'] = new sfWidgetFormSelect(array('choices' => $miss_types));
     $this->widgetSchema['mission_date'] = new widgetFormDate(array('change_year' => true, 'change_month' => true, 'format_date' => array('js' => 'mm/dd/yy', 'php' => 'm/d/Y')), array('class' => 'text narrow'));
     $this->widgetSchema['date_requested'] = new sfWidgetFormInput(array(), array('class' => 'text', 'class' => 'text narrow'));
     //$this->widgetSchema['passenger_id'] = new sfWidgetFormSelect(array('choices'=>$passes));
     // $this->widgetSchema['requester_id'] = new sfWidgetFormSelect(array('choices'=>$reqs));
     // $this->widgetSchema['agency_id'] = new sfWidgetFormSelect(array('choices'=>$agencies));
     // $this->widgetSchema['camp_id'] = new sfWidgetFormSelect(array('choices'=>$camps));
     $this->widgetSchema['coordinator_id'] = new sfWidgetFormSelect(array('choices' => $coors));
     $this->widgetSchema['appt_date'] = new widgetFormDate(array('change_year' => true, 'change_month' => true, 'format_date' => array('js' => 'mm/dd/yy', 'php' => 'm/d/Y')), array('class' => 'text narrow'));
     $this->widgetSchema['flight_time'] = new sfWidgetFormInput(array(), array('class' => 'text narrow'));
     $this->widgetSchema['treatment'] = new sfWidgetFormInput(array(), array('class' => 'text narrow'));
     $this->widgetSchema['comment'] = new sfWidgetFormInput(array(), array('class' => 'text narrow'));
     $this->widgetSchema['appointment'] = new sfWidgetFormInput(array(), array('class' => 'text narrow'));
     $this->widgetSchema['mission_specific_comments'] = new sfWidgetFormTextarea(array(), array('class' => 'text'));
     $this->widgetSchema['cancel_mission'] = new sfWidgetFormChoice(array('choices' => array("cancel", "activate"), 'expanded' => true));
     # Labels
     $this->widgetSchema->setLabels(array('mission_type_id' => 'Mission type'));
     $this->widgetSchema->setLabels(array('mission_date' => 'Mission Date'));
     $this->widgetSchema->setLabels(array('date_requested' => 'Date Requested'));
     //$this->widgetSchema->setLabels(array('passenger_id' => 'Passenger'));
     //$this->widgetSchema->setLabels(array('requester_id' => 'Requester'));
     // $this->widgetSchema->setLabels(array('agency_id' => 'Agency'));
     //$this->widgetSchema->setLabels(array('camp_id' => 'Camp'));
     $this->widgetSchema->setLabels(array('coordinator_id' => 'Coordinator'));
     $this->widgetSchema->setLabels(array('appt_date' => 'Appointment Date'));
     $this->widgetSchema->setLabels(array('flight_time' => 'Flight Time'));
     $this->widgetSchema->setLabels(array('treatment' => 'Treatment'));
     $this->widgetSchema->setLabels(array('comment' => 'Comment'));
     $this->widgetSchema->setLabels(array('appointment' => 'Appointment'));
     $this->widgetSchema->setLabels(array('mission_specific_comments' => 'Specific Comment'));
     $this->widgetSchema->setLabels(array('cancel_mission' => 'Cancel Mission'));
     # Validation
     $this->validatorSchema['mission_type_id'] = new sfValidatorString(array('required' => true), array('required' => 'Please choice Mission Type !'));
     $this->validatorSchema['mission_date'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['date_requested'] = new sfValidatorString(array('required' => true), array('required' => 'Please confirm date requested !'));
     //$this->validatorSchema['passenger_id'] = new sfValidatorInteger(array('required' => false));
     //$this->validatorSchema['requester_id'] = new sfValidatorInteger(array('required' => false));
     // $this->validatorSchema['agency_id'] = new sfValidatorInteger(array('required' => false));
     //$this->validatorSchema['camp_id'] = new sfValidatorInteger(array('required' => false));
     $this->validatorSchema['coordinator_id'] = new sfValidatorInteger(array('required' => false));
     $this->validatorSchema['appt_date'] = new sfValidatorDate(array('required' => false), array('invalid' => 'Date of birth is invalid !.'));
     $this->validatorSchema['flight_time'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['treatment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['comment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['appointment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['mission_specific_comments'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['cancel_mission'] = new sfValidatorInteger(array('required' => false));
     # Descriptive message
     $this->widgetSchema->setNameFormat('mission_edit[%s]');
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
 }
示例#6
0
    ?>
<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;
 }
示例#8
0
 public function executeIndex(sfWebRequest $request)
 {
     $text = $request->getParameter('search_by');
     $this->results = array();
     $this->messages = array();
     $this->uris = array();
     //person search
     if ($this->getUser()->hasRights('person_index')) {
         $c = new Criteria();
         $c1 = $c->getNewCriterion(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
         $c2 = $c->getNewCriterion(PersonPeer::LAST_NAME, $text . '%', Criteria::LIKE);
         //$c->setDistinct(PersonPeer::FIRST_NAME);
         //$c->setDistinct(PersonPeer::LAST_NAME);
         $c->add($c1->addOr($c2));
         $this->results['person'] = PersonPeer::doCount($c);
         $this->messages['person'] = ' person results';
         $this->uris['person'] = 'person/index?filter=1&findperson=1&firstname=' . $text;
     }
     //passenger search
     if ($this->getUser()->hasRights('passenger_index')) {
         $c = new Criteria();
         $c->addJoin(PassengerPeer::PERSON_ID, PersonPeer::ID, Criteria::LEFT_JOIN);
         $c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
         $this->results['passenger'] = PassengerPeer::doCount($c);
         $this->messages['passenger'] = ' passenger results';
         $this->uris['passenger'] = 'passenger/index?filter=1&firstname=' . $text;
     }
     //companion search
     if ($this->getUser()->hasRights('companion_index')) {
         $c = new Criteria();
         $c->add(CompanionPeer::NAME, $text . '%', Criteria::LIKE);
         $this->results['companion'] = CompanionPeer::doCount($c);
         $this->messages['companion'] = ' companion results';
         $this->uris['companion'] = 'companion/index?filter=1&name=' . $text;
     }
     //mission search
     if ($this->getUser()->hasRights('mission_index')) {
         $c = new Criteria();
         if (is_numeric($text)) {
             $c->add(MissionPeer::ID, $text . '%', Criteria::LIKE);
             $this->results['mission'] = MissionPeer::doCount($c);
             $this->uris['mission'] = 'mission/index?filter=1&miss_id=' . $text;
         } else {
             $c->addJoin(MissionPeer::PASSENGER_ID, PassengerPeer::ID, Criteria::LEFT_JOIN);
             $c->addJoin(PassengerPeer::PERSON_ID, PersonPeer::ID, Criteria::LEFT_JOIN);
             $c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
             $this->results['mission'] = MissionPeer::doCount($c);
             $this->uris['mission'] = 'mission/index?filter=1&pass_fname=' . $text;
         }
         $this->messages['mission'] = ' mission results';
     }
     //leg search
     if ($this->getUser()->hasRights('leg_index')) {
         $c = new Criteria();
         $c->addJoin(MissionLegPeer::MISSION_ID, MissionPeer::ID, Criteria::LEFT_JOIN);
         $c->addJoin(MissionPeer::PASSENGER_ID, PassengerPeer::ID, Criteria::LEFT_JOIN);
         $c->addJoin(PassengerPeer::PERSON_ID, PersonPeer::ID, Criteria::LEFT_JOIN);
         $c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
         $this->results['leg'] = MissionLegPeer::doCount($c);
         $this->messages['leg'] = ' mission leg results';
         $this->uris['leg'] = 'missionLeg/index?filter=1&pass_fname=' . $text;
     }
     //requester search
     if ($this->getUser()->hasRights('requester_index')) {
         $c = new Criteria();
         $c->addJoin(RequesterPeer::PERSON_ID, PersonPeer::ID, Criteria::LEFT_JOIN);
         $c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
         $this->results['requester'] = RequesterPeer::doCount($c);
         $this->messages['requester'] = ' requester results';
         $this->uris['requester'] = 'requester/index?filter=1&firstname=' . $text;
     }
     //agency search
     if ($this->getUser()->hasRights('agency_index')) {
         $c = new Criteria();
         $c->add(AgencyPeer::NAME, $text . '%', Criteria::LIKE);
         $this->results['agency'] = AgencyPeer::doCount($c);
         $this->messages['agency'] = ' agency results';
         $this->uris['agency'] = 'agency/index?filter=1&name=' . $text;
     }
     //coordinator search
     if ($this->getUser()->hasRights('coordinator_index')) {
         $c = new Criteria();
         $c->addJoin(CoordinatorPeer::MEMBER_ID, MemberPeer::ID);
         $c->addJoin(PersonPeer::ID, MemberPeer::PERSON_ID);
         $c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
         $this->results['coordinator'] = CoordinatorPeer::doCount($c);
         $this->messages['coordinator'] = ' coordinator results';
         $this->uris['coordinator'] = 'coordinator/index?filter=1&firstname=' . $text;
     }
     //camp search
     if ($this->getUser()->hasRights('camp_index')) {
         $c = new Criteria();
         $c->add(CampPeer::CAMP_NAME, $text . '%', Criteria::LIKE);
         $this->results['camp'] = CampPeer::doCount($c);
         $this->messages['camp'] = ' camp results';
         $this->uris['camp'] = 'camp/index?filter=1&camp_name=' . $text;
     }
     //airport search
     if ($this->getUser()->hasRights('airport_index')) {
         $c = new Criteria();
         $c->add(AirportPeer::NAME, $text . '%', Criteria::LIKE);
         $this->results['airport'] = AirportPeer::doCount($c);
         $this->messages['airport'] = ' airport results';
         $this->uris['airport'] = 'airport/index?filter=1&name=' . $text;
     }
     //member search
     if ($this->getUser()->hasRights('member_index')) {
         $c = new Criteria();
         if (is_numeric($text)) {
             $c->add(MemberPeer::ID, $text . '%', Criteria::LIKE);
             $this->results['member'] = MemberPeer::doCount($c);
             $this->uris['member'] = 'member/index?filter=1&member_id=' . $text;
         } else {
             $c->addJoin(MemberPeer::PERSON_ID, PersonPeer::ID, Criteria::LEFT_JOIN);
             $c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
             $this->results['member'] = MemberPeer::doCount($c);
             $this->uris['member'] = 'member/index?filter=1&firstname=' . $text;
         }
         $this->messages['member'] = ' member results';
     }
     //pilot search
     if ($this->getUser()->hasRights('pilot_index')) {
         $c = new Criteria();
         $c->addJoin(PilotPeer::MEMBER_ID, MemberPeer::ID, Criteria::LEFT_JOIN);
         $c->addJoin(MemberPeer::PERSON_ID, PersonPeer::ID, Criteria::LEFT_JOIN);
         $c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
         $this->results['pilot'] = PilotPeer::doCount($c);
         $this->messages['pilot'] = ' pilot results';
         $this->uris['pilot'] = 'pilot/index?filter=1&firstname=' . $text;
     }
     //pilot request search
     if ($this->getUser()->hasRights('mission_available_list')) {
         $c = new Criteria();
         if ($text) {
             $c->add(PilotRequestPeer::DATE, date('Y-m-d', strtotime($text)), Criteria::GREATER_EQUAL);
         }
         $this->results['pilotRequest'] = PilotRequestPeer::doCount($c);
         $this->messages['pilotRequest'] = ' pilot request results';
         $this->uris['pilotRequest'] = 'pilotRequest/index?filter=1&req_date2=' . $text;
     }
     //mission request search
     if ($this->getUser()->hasRights('mission_request_index')) {
         $c = new Criteria();
         if ($text) {
             $c->add(MissionRequestPeer::REQUESTER_DATE, date('Y-m-d', strtotime($text)), Criteria::GREATER_EQUAL);
         }
         $this->results['missionRequest'] = MissionRequestPeer::doCount($c);
         $this->messages['missionRequest'] = ' missionRequest results';
         $this->uris['missionRequest'] = 'missionRequest/index?filter=1&request_date2=' . $text;
     }
     //mission report search
     if ($this->getUser()->hasRights('mission_report_review')) {
         $c = new Criteria();
         $c->add(MissionReportPeer::COPILOT_NAME, $text . '%', Criteria::LIKE);
         $this->results['missionReport'] = MissionReportPeer::doCount($c);
         $this->messages['missionReport'] = ' missionReport results';
         $this->uris['missionReport'] = 'mission_report/review?filter=1&pilot_name=' . $text;
     }
     //role search
     if (1 == 1) {
         $c = new Criteria();
         if (isset($text)) {
             $c->add(RolePeer::TITLE, $text . '%', Criteria::LIKE);
         }
         $this->results['role'] = RolePeer::doCount($c);
         $this->messages['role'] = ' role results';
         $this->uris['role'] = 'role_permission/index?search_by=' . $text;
     }
     $this->text = $text;
 }
示例#9
0
 /**
  * If this collection has already been initialized with
  * an identical criteria, it returns the collection.
  * Otherwise if this Coordinator is new, it will return
  * an empty collection; or if this Coordinator has previously
  * been saved, it will retrieve related CoordinatorsRelatedByLeadId from storage.
  *
  * This method is protected by default in order to keep the public
  * api reasonable.  You can provide public methods for those you
  * actually need in Coordinator.
  */
 public function getCoordinatorsRelatedByLeadIdJoinMember($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     if ($criteria === null) {
         $criteria = new Criteria(CoordinatorPeer::DATABASE_NAME);
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collCoordinatorsRelatedByLeadId === null) {
         if ($this->isNew()) {
             $this->collCoordinatorsRelatedByLeadId = array();
         } else {
             $criteria->add(CoordinatorPeer::LEAD_ID, $this->id);
             $this->collCoordinatorsRelatedByLeadId = CoordinatorPeer::doSelectJoinMember($criteria, $con, $join_behavior);
         }
     } else {
         // the following code is to determine if a new query is
         // called for.  If the criteria is the same as the last
         // one, just return the collection.
         $criteria->add(CoordinatorPeer::LEAD_ID, $this->id);
         if (!isset($this->lastCoordinatorRelatedByLeadIdCriteria) || !$this->lastCoordinatorRelatedByLeadIdCriteria->equals($criteria)) {
             $this->collCoordinatorsRelatedByLeadId = CoordinatorPeer::doSelectJoinMember($criteria, $con, $join_behavior);
         }
     }
     $this->lastCoordinatorRelatedByLeadIdCriteria = $criteria;
     return $this->collCoordinatorsRelatedByLeadId;
 }
示例#10
0
 /**
  * Get the associated Coordinator object
  *
  * @param      PropelPDO Optional Connection object.
  * @return     Coordinator The associated Coordinator object.
  * @throws     PropelException
  */
 public function getCoordinator(PropelPDO $con = null)
 {
     if ($this->aCoordinator === null && $this->coordinator_id !== null) {
         $c = new Criteria(CoordinatorPeer::DATABASE_NAME);
         $c->add(CoordinatorPeer::ID, $this->coordinator_id);
         $this->aCoordinator = CoordinatorPeer::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->aCoordinator->addMissions($this);
         		 */
     }
     return $this->aCoordinator;
 }
示例#11
0
 public static function getNotInCoordinator()
 {
     $c = new Criteria();
     $coordinators = CoordinatorPeer::doSelect($c);
     if ($coordinators) {
         foreach ($coordinators as $coordinator) {
             $c->addJoin(self::ID, CoordinatorPeer::MEMBER_ID, Criteria::LEFT_JOIN);
             $c->addJoin(self::PERSON_ID, PersonPeer::ID);
             $c->add($coordinator->getMemberId(), null, Criteria::ISNULL);
             $not_in_coordinator_persons = PersonPeer::doSelect($c);
         }
     } else {
         $not_in_coordinator_persons = PersonPeer::doSelect($c);
     }
     $arr = array();
     $arr[0] = '-- select --';
     foreach ($not_in_coordinator_persons as $not_in_coordinator_person) {
         $arr[$not_in_coordinator_person->getId()] = $not_in_coordinator_person->getLastName();
     }
     return $arr;
 }
示例#12
0
 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');
         }
     }
 }
示例#13
0
 /**
  * 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());
         }
     }
 }
示例#14
0
 /**
  * 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());
 }
示例#15
0
 /**
  * Selects a collection of MissionLeg objects pre-filled with all related objects except Fbo.
  *
  * @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 MissionLeg objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptFbo(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);
     }
     MissionLegPeer::addSelectColumns($c);
     $startcol2 = MissionLegPeer::NUM_COLUMNS - MissionLegPeer::NUM_LAZY_LOAD_COLUMNS;
     MissionPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (MissionPeer::NUM_COLUMNS - MissionPeer::NUM_LAZY_LOAD_COLUMNS);
     AirportPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + (AirportPeer::NUM_COLUMNS - AirportPeer::NUM_LAZY_LOAD_COLUMNS);
     AirportPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + (AirportPeer::NUM_COLUMNS - AirportPeer::NUM_LAZY_LOAD_COLUMNS);
     CoordinatorPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + (CoordinatorPeer::NUM_COLUMNS - CoordinatorPeer::NUM_LAZY_LOAD_COLUMNS);
     PilotPeer::addSelectColumns($c);
     $startcol7 = $startcol6 + (PilotPeer::NUM_COLUMNS - PilotPeer::NUM_LAZY_LOAD_COLUMNS);
     MemberPeer::addSelectColumns($c);
     $startcol8 = $startcol7 + (MemberPeer::NUM_COLUMNS - MemberPeer::NUM_LAZY_LOAD_COLUMNS);
     PilotPeer::addSelectColumns($c);
     $startcol9 = $startcol8 + (PilotPeer::NUM_COLUMNS - PilotPeer::NUM_LAZY_LOAD_COLUMNS);
     MemberPeer::addSelectColumns($c);
     $startcol10 = $startcol9 + (MemberPeer::NUM_COLUMNS - MemberPeer::NUM_LAZY_LOAD_COLUMNS);
     MissionReportPeer::addSelectColumns($c);
     $startcol11 = $startcol10 + (MissionReportPeer::NUM_COLUMNS - MissionReportPeer::NUM_LAZY_LOAD_COLUMNS);
     PilotAircraftPeer::addSelectColumns($c);
     $startcol12 = $startcol11 + (PilotAircraftPeer::NUM_COLUMNS - PilotAircraftPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(MissionLegPeer::MISSION_ID), array(MissionPeer::ID), $join_behavior);
     $c->addJoin(array(MissionLegPeer::FROM_AIRPORT_ID), array(AirportPeer::ID), $join_behavior);
     $c->addJoin(array(MissionLegPeer::TO_AIRPORT_ID), array(AirportPeer::ID), $join_behavior);
     $c->addJoin(array(MissionLegPeer::COORDINATOR_ID), array(CoordinatorPeer::ID), $join_behavior);
     $c->addJoin(array(MissionLegPeer::PILOT_ID), array(PilotPeer::ID), $join_behavior);
     $c->addJoin(array(MissionLegPeer::COPILOT_ID), array(MemberPeer::ID), $join_behavior);
     $c->addJoin(array(MissionLegPeer::BACKUP_PILOT_ID), array(PilotPeer::ID), $join_behavior);
     $c->addJoin(array(MissionLegPeer::BACKUP_COPILOT_ID), array(MemberPeer::ID), $join_behavior);
     $c->addJoin(array(MissionLegPeer::MISSION_REPORT_ID), array(MissionReportPeer::ID), $join_behavior);
     $c->addJoin(array(MissionLegPeer::PILOT_AIRCRAFT_ID), array(PilotAircraftPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = MissionLegPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = MissionLegPeer::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 = MissionLegPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             MissionLegPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined Mission rows
         $key2 = MissionPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = MissionPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = MissionPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 MissionPeer::addInstanceToPool($obj2, $key2);
             }
             // if $obj2 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj2 (Mission)
             $obj2->addMissionLeg($obj1);
         }
         // if joined row is not null
         // Add objects for joined Airport rows
         $key3 = AirportPeer::getPrimaryKeyHashFromRow($row, $startcol3);
         if ($key3 !== null) {
             $obj3 = AirportPeer::getInstanceFromPool($key3);
             if (!$obj3) {
                 $omClass = AirportPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj3 = new $cls();
                 $obj3->hydrate($row, $startcol3);
                 AirportPeer::addInstanceToPool($obj3, $key3);
             }
             // if $obj3 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj3 (Airport)
             $obj3->addMissionLegRelatedByFromAirportId($obj1);
         }
         // if joined row is not null
         // Add objects for joined Airport rows
         $key4 = AirportPeer::getPrimaryKeyHashFromRow($row, $startcol4);
         if ($key4 !== null) {
             $obj4 = AirportPeer::getInstanceFromPool($key4);
             if (!$obj4) {
                 $omClass = AirportPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj4 = new $cls();
                 $obj4->hydrate($row, $startcol4);
                 AirportPeer::addInstanceToPool($obj4, $key4);
             }
             // if $obj4 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj4 (Airport)
             $obj4->addMissionLegRelatedByToAirportId($obj1);
         }
         // if joined row is not null
         // Add objects for joined Coordinator rows
         $key5 = CoordinatorPeer::getPrimaryKeyHashFromRow($row, $startcol5);
         if ($key5 !== null) {
             $obj5 = CoordinatorPeer::getInstanceFromPool($key5);
             if (!$obj5) {
                 $omClass = CoordinatorPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj5 = new $cls();
                 $obj5->hydrate($row, $startcol5);
                 CoordinatorPeer::addInstanceToPool($obj5, $key5);
             }
             // if $obj5 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj5 (Coordinator)
             $obj5->addMissionLeg($obj1);
         }
         // if joined row is not null
         // Add objects for joined Pilot rows
         $key6 = PilotPeer::getPrimaryKeyHashFromRow($row, $startcol6);
         if ($key6 !== null) {
             $obj6 = PilotPeer::getInstanceFromPool($key6);
             if (!$obj6) {
                 $omClass = PilotPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj6 = new $cls();
                 $obj6->hydrate($row, $startcol6);
                 PilotPeer::addInstanceToPool($obj6, $key6);
             }
             // if $obj6 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj6 (Pilot)
             $obj6->addMissionLegRelatedByPilotId($obj1);
         }
         // if joined row is not null
         // Add objects for joined Member rows
         $key7 = MemberPeer::getPrimaryKeyHashFromRow($row, $startcol7);
         if ($key7 !== null) {
             $obj7 = MemberPeer::getInstanceFromPool($key7);
             if (!$obj7) {
                 $omClass = MemberPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj7 = new $cls();
                 $obj7->hydrate($row, $startcol7);
                 MemberPeer::addInstanceToPool($obj7, $key7);
             }
             // if $obj7 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj7 (Member)
             $obj7->addMissionLegRelatedByCopilotId($obj1);
         }
         // if joined row is not null
         // Add objects for joined Pilot rows
         $key8 = PilotPeer::getPrimaryKeyHashFromRow($row, $startcol8);
         if ($key8 !== null) {
             $obj8 = PilotPeer::getInstanceFromPool($key8);
             if (!$obj8) {
                 $omClass = PilotPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj8 = new $cls();
                 $obj8->hydrate($row, $startcol8);
                 PilotPeer::addInstanceToPool($obj8, $key8);
             }
             // if $obj8 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj8 (Pilot)
             $obj8->addMissionLegRelatedByBackupPilotId($obj1);
         }
         // if joined row is not null
         // Add objects for joined Member rows
         $key9 = MemberPeer::getPrimaryKeyHashFromRow($row, $startcol9);
         if ($key9 !== null) {
             $obj9 = MemberPeer::getInstanceFromPool($key9);
             if (!$obj9) {
                 $omClass = MemberPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj9 = new $cls();
                 $obj9->hydrate($row, $startcol9);
                 MemberPeer::addInstanceToPool($obj9, $key9);
             }
             // if $obj9 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj9 (Member)
             $obj9->addMissionLegRelatedByBackupCopilotId($obj1);
         }
         // if joined row is not null
         // Add objects for joined MissionReport rows
         $key10 = MissionReportPeer::getPrimaryKeyHashFromRow($row, $startcol10);
         if ($key10 !== null) {
             $obj10 = MissionReportPeer::getInstanceFromPool($key10);
             if (!$obj10) {
                 $omClass = MissionReportPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj10 = new $cls();
                 $obj10->hydrate($row, $startcol10);
                 MissionReportPeer::addInstanceToPool($obj10, $key10);
             }
             // if $obj10 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj10 (MissionReport)
             $obj10->addMissionLeg($obj1);
         }
         // if joined row is not null
         // Add objects for joined PilotAircraft rows
         $key11 = PilotAircraftPeer::getPrimaryKeyHashFromRow($row, $startcol11);
         if ($key11 !== null) {
             $obj11 = PilotAircraftPeer::getInstanceFromPool($key11);
             if (!$obj11) {
                 $omClass = PilotAircraftPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj11 = new $cls();
                 $obj11->hydrate($row, $startcol11);
                 PilotAircraftPeer::addInstanceToPool($obj11, $key11);
             }
             // if $obj11 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj11 (PilotAircraft)
             $obj11->addMissionLeg($obj1);
         }
         // if joined row is not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }