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


PHP CRM_Case_BAO_Case::deleteCaseContact方法代码示例

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


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

示例1: postProcess

 /** 
  * Function to process the form 
  * 
  * @access public 
  * @return None 
  */
 public function postProcess()
 {
     if ($this->_action & CRM_Core_Action::DELETE) {
         require_once 'CRM/Case/BAO/Case.php';
         CRM_Case_BAO_Case::deleteCase($this->_id);
         CRM_Core_Session::setStatus(ts("Selected Case has been deleted."));
         return;
     }
     // get the submitted form values.
     $params = $this->controller->exportValues($this->_name);
     if ($this->_action & CRM_Core_Action::UPDATE) {
         $params['id'] = $this->_id;
     }
     $params['contact_id'] = $this->_contactID;
     $params['start_date'] = CRM_Utils_Date::format($params['start_date']);
     $params['end_date'] = CRM_Utils_Date::format($params['end_date']);
     $params['case_type_id'] = CRM_Case_BAO_Case::VALUE_SEPERATOR . implode(CRM_Case_BAO_Case::VALUE_SEPERATOR, $params['case_type_id']) . CRM_Case_BAO_Case::VALUE_SEPERATOR;
     $config =& CRM_Core_Config::singleton();
     if ($config->civiHRD) {
         $params['casetag2_id'] = CRM_Case_BAO_Case::VALUE_SEPERATOR . implode(CRM_Case_BAO_Case::VALUE_SEPERATOR, $params['casetag2_id']) . CRM_Case_BAO_Case::VALUE_SEPERATOR;
         $params['casetag3_id'] = CRM_Case_BAO_Case::VALUE_SEPERATOR . implode(CRM_Case_BAO_Case::VALUE_SEPERATOR, $params['casetag3_id']) . CRM_Case_BAO_Case::VALUE_SEPERATOR;
     }
     require_once 'CRM/Case/BAO/Case.php';
     $case = CRM_Case_BAO_Case::create($params);
     CRM_Case_BAO_Case::deleteCaseContact($case->id);
     if (!empty($this->_contactIds) && is_array($this->_contactIds)) {
         foreach ($this->_contactIds as $key => $id) {
             if ($id) {
                 $contactParams = array('case_id' => $case->id, 'contact_id' => $id);
                 CRM_Case_BAO_Case::addCaseToContact($contactParams);
             }
         }
     } else {
         $contactParams = array('case_id' => $case->id, 'contact_id' => $this->_contactID);
         CRM_Case_BAO_Case::addCaseToContact($contactParams);
         foreach ($params['case_contact'] as $key => $id) {
             if ($id) {
                 $contactParams = array('case_id' => $case->id, 'contact_id' => $id);
                 CRM_Case_BAO_Case::addCaseToContact($contactParams);
             }
         }
     }
     // set status message
     CRM_Core_Session::setStatus(ts('Case \'%1\' has been saved.', array(1 => $params['subject'])));
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:51,代码来源:Case.php


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