/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, false); if ($cid) { // not sure why this is needed :( // also add the cid params to the Menu array CRM_Core_Menu::addParam('cid', $cid); // create menus .. $startWeight = CRM_Core_Menu::getMaxWeight('civicrm/contact/view'); $startWeight++; CRM_Core_BAO_CustomGroup::addMenuTabs(CRM_Contact_BAO_Contact::getContactType($cid), 'civicrm/contact/view/cd', $startWeight); $this->_contactIds = array($cid); $this->_single = true; $smsNumbers = CRM_Contact_BAO_Contact::allPhones($cid, 'Mobile'); $this->_emails = array(); $toName = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $cid, 'display_name'); foreach ($smsNumbers as $number => $item) { $this->_smsNumbers[$number] = '"' . $toName . '" <' . $number . '> ' . $item['locationType']; if ($item['is_primary']) { $this->_smsNumbers[$number] .= ' ' . ts('(preferred)'); } $this->_smsNumbers[$number] = htmlspecialchars($this->_emails[$email]); } } else { parent::preProcess(); } $this->assign('single', $this->_single); }