Merge pull request #4820 from kurund/CRM-15705
[civicrm-core.git] / CRM / Financial / BAO / ExportFormat.php
index d6105f9dde414f1c27c76cc996afdd069591044a..727d1d93166abd2cdb51fb493e104beb9ec4f4be 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                             |
+ | CiviCRM version 4.6                                             |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -52,9 +52,9 @@ class CRM_Financial_BAO_ExportFormat {
   static protected $_template;
 
   /**
-   * class constructor
+   * Class constructor
    */
-  function __construct() {
+  public function __construct() {
     if ( !isset( self::$_template ) ) {
       self::$_template = CRM_Core_Smarty::singleton();
     }
@@ -62,11 +62,11 @@ class CRM_Financial_BAO_ExportFormat {
 
   // Override to assemble the appropriate subset of financial data for the specific export format
   /**
-   * @param $exportParams
+   * @param array $exportParams
    *
    * @return mixed
    */
-  function export($exportParams) {
+  public function export($exportParams) {
     $this->_exportParams = $exportParams;
     return $exportParams;
   }
@@ -74,7 +74,7 @@ class CRM_Financial_BAO_ExportFormat {
   /**
    * @param null $fileName
    */
-  function output($fileName = NULL) {
+  public function output($fileName = NULL) {
     switch ($this->getFileExtension()) {
       case 'csv':
         self::createActivityExport($this->_batchIds, $fileName);
@@ -92,14 +92,14 @@ class CRM_Financial_BAO_ExportFormat {
   /**
    * @return string
    */
-  function getMimeType() {
+  public function getMimeType() {
     return 'text/plain';
   }
 
   /**
    * @return string
    */
-  function getFileExtension() {
+  public function getFileExtension() {
     return 'txt';
   }
 
@@ -107,14 +107,14 @@ class CRM_Financial_BAO_ExportFormat {
   /**
    * @return null
    */
-  function getTemplateFileName() {
+  public function getTemplateFileName() {
     return null;
   }
 
   /**
    * @return object
    */
-  static function &getTemplate() {
+  public static function &getTemplate() {
     return self::$_template;
   }
 
@@ -122,7 +122,7 @@ class CRM_Financial_BAO_ExportFormat {
    * @param $var
    * @param null $value
    */
-  function assign($var, $value = NULL) {
+  public function assign($var, $value = NULL) {
     self::$_template->assign($var, $value);
   }
 
@@ -138,7 +138,7 @@ class CRM_Financial_BAO_ExportFormat {
    *
    * @return null
    */
-  static function format($s, $type = 'string') {
+  public static function format($s, $type = 'string') {
     if (!empty($s)) {
       return $s;
     }
@@ -147,7 +147,7 @@ class CRM_Financial_BAO_ExportFormat {
     }
   }
 
-  function initiateDownload() {
+  public function initiateDownload() {
     $config = CRM_Core_Config::singleton();
     //zip files if more than one.
     if (count($this->_downloadFile)>1) {
@@ -177,11 +177,11 @@ class CRM_Financial_BAO_ExportFormat {
 
   /**
    * @param $batchIds
-   * @param $fileName
+   * @param string $fileName
    *
    * @throws CRM_Core_Exception
    */
-  static function createActivityExport($batchIds, $fileName) {
+  public static function createActivityExport($batchIds, $fileName) {
     $session = CRM_Core_Session::singleton();
     $values = array();
     $params = array('id' => $batchIds);
@@ -194,7 +194,7 @@ class CRM_Financial_BAO_ExportFormat {
       $paymentInstrument = array_flip(CRM_Contribute_PseudoConstant::paymentInstrument('label'));
       $values['payment_instrument_id'] = array_search($values['payment_instrument_id'], $paymentInstrument);
     }
-    $details = '<p>' . ts('Record: ') . $values['title'] . '</p><p>' . ts('Description: ') . '</p><p>' . ts('Created By: ') . $createdBy . '</p><p>' . ts('Created Date: ') . $values['created_date'] . '</p><p>' . ts('Last Modified By: ') . $modifiedBy . '</p><p>' . ts('Payment Instrument: ') . $values['payment_instrument_id'] . '</p>';
+    $details = '<p>' . ts('Record:') . ' ' . $values['title'] . '</p><p>' . ts('Description:') . '</p><p>' . ts('Created By:') . " $createdBy" . '</p><p>' . ts('Created Date:') . ' ' . $values['created_date'] . '</p><p>' . ts('Last Modified By:') . ' ' . $modifiedBy . '</p><p>' . ts('Payment Instrument:') . ' ' . $values['payment_instrument_id'] . '</p>';
     $subject = '';
     if (!empty($values['total'])) {
       $subject .= ts('Total') . '['. CRM_Utils_Money::format($values['total']) .'],';
@@ -233,7 +233,7 @@ class CRM_Financial_BAO_ExportFormat {
    *
    * @return bool
    */
-  function createZip($files = array(), $destination = NULL, $overwrite = FALSE) {
+  public function createZip($files = array(), $destination = NULL, $overwrite = FALSE) {
     //if the zip file already exists and overwrite is false, return false
     if (file_exists($destination) && !$overwrite) {
       return FALSE;