Esempio n. 1
0
 public function configure()
 {
     unset($this['id'], $this['person_id'], $this['date_added'], $this['date_updated']);
     $sources = RefSourcePeer::getForSelectParent();
     $types = ContactTypePeer::getForSelectParent();
     $companies = CompanyPeer::getForSelectParent();
     # Fields
     $this->widgetSchema['ref_source_id'] = new sfWidgetFormChoice(array('choices' => $sources), array('class' => 'text narrow'));
     $this->widgetSchema['send_app_format'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['comment'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['letter_sent'] = 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['contact_type_id'] = new sfWidgetFormChoice(array('choices' => $types), array('class' => 'text narrow'));
     $this->widgetSchema['company_name'] = new sfWidgetFormChoice(array('choices' => $companies), array('class' => 'text narrow'));
     $this->widgetSchema->setLabels(array('person_id' => 'Person'));
     $this->widgetSchema->setLabels(array('ref_source_id' => 'Ref Source'));
     $this->widgetSchema->setLabels(array('send_app_format' => 'Send Application Format'));
     $this->widgetSchema->setLabels(array('comment' => 'Comment'));
     $this->widgetSchema->setLabels(array('letter_sent' => 'Letter Sent'));
     $this->widgetSchema->setLabels(array('contact_type_id' => 'Contact Type'));
     $this->widgetSchema->setLabels(array('company_name' => 'Company Name'));
     $this->validatorSchema['ref_source_id'] = new sfValidatorInteger(array('required' => false));
     $this->validatorSchema['send_app_format'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['comment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['letter_sent'] = new sfValidatorDate(array('max' => time(), 'required' => false), array('invalid' => 'Letter sent is invalid !.'));
     $this->validatorSchema['contact_type_id'] = new sfValidatorInteger(array('required' => false));
     $this->validatorSchema['company_name'] = new sfValidatorInteger(array('required' => false));
     $this->widgetSchema->setNameFormat('contact[%s]');
 }
 public function configure()
 {
     $ref_sources = RefSourcePeer::getForSelectParent();
     $contact_types = ContactTypePeer::getForSelectParent();
     $this->setWidgets(array('id' => new sfWidgetFormInputHidden(), 'ref_source_id' => new sfWidgetFormSelect(array('choices' => $ref_sources)), 'send_app_format' => new sfWidgetFormInput(array(), array('class' => 'text')), 'comment' => new sfWidgetFormInput(array(), array('class' => 'text')), 'contact_type_id' => new sfWidgetFormSelect(array('choices' => $contact_types)), 'letter_sent_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->setLabels(array('ref_source_id' => 'Ref Source*', 'send_app_format' => 'Send Application Format', 'comment' => 'Comment', 'contact_type_id' => 'Contact Type*', 'letter_sent_date' => 'Letter Sent Date'));
     $this->setValidators(array('id' => new sfValidatorPropelChoice(array('model' => 'ContactRequest', 'column' => 'id', 'required' => false)), 'ref_source_id' => new sfValidatorChoice(array('choices' => array_keys($ref_sources), 'required' => false)), 'send_app_format' => new sfValidatorString(array('max_length' => 40)), 'comment' => new sfValidatorString(array('max_length' => 40, 'required' => false)), 'contact_type_id' => new sfValidatorChoice(array('choices' => array_keys($contact_types), 'required' => false)), 'letter_sent_date' => new sfValidatorString(array('max_length' => 25, 'required' => false))));
     $this->widgetSchema->setNameFormat('contact_request[%s]');
 }
Esempio n. 3
0
 /**
  * Searches for contacts
  * CODE:contact_index
  */
 public function executeIndex(sfWebRequest $request)
 {
     # security
     if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Volunteer'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     # filter
     $this->processFilter($request);
     if ($request->isMethod('post') || $request->getParameter('page')) {
         $this->pager = ContactPeer::getPager($this->max, $this->page, $this->firstname, $this->lastname, $this->city, $this->state, $this->ref_source, $this->contact_type, $this->added_date1, $this->added_date2);
         $this->contact_list = $this->pager->getResults();
     }
     $this->ref_sources = RefSourcePeer::doSelect(new Criteria());
     $this->contact_types = ContactTypePeer::doSelect(new Criteria());
     $this->date_widget = new widgetFormDate(array('format_date' => array('js' => 'mm/dd/yy', 'php' => 'm/d/Y')), array('class' => 'text'));
 }
Esempio n. 4
0
 /**
  * Get the associated RefSource object
  *
  * @param      PropelPDO Optional Connection object.
  * @return     RefSource The associated RefSource object.
  * @throws     PropelException
  */
 public function getRefSource(PropelPDO $con = null)
 {
     if ($this->aRefSource === null && $this->ref_source_id !== null) {
         $c = new Criteria(RefSourcePeer::DATABASE_NAME);
         $c->add(RefSourcePeer::ID, $this->ref_source_id);
         $this->aRefSource = RefSourcePeer::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->aRefSource->addContacts($this);
         		 */
     }
     return $this->aRefSource;
 }
 public function configure()
 {
     unset($this['id'], $this['requester_id'], $this['requester_date'], $this['baggage_weight'], $this['baggage_desc'], $this['pass_address1'], $this['pass_address2'], $this['pass_city'], $this['pass_county'], $this['pass_state'], $this['pass_country'], $this['pass_day_phone'], $this['pass_day_comment'], $this['pass_eve_phone'], $this['pass_eve_comment'], $this['pass_mobile_phone'], $this['pass_mobile_comment'], $this['pass_pager_phone'], $this['pass_pager_comment'], $this['pass_other_phone'], $this['pass_email'], $this['financial'], $this['pass_weight'], $this['req_title'], $this['req_county'], $this['req_country'], $this['req_day_phone'], $this['orgin_ident'], $this['orgin_id'], $this['dest_ident'], $this['dest_id'], $this['req_language'], $this['best_contact'], $this['emergency_phone2'], $this['emergency_phone2_comment'], $this['comment'], $this['processed_date'], $this['session_id'], $this['ip_address'], $this['pass_fax_phone1'], $this['pass_fax_comment1'], $this['guar_first_name'], $this['guar_last_name'], $this['guar_address1'], $this['guar_address2'], $this['guar_city'], $this['guar_state'], $this['guar_zipcode'], $this['guar_day_phone'], $this['guar_day_comment'], $this['guar_eve_phone'], $this['guar_eve_comment'], $this['guar_fax_phone'], $this['guar_fax_comment'], $this['guar_mobile_phone'], $this['guar_mobile_comment'], $this['guar_other_phone'], $this['guar_other_comment'], $this['guar_pager_phone'], $this['guar_pager_comment'], $this['guar_guar_email'], $this['req_fax_phone1'], $this['req_fax_comment1'], $this['req_fax_comment1'], $this['pass_height'], $this['afa_org_id'], $this['afa_org_mission_id'], $this['mission_request_type_id'], $this['last_page_processed'], $this['pass_title'], $this['pass_first_name'], $this['pass_last_name'], $this['on_behalf'], $this['request_by'], $this['follow_up_contact_name'], $this['follow_up_contact_phone'], $this['follow_up_email'], $this['pass_zipcode'], $this['pass_date_of_birth'], $this['orgin_city'], $this['orgin_state'], $this['orgin_zipcode'], $this['dest_city'], $this['dest_state'], $this['dest_zipcode'], $this['req_first_name'], $this['req_last_name'], $this['agency_name'], $this['req_address1'], $this['req_address2'], $this['req_city'], $this['req_state'], $this['req_zipcode'], $this['req_day_phone'], $this['req_day_comment'], $this['req_eve_phone'], $this['req_eve_comment'], $this['req_mobile_phone'], $this['req_mobile_comment'], $this['req_pager_phone'], $this['req_pager_comment'], $this['req_other_phone'], $this['req_other_comment'], $this['req_email'], $this['appt_date'], $this['return_date'], $this['releasing_physician'], $this['release_phone'], $this['release_phone_comment'], $this['release_fax'], $this['release_fax_comment'], $this['release_email'], $this['treating_physician'], $this['treating_phone'], $this['treating_phone_comment'], $this['treating_fax'], $this['treating_fax_comment'], $this['treating_email'], $this['facility_name'], $this['facility_phone'], $this['facility_phone_comment'], $this['lodging_name'], $this['lodging_phone'], $this['lodging_phone_comment'], $this['emergency_name'], $this['emergency_phone1'], $this['emergency_phone1_comment'], $this['pass_english'], $this['pass_language'], $this['pass_oxygen'], $this['illness'], $this['financial'], $this['pass_medical'], $this['referral_source_id'], $this['miss_req_orginator_afa_org_id'], $this['_csrf_token'], $this['req_secondary_email'], $this['req_pager_email'], $this['req_position'], $this['req_discharge'], $this['appt_time'], $this['flight_time'], $this['mission_date'], $this['waiver_required']);
     $phone_widget_options = array('mask' => '(999) 999-9999', 'ok_class' => 'field_ok', 'holder_class' => 'field_hold');
     $relationships = sfConfig::get('app_relationship', array('relative' => 'Relative', 'friend' => 'Friend', 'caregiver' => 'Caregiver'));
     $ref_sources = RefSourcePeer::getForSelectParent();
     # Fields
     $this->widgetSchema['com1_name'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['com1_relationship'] = new sfWidgetFormSelect(array('choices' => $relationships));
     $this->widgetSchema['com1_date_of_birth'] = 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['com1_weight'] = new sfWidgetFormInput(array(), array('class' => 'text narrowest'));
     $this->widgetSchema['com1_phone'] = new widgetFormInputPhone($phone_widget_options, array('class' => 'text narrow'));
     $this->widgetSchema['com1_comment'] = new sfWidgetFormInput(array(), array('class' => 'text narrow'));
     $this->widgetSchema['com2_name'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['com2_relationship'] = new sfWidgetFormSelect(array('choices' => $relationships));
     $this->widgetSchema['com2_date_of_birth'] = 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['com2_weight'] = new sfWidgetFormInput(array(), array('class' => 'text narrowest'));
     $this->widgetSchema['com2_phone'] = new widgetFormInputPhone($phone_widget_options, array('class' => 'text narrow'));
     $this->widgetSchema['com2_comment'] = new sfWidgetFormInput(array(), array('class' => 'text narrow'));
     $this->widgetSchema['com3_name'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['com3_relationship'] = new sfWidgetFormSelect(array('choices' => $relationships));
     $this->widgetSchema['com3_date_of_birth'] = 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['com3_weight'] = new sfWidgetFormInput(array(), array('class' => 'text narrowest'));
     $this->widgetSchema['com3_phone'] = new widgetFormInputPhone($phone_widget_options, array('class' => 'text narrow'));
     $this->widgetSchema['com3_comment'] = new sfWidgetFormInput(array(), array('class' => 'text narrow'));
     $this->widgetSchema['com4_name'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['com4_relationship'] = new sfWidgetFormSelect(array('choices' => $relationships));
     $this->widgetSchema['com4_date_of_birth'] = 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['com4_weight'] = new sfWidgetFormInput(array(), array('class' => 'text narrowest'));
     $this->widgetSchema['com4_phone'] = new widgetFormInputPhone($phone_widget_options, array('class' => 'text narrow'));
     $this->widgetSchema['com4_comment'] = new sfWidgetFormInput(array(), array('class' => 'text narrow'));
     $this->widgetSchema['com5_name'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['com5_relationship'] = new sfWidgetFormSelect(array('choices' => $relationships));
     $this->widgetSchema['com5_date_of_birth'] = 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['com5_weight'] = new sfWidgetFormInput(array(), array('class' => 'text narrowest'));
     $this->widgetSchema['com5_phone'] = new widgetFormInputPhone($phone_widget_options, array('class' => 'text narrow'));
     $this->widgetSchema['com5_comment'] = new sfWidgetFormInput(array(), array('class' => 'text narrow'));
     # Labels
     $this->widgetSchema->setLabels(array('com1_name' => 'Name'));
     $this->widgetSchema->setLabels(array('com1_relationship' => 'Relationship'));
     $this->widgetSchema->setLabels(array('com1_date_of_birth' => 'Date of birth'));
     $this->widgetSchema->setLabels(array('com1_weight' => 'Weight'));
     $this->widgetSchema->setLabels(array('com1_phone' => 'Phone'));
     $this->widgetSchema->setLabels(array('com1_comment' => 'Comment'));
     $this->widgetSchema->setLabels(array('com2_name' => 'Name'));
     $this->widgetSchema->setLabels(array('com2_relationship' => 'Relationship'));
     $this->widgetSchema->setLabels(array('com2_date_of_birth' => 'Date of birth'));
     $this->widgetSchema->setLabels(array('com2_weight' => 'Weight'));
     $this->widgetSchema->setLabels(array('com2_phone' => 'Phone'));
     $this->widgetSchema->setLabels(array('com2_comment' => 'Comment'));
     $this->widgetSchema->setLabels(array('com3_name' => 'Name'));
     $this->widgetSchema->setLabels(array('com3_relationship' => 'Relationship'));
     $this->widgetSchema->setLabels(array('com3_date_of_birth' => 'Date of birth'));
     $this->widgetSchema->setLabels(array('com3_weight' => 'Weight'));
     $this->widgetSchema->setLabels(array('com3_phone' => 'Phone'));
     $this->widgetSchema->setLabels(array('com3_comment' => 'Comment'));
     $this->widgetSchema->setLabels(array('com4_name' => 'Name'));
     $this->widgetSchema->setLabels(array('com4_relationship' => 'Relationship'));
     $this->widgetSchema->setLabels(array('com4_date_of_birth' => 'Date of birth'));
     $this->widgetSchema->setLabels(array('com4_weight' => 'Weight'));
     $this->widgetSchema->setLabels(array('com4_phone' => 'Phone'));
     $this->widgetSchema->setLabels(array('com4_comment' => 'Comment'));
     $this->widgetSchema->setLabels(array('com5_name' => 'Name'));
     $this->widgetSchema->setLabels(array('com5_relationship' => 'Relationship'));
     $this->widgetSchema->setLabels(array('com5_date_of_birth' => 'Date of birth'));
     $this->widgetSchema->setLabels(array('com5_weight' => 'Weight'));
     $this->widgetSchema->setLabels(array('com5_phone' => 'Phone'));
     $this->widgetSchema->setLabels(array('com5_comment' => 'Comment'));
     # Validation
     $this->validatorSchema['com1_name'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com1_relationship'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com1_date_of_birth'] = new sfValidatorDate(array('max' => time(), 'required' => false), array('invalid' => 'Date of birth is invalid !.'));
     $this->validatorSchema['com1_weight'] = new sfValidatorInteger(array('required' => false));
     $this->validatorSchema['com1_phone'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com1_comment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com2_name'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com2_relationship'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com2_date_of_birth'] = new sfValidatorDate(array('max' => time(), 'required' => false), array('invalid' => 'Date of birth is invalid !.'));
     $this->validatorSchema['com2_weight'] = new sfValidatorInteger(array('required' => false));
     $this->validatorSchema['com2_phone'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com2_comment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com3_name'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com3_relationship'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com3_date_of_birth'] = new sfValidatorDate(array('max' => time(), 'required' => false), array('invalid' => 'Date of birth is invalid !.'));
     $this->validatorSchema['com3_weight'] = new sfValidatorInteger(array('required' => false));
     $this->validatorSchema['com3_phone'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com3_comment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com4_name'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com4_relationship'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com4_date_of_birth'] = new sfValidatorDate(array('max' => time(), 'required' => false), array('invalid' => 'Date of birth is invalid !.'));
     $this->validatorSchema['com4_weight'] = new sfValidatorInteger(array('required' => false));
     $this->validatorSchema['com4_phone'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com4_comment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com5_name'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com5_relationship'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com5_date_of_birth'] = new sfValidatorDate(array('max' => time(), 'required' => false), array('invalid' => 'Date of birth is invalid !.'));
     $this->validatorSchema['com5_weight'] = new sfValidatorInteger(array('required' => false));
     $this->validatorSchema['com5_phone'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['com5_comment'] = new sfValidatorString(array('required' => false));
     # Descriptive message
     $this->widgetSchema->setNameFormat('miss_req_temp5[%s]');
 }
Esempio n. 6
0
            <td>
              <?php 
echo $contact_request->getFaxComment() ? $contact_request->getFaxComment() : '--';
?>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
        </div>
  <div>
  <h3>Contact Information</h3>
    <dl class="person-data">
        <dt class="dt1">Ref Source:</dt>
        <dd><?php 
echo $contact_request->getRefSourceId() ? RefSourcePeer::retrieveByPK($contact_request->getRefSourceId()) : '--';
?>
</dd>
      <dt class="dt1">Send Application Format:</dt>
              <dd><?php 
echo $contact_request->getSendAppFormat() ? $contact_request->getSendAppFormat() : '--';
?>
</dd>
      <dt class="dt1">Comment:</dt>
              <dd><?php 
echo $contact_request->getComment() ? $contact_request->getComment() : '--';
?>
</dd>
      <dt class="dt1">Contact Type:</dt>
      <dd><?php 
echo $contact_request->getContactTypeId() ? ContactTypePeer::retrieveByPK($contact_request->getContactTypeId()) : '--';
Esempio n. 7
0
 /**
  * Selects a collection of Contact objects pre-filled with all related objects except ContactType.
  *
  * @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 Contact objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptContactType(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);
     }
     ContactPeer::addSelectColumns($c);
     $startcol2 = ContactPeer::NUM_COLUMNS - ContactPeer::NUM_LAZY_LOAD_COLUMNS;
     PersonPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (PersonPeer::NUM_COLUMNS - PersonPeer::NUM_LAZY_LOAD_COLUMNS);
     RefSourcePeer::addSelectColumns($c);
     $startcol4 = $startcol3 + (RefSourcePeer::NUM_COLUMNS - RefSourcePeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(ContactPeer::PERSON_ID), array(PersonPeer::ID), $join_behavior);
     $c->addJoin(array(ContactPeer::REF_SOURCE_ID), array(RefSourcePeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = ContactPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = ContactPeer::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 = ContactPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             ContactPeer::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 (Contact) to the collection in $obj2 (Person)
             $obj2->addContact($obj1);
         }
         // if joined row is not null
         // Add objects for joined RefSource rows
         $key3 = RefSourcePeer::getPrimaryKeyHashFromRow($row, $startcol3);
         if ($key3 !== null) {
             $obj3 = RefSourcePeer::getInstanceFromPool($key3);
             if (!$obj3) {
                 $omClass = RefSourcePeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj3 = new $cls();
                 $obj3->hydrate($row, $startcol3);
                 RefSourcePeer::addInstanceToPool($obj3, $key3);
             }
             // if $obj3 already loaded
             // Add the $obj1 (Contact) to the collection in $obj3 (RefSource)
             $obj3->addContact($obj1);
         }
         // if joined row is not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
Esempio n. 8
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 = RefSourcePeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setSourceName($arr[$keys[1]]);
     }
 }
Esempio n. 9
0
        <th><?php 
echo 'Referral Source:';
?>
</th>
        <td>
          <?php 
echo $form['ref_source_id']->renderError();
?>
          <?php 
//echo $form['ref_source_id']
?>
          <select id="contact_request_ref_source_id" name="contact_request[ref_source_id]">
              <option value="0">--Please Select--</option>
              <?php 
$ref = new Criteria();
$refs = RefSourcePeer::doSelect($ref);
foreach ($refs as $ref_list) {
    ?>
              <option value="<?php 
    echo $ref_list->getId();
    ?>
"><?php 
    echo $ref_list->getSourceName();
    ?>
</option>
          <?php 
}
?>
          </select>
        </td>
      </tr>
Esempio n. 10
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(RefSourcePeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(RefSourcePeer::DATABASE_NAME);
         $criteria->add(RefSourcePeer::ID, $pks, Criteria::IN);
         $objs = RefSourcePeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Esempio n. 11
0
 public function configure()
 {
     unset($this['id'], $this['requester_id'], $this['requester_date'], $this['baggage_weight'], $this['baggage_desc'], $this['pass_address1'], $this['pass_address2'], $this['pass_city'], $this['pass_county'], $this['pass_state'], $this['pass_country'], $this['pass_day_phone'], $this['pass_day_comment'], $this['pass_eve_phone'], $this['pass_eve_comment'], $this['pass_mobile_phone'], $this['pass_mobile_comment'], $this['pass_pager_phone'], $this['pass_pager_comment'], $this['pass_other_phone'], $this['pass_other_comment'], $this['pass_email'], $this['pass_weight'], $this['req_title'], $this['req_county'], $this['req_country'], $this['orgin_ident'], $this['orgin_id'], $this['dest_id'], $this['com1_name'], $this['com1_relationship'], $this['com1_date_of_birth'], $this['com1_weigth'], $this['com1_phone'], $this['com1_comment'], $this['com2_name'], $this['com2_relationship'], $this['com2_date_of_birth'], $this['com2_weigth'], $this['com2_phone'], $this['com2_comment'], $this['com3_name'], $this['com3_relationship'], $this['com3_date_of_birth'], $this['com3_weigth'], $this['com3_phone'], $this['com3_comment'], $this['com4_name'], $this['com4_relationship'], $this['com4_date_of_birth'], $this['com4_weigth'], $this['com4_phone'], $this['com4_comment'], $this['com5_name'], $this['com5_relationship'], $this['com5_date_of_birth'], $this['com5_weigth'], $this['com5_phone'], $this['com5_comment'], $this['req_language'], $this['best_contact'], $this['emergency_phone2'], $this['emergency_phone2_comment'], $this['comment'], $this['processed_date'], $this['session_id'], $this['ip_address'], $this['pass_fax_phone1'], $this['pass_fax_comment1'], $this['guar_first_name'], $this['guar_last_name'], $this['guar_address1'], $this['guar_address2'], $this['guar_city'], $this['guar_state'], $this['guar_zipcode'], $this['guar_day_phone'], $this['guar_day_comment'], $this['guar_eve_phone'], $this['guar_eve_comment'], $this['guar_fax_phone'], $this['guar_fax_comment'], $this['guar_mobile_phone'], $this['guar_mobile_comment'], $this['guar_other_phone'], $this['guar_other_comment'], $this['guar_pager_phone'], $this['guar_pager_comment'], $this['guar_guar_email'], $this['req_fax_phone1'], $this['req_fax_comment1'], $this['pass_height'], $this['afa_org_id'], $this['afa_org_mission_id'], $this['mission_request_type_id'], $this['last_page_processed'], $this['pass_title'], $this['pass_first_name'], $this['pass_last_name'], $this['on_behalf'], $this['request_by'], $this['follow_up_contact_name'], $this['follow_up_contact_phone'], $this['follow_up_email'], $this['pass_zipcode'], $this['pass_date_of_birth'], $this['orgin_city'], $this['orgin_state'], $this['orgin_zipcode'], $this['dest_city'], $this['dest_state'], $this['dest_zipcode'], $this['req_first_name'], $this['req_last_name'], $this['agency_name'], $this['req_address1'], $this['req_address2'], $this['req_city'], $this['req_state'], $this['req_zipcode'], $this['req_day_phone'], $this['req_day_comment'], $this['req_eve_phone'], $this['req_eve_comment'], $this['req_mobile_phone'], $this['req_mobile_comment'], $this['req_pager_phone'], $this['req_pager_comment'], $this['req_other_phone'], $this['req_other_comment'], $this['req_email'], $this['miss_req_orginator_afa_org_id'], $this['_csrf_token'], $this['req_secondary_email'], $this['req_pager_email'], $this['req_position'], $this['req_discharge'], $this['appt_time'], $this['flight_time'], $this['waiver_required']);
     $phone_widget_options = array('mask' => '(999) 999-9999', 'ok_class' => 'field_ok', 'holder_class' => 'field_hold');
     $medicals = sfConfig::get('app_medicals', array('0' => 'Medical', '1' => 'Compassionate'));
     $ref_sources = RefSourcePeer::getForSelectParent();
     # Fields
     $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['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['return_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['releasing_physician'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['release_phone'] = new widgetFormInputPhone($phone_widget_options, array('class' => 'text narrow'));
     $this->widgetSchema['release_phone_comment'] = new sfWidgetFormInput(array(), array('class' => 'text narrow'));
     $this->widgetSchema['release_fax'] = new widgetFormInputPhone($phone_widget_options, array('class' => 'text narrow'));
     $this->widgetSchema['release_fax_comment'] = new sfWidgetFormInput(array(), array('class' => 'text narrow'));
     $this->widgetSchema['release_email'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['treating_physician'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['treating_phone'] = new widgetFormInputPhone($phone_widget_options, array('class' => 'text narrow'));
     $this->widgetSchema['treating_phone_comment'] = new sfWidgetFormInput(array(), array('class' => 'text narrow'));
     $this->widgetSchema['treating_fax'] = new widgetFormInputPhone($phone_widget_options, array('class' => 'text narrow'));
     $this->widgetSchema['treating_fax_comment'] = new sfWidgetFormInput(array(), array('class' => 'text narrow'));
     $this->widgetSchema['treating_email'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['facility_name'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['facility_phone'] = new widgetFormInputPhone($phone_widget_options, array('class' => 'text narrow'));
     $this->widgetSchema['facility_phone_comment'] = new sfWidgetFormInput(array(), array('class' => 'text narrow'));
     $this->widgetSchema['lodging_name'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['lodging_phone'] = new widgetFormInputPhone($phone_widget_options, array('class' => 'text narrow'));
     $this->widgetSchema['lodging_phone_comment'] = new sfWidgetFormInput(array(), array('class' => 'text narrow'));
     $this->widgetSchema['emergency_name'] = new sfWidgetFormInput(array(), array('class' => 'text'));
     $this->widgetSchema['emergency_phone1'] = new widgetFormInputPhone($phone_widget_options, array('class' => 'text narrow'));
     $this->widgetSchema['emergency_phone1_comment'] = new sfWidgetFormInput(array(), array('class' => 'text narrow'));
     $this->widgetSchema['pass_english'] = new sfWidgetFormInputCheckbox(array(), array('value' => 1));
     $this->widgetSchema['pass_language'] = new sfWidgetFormInput(array(), array('class' => 'text narrow'));
     $this->widgetSchema['pass_oxygen'] = new sfWidgetFormInputCheckbox(array(), array('value' => 1));
     $this->widgetSchema['illness'] = new sfWidgetFormTextarea(array(), array('class' => 'text'));
     $this->widgetSchema['financial'] = new sfWidgetFormTextarea(array(), array('class' => 'text'));
     $this->widgetSchema['pass_medical'] = new sfWidgetFormSelect(array('choices' => $medicals), array('class' => 'text'));
     $this->widgetSchema['referral_source_id'] = new sfWidgetFormSelect(array('choices' => $ref_sources), array('class' => 'text'));
     # Labels
     $this->widgetSchema->setLabels(array('appt_date' => 'Appointment Date*'));
     $this->widgetSchema->setLabels(array('mission_date' => 'Mission Date*'));
     $this->widgetSchema->setLabels(array('return_date' => 'Return Date'));
     $this->widgetSchema->setLabels(array('releasing_physician' => 'Name'));
     $this->widgetSchema->setLabels(array('release_phone' => 'Phone'));
     $this->widgetSchema->setLabels(array('release_phone_comment' => 'Comment'));
     $this->widgetSchema->setLabels(array('release_fax' => 'Fax'));
     $this->widgetSchema->setLabels(array('release_fax_comment' => 'Comment'));
     $this->widgetSchema->setLabels(array('release_email' => 'Email'));
     $this->widgetSchema->setLabels(array('treating_physician' => 'Name'));
     $this->widgetSchema->setLabels(array('treating_phone' => 'Phone'));
     $this->widgetSchema->setLabels(array('treating_phone_comment' => 'Comment'));
     $this->widgetSchema->setLabels(array('treating_fax' => 'Fax'));
     $this->widgetSchema->setLabels(array('treating_fax_comment' => 'Comment'));
     $this->widgetSchema->setLabels(array('treating_email' => 'Email'));
     $this->widgetSchema->setLabels(array('facility_name' => 'Name'));
     $this->widgetSchema->setLabels(array('facility_phone' => 'Phone'));
     $this->widgetSchema->setLabels(array('facility_phone_comment' => 'Comment'));
     $this->widgetSchema->setLabels(array('lodging_name' => 'Lodging Name'));
     $this->widgetSchema->setLabels(array('lodging_phone' => 'Phone'));
     $this->widgetSchema->setLabels(array('lodging_phone_comment' => 'Comment'));
     $this->widgetSchema->setLabels(array('emergency_name' => 'Emergency Name'));
     $this->widgetSchema->setLabels(array('emergency_phone1' => 'Primary Phone'));
     $this->widgetSchema->setLabels(array('emergency_phone1_comment' => 'Comment'));
     $this->widgetSchema->setLabels(array('pass_english' => 'Speak English ?'));
     $this->widgetSchema->setLabels(array('pass_language' => 'Language'));
     $this->widgetSchema->setLabels(array('pass_oxygen' => 'Do the passenger or any of the companions require oxygen on board? '));
     $this->widgetSchema->setLabels(array('pass_medical' => 'Is the flight for medical treatment or a compassionate reason? '));
     $this->widgetSchema->setLabels(array('illness' => 'Illness'));
     $this->widgetSchema->setLabels(array('financial' => 'Financial'));
     $this->widgetSchema->setLabels(array('referral_source_id' => 'How did you hear about Angel Flight?'));
     # Validation
     $this->validatorSchema['appt_date'] = new sfValidatorDate(array('required' => true), array('invalid' => 'Appointment date is invalid !.', 'required' => 'Please confirm appointment date !'));
     $this->validatorSchema['mission_date'] = new sfValidatorDate(array('required' => true), array('invalid' => 'Mission date is invalid !.', 'required' => 'Please confirm mission date !'));
     $this->validatorSchema['return_date'] = new sfValidatorDate(array('required' => false), array('invalid' => 'Return date is invalid !.'));
     $this->validatorSchema['releasing_physician'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['release_phone_comment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['release_fax'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['release_fax_comment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['release_email'] = new sfValidatorEmail(array('required' => false), array('invalid' => 'Invalid release email !'));
     $this->validatorSchema['treating_physician'] = new validatorZipcode(array('required' => false), array('max_length' => 10, 'min_length' => 5));
     $this->validatorSchema['treating_phone'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['treating_phone_comment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['treating_fax'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['treating_fax_comment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['treating_email'] = new sfValidatorEmail(array('required' => false), array('invalid' => 'Invalid treating email !'));
     $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['lodging_name'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['lodging_phone'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['lodging_phone_comment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['emergency_name'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['emergency_phone1'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['emergency_phone1_comment'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['pass_english'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['pass_language'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['pass_oxygen'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['pass_medical'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['illness'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['financial'] = new sfValidatorString(array('required' => false));
     $this->validatorSchema['referral_source_id'] = new sfValidatorString(array('required' => false));
     # Descriptive message
     $this->widgetSchema->setHelp('illness', 'Please describe the passenger\'s illness or compassionate reason for the flight (in layman\'s terms). Include any medical equipment needed on this flight. The weight of all medical treatment must be included in the 50 pound luggage limit per flight.');
     $this->widgetSchema->setHelp('financial', 'Please describe briefly the passenger\'s financial situation that warrants a charitable flight:');
     $this->widgetSchema->setNameFormat('miss_req_temp4[%s]');
 }