当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Core_BAO_CustomGroup::addMenuTabs方法代码示例

本文整理汇总了PHP中CRM_Core_BAO_CustomGroup::addMenuTabs方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_CustomGroup::addMenuTabs方法的具体用法?PHP CRM_Core_BAO_CustomGroup::addMenuTabs怎么用?PHP CRM_Core_BAO_CustomGroup::addMenuTabs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Core_BAO_CustomGroup的用法示例。


在下文中一共展示了CRM_Core_BAO_CustomGroup::addMenuTabs方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 /**
  * Run the page.
  *
  * This method is called after the page is created.
  *
  * @return void
  * @access public
  *
  */
 function run()
 {
     // get the callback, module and activity id
     $action = CRM_Utils_Request::retrieve('action', $this, false, 'browse');
     $id = CRM_Utils_Request::retrieve('id', $this);
     $dao =& new CRM_Core_DAO_ActivityHistory();
     $dao->activity_id = $id;
     $dao->activity_type = ts('SMS Sent');
     if ($dao->find(true)) {
         $cid = $dao->entity_id;
     }
     require_once 'CRM/SMS/DAO/History.php';
     $dao =& new CRM_SMS_DAO_History();
     $dao->id = $id;
     if ($dao->find(true)) {
         $this->assign('fromName', CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $dao->contact_id, 'display_name'));
         $this->assign('toName', CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $cid, 'display_name'));
         $this->assign('sentDate', $dao->sent_date);
         $this->assign('message', $dao->message);
         // get the display name and images for the contact
         list($displayName, $contactImage) = CRM_Contact_BAO_Contact::getDisplayAndImage($dao->contact_id);
         CRM_Utils_System::setTitle($contactImage . ' ' . $displayName);
         require_once 'CRM/Utils/Menu.php';
         // also add the cid params to the Menu array
         CRM_Utils_Menu::addParam('cid', $cid);
         // create menus ..
         $startWeight = CRM_Utils_Menu::getMaxWeight('civicrm/contact/view');
         $startWeight++;
         require_once 'CRM/Core/BAO/CustomGroup.php';
         CRM_Core_BAO_CustomGroup::addMenuTabs(CRM_Contact_BAO_Contact::getContactType($cid), 'civicrm/contact/view/cd', $startWeight);
     }
     parent::run();
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:42,代码来源:SMS.php

示例2: preProcess

 /**
  * 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);
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:34,代码来源:SMS.php

示例3: preProcess

 /**
  * build all the data structures needed to build the form
  *
  * @return void
  * @access public
  */
 function preProcess()
 {
     $cid = CRM_Utils_Request::retrieve('cid', $this, false);
     if ($cid) {
         // not sure why this is needed :(
         // also add the cid params to the Menu array
         CRM_Utils_Menu::addParam('cid', $cid);
         // create menus ..
         $startWeight = CRM_Utils_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;
         $emails = CRM_Contact_BAO_Contact::allEmails($cid);
         $this->_emails = array();
         $toName = CRM_Contact_BAO_Contact::displayName($cid);
         foreach ($emails as $email => $item) {
             if (!$email && count($emails) <= 1) {
                 $this->_emails[$email] = '"' . $toName . '"';
                 $this->_noEmails = true;
             } else {
                 if ($email) {
                     $this->_emails[$email] = '"' . $toName . '" <' . $email . '> ' . $item['locationType'];
                 }
             }
             if ($item['is_primary']) {
                 $this->_emails[$email] .= ' ' . ts('(preferred)');
             }
             $this->_emails[$email] = htmlspecialchars($this->_emails[$email]);
         }
     } else {
         parent::preProcess();
     }
     $this->assign('single', $this->_single);
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:41,代码来源:Email.php

示例4: preProcess

 /** 
  * build all the data structures needed to build the form 
  * 
  * @return void 
  * @access public 
  */
 function preProcess()
 {
     $cid = CRM_Utils_Request::retrieve('cid', $this, false);
     if ($cid) {
         // not sure why this is needed :(
         // also add the cid params to the Menu array
         CRM_Utils_Menu::addParam('cid', $cid);
         // create menus ..
         $startWeight = CRM_Utils_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;
         $this->assign('totalSelectedContacts', 1);
     } else {
         parent::preProcess();
     }
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:24,代码来源:Delete.php

示例5: preProcess

 /**
  * Heart of the viewing process. The runner gets all the meta data for
  * the contact and calls the appropriate type of page to view.
  *
  * @return void
  * @access public
  *
  */
 function preProcess()
 {
     $this->_id = CRM_Utils_Request::retrieve('id', $this);
     $this->assign('id', $this->_id);
     $this->_contactId = CRM_Utils_Request::retrieve('cid', $this, true);
     if (!$this->_contactId) {
         CRM_Utils_System::statusBounce(ts('We could not find a contact id.'));
     }
     $this->assign('contactId', $this->_contactId);
     $this->_action = CRM_Utils_Request::retrieve('action', $this, false, 'browse');
     $this->assign('action', $this->_action);
     // check for permissions
     $this->_permission = null;
     if (CRM_Contact_BAO_Contact::permissionedContact($this->_contactId, CRM_CORE_PERMISSION_EDIT)) {
         $this->assign('permission', 'edit');
         $this->_permission = CRM_CORE_PERMISSION_EDIT;
     } else {
         if (CRM_Contact_BAO_Contact::permissionedContact($this->_contactId, CRM_CORE_PERMISSION_VIEW)) {
             $this->assign('permission', 'view');
             $this->_permission = CRM_CORE_PERMISSION_VIEW;
         } else {
             CRM_Utils_System::statusBounce(ts('You do not have the necessary permission to view this contact.'));
         }
     }
     $this->getContactDetails();
     $contactImage = $this->get('contactImage');
     $displayName = $this->get('displayName');
     $this->assign('displayName', $displayName);
     CRM_Utils_System::setTitle($contactImage . ' ' . $displayName);
     CRM_Utils_Recent::add($displayName, CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $this->_contactId), $contactImage, $this->_contactId);
     // also add the cid params to the Menu array
     CRM_Utils_Menu::addParam('cid', $this->_contactId);
     $this->assign('viewForm', $form);
     $this->assign('showBlocks1', $showBlocks);
     $this->assign('hideBlocks1', $hideBlocks);
     $this->assign('groupTree', $_groupTree);
     //------------
     // create menus ..
     $startWeight = CRM_Utils_Menu::getMaxWeight('civicrm/contact/view');
     $startWeight++;
     CRM_Core_BAO_CustomGroup::addMenuTabs(CRM_Contact_BAO_Contact::getContactType($this->_contactId), 'civicrm/contact/view/cd', $startWeight);
     //display OtherActivity link
     $otherAct = CRM_Core_PseudoConstant::activityType(false);
     $activityNum = count($otherAct);
     $this->assign('showOtherActivityLink', $activityNum);
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:54,代码来源:View.php

示例6: run

 /**
  * Run the page.
  *
  * This method is called after the page is created.
  *
  * @return void
  * @access public
  *
  */
 function run()
 {
     // get the callback, module and activity id
     $action = CRM_Utils_Request::retrieve('action', $this, false, 'browse');
     $id = CRM_Utils_Request::retrieve('id', $this);
     $dao =& new CRM_Core_DAO_ActivityHistory();
     $dao->activity_id = $id;
     $dao->activity_type = ts('Email Sent');
     if ($dao->find(true)) {
         $cid = $dao->entity_id;
     }
     $dao =& new CRM_Core_DAO_EmailHistory();
     $dao->id = $id;
     if ($dao->find(true)) {
         // get the display name and email for the contact
         list($toContactName, $toContactEmail, $toDoNotEmail) = CRM_Contact_BAO_Contact::getContactDetails($cid);
         if (!trim($toContactName)) {
             $toContactName = $toContactEmail;
         }
         if (trim($toContactEmail)) {
             $toContactName = "\"{$toContactName}\" <{$toContactEmail}>";
         }
         $this->assign('toName', $toContactName);
         // get the display name and email for the contact
         list($fromContactName, $fromContactEmail, $toDoNotEmail) = CRM_Contact_BAO_Contact::getContactDetails($dao->contact_id);
         if (!trim($fromContactEmail)) {
             CRM_Utils_System::statusBounce(ts('Your user record does not have a valid email address'));
         }
         if (!trim($fromContactName)) {
             $fromContactName = $fromContactEmail;
         }
         $this->assign('fromName', "\"{$fromContactName}\" <{$fromContactEmail}>");
         $this->assign('sentDate', $dao->sent_date);
         $this->assign('subject', $dao->subject);
         $this->assign('message', $dao->message);
         // get the display name and images for the contact
         list($displayName, $contactImage) = CRM_Contact_BAO_Contact::getDisplayAndImage($dao->contact_id);
         CRM_Utils_System::setTitle($contactImage . ' ' . $displayName);
         require_once 'CRM/Utils/Menu.php';
         // also add the cid params to the Menu array
         CRM_Utils_Menu::addParam('cid', $cid);
         // create menus ..
         $startWeight = CRM_Utils_Menu::getMaxWeight('civicrm/contact/view');
         $startWeight++;
         require_once 'CRM/Core/BAO/CustomGroup.php';
         CRM_Core_BAO_CustomGroup::addMenuTabs(CRM_Contact_BAO_Contact::getContactType($cid), 'civicrm/contact/view/cd', $startWeight);
     }
     parent::run();
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:58,代码来源:Email.php


注:本文中的CRM_Core_BAO_CustomGroup::addMenuTabs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。