<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
}
// Override to assemble the appropriate subset of financial data for the specific export format
+ /**
+ * @param $exportParams
+ *
+ * @return mixed
+ */
function export($exportParams) {
$this->_exportParams = $exportParams;
return $exportParams;
}
+ /**
+ * @param null $fileName
+ */
function output($fileName = NULL) {
switch ($this->getFileExtension()) {
case 'csv':
}
}
+ /**
+ * @return string
+ */
function getMimeType() {
return 'text/plain';
}
+ /**
+ * @return string
+ */
function getFileExtension() {
return 'txt';
}
// Override this if appropriate
+ /**
+ * @return null
+ */
function getTemplateFileName() {
return null;
}
+ /**
+ * @return object
+ */
static function &getTemplate() {
return self::$_template;
}
+ /**
+ * @param $var
+ * @param null $value
+ */
function assign($var, $value = NULL) {
self::$_template->assign($var, $value);
}
* Depending on the output format might want to override this, e.g. for IIF tabs need to be escaped etc,
* but for CSV it doesn't make sense because php has built in csv output functions.
*/
+ /**
+ * @param $s
+ * @param string $type
+ *
+ * @return null
+ */
static function format($s, $type = 'string') {
if (!empty($s)) {
return $s;
}
}
+ /**
+ * @param $batchIds
+ * @param $fileName
+ *
+ * @throws CRM_Core_Exception
+ */
static function createActivityExport($batchIds, $fileName) {
$session = CRM_Core_Session::singleton();
$values = array();
}
$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 (CRM_Utils_Array::value('total', $values)) {
+ if (!empty($values['total'])) {
$subject .= ts('Total') . '['. CRM_Utils_Money::format($values['total']) .'],';
}
- if (CRM_Utils_Array::value('item_count', $values)) {
+ if (!empty($values['item_count'])) {
$subject .= ' ' . ts('Count') . '['. $values['item_count'] .'],';
}
CRM_Activity_BAO_Activity::create($activityParams);
}
+ /**
+ * @param array $files
+ * @param null $destination
+ * @param bool $overwrite
+ *
+ * @return bool
+ */
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) {