示例#1
0
 /**
  * Call preprocess.
  */
 public function preProcess()
 {
     parent::preProcess();
     $this->_locBlockNo = CRM_Utils_Request::retrieve('locno', 'Positive', $this, TRUE, NULL, $_REQUEST);
     $this->assign('blockId', $this->_locBlockNo);
     $addressSequence = CRM_Core_BAO_Address::addressSequence();
     $this->assign('addressSequence', $addressSequence);
     $this->_values = array();
     $this->_addressId = CRM_Utils_Request::retrieve('aid', 'Positive', $this, FALSE, NULL, $_REQUEST);
     $this->_action = CRM_Core_Action::ADD;
     if ($this->_addressId) {
         $params = array('id' => $this->_addressId);
         $address = CRM_Core_BAO_Address::getValues($params, FALSE, 'id');
         $this->_values['address'][$this->_locBlockNo] = array_pop($address);
         $this->_action = CRM_Core_Action::UPDATE;
     } else {
         $this->_addressId = 0;
     }
     $this->assign('action', $this->_action);
     $this->assign('addressId', $this->_addressId);
     // parse street address, CRM-5450
     $this->_parseStreetAddress = $this->get('parseStreetAddress');
     if (!isset($this->_parseStreetAddress)) {
         $addressOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'address_options');
         $this->_parseStreetAddress = FALSE;
         if (!empty($addressOptions['street_address']) && !empty($addressOptions['street_address_parsing'])) {
             $this->_parseStreetAddress = TRUE;
         }
         $this->set('parseStreetAddress', $this->_parseStreetAddress);
     }
     $this->assign('parseStreetAddress', $this->_parseStreetAddress);
 }
示例#2
0
文件: OpenID.php 项目: kidaa30/yes
 /**
  * Call preprocess.
  */
 public function preProcess()
 {
     parent::preProcess();
     //get all the existing openids
     $openid = new CRM_Core_BAO_OpenID();
     $openid->contact_id = $this->_contactId;
     $this->_openids = CRM_Core_BAO_Block::retrieveBlock($openid, NULL);
 }
示例#3
0
文件: IM.php 项目: hguru/224Civi
 /**
  * call preprocess
  */
 public function preProcess()
 {
     parent::preProcess();
     //get all the existing ims
     $im = new CRM_Core_BAO_IM();
     $im->contact_id = $this->_contactId;
     $this->_ims = CRM_Core_BAO_Block::retrieveBlock($im, NULL);
 }
示例#4
0
 /**
  * call preprocess
  */
 public function preProcess()
 {
     parent::preProcess();
     //get all the existing phones
     $phone = new CRM_Core_BAO_Phone();
     $phone->contact_id = $this->_contactId;
     $this->_phones = CRM_Core_BAO_Block::retrieveBlock($phone, NULL);
 }
示例#5
0
 /**
  * call preprocess
  */
 public function preProcess()
 {
     parent::preProcess();
     //get all the existing websites
     $params = array('contact_id' => $this->_contactId);
     $values = array();
     $this->_websites = CRM_Core_BAO_Website::getValues($params, $values);
 }
示例#6
0
 /**
  * call preprocess
  */
 public function preProcess()
 {
     parent::preProcess();
     //get all the existing email addresses
     $email = new CRM_Core_BAO_Email();
     $email->contact_id = $this->_contactId;
     $this->_emails = CRM_Core_BAO_Block::retrieveBlock($email, NULL);
 }
 /**
  * Call preprocess.
  */
 public function preProcess()
 {
     parent::preProcess();
     $this->_groupID = CRM_Utils_Request::retrieve('groupID', 'Positive', $this, TRUE, NULL, $_REQUEST);
     $this->assign('customGroupId', $this->_groupID);
     $customRecId = CRM_Utils_Request::retrieve('customRecId', 'Positive', $this, FALSE, 1, $_REQUEST);
     $cgcount = CRM_Utils_Request::retrieve('cgcount', 'Positive', $this, FALSE, 1, $_REQUEST);
     $subType = CRM_Contact_BAO_Contact::getContactSubType($this->_contactId, ',');
     CRM_Custom_Form_CustomData::preProcess($this, NULL, $subType, $cgcount, $this->_contactType, $this->_contactId);
 }
示例#8
0
 /**
  * Call preprocess.
  */
 public function preProcess()
 {
     parent::preProcess();
     //get all the existing email addresses
     $email = new CRM_Core_BAO_Email();
     $email->contact_id = $this->_contactId;
     $this->_emails = CRM_Core_BAO_Block::retrieveBlock($email, NULL);
     // Check if this contact has a first/last/organization/household name
     if ($this->_contactType == 'Individual') {
         $this->contactHasName = (bool) (CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactId, 'last_name') || CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactId, 'first_name'));
     } else {
         $this->contactHasName = (bool) CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactId, strtolower($this->_contactType) . '_name');
     }
 }