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


PHP CRM_Report_Form::getTemplateFileName方法代码示例

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


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

示例1: getTemplateFileName

  /**
   * @return string
   */
  function getTemplateFileName() {
    $defaultTpl = parent::getTemplateFileName();

    if (in_array($this->_outputMode, array('print', 'pdf'))) {
      if ($this->_params['templates']) {
        $defaultTpl = 'CRM/Extendedreport/Form/Report/CustomTemplates/' . $this->_params['templates'] . '.tpl';
      }
    }

    if (!CRM_Utils_File::isIncludable('templates/' . $defaultTpl)) {
      $defaultTpl = 'CRM/Report/Form.tpl';
    }
    if (CRM_Utils_Array::value('templates', $this->_params) == 1) {
      //
    }
    return $defaultTpl;
  }
开发者ID:riyadennis,项目名称:my_civicrm,代码行数:20,代码来源:ExtendedReport.php

示例2: postProcess

 public function postProcess()
 {
     // get the acl clauses built before we assemble the query
     $this->buildACLClause($this->_aliases['civicrm_contact']);
     // get ready with post process params
     $this->beginPostProcess();
     // build query
     $sql = $this->buildQuery();
     // build array of result based on column headers. This method also allows
     // modifying column headers before using it to build result set i.e $rows.
     $rows = array();
     $this->buildRows($sql, $rows);
     // format result set.
     $this->formatDisplay($rows);
     //call local post process for only print and pdf.
     //we do need special formatted o/p only when we do have grouping
     $orderBys = CRM_Utils_Array::value('order_bys', $this->_params, array());
     if (in_array($this->_outputMode, array('print', 'pdf'))) {
         $outPut = array();
         $templateFile = parent::getTemplateFileName();
         if (array_key_exists('street_name', $orderBys) || array_key_exists('street_number', $orderBys)) {
             $orderByStreetName = CRM_Utils_Array::value('street_name', $orderBys);
             $orderByStreetNum = CRM_Utils_Array::value('street_number', $orderBys);
             $pageCnt = 0;
             $dataPerPage = array();
             $lastStreetName = $lastStreetNum = NULL;
             foreach ($rows as $row) {
                 //do we need to take new page.
                 if ($orderByStreetName && $lastStreetName != CRM_Utils_Array::value('civicrm_address_street_name', $row)) {
                     $pageCnt++;
                 } elseif ($orderByStreetNum && $lastStreetNum != CRM_Utils_Array::value('civicrm_address_street_number', $row) % 2) {
                     $pageCnt++;
                 }
                 //get the data per page.
                 $dataPerPage[$pageCnt][] = $row;
                 $lastStreetName = CRM_Utils_Array::value('civicrm_address_street_name', $row);
                 $lastStreetNum = CRM_Utils_Array::value('civicrm_address_street_number', $row) % 2;
             }
             foreach ($dataPerPage as $page) {
                 // assign variables to templates
                 $this->doTemplateAssignment($page);
                 $outPut[] = CRM_Core_Form::$_template->fetch($templateFile);
             }
         } else {
             $this->doTemplateAssignment($rows);
             $outPut[] = CRM_Core_Form::$_template->fetch($templateFile);
         }
         $header = $this->_formValues['report_header'];
         $footer = $this->_formValues['report_footer'];
         //get the cover sheet.
         $coverSheet = $this->_surveyCoverSheet();
         $footerImage = preg_replace('/<\\/html>|<\\/body>|<\\/div>/i', '', $footer);
         $outPut = $header . $coverSheet . "<div style=\"page-break-after: always\"></div>" . implode($footerImage . "<div style=\"page-break-after: always\"></div>", $outPut) . $footer;
         if ($this->_outputMode == 'print') {
             echo $outPut;
         } else {
             CRM_Utils_PDF_Utils::html2pdf($outPut, "CiviReport.pdf");
         }
         CRM_Utils_System::civiExit();
     } else {
         $this->doTemplateAssignment($rows);
         $this->endPostProcess($rows);
     }
 }
开发者ID:konadave,项目名称:civicrm-core,代码行数:64,代码来源:SurveyDetails.php


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