Example #1
0
                ?>
 disabled="disabled" <?php 
            }
            ?>
 name="pilot_aircraft_mail[]" />
              </div>
              <div class="leglabel">Email: </div>
              <div class="leg_filed">
                  <?php 
            echo $pilot_aircraft_id->getMember()->getPerson()->getEmail();
            ?>
              </div>
          </div>
          <?php 
        }
        $afa_org = AfaOrgPeer::retrieveByPK($miss_leg->getShareAfaOrgId());
        if ($afa_org) {
            ?>
           <div class="legemail_box">
               <div class="heading">Afa Org: <?php 
            echo $afa_org->getName();
            ?>
 </div>
              <div class="chbox">
                  <input type="checkbox" <?php 
            if ($afa_org && $afa_org->getRefContactEmail()) {
                ?>
 value="<?php 
                echo $afa_org->getRefContactEmail();
                ?>
" class="mailable" <?php 
Example #2
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 = AfaOrgPeer::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->setOrgPhone($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setHomePageUrl($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setOrgFax($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setRefContactName($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setRefContactEmail($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setVpoSoapServerUrl($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setVpoRequestPostEmail($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setVpoUserId($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setVpoUserPassword($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setVpoOrgId($arr[$keys[11]]);
     }
     if (array_key_exists($keys[12], $arr)) {
         $this->setAfidsRequesterUserName($arr[$keys[12]]);
     }
     if (array_key_exists($keys[13], $arr)) {
         $this->setAfidsRequesterPassword($arr[$keys[13]]);
     }
     if (array_key_exists($keys[14], $arr)) {
         $this->setAfidsSoapServerUrl($arr[$keys[14]]);
     }
     if (array_key_exists($keys[15], $arr)) {
         $this->setAfidsRequestPostEmail($arr[$keys[15]]);
     }
     if (array_key_exists($keys[16], $arr)) {
         $this->setPhoneNumber1($arr[$keys[16]]);
     }
     if (array_key_exists($keys[17], $arr)) {
         $this->setPhoneNumber2($arr[$keys[17]]);
     }
 }
Example #3
0
 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      PropelPDO $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function retrieveByPKs($pks, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(AfaOrgPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(AfaOrgPeer::DATABASE_NAME);
         $criteria->add(AfaOrgPeer::ID, $pks, Criteria::IN);
         $objs = AfaOrgPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Example #4
0
 /**
  * TODO: Check related records.
  * CODE: afaorg_delete
  */
 public function executeDelete(sfWebRequest $request)
 {
     # security
     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');
     }
     if ($request->isMethod('delete')) {
         $request->checkCSRFProtection();
         $afa = AfaOrgPeer::retrieveByPK($request->getParameter('id'));
         $this->forward404Unless($afa);
         $this->getUser()->setFlash('success', 'Linking Organization information has been successfully deleted!');
         $afa->delete();
     }
     return $this->redirect('@afaOrg');
 }
 public static function getEmailAddressesOfPersonsRelatedToMissionLeg(MissionLeg $mission_leg)
 {
     $receivers = array();
     // Get Coordinator email address
     $coordinator = CoordinatorPeer::retrieveByPK($mission_leg->getCoordinatorId());
     if ($coordinator && ($coordinator = $coordinator->getMember())) {
         $coordinator = $coordinator->getPerson()->getEmail();
         if (!empty($coordinator)) {
             //            $receivers['coordinator_'.$mission_leg->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 Pilot email address
     $pilot = PilotPeer::retrieveByPK($mission_leg->getPilotId());
     if ($pilot && ($pilot = $pilot->getMember())) {
         $pilot = $pilot->getPerson()->getEmail();
         if (!empty($pilot)) {
             //        $receivers['pilot_'.$mission_leg->getId()] = $pilot;
             if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $pilot)) {
                 $receivers[] = $pilot;
             }
         }
     }
     unset($pilot);
     // Get Backup Pilot email address
     $backup_pilot = PilotPeer::retrieveByPK($mission_leg->getBackupPilotId());
     if ($backup_pilot && ($backup_pilot = $backup_pilot->getMember())) {
         $backup_pilot = $backup_pilot->getPerson()->getEmail();
         if (!empty($backup_pilot)) {
             //            $receivers['backup_pilot_'.$mission_leg->getId()] = $backup_pilot;
             if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $backup_pilot)) {
                 $receivers[] = $backup_pilot;
             }
         }
     }
     unset($backup_pilot);
     // Get Co-Pilot which is relate to Member
     $co_pilot = MemberPeer::retrieveByPK($mission_leg->getCopilotId());
     if ($co_pilot) {
         $co_pilot = $co_pilot->getPerson()->getEmail();
         if (!empty($co_pilot)) {
             //            $receivers['co_pilot_'.$mission_leg->getId()] = $co_pilot;
             if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $co_pilot)) {
                 $receivers[] = $co_pilot;
             }
         }
     }
     unset($co_pilot);
     // Get Backup Co-pilot email address
     $backup_co_pilot = MemberPeer::retrieveByPK($mission_leg->getBackupCopilotId());
     if ($backup_co_pilot) {
         $backup_co_pilot = $backup_co_pilot->getPerson()->getEmail();
         if (!empty($backup_co_pilot)) {
             //            $receivers['backup_co_pilot_'.$mission_leg->getId()] = $backup_co_pilot;
             if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $backup_co_pilot)) {
                 $receivers[] = $backup_co_pilot;
             }
         }
     }
     unset($backup_co_pilot);
     // Get mission assist email address
     $mission_assist = MemberPeer::retrieveByPK($mission_leg->getMissAssisId());
     if ($mission_assist) {
         $mission_assist = $mission_assist->getPerson()->getEmail();
         if (!empty($mission_assist)) {
             //            $receivers['mission_assist_'.$mission_leg->getId()] = $mission_assist;
             if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $mission_assist)) {
                 $receivers[] = $mission_assist;
             }
         }
     }
     unset($mission_assist);
     // Get Backup mission assist email address
     $backup_mission_assist = MemberPeer::retrieveByPK($mission_leg->getBackupMissAssisId());
     if ($backup_mission_assist) {
         $backup_mission_assist = $backup_mission_assist->getPerson()->getEmail();
         if (!empty($backup_mission_assist)) {
             //            $receivers['backup_mission_assist_'.$mission_leg->getId()] = $backup_mission_assist;
             if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $backup_mission_assist)) {
                 $receivers[] = $backup_mission_assist;
             }
         }
     }
     unset($backup_mission_assist);
     // Get Pilot Aircraft email address
     $pilot_aircraft = PilotAircraftPeer::retrieveByPK($mission_leg->getPilotAircraftId());
     if ($pilot_aircraft && ($pilot_aircraft = $pilot_aircraft->getMember())) {
         $pilot_aircraft = $pilot_aircraft->getPerson()->getEmail();
         if (!empty($pilot_aircraft)) {
             //            $receivers['pilot_aircraft_'.$mission_leg->getId()] = $pilot_aircraft;
             if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $pilot_aircraft)) {
                 $receivers[] = $pilot_aircraft;
             }
         }
     }
     unset($pilot_aircraft);
     // Get Share AFA ORG email address
     $afa_org = AfaOrgPeer::retrieveByPK($mission_leg->getShareAfaOrgId());
     if ($afa_org) {
         $afa_org = $afa_org->getRefContactEmail();
         if (!empty($afa_org)) {
             //            $receivers['afa_org_'.$mission_leg->getId()] = $afa_org;
             if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $afa_org)) {
                 $receivers[] = $afa_org;
             }
         }
     }
     unset($afa_org);
     return $receivers;
 }
Example #6
0
 /**
  * Selects a collection of AfaLeg objects pre-filled with all related objects except Aircraft.
  *
  * @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 AfaLeg objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptAircraft(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);
     }
     AfaLegPeer::addSelectColumns($c);
     $startcol2 = AfaLegPeer::NUM_COLUMNS - AfaLegPeer::NUM_LAZY_LOAD_COLUMNS;
     MissionLegPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (MissionLegPeer::NUM_COLUMNS - MissionLegPeer::NUM_LAZY_LOAD_COLUMNS);
     AfaOrgPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + (AfaOrgPeer::NUM_COLUMNS - AfaOrgPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(AfaLegPeer::ID), array(MissionLegPeer::ID), $join_behavior);
     $c->addJoin(array(AfaLegPeer::AFA_ORG_ID), array(AfaOrgPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = AfaLegPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = AfaLegPeer::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 = AfaLegPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             AfaLegPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined MissionLeg rows
         $key2 = MissionLegPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = MissionLegPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = MissionLegPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 MissionLegPeer::addInstanceToPool($obj2, $key2);
             }
             // if $obj2 already loaded
             // Add the $obj1 (AfaLeg) to the collection in $obj2 (MissionLeg)
             $obj2->setAfaLeg($obj1);
         }
         // if joined row is not null
         // Add objects for joined AfaOrg rows
         $key3 = AfaOrgPeer::getPrimaryKeyHashFromRow($row, $startcol3);
         if ($key3 !== null) {
             $obj3 = AfaOrgPeer::getInstanceFromPool($key3);
             if (!$obj3) {
                 $omClass = AfaOrgPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj3 = new $cls();
                 $obj3->hydrate($row, $startcol3);
                 AfaOrgPeer::addInstanceToPool($obj3, $key3);
             }
             // if $obj3 already loaded
             // Add the $obj1 (AfaLeg) to the collection in $obj3 (AfaOrg)
             $obj3->addAfaLeg($obj1);
         }
         // if joined row is not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
Example #7
0
 /**
  * Get the associated AfaOrg object
  *
  * @param      PropelPDO Optional Connection object.
  * @return     AfaOrg The associated AfaOrg object.
  * @throws     PropelException
  */
 public function getAfaOrg(PropelPDO $con = null)
 {
     if ($this->aAfaOrg === null && $this->afa_org_id !== null) {
         $c = new Criteria(AfaOrgPeer::DATABASE_NAME);
         $c->add(AfaOrgPeer::ID, $this->afa_org_id);
         $this->aAfaOrg = AfaOrgPeer::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->aAfaOrg->addAfaLegs($this);
         		 */
     }
     return $this->aAfaOrg;
 }