當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。