• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CRM_Report_Utils_Report类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ifnull

 public static function &info($ovID = null, &$title = null)
 {
     $report = '';
     if ($ovID) {
         $report = " AND v.id = {$ovID} ";
     }
     $sql = "\n        SELECT inst.id, inst.title, inst.report_id, inst.description, v.label, \n               ifnull( SUBSTRING(comp.name, 5), 'Contact' ) as compName\n          FROM civicrm_option_group g\n          LEFT JOIN civicrm_option_value v\n                 ON v.option_group_id = g.id AND\n                    g.name  = 'report_template'\n          LEFT JOIN civicrm_report_instance inst\n                 ON v.value = inst.report_id\n          LEFT JOIN civicrm_component comp \n                 ON v.component_id = comp.id\n            \n         WHERE v.is_active = 1 {$report}\n\n         ORDER BY v.weight\n        ";
     $dao = CRM_Core_DAO::executeQuery($sql);
     $config = CRM_Core_Config::singleton();
     $rows = array();
     $url = 'civicrm/report/instance';
     while ($dao->fetch()) {
         $enabled = in_array("Civi{$dao->compName}", $config->enableComponents);
         if ($dao->compName == 'Contact') {
             $enabled = true;
         }
         //filter report listings by permissions
         if (!($enabled && CRM_Report_Utils_Report::isInstancePermissioned($dao->id))) {
             continue;
         }
         if (trim($dao->title)) {
             if ($ovID) {
                 $title = ts("Report(s) created from the template: %1", array(1 => $dao->label));
             }
             $rows[$dao->compName][$dao->id]['title'] = $dao->title;
             $rows[$dao->compName][$dao->id]['label'] = $dao->label;
             $rows[$dao->compName][$dao->id]['description'] = $dao->description;
             $rows[$dao->compName][$dao->id]['url'] = CRM_Utils_System::url("{$url}/{$dao->id}", "reset=1");
             if (CRM_Core_Permission::check('administer Reports')) {
                 $rows[$dao->compName][$dao->id]['deleteUrl'] = CRM_Utils_System::url("{$url}/{$dao->id}", 'action=delete&reset=1');
             }
         }
     }
     return $rows;
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:35,代码来源:InstanceList.php


示例2: run

 /**
  * run this page (figure out the action needed and perform it).
  *
  * @return void
  */
 function run()
 {
     $instanceId = CRM_Report_Utils_Report::getInstanceID();
     $action = CRM_Utils_Request::retrieve('action', 'String', $this);
     $optionVal = CRM_Report_Utils_Report::getValueFromUrl($instanceId);
     $reportUrl = CRM_Utils_System::url('civicrm/report/list', "reset=1");
     if ($action & CRM_Core_Action::DELETE) {
         if (!CRM_Core_Permission::check('administer Reports')) {
             $statusMessage = ts('Your do not have permission to Delete Report.');
             CRM_Core_Error::statusBounce($statusMessage, $reportUrl);
         }
         CRM_Report_BAO_Instance::delete($instanceId);
         CRM_Core_Session::setStatus(ts('Selected Instance has been deleted.'));
     } else {
         require_once 'CRM/Core/OptionGroup.php';
         $templateInfo = CRM_Core_OptionGroup::getRowValues('report_template', "{$optionVal}", 'value');
         if (strstr($templateInfo['name'], '_Form')) {
             $instanceInfo = array();
             CRM_Report_BAO_Instance::retrieve(array('id' => $instanceId), $instanceInfo);
             if (!empty($instanceInfo['title'])) {
                 CRM_Utils_System::setTitle($instanceInfo['title']);
                 $this->assign('reportTitle', $instanceInfo['title']);
             } else {
                 CRM_Utils_System::setTitle($templateInfo['label']);
                 $this->assign('reportTitle', $templateInfo['label']);
             }
             $wrapper =& new CRM_Utils_Wrapper();
             return $wrapper->run($templateInfo['name'], null, null);
         }
         CRM_Core_Session::setStatus(ts('Could not find template for the instance.'));
     }
     return CRM_Utils_System::redirect($reportUrl);
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:38,代码来源:Instance.php


示例3: buildRows

 function buildRows($sql, &$rows)
 {
     // safeguard for when there aren’t any log entries yet
     if (!$this->log_conn_id or !$this->log_date) {
         return;
     }
     $params = array(1 => array($this->log_conn_id, 'Integer'), 2 => array($this->log_date, 'String'));
     // let the template know who updated whom when
     $sql = "\n            SELECT who.id who_id, who.display_name who_name, whom.id whom_id, whom.display_name whom_name, l.is_deleted\n            FROM `{$this->loggingDB}`.log_civicrm_contact l\n            JOIN civicrm_contact who ON (l.log_user_id = who.id)\n            JOIN civicrm_contact whom ON (l.id = whom.id)\n            WHERE log_action = 'Update' AND log_conn_id = %1 AND log_date = %2 ORDER BY log_date DESC LIMIT 1\n        ";
     $dao =& CRM_Core_DAO::executeQuery($sql, $params);
     $dao->fetch();
     $this->assign('who_url', CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$dao->who_id}"));
     $this->assign('whom_url', CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$dao->whom_id}"));
     $this->assign('who_name', $dao->who_name);
     $this->assign('whom_name', $dao->whom_name);
     $this->assign('log_date', $this->log_date);
     // link back to summary report
     require_once 'CRM/Report/Utils/Report.php';
     $this->assign('summaryReportURL', CRM_Report_Utils_Report::getNextUrl('logging/contact/summary', 'reset=1', false, true));
     $rows = $this->diffsInTable('log_civicrm_contact');
     // add custom data changes
     $dao = CRM_Core_DAO::executeQuery("SHOW TABLES FROM `{$this->loggingDB}` LIKE 'log_civicrm_value_%'");
     while ($dao->fetch()) {
         $table = $dao->toValue("Tables_in_{$this->loggingDB}_(log_civicrm_value_%)");
         $rows = array_merge($rows, $this->diffsInTable($table));
     }
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:27,代码来源:LoggingDetail.php


示例4: run

 /**
  * run this page (figure out the action needed and perform it).
  *
  * @return void
  */
 function run()
 {
     if (!CRM_Core_Permission::check('administer Reports')) {
         return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/report/list', 'reset=1'));
     }
     $optionVal = CRM_Report_Utils_Report::getValueFromUrl();
     $templateInfo = CRM_Core_OptionGroup::getRowValues('report_template', "{$optionVal}", 'value', 'String', FALSE);
     $extKey = strpos(CRM_Utils_Array::value('name', $templateInfo), '.');
     $reportClass = NULL;
     if ($extKey !== FALSE) {
         $ext = CRM_Extension_System::singleton()->getMapper();
         $reportClass = $ext->keyToClass($templateInfo['name'], 'report');
         $templateInfo['name'] = $reportClass;
     }
     if (strstr(CRM_Utils_Array::value('name', $templateInfo), '_Form') || !is_null($reportClass)) {
         CRM_Utils_System::setTitle($templateInfo['label'] . ' - Template');
         $this->assign('reportTitle', $templateInfo['label']);
         $session = CRM_Core_Session::singleton();
         $session->set('reportDescription', $templateInfo['description']);
         $wrapper = new CRM_Utils_Wrapper();
         return $wrapper->run($templateInfo['name'], NULL, NULL);
     }
     if ($optionVal) {
         CRM_Core_Session::setStatus(ts('Could not find the report template. Make sure the report template is registered and / or url is correct.'), ts('Template Not Found'), 'error');
     }
     return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/report/list', 'reset=1'));
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:32,代码来源:Report.php


示例5: alterDisplay

 function alterDisplay(&$rows)
 {
     // cache for id → is_deleted mapping
     $isDeleted = array();
     foreach ($rows as &$row) {
         if (!isset($isDeleted[$row['log_civicrm_contact_id']])) {
             $isDeleted[$row['log_civicrm_contact_id']] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $row['log_civicrm_contact_id'], 'is_deleted') !== '0';
         }
         if (!$isDeleted[$row['log_civicrm_contact_id']]) {
             $row['log_civicrm_contact_altered_contact_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_contact_id']);
             $row['log_civicrm_contact_altered_contact_hover'] = ts("Go to contact summary");
         }
         $row['civicrm_contact_altered_by_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_contact_log_user_id']);
         $row['civicrm_contact_altered_by_hover'] = ts("Go to contact summary");
         if ($row['log_civicrm_contact_is_deleted'] and $row['log_civicrm_contact_log_action'] == 'Update') {
             $row['log_civicrm_contact_log_action'] = ts('Delete (to trash)');
         }
         if ($row['log_civicrm_contact_log_action'] == 'Update') {
             $q = "reset=1&log_conn_id={$row['log_civicrm_contact_log_conn_id']}&log_date={$row['log_civicrm_contact_log_date']}";
             $url = CRM_Report_Utils_Report::getNextUrl('logging/contact/detail', $q, false, true);
             $row['log_civicrm_contact_log_action_link'] = $url;
             $row['log_civicrm_contact_log_action_hover'] = ts("View details for this update");
             $row['log_civicrm_contact_log_action'] = '<div class="icon details-icon"></div> ' . ts('Update');
         }
         unset($row['log_civicrm_contact_log_user_id']);
         unset($row['log_civicrm_contact_log_conn_id']);
     }
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:28,代码来源:LoggingSummary.php


示例6: alterDisplay

 /**
  * Alter display of rows.
  *
  * Iterate through the rows retrieved via SQL and make changes for display purposes,
  * such as rendering contacts as links.
  *
  * @param array $rows
  *   Rows generated by SQL, with an array for each row.
  */
 public function alterDisplay(&$rows)
 {
     // cache for id → is_deleted mapping
     $isDeleted = array();
     foreach ($rows as &$row) {
         if (!isset($isDeleted[$row['civicrm_contact_is_deleted']])) {
             $isDeleted[$row['civicrm_contact_is_deleted']] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $row['civicrm_contact_altered_contact_id'], 'is_deleted') !== '0';
         }
         if (!$isDeleted[$row['civicrm_contact_is_deleted']]) {
             $row['civicrm_contact_altered_contact_display_name_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_contribution_contact_id']);
             $row['civicrm_contact_altered_contact_display_name_hover'] = ts('Go to contact summary');
         }
         $row['civicrm_contact_altered_by_display_name_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_contribution_log_user_id']);
         $row['civicrm_contact_altered_by_display_name_hover'] = ts('Go to contact summary');
         if ($row['civicrm_contact_altered_contact_is_deleted'] and $row['log_civicrm_contribution_log_action'] == 'Update') {
             $row['log_civicrm_contribution_log_action'] = ts('Delete');
         }
         if ($row['log_civicrm_contribution_log_action'] == 'Update') {
             $q = "reset=1&log_conn_id={$row['log_civicrm_contribution_log_conn_id']}&log_date={$row['log_civicrm_contribution_log_date']}";
             if ($this->cid) {
                 $q .= '&cid=' . $this->cid;
             }
             $url = CRM_Report_Utils_Report::getNextUrl('logging/contribute/detail', $q, FALSE, TRUE);
             $row['log_civicrm_contribution_log_action_link'] = $url;
             $row['log_civicrm_contribution_log_action_hover'] = ts('View details for this update');
             $row['log_civicrm_contribution_log_action'] = '<div class="icon ui-icon-zoomin"></div> ' . ts('Update');
         }
         unset($row['log_civicrm_contribute_log_user_id']);
         unset($row['log_civicrm_contribute_log_conn_id']);
     }
 }
开发者ID:nganivet,项目名称:civicrm-core,代码行数:40,代码来源:LoggingSummary.php


示例7: run

 /**
  * Run this page (figure out the action needed and perform it).
  */
 public function run()
 {
     $instanceId = CRM_Report_Utils_Report::getInstanceID();
     if (!$instanceId) {
         $instanceId = CRM_Report_Utils_Report::getInstanceIDForPath();
     }
     if (is_numeric($instanceId)) {
         $instanceURL = CRM_Utils_System::url("civicrm/report/instance/{$instanceId}", 'reset=1');
         CRM_Core_Session::singleton()->replaceUserContext($instanceURL);
     }
     $action = CRM_Utils_Request::retrieve('action', 'String', $this);
     $optionVal = CRM_Report_Utils_Report::getValueFromUrl($instanceId);
     $reportUrl = CRM_Utils_System::url('civicrm/report/list', "reset=1");
     if ($action & CRM_Core_Action::DELETE) {
         if (!CRM_Core_Permission::check('administer Reports')) {
             $statusMessage = ts('You do not have permission to Delete Report.');
             CRM_Core_Error::statusBounce($statusMessage, $reportUrl);
         }
         $navId = CRM_Core_DAO::getFieldValue('CRM_Report_DAO_ReportInstance', $instanceId, 'navigation_id', 'id');
         CRM_Report_BAO_ReportInstance::del($instanceId);
         //delete navigation if exists
         if ($navId) {
             CRM_Core_BAO_Navigation::processDelete($navId);
             CRM_Core_BAO_Navigation::resetNavigation();
         }
         CRM_Core_Session::setStatus(ts('Selected report has been deleted.'), ts('Deleted'), 'success');
     } else {
         $templateInfo = CRM_Core_OptionGroup::getRowValues('report_template', "{$optionVal}", 'value');
         if (empty($templateInfo)) {
             CRM_Core_Error::statusBounce('You have tried to access a report that does not exist.');
         }
         $extKey = strpos($templateInfo['name'], '.');
         $reportClass = NULL;
         if ($extKey !== FALSE) {
             $ext = CRM_Extension_System::singleton()->getMapper();
             $reportClass = $ext->keyToClass($templateInfo['name'], 'report');
             $templateInfo['name'] = $reportClass;
         }
         if (strstr($templateInfo['name'], '_Form') || !is_null($reportClass)) {
             $instanceInfo = array();
             CRM_Report_BAO_ReportInstance::retrieve(array('id' => $instanceId), $instanceInfo);
             if (!empty($instanceInfo['title'])) {
                 CRM_Utils_System::setTitle($instanceInfo['title']);
                 $this->assign('reportTitle', $instanceInfo['title']);
             } else {
                 CRM_Utils_System::setTitle($templateInfo['label']);
                 $this->assign('reportTitle', $templateInfo['label']);
             }
             $wrapper = new CRM_Utils_Wrapper();
             return $wrapper->run($templateInfo['name'], NULL, NULL);
         }
         CRM_Core_Session::setStatus(ts('Could not find template for the instance.'), ts('Template Not Found'), 'error');
     }
     return CRM_Utils_System::redirect($reportUrl);
 }
开发者ID:saurabhbatra96,项目名称:civicrm-core,代码行数:58,代码来源:Instance.php


示例8: buildQuickForm

 function buildQuickForm()
 {
     parent::buildQuickForm();
     if ($this->cid) {
         // link back to contact summary
         $this->assign('backURL', CRM_Utils_System::url('civicrm/contact/view', "reset=1&selectedChild=log&cid={$this->cid}", FALSE, NULL, FALSE));
         $this->assign('revertURL', self::$_template->get_template_vars('revertURL') . "&cid={$this->cid}");
     } else {
         // link back to summary report
         $this->assign('backURL', CRM_Report_Utils_Report::getNextUrl('logging/contact/summary', 'reset=1', FALSE, TRUE));
     }
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:12,代码来源:LoggingDetail.php


示例9: registerScripts

 static function registerScripts()
 {
     static $loaded = FALSE;
     if ($loaded) {
         return;
     }
     $loaded = TRUE;
     CRM_Core_Resources::singleton()->addSettingsFactory(function () {
         $config = CRM_Core_Config::singleton();
         return array('PseudoConstant' => array('locationType' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'), 'job_hours_time' => CRM_Hrjobcontract_Page_JobContractTab::getJobHoursTime(), 'working_days' => CRM_Hrjobcontract_Page_JobContractTab::getDaysPerTime()), 'FieldOptions' => CRM_Hrjobcontract_Page_JobContractTab::getFieldOptions(), 'jobContractTabApp' => array('contactId' => CRM_Utils_Request::retrieve('cid', 'Integer'), 'domainId' => CRM_Core_Config::domainID(), 'isLogEnabled' => (bool) $config->logging, 'loggingReportId' => CRM_Report_Utils_Report::getInstanceIDForValue('logging/contact/summary'), 'currencies' => CRM_Hrjobcontract_Page_JobContractTab::getCurrencyFormats(), 'defaultCurrency' => $config->defaultCurrency, 'path' => CRM_Core_Resources::singleton()->getUrl('org.civicrm.hrjobcontract'), 'fields' => CRM_Hrjobcontract_Page_JobContractTab::getFields(), 'contractList' => CRM_Hrjobcontract_Page_JobContractTab::getContractList(), 'maxFileSize' => file_upload_max_size()), 'debug' => $config->debug);
     });
 }
开发者ID:JoeMurray,项目名称:civihr,代码行数:12,代码来源:JobContractTab.php


示例10: hrvisa_civicrm_buildProfile

/**
 * Implementation of hook_civicrm_buildProfile
 */
function hrvisa_civicrm_buildProfile($name)
{
    if ($name == 'hrvisa_tab') {
        // To fix validation alert issue
        $smarty = CRM_Core_Smarty::singleton();
        $smarty->assign('urlIsPublic', FALSE);
        $contactID = CRM_Utils_Request::retrieve('id', 'Positive', $this);
        $config = CRM_Core_Config::singleton();
        if ($config->logging && 'multiProfileDialog' !== CRM_Utils_Request::retrieve('context', 'String', CRM_Core_DAO::$_nullObject)) {
            CRM_Core_Region::instance('profile-form-hrvisa_tab')->add(array('template' => 'CRM/common/logButton.tpl', 'instance_id' => CRM_Report_Utils_Report::getInstanceIDForValue('logging/contact/summary'), 'css_class' => 'hrvisa-revision-link', 'table_name' => CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', 'Immigration', 'table_name', 'name'), 'contact_id' => $contactID, 'weight' => -2));
        }
    }
}
开发者ID:JoeMurray,项目名称:civihr,代码行数:16,代码来源:hrvisa.php


示例11: run

 /**
  * run this page (figure out the action needed and perform it).
  *
  * @return void
  */
 function run()
 {
     $instanceId = CRM_Report_Utils_Report::getInstanceID();
     if (!$instanceId) {
         $instanceId = CRM_Report_Utils_Report::getInstanceIDForPath();
     }
     $action = CRM_Utils_Request::retrieve('action', 'String', $this);
     $optionVal = CRM_Report_Utils_Report::getValueFromUrl($instanceId);
     $reportUrl = CRM_Utils_System::url('civicrm/report/list', "reset=1");
     if ($action & CRM_Core_Action::DELETE) {
         if (!CRM_Core_Permission::check('administer Reports')) {
             $statusMessage = ts('Your do not have permission to Delete Report.');
             CRM_Core_Error::statusBounce($statusMessage, $reportUrl);
         }
         $navId = CRM_Core_DAO::getFieldValue('CRM_Report_DAO_Instance', $instanceId, 'navigation_id', 'id');
         CRM_Report_BAO_Instance::delete($instanceId);
         //delete navigation if exists
         if ($navId) {
             require_once 'CRM/Core/BAO/Navigation.php';
             CRM_Core_BAO_Navigation::processDelete($navId);
             CRM_Core_BAO_Navigation::resetNavigation();
         }
         CRM_Core_Session::setStatus(ts('Selected Instance has been deleted.'));
     } else {
         require_once 'CRM/Core/OptionGroup.php';
         $templateInfo = CRM_Core_OptionGroup::getRowValues('report_template', "{$optionVal}", 'value');
         $extKey = strpos($templateInfo['name'], '.');
         $reportClass = null;
         if ($extKey !== FALSE) {
             require_once 'CRM/Core/Extensions.php';
             $ext = new CRM_Core_Extensions();
             $reportClass = $ext->keyToClass($templateInfo['name'], 'report');
             $templateInfo['name'] = $reportClass;
         }
         if (strstr($templateInfo['name'], '_Form') || !is_null($reportClass)) {
             $instanceInfo = array();
             CRM_Report_BAO_Instance::retrieve(array('id' => $instanceId), $instanceInfo);
             if (!empty($instanceInfo['title'])) {
                 CRM_Utils_System::setTitle($instanceInfo['title']);
                 $this->assign('reportTitle', $instanceInfo['title']);
             } else {
                 CRM_Utils_System::setTitle($templateInfo['label']);
                 $this->assign('reportTitle', $templateInfo['label']);
             }
             $wrapper = new CRM_Utils_Wrapper();
             return $wrapper->run($templateInfo['name'], null, null);
         }
         CRM_Core_Session::setStatus(ts('Could not find template for the instance.'));
     }
     return CRM_Utils_System::redirect($reportUrl);
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:56,代码来源:Instance.php


示例12: civicrm_api3_nrm_processcounselor

/**
 * YoteUp ProcessCounselor API
 *
 * @return array API result descriptor
 * @see civicrm_api3_create_success
 * @see civicrm_api3_create_error
 * @throws API_Exception
 */
function civicrm_api3_nrm_processcounselor($params)
{
    // Get list of counselors
    $counsellorCount = civicrm_api3('Contact', 'getCount', array('contact_sub_type' => 'Counselors'));
    $counselorParams = array('contact_sub_type' => 'Counselors', 'return.email' => 1, 'return.custom_' . TERRITORY_COUNSELOR => 1, 'rowCount' => $counsellorCount);
    $counselors = civicrm_api3('Contact', 'get', $counselorParams);
    $ind = array();
    $is_error = 0;
    $messages = array("Report Mail Triggered...");
    if ($counselors['count'] >= 1) {
        $counselors = $counselors['values'];
        foreach ($counselors as $key => $value) {
            if (!empty($value['custom_' . TERRITORY_COUNSELOR])) {
                $ind[$key]['contact_id'] = $value['contact_id'];
                $ind[$key]['email'] = $value['email'];
            }
        }
        // Now email
        $instanceId = CRM_Utils_Array::value('instanceId', $params);
        $_REQUEST['instanceId'] = $instanceId;
        $_REQUEST['sendmail'] = CRM_Utils_Array::value('sendmail', $params, 1);
        // if cron is run from terminal --output is reserved, and therefore we would provide another name 'format'
        $_REQUEST['output'] = CRM_Utils_Array::value('format', $params, CRM_Utils_Array::value('output', $params, 'pdf'));
        $_REQUEST['reset'] = CRM_Utils_Array::value('reset', $params, 1);
        $optionVal = CRM_Report_Utils_Report::getValueFromUrl($instanceId);
        $templateInfo = CRM_Core_OptionGroup::getRowValues('report_template', $optionVal, 'value');
        if (strstr(CRM_Utils_Array::value('name', $templateInfo), '_Form')) {
            $obj = new CRM_Report_Page_Instance();
            $instanceInfo = array();
            CRM_Report_BAO_ReportInstance::retrieve(array('id' => $instanceId), $instanceInfo);
            if (!empty($instanceInfo['title'])) {
                $obj->assign('reportTitle', $instanceInfo['title']);
            } else {
                $obj->assign('reportTitle', $templateInfo['label']);
            }
            foreach ($ind as $key => $value) {
                $_REQUEST['email_to_send'] = $value['email'];
                $_GET['counsellor_id_value'] = $value['contact_id'];
                $wrapper = new CRM_Utils_Wrapper();
                $arguments = array('urlToSession' => array(array('urlVar' => 'instanceId', 'type' => 'Positive', 'sessionVar' => 'instanceId', 'default' => 'null')), 'ignoreKey' => TRUE);
                $messages[] = $wrapper->run($templateInfo['name'], NULL, $arguments);
            }
        }
    }
    if ($is_error == 0) {
        return civicrm_api3_create_success();
    } else {
        return civicrm_api3_create_error($messages);
    }
}
开发者ID:JMAConsulting,项目名称:biz.jmaconsulting.nrm,代码行数:58,代码来源:Processcounselor.php


示例13: alterDisplay

 function alterDisplay(&$rows)
 {
     // cache for id → is_deleted mapping
     $isDeleted = array();
     $newRows = array();
     foreach ($rows as $key => &$row) {
         if (!isset($isDeleted[$row['log_civicrm_entity_altered_contact_id']])) {
             $isDeleted[$row['log_civicrm_entity_altered_contact_id']] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $row['log_civicrm_entity_altered_contact_id'], 'is_deleted') !== '0';
         }
         if (!$isDeleted[$row['log_civicrm_entity_altered_contact_id']]) {
             $row['log_civicrm_entity_altered_contact_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_entity_altered_contact_id']);
             $row['log_civicrm_entity_altered_contact_hover'] = ts("Go to contact summary");
             $entity = $this->getEntityValue($row['log_civicrm_entity_id'], $row['log_civicrm_entity_log_type']);
             if ($entity) {
                 $row['log_civicrm_entity_altered_contact'] = $row['log_civicrm_entity_altered_contact'] . " [{$entity}]";
             }
         }
         $row['altered_by_contact_display_name_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_entity_log_user_id']);
         $row['altered_by_contact_display_name_hover'] = ts("Go to contact summary");
         if ($row['log_civicrm_entity_is_deleted'] and $row['log_civicrm_entity_log_action'] == 'Update') {
             $row['log_civicrm_entity_log_action'] = ts('Delete (to trash)');
         }
         if ('Contact' == CRM_Utils_Array::value('log_type', $this->_logTables[$row['log_civicrm_entity_log_type']]) && $row['log_civicrm_entity_log_action'] == 'Insert') {
             $row['log_civicrm_entity_log_action'] = ts('Update');
         }
         if ($newAction = $this->getEntityAction($row['log_civicrm_entity_id'], $row['log_civicrm_entity_log_conn_id'], $row['log_civicrm_entity_log_type'])) {
             $row['log_civicrm_entity_log_action'] = $newAction;
         }
         $row['log_civicrm_entity_log_type'] = $this->getLogType($row['log_civicrm_entity_log_type']);
         if ($row['log_civicrm_entity_log_action'] == 'Update') {
             $q = "reset=1&log_conn_id={$row['log_civicrm_entity_log_conn_id']}&log_date={$row['log_civicrm_entity_log_date']}";
             if ($this->cid) {
                 $q .= '&cid=' . $this->cid;
             }
             $url = CRM_Report_Utils_Report::getNextUrl('logging/contact/detail', $q, FALSE, TRUE);
             $row['log_civicrm_entity_log_action_link'] = $url;
             $row['log_civicrm_entity_log_action_hover'] = ts("View details for this update");
             $row['log_civicrm_entity_log_action'] = '<div class="icon details-icon"></div> ' . ts('Update');
         }
         $date = CRM_Utils_Date::isoToMysql($row['log_civicrm_entity_log_date']);
         $key = $date . '_' . $row['log_civicrm_entity_log_type'] . '_' . $row['log_civicrm_entity_log_conn_id'] . '_' . $row['log_civicrm_entity_log_user_id'];
         $newRows[$key] = $row;
         unset($row['log_civicrm_entity_log_user_id']);
         unset($row['log_civicrm_entity_log_conn_id']);
     }
     krsort($newRows);
     $rows = $newRows;
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:48,代码来源:LoggingSummary.php


示例14: run

 public function run()
 {
     $lock = Civi\Core\Container::singleton()->get('lockManager')->acquire('worker.report.CiviReportMail');
     if ($lock->isAcquired()) {
         // try to unset any time limits
         if (!ini_get('safe_mode')) {
             set_time_limit(0);
         }
         // if there are named sets of settings, use them - otherwise use the default (null)
         require_once 'CRM/Report/Utils/Report.php';
         $result = CRM_Report_Utils_Report::processReport();
         echo $result['messages'];
     } else {
         throw new Exception('Could not acquire lock, another CiviReportMail process is running');
     }
     $lock->release();
 }
开发者ID:kidaa30,项目名称:yes,代码行数:17,代码来源:CiviReportMail.php


示例15: run

 function run()
 {
     require_once 'CRM/Core/Lock.php';
     $lock = new CRM_Core_Lock('CiviReportMail');
     if ($lock->isAcquired()) {
         // try to unset any time limits
         if (!ini_get('safe_mode')) {
             set_time_limit(0);
         }
         // if there are named sets of settings, use them - otherwise use the default (null)
         require_once 'CRM/Report/Utils/Report.php';
         $result = CRM_Report_Utils_Report::processReport();
         echo $result['messages'];
     } else {
         throw new Exception('Could not acquire lock, another CiviReportMail process is running');
     }
     $lock->release();
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:18,代码来源:CiviReportMail.php


示例16: hrqual_civicrm_buildProfile

/**
 * Implementation of hook_civicrm_buildProfile
 */
function hrqual_civicrm_buildProfile($name)
{
    if ($name == 'hrqual_tab') {
        // To fix validation alert issue
        $smarty = CRM_Core_Smarty::singleton();
        $smarty->assign('urlIsPublic', FALSE);
        $action = CRM_Utils_Request::retrieve('multiRecord', 'String', $this);
        // display the select box only in add and update mode
        if (in_array($action, array("add", "update"))) {
            $regionParams = array('markup' => "<select id='category_name' name='category_name' style='display:none' class='form-select required'></select>");
            CRM_Core_Region::instance('profile-form-hrqual_tab')->add($regionParams);
        }
        $config = CRM_Core_Config::singleton();
        if ($config->logging && 'multiProfileDialog' !== CRM_Utils_Request::retrieve('context', 'String', CRM_Core_DAO::$_nullObject)) {
            $contactID = CRM_Utils_Request::retrieve('id', 'Positive', $this);
            CRM_Core_Region::instance('profile-form-hrqual_tab')->add(array('template' => 'CRM/common/logButton.tpl', 'instance_id' => CRM_Report_Utils_Report::getInstanceIDForValue('logging/contact/summary'), 'css_class' => 'hrqual-revision-link', 'table_name' => CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', 'Qualifications', 'table_name', 'name'), 'contact_id' => $contactID, 'weight' => -2));
        }
    }
}
开发者ID:JoeMurray,项目名称:civihr,代码行数:22,代码来源:hrqual.php


示例17: getReportOutputAsCsv

 function getReportOutputAsCsv($reportClass, $inputParams)
 {
     $config = CRM_Core_Config::singleton();
     $config->keyDisable = TRUE;
     $controller = new CRM_Core_Controller_Simple($reportClass, ts('some title'));
     $tmpReportVal = explode('_', $reportClass);
     $reportName = array_pop($tmpReportVal);
     $reportObj =& $controller->_pages[$reportName];
     $tmpGlobals = array();
     $tmpGlobals['_REQUEST']['force'] = 1;
     $tmpGlobals['_GET'][$config->userFrameworkURLVar] = 'civicrm/placeholder';
     $tmpGlobals['_SERVER']['QUERY_STRING'] = '';
     if (!empty($inputParams['fields'])) {
         $fields = implode(',', $inputParams['fields']);
         $tmpGlobals['_GET']['fld'] = $fields;
         $tmpGlobals['_GET']['ufld'] = 1;
     }
     if (!empty($inputParams['filters'])) {
         foreach ($inputParams['filters'] as $key => $val) {
             $tmpGlobals['_GET'][$key] = $val;
         }
     }
     if (!empty($inputParams['group_bys'])) {
         $groupByFields = implode(' ', $inputParams['group_bys']);
         $tmpGlobals['_GET']['gby'] = $groupByFields;
     }
     CRM_Utils_GlobalStack::singleton()->push($tmpGlobals);
     try {
         $reportObj->storeResultSet();
         $reportObj->buildForm();
         $rows = $reportObj->getResultSet();
         $tmpFile = $this->createTempDir() . CRM_Utils_File::makeFileName('CiviReport.csv');
         $csvContent = CRM_Report_Utils_Report::makeCsv($reportObj, $rows);
         file_put_contents($tmpFile, $csvContent);
     } catch (Exception $e) {
         // print_r($e->getCause()->getUserInfo());
         CRM_Utils_GlobalStack::singleton()->pop();
         throw $e;
     }
     CRM_Utils_GlobalStack::singleton()->pop();
     return $tmpFile;
 }
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:42,代码来源:CiviReportTestCase.php


示例18: run

 /**
  * run this page (figure out the action needed and perform it).
  *
  * @return void
  */
 function run()
 {
     if (!CRM_Core_Permission::check('administer Reports')) {
         return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/report/list', "reset=1"));
     }
     $optionVal = CRM_Report_Utils_Report::getValueFromUrl();
     require_once 'CRM/Core/OptionGroup.php';
     $templateInfo = CRM_Core_OptionGroup::getRowValues('report_template', "{$optionVal}", 'value', 'String', false);
     if (strstr(CRM_Utils_Array::value('name', $templateInfo), '_Form')) {
         CRM_Utils_System::setTitle($templateInfo['label'] . ' - Template');
         $this->assign('reportTitle', $templateInfo['label']);
         $session =& CRM_Core_Session::singleton();
         $session->set('reportDescription', $templateInfo['description']);
         $wrapper =& new CRM_Utils_Wrapper();
         return $wrapper->run($templateInfo['name'], null, null);
     }
     if ($optionVal) {
         CRM_Core_Session::setStatus(ts('Could not find the report template. Make sure the report template is registered and / or url is correct.'));
     }
     return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/report/list', "reset=1"));
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:26,代码来源:Report.php


示例19: registerScripts

 static function registerScripts()
 {
     static $loaded = FALSE;
     if ($loaded) {
         return;
     }
     $loaded = TRUE;
     CRM_Core_Resources::singleton()->addSettingsFactory(function () {
         $config = CRM_Core_Config::singleton();
         return array('PseudoConstant' => array('locationType' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'), 'job_hours_time' => CRM_HRJob_Page_JobsTab::getJobHoursTime(), 'working_days' => CRM_HRJob_Page_JobsTab::getDaysPerTime()), 'FieldOptions' => CRM_HRJob_Page_JobsTab::getFieldOptions(), 'jobTabApp' => array('contact_id' => CRM_Utils_Request::retrieve('cid', 'Integer'), 'domain_id' => CRM_Core_Config::domainID(), 'isLogEnabled' => (bool) $config->logging, 'loggingReportId' => CRM_Report_Utils_Report::getInstanceIDForValue('logging/contact/summary'), 'currencies' => CRM_HRJob_Page_JobsTab::getCurrencyFormats(), 'defaultCurrency' => $config->defaultCurrency));
     })->addScriptFile('civicrm', 'packages/backbone/json2.js', 100, 'html-header', FALSE)->addScriptFile('civicrm', 'packages/backbone/backbone.js', 120, 'html-header')->addScriptFile('civicrm', 'packages/backbone/backbone.marionette.js', 125, 'html-header', FALSE)->addScriptFile('civicrm', 'packages/backbone/backbone.modelbinder.js', 125, 'html-header', FALSE)->addScriptFile('civicrm', 'js/jquery/jquery.crmRevisionLink.js', 125, 'html-header', FALSE)->addScriptFile('org.civicrm.hrjob', 'js/jquery/jquery.hrContactLink.js', 125, 'html-header', FALSE)->addScriptFile('org.civicrm.hrjob', 'js/jquery/jquery.hrFileLink.js', 125, 'html-header', FALSE)->addScriptFile('org.civicrm.hrjob', 'js/jquery/jquery.lockButton.js', 125, 'html-header', FALSE)->addScriptFile('civicrm', 'js/crm.backbone.js', 130, 'html-header', FALSE)->addStyleFile('org.civicrm.hrjob', 'css/hrjob.css', 140, 'html-header')->addScriptFile('org.civicrm.hrjob', 'js/hrapp.js', 150, 'html-header')->addScriptFile('org.civicrm.hrjob', 'js/renderutil.js', 155, 'html-header')->addScriptFile('org.civicrm.hrjob', 'js/entities/hrjob.js', 155, 'html-header')->addScriptFile('org.civicrm.hrjob', 'js/common/navigation.js', 155, 'html-header')->addScriptFile('org.civicrm.hrjob', 'js/common/mbind.js', 155, 'html-header')->addScriptFile('org.civicrm.hrjob', 'js/common/views.js', 155, 'html-header')->addScriptFile('org.civicrm.hrjob', 'js/jobtabapp.js', 160, 'html-header')->addScriptFile('org.civicrm.hrjob', 'js/jobtabapp/intro/show_controller.js', 160, 'html-header')->addScriptFile('org.civicrm.hrjob', 'js/jobtabapp/intro/show_views.js', 160, 'html-header')->addScriptFile('org.civicrm.hrjob', 'js/jobtabapp/tree/tree_controller.js', 160, 'html-header')->addScriptFile('org.civicrm.hrjob', 'js/jobtabapp/tree/tree_views.js', 160, 'html-header')->addScriptFile('org.civicrm.hrjob', 'js/jobtabapp/summary/summary_controller.js', 160, 'html-header')->addScriptFile('org.civicrm.hrjob', 'js/jobtabapp/summary/summary_views.js', 160, 'html-header');
     foreach (array('general', 'funding', 'health', 'hour', 'leave', 'pay', 'pension', 'role') as $module) {
         CRM_Core_Resources::singleton()->addScriptFile('org.civicrm.hrjob', "js/jobtabapp/{$module}/edit_controller.js", 160, 'html-header')->addScriptFile('org.civicrm.hrjob', "js/jobtabapp/{$module}/edit_views.js", 160, 'html-header')->addScriptFile('org.civicrm.hrjob', "js/jobtabapp/{$module}/summary_views.js", 160, 'html-header');
     }
     $templateDir = CRM_Extension_System::singleton()->getMapper()->keyToBasePath('org.civicrm.hrjob') . '/templates/';
     $region = CRM_Core_Region::instance('page-header');
     foreach (glob($templateDir . 'CRM/HRJob/Underscore/*.tpl') as $file) {
         $fileName = substr($file, strlen($templateDir));
         $region->add(array('template' => $fileName));
     }
     $region->add(array('template' => 'CRM/Form/validate.tpl'));
 }
开发者ID:JoeMurray,项目名称:civihr,代码行数:22,代码来源:JobsTab.php


示例20: processReport

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CRM_Upgrade_Form类代码示例发布时间:2022-05-20
下一篇:
PHP CRM_Report_Form类代码示例发布时间:2022-05-20
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap