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


PHP CRM_Report_Utils_Report::getValueIDFromUrl方法代码示例

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


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

示例1: preProcessCommon

 /**
  * Shared pre-process function.
  *
  * If overriding preProcess function this should still be called.
  *
  * @throws \Exception
  */
 public function preProcessCommon()
 {
     $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', CRM_Core_DAO::$_nullObject);
     $this->_dashBoardRowCount = CRM_Utils_Request::retrieve('rowCount', 'Integer', CRM_Core_DAO::$_nullObject);
     $this->_section = CRM_Utils_Request::retrieve('section', 'Integer', CRM_Core_DAO::$_nullObject);
     $this->assign('section', $this->_section);
     CRM_Core_Region::instance('page-header')->add(array('markup' => sprintf('<!-- Report class: [%s] -->', htmlentities(get_class($this)))));
     if (!$this->noController) {
         $this->setID($this->get('instanceId'));
         if (!$this->_id) {
             $this->setID(CRM_Report_Utils_Report::getInstanceID());
             if (!$this->_id) {
                 $this->setID(CRM_Report_Utils_Report::getInstanceIDForPath());
             }
         }
         // set qfkey so that pager picks it up and use it in the "Next > Last >>" links.
         // FIXME: Note setting it in $_GET doesn't work, since pager generates link based on QUERY_STRING
         $_SERVER['QUERY_STRING'] .= "&qfKey={$this->controller->_key}";
     }
     if ($this->_id) {
         $this->assign('instanceId', $this->_id);
         $params = array('id' => $this->_id);
         $this->_instanceValues = array();
         CRM_Core_DAO::commonRetrieve('CRM_Report_DAO_ReportInstance', $params, $this->_instanceValues);
         if (empty($this->_instanceValues)) {
             CRM_Core_Error::fatal("Report could not be loaded.");
         }
         $this->_title = $this->_instanceValues['title'];
         if (!empty($this->_instanceValues['permission']) && !(CRM_Core_Permission::check($this->_instanceValues['permission']) || CRM_Core_Permission::check('administer Reports'))) {
             CRM_Utils_System::permissionDenied();
             CRM_Utils_System::civiExit();
         }
         $formValues = CRM_Utils_Array::value('form_values', $this->_instanceValues);
         if ($formValues) {
             $this->_formValues = unserialize($formValues);
         } else {
             $this->_formValues = NULL;
         }
         $this->setOutputMode();
         if ($this->_outputMode == 'copy') {
             $this->_createNew = TRUE;
             $this->_params = $this->_formValues;
             $this->_params['view_mode'] = 'criteria';
             $this->_params['title'] = ts('(copy)') . $this->getTitle();
             // Do not pass go. Do not collect another chance to re-run the same query.
             CRM_Report_Form_Instance::postProcess($this);
         }
         // lets always do a force if reset is found in the url.
         // Hey why not? see CRM-17225 for more about this. The use of reset to be force is historical for reasons stated
         // in the comment line above these 2.
         if (!empty($_REQUEST['reset']) && !in_array(CRM_Utils_Request::retrieve('output', 'String'), array('save', 'criteria'))) {
             $this->_force = 1;
         }
         // set the mode
         $this->assign('mode', 'instance');
     } elseif (!$this->noController) {
         list($optionValueID, $optionValue) = CRM_Report_Utils_Report::getValueIDFromUrl();
         $instanceCount = CRM_Report_Utils_Report::getInstanceCount($optionValue);
         if ($instanceCount > 0 && $optionValueID) {
             $this->assign('instanceUrl', CRM_Utils_System::url('civicrm/report/list', "reset=1&ovid={$optionValueID}"));
         }
         if ($optionValueID) {
             $this->_description = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $optionValueID, 'description');
         }
         // set the mode
         $this->assign('mode', 'template');
     }
     // lets display the Report Settings section
     $this->_instanceForm = $this->_force || $this->_id || !empty($_POST);
     // Do not display Report Settings section if administer Reports permission is absent OR
     // if report instance is reserved and administer reserved reports absent
     if (!CRM_Core_Permission::check('administer Reports') || $this->_instanceValues['is_reserved'] && !CRM_Core_Permission::check('administer reserved reports')) {
         $this->_instanceForm = FALSE;
     }
     $this->assign('criteriaForm', FALSE);
     // Display Report Criteria section if user has access Report Criteria OR administer Reports AND report instance is not reserved
     if (CRM_Core_Permission::check('administer Reports') || CRM_Core_Permission::check('access Report Criteria')) {
         if (!$this->_instanceValues['is_reserved'] || CRM_Core_Permission::check('administer reserved reports')) {
             $this->assign('criteriaForm', TRUE);
             $this->_criteriaForm = TRUE;
         }
     }
     $this->_instanceButtonName = $this->getButtonName('submit', 'save');
     $this->_createNewButtonName = $this->getButtonName('submit', 'next');
     $this->_printButtonName = $this->getButtonName('submit', 'print');
     $this->_pdfButtonName = $this->getButtonName('submit', 'pdf');
     $this->_csvButtonName = $this->getButtonName('submit', 'csv');
     $this->_groupButtonName = $this->getButtonName('submit', 'group');
     $this->_chartButtonName = $this->getButtonName('submit', 'chart');
 }
开发者ID:konadave,项目名称:civicrm-core,代码行数:97,代码来源:Form.php

示例2: preProcessCommon

 function preProcessCommon()
 {
     $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', CRM_Core_DAO::$_nullObject);
     $this->_section = CRM_Utils_Request::retrieve('section', 'Integer', CRM_Core_DAO::$_nullObject);
     $this->assign('section', $this->_section);
     $this->_id = $this->get('instanceId');
     if (!$this->_id) {
         $this->_id = CRM_Report_Utils_Report::getInstanceID();
         if (!$this->_id) {
             $this->_id = CRM_Report_Utils_Report::getInstanceIDForPath();
         }
     }
     // set qfkey so that pager picks it up and use it in the "Next > Last >>" links,
     $_GET['qfKey'] = $this->controller->_key;
     if ($this->_id) {
         $this->assign('instanceId', $this->_id);
         $params = array('id' => $this->_id);
         $this->_instanceValues = array();
         CRM_Core_DAO::commonRetrieve('CRM_Report_DAO_Instance', $params, $this->_instanceValues);
         if (empty($this->_instanceValues)) {
             CRM_Core_Error::fatal("Report could not be loaded.");
         }
         if (!empty($this->_instanceValues['permission']) && !(CRM_Core_Permission::check($this->_instanceValues['permission']) || CRM_Core_Permission::check('administer Reports'))) {
             CRM_Utils_System::permissionDenied();
             CRM_Utils_System::civiExit();
         }
         $this->_formValues = unserialize($this->_instanceValues['form_values']);
         // lets always do a force if reset is found in the url.
         if (CRM_Utils_Array::value('reset', $_GET)) {
             $this->_force = 1;
         }
         // set the mode
         $this->assign('mode', 'instance');
     } else {
         list($optionValueID, $optionValue) = CRM_Report_Utils_Report::getValueIDFromUrl();
         $instanceCount = CRM_Report_Utils_Report::getInstanceCount($optionValue);
         if ($instanceCount > 0 && $optionValueID) {
             $this->assign('instanceUrl', CRM_Utils_System::url('civicrm/report/list', "reset=1&ovid={$optionValueID}"));
         }
         if ($optionValueID) {
             $this->_description = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $optionValueID, 'description');
         }
         // set the mode
         $this->assign('mode', 'template');
     }
     // lets display the
     $this->_instanceForm = $this->_force || $this->_id || !empty($_POST);
     // do not display instance form if administer Reports permission is absent
     if (!CRM_Core_Permission::check('administer Reports')) {
         $this->_instanceForm = false;
     }
     $this->assign('criteriaForm', false);
     if (CRM_Core_Permission::check('administer Reports') || CRM_Core_Permission::check('access Report Criteria')) {
         $this->assign('criteriaForm', true);
     }
     $this->_instanceButtonName = $this->getButtonName('submit', 'save');
     $this->_printButtonName = $this->getButtonName('submit', 'print');
     $this->_pdfButtonName = $this->getButtonName('submit', 'pdf');
     $this->_csvButtonName = $this->getButtonName('submit', 'csv');
     $this->_groupButtonName = $this->getButtonName('submit', 'group');
     $this->_chartButtonName = $this->getButtonName('submit', 'chart');
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:62,代码来源:Form.php


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