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


PHP Audit::run方法代码示例

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


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

示例1: printCaseReport


//.........这里部分代码省略.........
     require_once 'CRM/Case/BAO/Case.php';
     $caseRelationships = CRM_Case_BAO_Case::getCaseRoles($clientID, $caseID);
     $caseType = CRM_Case_BAO_Case::getCaseType($caseID, 'name');
     require_once 'CRM/Case/XMLProcessor/Process.php';
     $xmlProcessor = new CRM_Case_XMLProcessor_Process();
     $caseRoles = $xmlProcessor->get($caseType, 'CaseRoles');
     foreach ($caseRelationships as $key => &$value) {
         if (CRM_Utils_Array::value($value['relation_type'], $caseRoles)) {
             unset($caseRoles[$value['relation_type']]);
         }
         if ($isRedact) {
             if (!array_key_exists($value['name'], $report->_redactionStringRules)) {
                 $report->_redactionStringRules = CRM_Utils_Array::crmArrayMerge($report->_redactionStringRules, array($value['name'] => 'name_' . rand(10000, 100000)));
             }
             $value['name'] = self::redact($value['name'], true, $report->_redactionStringRules);
             if (CRM_Utils_Array::value('email', $value) && !array_key_exists($value['email'], $report->_redactionStringRules)) {
                 $report->_redactionStringRules = CRM_Utils_Array::crmArrayMerge($report->_redactionStringRules, array($value['email'] => 'email_' . rand(10000, 100000)));
             }
             $value['email'] = self::redact($value['email'], true, $report->_redactionStringRules);
             if (CRM_Utils_Array::value('phone', $value) && !array_key_exists($value['phone'], $report->_redactionStringRules)) {
                 $report->_redactionStringRules = CRM_Utils_Array::crmArrayMerge($report->_redactionStringRules, array($value['phone'] => 'phone_' . rand(10000, 100000)));
             }
             $value['phone'] = self::redact($value['phone'], true, $report->_redactionStringRules);
         }
     }
     $caseRoles['client'] = CRM_Case_BAO_Case::getContactNames($caseID);
     if ($isRedact) {
         if (!array_key_exists($caseRoles['client']['sort_name'], $report->_redactionStringRules)) {
             $report->_redactionStringRules = CRM_Utils_Array::crmArrayMerge($report->_redactionStringRules, array($caseRoles['client']['sort_name'] => 'name_' . rand(10000, 100000)));
         }
         if (!array_key_exists($caseRoles['client']['display_name'], $report->_redactionStringRules)) {
             $report->_redactionStringRules[$caseRoles['client']['display_name']] = $report->_redactionStringRules[$caseRoles['client']['sort_name']];
         }
         $caseRoles['client']['sort_name'] = self::redact($caseRoles['client']['sort_name'], true, $report->_redactionStringRules);
         if (CRM_Utils_Array::value('email', $caseRoles['client']) && !array_key_exists($caseRoles['client']['email'], $report->_redactionStringRules)) {
             $report->_redactionStringRules = CRM_Utils_Array::crmArrayMerge($report->_redactionStringRules, array($caseRoles['client']['email'] => 'email_' . rand(10000, 100000)));
         }
         $caseRoles['client']['email'] = self::redact($caseRoles['client']['email'], true, $report->_redactionStringRules);
         if (CRM_Utils_Array::value('phone', $caseRoles['client']) && !array_key_exists($caseRoles['client']['phone'], $report->_redactionStringRules)) {
             $report->_redactionStringRules = CRM_Utils_Array::crmArrayMerge($report->_redactionStringRules, array($caseRoles['client']['phone'] => 'phone_' . rand(10000, 100000)));
         }
         $caseRoles['client']['phone'] = self::redact($caseRoles['client']['phone'], true, $report->_redactionStringRules);
     }
     // Retrieve ALL client relationships
     require_once 'CRM/Contact/BAO/Relationship.php';
     $relClient = CRM_Contact_BAO_Relationship::getRelationship($clientID, CRM_Contact_BAO_Relationship::CURRENT, 0, 0, 0, null, null, false);
     foreach ($relClient as $r) {
         if ($isRedact) {
             if (!array_key_exists($r['name'], $report->_redactionStringRules)) {
                 $report->_redactionStringRules = CRM_Utils_Array::crmArrayMerge($report->_redactionStringRules, array($r['name'] => 'name_' . rand(10000, 100000)));
             }
             if (!array_key_exists($r['display_name'], $report->_redactionStringRules)) {
                 $report->_redactionStringRules[$r['display_name']] = $report->_redactionStringRules[$r['name']];
             }
             $r['name'] = self::redact($r['name'], true, $report->_redactionStringRules);
             if (CRM_Utils_Array::value('phone', $r) && !array_key_exists($r['phone'], $report->_redactionStringRules)) {
                 $report->_redactionStringRules = CRM_Utils_Array::crmArrayMerge($report->_redactionStringRules, array($r['phone'] => 'phone_' . rand(10000, 100000)));
             }
             $r['phone'] = self::redact($r['phone'], true, $report->_redactionStringRules);
             if (CRM_Utils_Array::value('email', $r) && !array_key_exists($r['email'], $report->_redactionStringRules)) {
                 $report->_redactionStringRules = CRM_Utils_Array::crmArrayMerge($report->_redactionStringRules, array($r['email'] => 'email_' . rand(10000, 100000)));
             }
             $r['email'] = self::redact($r['email'], true, $report->_redactionStringRules);
         }
         if (!array_key_exists($r['id'], $caseRelationships)) {
             $otherRelationships[] = $r;
         }
     }
     // Now global contact list that appears on all cases.
     $relGlobal = CRM_Case_BAO_Case::getGlobalContacts($globalGroupInfo);
     foreach ($relGlobal as &$r) {
         if ($isRedact) {
             if (!array_key_exists($r['sort_name'], $report->_redactionStringRules)) {
                 $report->_redactionStringRules = CRM_Utils_Array::crmArrayMerge($report->_redactionStringRules, array($r['sort_name'] => 'name_' . rand(10000, 100000)));
             }
             if (!array_key_exists($r['display_name'], $report->_redactionStringRules)) {
                 $report->_redactionStringRules[$r['display_name']] = $report->_redactionStringRules[$r['sort_name']];
             }
             $r['sort_name'] = self::redact($r['sort_name'], true, $report->_redactionStringRules);
             if (CRM_Utils_Array::value('phone', $r) && !array_key_exists($r['phone'], $report->_redactionStringRules)) {
                 $report->_redactionStringRules = CRM_Utils_Array::crmArrayMerge($report->_redactionStringRules, array($r['phone'] => 'phone_' . rand(10000, 100000)));
             }
             $r['phone'] = self::redact($r['phone'], true, $report->_redactionStringRules);
             if (CRM_Utils_Array::value('email', $r) && !array_key_exists($r['email'], $report->_redactionStringRules)) {
                 $report->_redactionStringRules = CRM_Utils_Array::crmArrayMerge($report->_redactionStringRules, array($r['email'] => 'email_' . rand(10000, 100000)));
             }
             $r['email'] = self::redact($r['email'], true, $report->_redactionStringRules);
         }
     }
     $template->assign('caseRelationships', $caseRelationships);
     $template->assign('caseRoles', $caseRoles);
     $template->assign('otherRelationships', $otherRelationships);
     $template->assign('globalRelationships', $relGlobal);
     $template->assign('globalGroupInfo', $globalGroupInfo);
     $contents = self::getCaseReport($clientID, $caseID, $activitySetName, $params, $report);
     require_once 'CRM/Case/Audit/Audit.php';
     $printReport = Audit::run($contents, $clientID, $caseID, true);
     echo $printReport;
     CRM_Utils_System::civiExit();
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:101,代码来源:Report.php


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