<?php
-
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
*
*/
-/*
- * @see http://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+Specifications+-++Batches#CiviAccountsSpecifications-Batches-%C2%A0Overviewofimplementation
+/**
+ * @link http://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+Specifications+-++Batches#CiviAccountsSpecifications-Batches-%C2%A0Overviewofimplementation
*/
-
class CRM_Financial_BAO_ExportFormat_CSV extends CRM_Financial_BAO_ExportFormat {
// For this phase, we always output these records too so that there isn't data referenced in the journal entries that isn't defined anywhere.
/**
* Class constructor
*/
- function __construct() {
+ public function __construct() {
parent::__construct();
}
/**
* @param array $exportParams
*/
- function export($exportParams) {
+ public function export($exportParams) {
$export = parent::export($exportParams);
// Save the file in the public directory
$fileName = self::putFile($export);
- foreach ( self::$complementaryTables as $rct ) {
+ foreach (self::$complementaryTables as $rct) {
$func = "export{$rct}";
$this->$func();
}
*
* @return Object
*/
- function generateExportQuery($batchId) {
+ public function generateExportQuery($batchId) {
$sql = "SELECT
ft.id as financial_trxn_id,
ft.trxn_date,
WHERE eb.batch_id = ( %1 )";
$params = array(1 => array($batchId, 'String'));
- $dao = CRM_Core_DAO::executeQuery( $sql, $params );
+ $dao = CRM_Core_DAO::executeQuery($sql, $params);
return $dao;
}
*
* @return string
*/
- function putFile($export) {
+ public function putFile($export) {
$config = CRM_Core_Config::singleton();
- $fileName = $config->uploadDir.'Financial_Transactions_'.$this->_batchIds.'_'.date('YmdHis').'.'.$this->getFileExtension();
- $this->_downloadFile[] = $config->customFileUploadDir.CRM_Utils_File::cleanFileName(basename($fileName));
+ $fileName = $config->uploadDir . 'Financial_Transactions_' . $this->_batchIds . '_' . date('YmdHis') . '.' . $this->getFileExtension();
+ $this->_downloadFile[] = $config->customFileUploadDir . CRM_Utils_File::cleanFileName(basename($fileName));
$out = fopen($fileName, 'w');
fputcsv($out, $export['headers']);
unset($export['headers']);
* @param array $values
* @return array
*/
- function formatHeaders($values) {
+ public function formatHeaders($values) {
$arrayKeys = array_keys($values);
$headers = '';
if (!empty($arrayKeys)) {
* Generate CSV array for export
*
* @param array $export
- *
*/
- function makeCSV($export) {
+ public function makeCSV($export) {
foreach ($export as $batchId => $dao) {
$financialItems = array();
$this->_batchIds = $batchId;
while ($dao->fetch()) {
- $creditAccountName = $creditAccountType =
- $creditAccount = NULL;
+ $creditAccountName = $creditAccountType = $creditAccount = NULL;
if ($dao->credit_account) {
$creditAccountName = $dao->credit_account_name;
$creditAccountType = $dao->credit_account_type_code;
/**
* @return string
*/
- function getFileExtension() {
+ public function getFileExtension() {
return 'csv';
}
- function exportACCNT() {
+ public function exportACCNT() {
}
- function exportCUST() {
+ public function exportCUST() {
}
- function exportTRANS() {
+ public function exportTRANS() {
}
+
}