$label = ts('Role');
$role = array(
- '-1' => ts('- select role -'),
- '0' => ts('Everyone'),
- ) + CRM_Core_OptionGroup::values('acl_role');
+ '-1' => ts('- select role -'),
+ '0' => ts('Everyone'),
+ ) + CRM_Core_OptionGroup::values('acl_role');
$this->add('select', 'entity_id', $label, $role, TRUE);
$group = array(
- '-1' => ts('- select -'),
- '0' => ts('All Groups'),
- ) + CRM_Core_PseudoConstant::group();
+ '-1' => ts('- select -'),
+ '0' => ts('All Groups'),
+ ) + CRM_Core_PseudoConstant::group();
$customGroup = array(
- '-1' => ts('- select -'),
- '0' => ts('All Custom Groups'),
- ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_CustomField', 'custom_group_id');
+ '-1' => ts('- select -'),
+ '0' => ts('All Custom Groups'),
+ ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_CustomField', 'custom_group_id');
$ufGroup = array(
- '-1' => ts('- select -'),
- '0' => ts('All Profiles'),
- ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id');
+ '-1' => ts('- select -'),
+ '0' => ts('All Profiles'),
+ ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id');
$event = array(
- '-1' => ts('- select -'),
- '0' => ts('All Events'),
- ) + CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )");
+ '-1' => ts('- select -'),
+ '0' => ts('All Events'),
+ ) + CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )");
$this->add('select', 'group_id', ts('Group'), $group);
$this->add('select', 'custom_group_id', ts('Custom Data'), $customGroup);
CRM_Core_BAO_EntityTag::del($tagParams);
CRM_Core_Session::setStatus(ts("Selected Activity has been deleted successfully."), ts('Record Deleted'), 'success');
- return;
+ return NULL;
}
// store the submitted values in an array
/**
* Get action Links
*
- * @return array
+ * @return array|NULL
* (reference) of action links
*/
public function &links() {
+ return NULL;
}
/**
}
/**
- * @param $xmlString
+ * @param string $xmlString
* @param int $clientID
* @param int $caseID
* @param bool $printReport
*
* @return mixed
*/
- static
- public function run($xmlString, $clientID, $caseID, $printReport = FALSE) {
+ public static function run($xmlString, $clientID, $caseID, $printReport = FALSE) {
/*
$fh = fopen('C:/temp/audit2.xml', 'w');
fwrite($fh, $xmlString);
$openCaseID = CRM_Core_OptionGroup::getValue('activity_type', 'Open Case', 'name');
unset($aTypes[$openCaseID]);
asort($aTypes);
- $this->_fields['followup_activity_type_id']['attributes'] = array(
- '' => '- select activity type -',
- ) + $aTypes;
+ $this->_fields['followup_activity_type_id']['attributes'] = array('' => '- select activity type -') + $aTypes;
}
$result = parent::buildQuickForm();
* @param array $params
* (reference) an assoc array of name/value pairs.
*
- * @return CRM_Contact_BAO_Contact|CRM_Core_Error
+ * @return CRM_Contact_BAO_Contact|CRM_Core_Error|NULL
* Created or updated contact object or error object.
* (error objects are being phased out in favour of exceptions)
*/
$contact = new CRM_Contact_DAO_Contact();
if (empty($params)) {
- return;
+ return NULL;
}
// Fix for validate contact sub type CRM-5143.
*
* @param int $id
* Group id.
- *
- * @return NULL
*/
public static function discard($id) {
CRM_Utils_Hook::pre('delete', 'Group', $id, CRM_Core_DAO::$_nullArray);
* Format in which labels needs to be printed.
* @param string $fileName
* The name of the file to save the label in.
- *
- * @return null
*/
public function createLabel(&$contactRows, &$format, $fileName = 'MailingLabels_CiviCRM.pdf') {
$pdf = new CRM_Utils_PDF_Label($format, 'mm');
$this->assign('instanceUrl',
CRM_Utils_System::url("civicrm/report/instance/{$loggingReport}",
"reset=1&force=1&snippet=4§ion=2&altered_contact_id_op=eq&altered_contact_id_value={$this->_contactId}&cid={$this->_contactId}", FALSE, NULL, FALSE));
- return;
+ return NULL;
}
$log = new CRM_Core_DAO_Log();
/**
* called when action is browse
- *
- * @return null
*/
public function browse() {
$note = new CRM_Core_DAO_Note();
/**
* called when action is update or new
- *
- * @return null
*/
public function edit() {
$controller = new CRM_Core_Controller_Simple('CRM_Note_Form_Note', ts('Contact Notes'), $this->_action);
'amount_level' => CRM_Utils_Array::value('amount_level', $params),
'invoice_id' => $params['invoiceID'],
'currency' => $params['currencyID'],
- 'source' =>
- (!$online || !empty($params['source'])) ?
- CRM_Utils_Array::value('source', $params) :
- CRM_Utils_Array::value('description', $params),
+ 'source' => (!$online || !empty($params['source'])) ? CRM_Utils_Array::value('source', $params) : CRM_Utils_Array::value('description', $params),
'is_pay_later' => CRM_Utils_Array::value('is_pay_later', $params, 0),
//configure cancel reason, cancel date and thankyou date
//from 'contribution' type profile if included
'cancel_reason' => CRM_Utils_Array::value('cancel_reason', $params, 0),
- 'cancel_date' =>
- isset($params['cancel_date']) ?
- CRM_Utils_Date::format($params['cancel_date']) :
- NULL,
- 'thankyou_date' =>
- isset($params['thankyou_date']) ?
- CRM_Utils_Date::format($params['thankyou_date']) :
- NULL,
+ 'cancel_date' => isset($params['cancel_date']) ? CRM_Utils_Date::format($params['cancel_date']) : NULL,
+ 'thankyou_date' => isset($params['thankyou_date']) ? CRM_Utils_Date::format($params['thankyou_date']) : NULL,
'campaign_id' => $campaignId,
'is_test' => $isTest,
'address_id' => $addressID,
*
* @param null $entity
*
- * @return array
+ * @return array|NULL
* array of created address
*/
public static function create(&$params, $fixAddress = TRUE, $entity = NULL) {
if (!isset($params['address']) || !is_array($params['address'])) {
- return;
+ return NULL;
}
CRM_Core_BAO_Block::sortPrimaryFirst($params['address']);
$addresses = array();
*
* @param string $fieldName
* @param string $context
- * @see CRM_Core_DAO::buildOptionsContext.
+ * @see CRM_Core_DAO::buildOptionsContext
* @param array $props
* whatever is known about this dao object.
*
*
* @param object $field
* The field object.
- *
- * @return boolean
- *
*/
public static function deleteField($field) {
CRM_Utils_System::flushCache();
$field->delete();
CRM_Core_BAO_UFField::delUFField($field->id);
CRM_Utils_Weight::correctDuplicateWeights('CRM_Core_DAO_CustomField');
-
- return;
}
/**
* @param bool $includeViewOnly
* If true, fields marked 'View Only' are included. Required for APIv3.
*
- * @return array
+ * @return array|NULL
* formatted custom field array
*/
public static function formatCustomField(
// return if field is a 'code' field
if (!$includeViewOnly && !empty($customFields[$customFieldId]['is_view'])) {
- return;
+ return NULL;
}
list($tableName, $columnName, $groupID) = self::getTableColumnGroup($customFieldId);
*
* @param int $id
* Id of the database record.
- * @param bool $is_activeValue we want to set the is_active field.
+ * @param bool $is_active
* Value we want to set the is_active field.
*
* @return Object
'name' => ts('Delete Attached File'),
'url' => 'civicrm/file',
'qs' => 'reset=1&id=%%id%%&eid=%%eid%%&fid=%%fid%%&action=delete',
- 'extra' => 'onclick = "if (confirm( \'' . $deleteExtra .
- '\' ) ) this.href+=\'&confirmed=1\'; else return false;"',
+ 'extra' => 'onclick = "if (confirm( \'' . $deleteExtra
+ . '\' ) ) this.href+=\'&confirmed=1\'; else return false;"',
),
);
$customValue['deleteURL'] = CRM_Core_Action::formLink($deleteURL,
//changed isset CRM-4601
if (CRM_Utils_System::isNull($value)) {
- return;
+ return NULL;
}
$htmlType = CRM_Utils_Array::value('html_type', $field);
* @param array $fieldIds
* Array of custom field ids.
*
- * @return array
+ * @return array|NULL
* array consisting of groups and fields labels with ids.
*/
public static function getGroupTitles($fieldIds) {
if (!is_array($fieldIds) && empty($fieldIds)) {
- return;
+ return NULL;
}
$groupLabels = array();
* @param int $gID
* Custom group id.
*
- * @return boolean
+ * @return bool|NULL
* true if empty otherwise false.
*/
public static function isGroupEmpty($gID) {
if (!$gID) {
- return;
+ return NULL;
}
$tableName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup',
* Determine whether the given table/id
* has discount associated with it
*
- * @param int $entityIdEntity id to be searched.
+ * @param int $entityId
* Entity id to be searched.
* @param string $entityTable
* Entity table to be searched.
*
* access public
*
- * @return array
+ * @return array|NULL
* reference to the array of default values
*/
public function setDefaultValues() {
+ return NULL;
}
/**
/**
* Add date
- * @param string $name
- * Name of the element.
- * @param string $label
- * Label of the element.
- * @param array $attributes
- * Key / value pair.
*
+ * @code
* // if you need time
* $attributes = array(
* 'addTime' => true,
* 'formatType' => 'relative' or 'birth' etc check advanced date settings
* );
+ * @endcode
+ *
+ * @param string $name
+ * Name of the element.
+ * @param string $label
+ * Label of the element.
* @param bool $required
* True if required.
+ * @param array $attributes
+ * Key / value pair.
*/
public function addDate($name, $label, $required = FALSE, $attributes = NULL) {
if (!empty($attributes['formatType'])) {
/**
* Global validation rules for the form
*
- * @param array $fields
- * Posted values of the form .
+ * @param array $values
+ * Posted values of the form.
*
* @return array
* list of errors to be posted back to the form
* it is unclear whether it is a function on the way in or on the way out
*
* @param array $params
- * @return void|int
+ * @return void|NULL|int
*/
public function updateContributionStatus(&$params) {
// get minimum required values.
$contributionId = CRM_Utils_Array::value('contribution_id', $params);
if (!$contributionId || !$componentId || !$componentName || !$statusId) {
- return;
+ return NULL;
}
$input = $ids = $objects = array();
* @param array $params
* Assoc array of input parameters for this transaction.
*
- * @return array
+ * @return array|NULL
* the result in an nice formatted array (or an error object)
* @abstract
*/
* @param string $rows
* (reference ) result set rows.
* @param null $titleHeader
- * @param bool $printShould the output be printed.
+ * @param bool $print
* Should the output be printed.
- *
* @param bool $outputHeader
*
* @return mixed
* @param CRM_Core_Smarty $smarty
* Reference to the smarty object.
*
- * @return string
+ * @return string|NULL
* HTML code of a link to documentation
*/
function smarty_function_docURL($params, &$smarty) {
if (!isset($smarty)) {
- return;
+ return NULL;
}
else {
return CRM_Utils_System::docURL($params);
*/
function smarty_function_help($params, &$smarty) {
if (!isset($params['id']) || !isset($smarty->_tpl_vars['config'])) {
- return;
+ return NULL;
}
if (empty($params['file']) && isset($smarty->_tpl_vars['tplFile'])) {
*
*/
-/*
- * Smarty plugin
- * Type: modifier
- * Name: substring
- * Version: 0.1
- * Date: 2006-16-02
- * Author: Thorsten Albrecht <thor_REMOVE.THIS_@wolke7.net>
- * Purpose: "substring" allows you to retrieve a small part (substring) of a string.
- * Notes: The substring is specified by giving the start position and the length.
- * Unlike the original function substr() in PHP the position of the characters
- * in the string starts at 1 (not at 0 as usual in php).
- * Example smarty code:
- * {$my_string|substring:2:4}
- * returns substring from character 2 until character 6
- * @link based on substr(): http://www.zend.com/manual/function.substr.php
- * @param string
- * @param position: startposition of the substring, beginning with 0
- * @param length: length of substring
- * @return string
- *
- * -------------------------------------------------------------
- */
+/**
+ * Smarty plugin
+ * Type: modifier
+ * Name: substring
+ * Version: 0.1
+ * Date: 2006-16-02
+ * Author: Thorsten Albrecht <thor_REMOVE.THIS_@wolke7.net>
+ * Purpose: "substring" allows you to retrieve a small part (substring) of a string.
+ * Notes: The substring is specified by giving the start position and the length.
+ * Unlike the original function substr() in PHP the position of the characters
+ * in the string starts at 1 (not at 0 as usual in php).
+ * Example smarty code:
+ * {$my_string|substring:2:4}
+ * returns substring from character 2 until character 6
+ * @link based on substr(): http://www.zend.com/manual/function.substr.php
+ * @param string
+ * @param position: startposition of the substring, beginning with 0
+ * @param length: length of substring
+ * @return string
+ *
+ * -------------------------------------------------------------
+ */
function smarty_modifier_substring($string, $position, $length) {
return substr($string, $position, $length);
}
'title' => 'Participant Note',
'name' => 'participant_note',
'type' => CRM_Utils_Type::T_STRING,
- ));
+ ),
+ );
- $participantStatus = array(
+ $participantStatus = array(
'participant_status' => array(
'title' => 'Participant Status',
'name' => 'participant_status',
'type' => CRM_Utils_Type::T_STRING,
- ));
+ ),
+ );
- $participantRole = array(
+ $participantRole = array(
'participant_role' => array(
'title' => 'Participant Role',
'name' => 'participant_role',
'type' => CRM_Utils_Type::T_STRING,
- ));
+ ),
+ );
- $discountFields = CRM_Core_DAO_Discount::export();
+ $discountFields = CRM_Core_DAO_Discount::export();
- $fields = array_merge($participantFields, $participantStatus, $participantRole, $eventFields, $noteField, $discountFields);
+ $fields = array_merge($participantFields, $participantStatus, $participantRole, $eventFields, $noteField, $discountFields);
- // add custom data
- $fields = array_merge($fields, CRM_Core_BAO_CustomField::getFieldsForImport('Participant'));
- self::$_exportableFields = $fields;
+ // add custom data
+ $fields = array_merge($fields, CRM_Core_BAO_CustomField::getFieldsForImport('Participant'));
+ self::$_exportableFields = $fields;
}
return self::$_exportableFields;
/**
* Checks duplicate participants
*
- * @param array $duplicates
- * (reference ) an assoc array of name/value pairs.
* @param array $input
* An assosiative array of name /value pairs.
* from other function
+ * @param array $duplicates
+ * (reference ) an assoc array of name/value pairs.
*
* @return CRM_Contribute_BAO_Contribution
*/
* @param int $newStatusID
* @param bool $updatePrimaryStatus
*
- * @return bool|void
+ * @return bool|NULL
*/
public static function updateParticipantStatus($participantID, $oldStatusID, $newStatusID = NULL, $updatePrimaryStatus = FALSE) {
if (!$participantID || !$oldStatusID) {
- return;
+ return NULL;
}
if (!$newStatusID) {
* @param bool $returnResult
* @param bool $skipCascadeRule
*
- * @return array
+ * @return array|NULL
*/
public static function transitionParticipants(
$participantIds, $toStatusId,
$fromStatusId = NULL, $returnResult = FALSE, $skipCascadeRule = FALSE
) {
if (!is_array($participantIds) || empty($participantIds) || !$toStatusId) {
- return;
+ return NULL;
}
//thumb rule is if we triggering primary participant need to triggered additional
*
* @param string $fieldName
* @param string $context
- * @see CRM_Core_DAO::buildOptionsContext.
+ * @see CRM_Core_DAO::buildOptionsContext
* @param array $props
* whatever is known about this dao object.
*
// DAO-based tables
case in_array($table, array_keys($daos)):
- $dao = new $daos[$table];
+ $dao = new $daos[$table]();
foreach ($row as $id => $changes) {
$dao->id = $id;
foreach ($changes as $field => $value) {
*
* @return void
*/
-
public function buildQuickForm() {
$this->addButtons(array(
array(
asort($this->activeCampaigns);
}
$this->_columns = array(
- 'civicrm_contact' => array(
- 'dao' => 'CRM_Contact_DAO_Contact',
- 'fields' => array(
- 'sort_name' => array(
- 'title' => ts('Donor Name'),
- 'required' => TRUE,
- ),
- 'first_name' => array(
- 'title' => ts('First Name'),
- ),
- 'last_name' => array(
- 'title' => ts('Last Name'),
- ),
- 'id' => array(
- 'no_display' => TRUE,
- 'required' => TRUE,
- ),
- 'contact_type' => array(
- 'title' => ts('Contact Type'),
- ),
- 'contact_sub_type' => array(
- 'title' => ts('Contact Subtype'),
- ),
+ 'civicrm_contact' => array(
+ 'dao' => 'CRM_Contact_DAO_Contact',
+ 'fields' => array(
+ 'sort_name' => array(
+ 'title' => ts('Donor Name'),
+ 'required' => TRUE,
),
- 'filters' => array(
- 'sort_name' => array(
- 'title' => ts('Donor Name'),
- 'operator' => 'like',
- ),
- 'id' => array(
- 'title' => ts('Contact ID'),
- 'no_display' => TRUE,
- 'type' => CRM_Utils_Type::T_INT,
- ),
+ 'first_name' => array(
+ 'title' => ts('First Name'),
),
- 'order_bys' => array(
- 'sort_name' => array(
- 'title' => ts('Last Name, First Name'),
- 'default' => '1',
- 'default_weight' => '0',
- 'default_order' => 'ASC',
- ),
+ 'last_name' => array(
+ 'title' => ts('Last Name'),
+ ),
+ 'id' => array(
+ 'no_display' => TRUE,
+ 'required' => TRUE,
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
),
- 'grouping' => 'contact-fields',
),
- 'civicrm_email' => array(
- 'dao' => 'CRM_Core_DAO_Email',
- 'fields' => array(
- 'email' => array(
- 'title' => ts('Donor Email'),
- 'default' => TRUE,
- ),
+ 'filters' => array(
+ 'sort_name' => array(
+ 'title' => ts('Donor Name'),
+ 'operator' => 'like',
+ ),
+ 'id' => array(
+ 'title' => ts('Contact ID'),
+ 'no_display' => TRUE,
+ 'type' => CRM_Utils_Type::T_INT,
),
- 'grouping' => 'contact-fields',
),
- 'civicrm_phone' => array(
- 'dao' => 'CRM_Core_DAO_Phone',
- 'fields' => array(
- 'phone' => array(
- 'title' => ts('Donor Phone'),
- 'default' => TRUE,
- 'no_repeat' => TRUE,
- ),
+ 'order_bys' => array(
+ 'sort_name' => array(
+ 'title' => ts('Last Name, First Name'),
+ 'default' => '1',
+ 'default_weight' => '0',
+ 'default_order' => 'ASC',
),
- 'grouping' => 'contact-fields',
),
- 'civicrm_contribution' => array(
- 'dao' => 'CRM_Contribute_DAO_Contribution',
- 'fields' => array(
- 'contribution_id' => array(
- 'name' => 'id',
- 'no_display' => TRUE,
- 'required' => TRUE,
- ),
- 'list_contri_id' => array(
- 'name' => 'id',
- 'title' => ts('Contribution ID'),
- ),
- 'financial_type_id' => array(
- 'title' => ts('Financial Type'),
- 'default' => TRUE,
- ),
- 'contribution_status_id' => array(
- 'title' => ts('Contribution Status'),
- ),
- 'contribution_page_id' => array(
- 'title' => ts('Contribution Page'),
- ),
- 'source' => array(
- 'title' => ts('Source'),
- ),
- 'payment_instrument_id' => array(
- 'title' => ts('Payment Type'),
- ),
- 'check_number' => array(
- 'title' => ts('Check Number'),
- ),
- 'currency' => array(
- 'required' => TRUE,
- 'no_display' => TRUE,
- ),
- 'trxn_id' => NULL,
- 'receive_date' => array('default' => TRUE),
- 'receipt_date' => NULL,
- 'total_amount' => array(
- 'title' => ts('Amount'),
- 'required' => TRUE,
- 'statistics' => array('sum' => ts('Amount')),
- ),
- 'fee_amount' => NULL,
- 'net_amount' => NULL,
- 'contribution_or_soft' => array(
- 'title' => ts('Contribution OR Soft Credit?'),
- 'dbAlias' => "'Contribution'",
- ),
- 'soft_credits' => array(
- 'title' => ts('Soft Credits'),
- 'dbAlias' => "NULL",
- ),
- 'soft_credit_for' => array(
- 'title' => ts('Soft Credit For'),
- 'dbAlias' => "NULL",
- ),
+ 'grouping' => 'contact-fields',
+ ),
+ 'civicrm_email' => array(
+ 'dao' => 'CRM_Core_DAO_Email',
+ 'fields' => array(
+ 'email' => array(
+ 'title' => ts('Donor Email'),
+ 'default' => TRUE,
),
- 'filters' => array(
- 'contribution_or_soft' => array(
- 'title' => ts('Contribution OR Soft Credit?'),
- 'clause' => "(1)",
- 'operatorType' => CRM_Report_Form::OP_SELECT,
- 'type' => CRM_Utils_Type::T_STRING,
- 'options' => array(
- 'both' => ts('Both'),
- 'contributions_only' => ts('Contributions Only'),
- 'soft_credits_only' => ts('Soft Credits Only'),
- ),
- ),
- 'receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
- 'currency' => array(
- 'title' => 'Currency',
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Core_OptionGroup::values('currencies_enabled'),
- 'default' => NULL,
- 'type' => CRM_Utils_Type::T_STRING,
- ),
- 'financial_type_id' => array(
- 'title' => ts('Financial Type'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Contribute_PseudoConstant::financialType(),
- 'type' => CRM_Utils_Type::T_INT,
- ),
- 'contribution_page_id' => array(
- 'title' => ts('Contribution Page'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Contribute_PseudoConstant::contributionPage(),
- 'type' => CRM_Utils_Type::T_INT,
- ),
- 'payment_instrument_id' => array(
- 'title' => ts('Payment Type'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Contribute_PseudoConstant::paymentInstrument(),
- 'type' => CRM_Utils_Type::T_INT,
- ),
- 'contribution_status_id' => array(
- 'title' => ts('Contribution Status'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
- 'default' => array(1),
- 'type' => CRM_Utils_Type::T_INT,
- ),
- 'total_amount' => array('title' => ts('Contribution Amount')),
+ ),
+ 'grouping' => 'contact-fields',
+ ),
+ 'civicrm_phone' => array(
+ 'dao' => 'CRM_Core_DAO_Phone',
+ 'fields' => array(
+ 'phone' => array(
+ 'title' => ts('Donor Phone'),
+ 'default' => TRUE,
+ 'no_repeat' => TRUE,
+ ),
+ ),
+ 'grouping' => 'contact-fields',
+ ),
+ 'civicrm_contribution' => array(
+ 'dao' => 'CRM_Contribute_DAO_Contribution',
+ 'fields' => array(
+ 'contribution_id' => array(
+ 'name' => 'id',
+ 'no_display' => TRUE,
+ 'required' => TRUE,
+ ),
+ 'list_contri_id' => array(
+ 'name' => 'id',
+ 'title' => ts('Contribution ID'),
+ ),
+ 'financial_type_id' => array(
+ 'title' => ts('Financial Type'),
+ 'default' => TRUE,
+ ),
+ 'contribution_status_id' => array(
+ 'title' => ts('Contribution Status'),
+ ),
+ 'contribution_page_id' => array(
+ 'title' => ts('Contribution Page'),
+ ),
+ 'source' => array(
+ 'title' => ts('Source'),
+ ),
+ 'payment_instrument_id' => array(
+ 'title' => ts('Payment Type'),
+ ),
+ 'check_number' => array(
+ 'title' => ts('Check Number'),
+ ),
+ 'currency' => array(
+ 'required' => TRUE,
+ 'no_display' => TRUE,
+ ),
+ 'trxn_id' => NULL,
+ 'receive_date' => array('default' => TRUE),
+ 'receipt_date' => NULL,
+ 'total_amount' => array(
+ 'title' => ts('Amount'),
+ 'required' => TRUE,
+ 'statistics' => array('sum' => ts('Amount')),
),
- 'order_bys' => array(
- 'financial_type_id' => array('title' => ts('Financial Type')),
- 'contribution_status_id' => array('title' => ts('Contribution Status')),
- 'payment_instrument_id' => array('title' => ts('Payment Instrument')),
- 'receive_date' => array('title' => ts('Receive Date')),
+ 'fee_amount' => NULL,
+ 'net_amount' => NULL,
+ 'contribution_or_soft' => array(
+ 'title' => ts('Contribution OR Soft Credit?'),
+ 'dbAlias' => "'Contribution'",
+ ),
+ 'soft_credits' => array(
+ 'title' => ts('Soft Credits'),
+ 'dbAlias' => "NULL",
+ ),
+ 'soft_credit_for' => array(
+ 'title' => ts('Soft Credit For'),
+ 'dbAlias' => "NULL",
),
- 'grouping' => 'contri-fields',
),
- 'civicrm_contribution_soft' => array(
- 'dao' => 'CRM_Contribute_DAO_ContributionSoft',
- 'fields' => array(
- 'soft_credit_type_id' => array('title' => ts('Soft Credit Type')),
- ),
- 'filters' => array(
- 'soft_credit_type_id' => array(
- 'title' => 'Soft Credit Type',
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Core_OptionGroup::values('soft_credit_type'),
- 'default' => NULL,
- 'type' => CRM_Utils_Type::T_STRING,
+ 'filters' => array(
+ 'contribution_or_soft' => array(
+ 'title' => ts('Contribution OR Soft Credit?'),
+ 'clause' => "(1)",
+ 'operatorType' => CRM_Report_Form::OP_SELECT,
+ 'type' => CRM_Utils_Type::T_STRING,
+ 'options' => array(
+ 'both' => ts('Both'),
+ 'contributions_only' => ts('Contributions Only'),
+ 'soft_credits_only' => ts('Soft Credits Only'),
),
),
+ 'receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
+ 'currency' => array(
+ 'title' => 'Currency',
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Core_OptionGroup::values('currencies_enabled'),
+ 'default' => NULL,
+ 'type' => CRM_Utils_Type::T_STRING,
+ ),
+ 'financial_type_id' => array(
+ 'title' => ts('Financial Type'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Contribute_PseudoConstant::financialType(),
+ 'type' => CRM_Utils_Type::T_INT,
+ ),
+ 'contribution_page_id' => array(
+ 'title' => ts('Contribution Page'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Contribute_PseudoConstant::contributionPage(),
+ 'type' => CRM_Utils_Type::T_INT,
+ ),
+ 'payment_instrument_id' => array(
+ 'title' => ts('Payment Type'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Contribute_PseudoConstant::paymentInstrument(),
+ 'type' => CRM_Utils_Type::T_INT,
+ ),
+ 'contribution_status_id' => array(
+ 'title' => ts('Contribution Status'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
+ 'default' => array(1),
+ 'type' => CRM_Utils_Type::T_INT,
+ ),
+ 'total_amount' => array('title' => ts('Contribution Amount')),
),
- 'civicrm_contribution_ordinality' => array(
- 'dao' => 'CRM_Contribute_DAO_Contribution',
- 'alias' => 'cordinality',
- 'filters' => array(
- 'ordinality' => array(
- 'title' => ts('Contribution Ordinality'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => array(
- 0 => 'First by Contributor',
- 1 => 'Second or Later by Contributor',
- ),
- 'type' => CRM_Utils_Type::T_INT,
- ),
+ 'order_bys' => array(
+ 'financial_type_id' => array('title' => ts('Financial Type')),
+ 'contribution_status_id' => array('title' => ts('Contribution Status')),
+ 'payment_instrument_id' => array('title' => ts('Payment Instrument')),
+ 'receive_date' => array('title' => ts('Receive Date')),
+ ),
+ 'grouping' => 'contri-fields',
+ ),
+ 'civicrm_contribution_soft' => array(
+ 'dao' => 'CRM_Contribute_DAO_ContributionSoft',
+ 'fields' => array(
+ 'soft_credit_type_id' => array('title' => ts('Soft Credit Type')),
+ ),
+ 'filters' => array(
+ 'soft_credit_type_id' => array(
+ 'title' => 'Soft Credit Type',
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Core_OptionGroup::values('soft_credit_type'),
+ 'default' => NULL,
+ 'type' => CRM_Utils_Type::T_STRING,
),
),
- 'civicrm_note' => array(
- 'dao' => 'CRM_Core_DAO_Note',
- 'fields' => array(
- 'contribution_note' => array(
- 'name' => 'note',
- 'title' => ts('Contribution Note'),
- ),
+ ),
+ 'civicrm_contribution_ordinality' => array(
+ 'dao' => 'CRM_Contribute_DAO_Contribution',
+ 'alias' => 'cordinality',
+ 'filters' => array(
+ 'ordinality' => array(
+ 'title' => ts('Contribution Ordinality'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => array(
+ 0 => 'First by Contributor',
+ 1 => 'Second or Later by Contributor',
+ ),
+ 'type' => CRM_Utils_Type::T_INT,
),
- 'filters' => array(
- 'note' => array(
- 'name' => 'note',
- 'title' => ts('Contribution Note'),
- 'operator' => 'like',
- 'type' => CRM_Utils_Type::T_STRING,
- ),
+ ),
+ ),
+ 'civicrm_note' => array(
+ 'dao' => 'CRM_Core_DAO_Note',
+ 'fields' => array(
+ 'contribution_note' => array(
+ 'name' => 'note',
+ 'title' => ts('Contribution Note'),
+ ),
+ ),
+ 'filters' => array(
+ 'note' => array(
+ 'name' => 'note',
+ 'title' => ts('Contribution Note'),
+ 'operator' => 'like',
+ 'type' => CRM_Utils_Type::T_STRING,
),
),
- ) + $this->addAddressFields(FALSE);
+ ),
+ ) + $this->addAddressFields(FALSE);
$this->_groupFilter = TRUE;
$this->_tagFilter = TRUE;
public $_drilldownReport = array('contribute/detail' => 'Link to Detail Report');
- /**
- */
/**
*/
public function __construct() {
}
$this->_columns = array(
- 'civicrm_contact' => array(
- 'dao' => 'CRM_Contact_DAO_Contact',
- 'fields' => array(
- 'sort_name' => array(
- 'title' => ts('Contact Name'),
- 'no_repeat' => TRUE,
- ),
- 'postal_greeting_display' => array('title' => ts('Postal Greeting')),
- 'id' => array(
- 'no_display' => TRUE,
- 'required' => TRUE,
- ),
- 'contact_type' => array(
- 'title' => ts('Contact Type'),
- ),
- 'contact_sub_type' => array(
- 'title' => ts('Contact Subtype'),
- ),
+ 'civicrm_contact' => array(
+ 'dao' => 'CRM_Contact_DAO_Contact',
+ 'fields' => array(
+ 'sort_name' => array(
+ 'title' => ts('Contact Name'),
+ 'no_repeat' => TRUE,
),
- 'grouping' => 'contact-fields',
- 'group_bys' => array(
- 'id' => array('title' => ts('Contact ID')),
- 'sort_name' => array(
- 'title' => ts('Contact Name'),
- ),
+ 'postal_greeting_display' => array('title' => ts('Postal Greeting')),
+ 'id' => array(
+ 'no_display' => TRUE,
+ 'required' => TRUE,
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
),
),
- 'civicrm_email' => array(
- 'dao' => 'CRM_Core_DAO_Email',
- 'fields' => array(
- 'email' => array(
- 'title' => ts('Email'),
- 'no_repeat' => TRUE,
- ),
+ 'grouping' => 'contact-fields',
+ 'group_bys' => array(
+ 'id' => array('title' => ts('Contact ID')),
+ 'sort_name' => array(
+ 'title' => ts('Contact Name'),
),
- 'grouping' => 'contact-fields',
),
- 'civicrm_phone' => array(
- 'dao' => 'CRM_Core_DAO_Phone',
- 'fields' => array(
- 'phone' => array(
- 'title' => ts('Phone'),
- 'no_repeat' => TRUE,
- ),
+ ),
+ 'civicrm_email' => array(
+ 'dao' => 'CRM_Core_DAO_Email',
+ 'fields' => array(
+ 'email' => array(
+ 'title' => ts('Email'),
+ 'no_repeat' => TRUE,
),
- 'grouping' => 'contact-fields',
),
- 'civicrm_financial_type' => array(
- 'dao' => 'CRM_Financial_DAO_FinancialType',
- 'fields' => array('financial_type' => NULL),
- 'grouping' => 'contri-fields',
- 'group_bys' => array(
- 'financial_type' => array('title' => ts('Financial Type')),
+ 'grouping' => 'contact-fields',
+ ),
+ 'civicrm_phone' => array(
+ 'dao' => 'CRM_Core_DAO_Phone',
+ 'fields' => array(
+ 'phone' => array(
+ 'title' => ts('Phone'),
+ 'no_repeat' => TRUE,
),
),
- 'civicrm_contribution' => array(
- 'dao' => 'CRM_Contribute_DAO_Contribution',
+ 'grouping' => 'contact-fields',
+ ),
+ 'civicrm_financial_type' => array(
+ 'dao' => 'CRM_Financial_DAO_FinancialType',
+ 'fields' => array('financial_type' => NULL),
+ 'grouping' => 'contri-fields',
+ 'group_bys' => array(
+ 'financial_type' => array('title' => ts('Financial Type')),
+ ),
+ ),
+ 'civicrm_contribution' => array(
+ 'dao' => 'CRM_Contribute_DAO_Contribution',
//'bao' => 'CRM_Contribute_BAO_Contribution',
- 'fields' => array(
- 'contribution_source' => array('title' => ts('Source')),
- 'currency' => array(
- 'required' => TRUE,
- 'no_display' => TRUE,
- ),
- 'total_amount' => array(
- 'title' => ts('Contribution Amount Stats'),
- 'default' => TRUE,
- 'statistics' => array(
- 'sum' => ts('Contribution Aggregate'),
- 'count' => ts('Contributions'),
- 'avg' => ts('Contribution Avg'),
- ),
- ),
+ 'fields' => array(
+ 'contribution_source' => array('title' => ts('Source')),
+ 'currency' => array(
+ 'required' => TRUE,
+ 'no_display' => TRUE,
),
- 'grouping' => 'contri-fields',
- 'filters' => array(
- 'receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
- 'contribution_status_id' => array(
- 'title' => ts('Contribution Status'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
- 'default' => array(1),
- 'type' => CRM_Utils_Type::T_INT,
- ),
- 'currency' => array(
- 'title' => 'Currency',
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Core_OptionGroup::values('currencies_enabled'),
- 'default' => NULL,
- 'type' => CRM_Utils_Type::T_STRING,
- ),
- 'financial_type_id' => array(
- 'title' => ts('Financial Type'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Contribute_PseudoConstant::financialType(),
- 'type' => CRM_Utils_Type::T_INT,
- ),
- 'contribution_page_id' => array(
- 'title' => ts('Contribution Page'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Contribute_PseudoConstant::contributionPage(),
- 'type' => CRM_Utils_Type::T_INT,
- ),
- 'total_amount' => array(
- 'title' => ts('Contribution Amount'),
- ),
- 'total_sum' => array(
- 'title' => ts('Contribution Aggregate'),
- 'type' => CRM_Report_Form::OP_INT,
- 'dbAlias' => 'civicrm_contribution_total_amount_sum',
- 'having' => TRUE,
- ),
- 'total_count' => array(
- 'title' => ts('Contribution Count'),
- 'type' => CRM_Report_Form::OP_INT,
- 'dbAlias' => 'civicrm_contribution_total_amount_count',
- 'having' => TRUE,
- ),
- 'total_avg' => array(
- 'title' => ts('Contribution Avg'),
- 'type' => CRM_Report_Form::OP_INT,
- 'dbAlias' => 'civicrm_contribution_total_amount_avg',
- 'having' => TRUE,
+ 'total_amount' => array(
+ 'title' => ts('Contribution Amount Stats'),
+ 'default' => TRUE,
+ 'statistics' => array(
+ 'sum' => ts('Contribution Aggregate'),
+ 'count' => ts('Contributions'),
+ 'avg' => ts('Contribution Avg'),
),
),
- 'group_bys' => array(
- 'receive_date' => array(
- 'frequency' => TRUE,
- 'default' => TRUE,
- 'chart' => TRUE,
- ),
- 'contribution_source' => NULL,
+ ),
+ 'grouping' => 'contri-fields',
+ 'filters' => array(
+ 'receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
+ 'contribution_status_id' => array(
+ 'title' => ts('Contribution Status'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
+ 'default' => array(1),
+ 'type' => CRM_Utils_Type::T_INT,
+ ),
+ 'currency' => array(
+ 'title' => 'Currency',
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Core_OptionGroup::values('currencies_enabled'),
+ 'default' => NULL,
+ 'type' => CRM_Utils_Type::T_STRING,
+ ),
+ 'financial_type_id' => array(
+ 'title' => ts('Financial Type'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Contribute_PseudoConstant::financialType(),
+ 'type' => CRM_Utils_Type::T_INT,
+ ),
+ 'contribution_page_id' => array(
+ 'title' => ts('Contribution Page'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Contribute_PseudoConstant::contributionPage(),
+ 'type' => CRM_Utils_Type::T_INT,
+ ),
+ 'total_amount' => array(
+ 'title' => ts('Contribution Amount'),
+ ),
+ 'total_sum' => array(
+ 'title' => ts('Contribution Aggregate'),
+ 'type' => CRM_Report_Form::OP_INT,
+ 'dbAlias' => 'civicrm_contribution_total_amount_sum',
+ 'having' => TRUE,
+ ),
+ 'total_count' => array(
+ 'title' => ts('Contribution Count'),
+ 'type' => CRM_Report_Form::OP_INT,
+ 'dbAlias' => 'civicrm_contribution_total_amount_count',
+ 'having' => TRUE,
+ ),
+ 'total_avg' => array(
+ 'title' => ts('Contribution Avg'),
+ 'type' => CRM_Report_Form::OP_INT,
+ 'dbAlias' => 'civicrm_contribution_total_amount_avg',
+ 'having' => TRUE,
),
),
- 'civicrm_contribution_soft' => array(
- 'dao' => 'CRM_Contribute_DAO_ContributionSoft',
- 'fields' => array(
- 'soft_amount' => array(
- 'title' => ts('Soft Credit Amount Stats'),
- 'name' => 'amount',
- 'statistics' => array(
- 'sum' => ts('Soft Credit Aggregate'),
- 'count' => ts('Soft Credits'),
- 'avg' => ts('Soft Credit Avg'),
- ),
- ),
+ 'group_bys' => array(
+ 'receive_date' => array(
+ 'frequency' => TRUE,
+ 'default' => TRUE,
+ 'chart' => TRUE,
),
- 'grouping' => 'contri-fields',
- 'filters' => array(
- 'amount' => array(
- 'title' => ts('Soft Credit Amount'),
- ),
- 'soft_credit_type_id' => array(
- 'title' => 'Soft Credit Type',
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Core_OptionGroup::values('soft_credit_type'),
- 'default' => NULL,
- 'type' => CRM_Utils_Type::T_STRING,
- ),
- 'soft_sum' => array(
- 'title' => ts('Soft Credit Aggregate'),
- 'type' => CRM_Report_Form::OP_INT,
- 'dbAlias' => 'civicrm_contribution_soft_soft_amount_sum',
- 'having' => TRUE,
- ),
- 'soft_count' => array(
- 'title' => ts('Soft Credits Count'),
- 'type' => CRM_Report_Form::OP_INT,
- 'dbAlias' => 'civicrm_contribution_soft_soft_amount_count',
- 'having' => TRUE,
- ),
- 'soft_avg' => array(
- 'title' => ts('Soft Credit Avg'),
- 'type' => CRM_Report_Form::OP_INT,
- 'dbAlias' => 'civicrm_contribution_soft_soft_amount_avg',
- 'having' => TRUE,
+ 'contribution_source' => NULL,
+ ),
+ ),
+ 'civicrm_contribution_soft' => array(
+ 'dao' => 'CRM_Contribute_DAO_ContributionSoft',
+ 'fields' => array(
+ 'soft_amount' => array(
+ 'title' => ts('Soft Credit Amount Stats'),
+ 'name' => 'amount',
+ 'statistics' => array(
+ 'sum' => ts('Soft Credit Aggregate'),
+ 'count' => ts('Soft Credits'),
+ 'avg' => ts('Soft Credit Avg'),
),
),
),
- ) + $this->addAddressFields();
+ 'grouping' => 'contri-fields',
+ 'filters' => array(
+ 'amount' => array(
+ 'title' => ts('Soft Credit Amount'),
+ ),
+ 'soft_credit_type_id' => array(
+ 'title' => 'Soft Credit Type',
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Core_OptionGroup::values('soft_credit_type'),
+ 'default' => NULL,
+ 'type' => CRM_Utils_Type::T_STRING,
+ ),
+ 'soft_sum' => array(
+ 'title' => ts('Soft Credit Aggregate'),
+ 'type' => CRM_Report_Form::OP_INT,
+ 'dbAlias' => 'civicrm_contribution_soft_soft_amount_sum',
+ 'having' => TRUE,
+ ),
+ 'soft_count' => array(
+ 'title' => ts('Soft Credits Count'),
+ 'type' => CRM_Report_Form::OP_INT,
+ 'dbAlias' => 'civicrm_contribution_soft_soft_amount_count',
+ 'having' => TRUE,
+ ),
+ 'soft_avg' => array(
+ 'title' => ts('Soft Credit Avg'),
+ 'type' => CRM_Report_Form::OP_INT,
+ 'dbAlias' => 'civicrm_contribution_soft_soft_amount_avg',
+ 'having' => TRUE,
+ ),
+ ),
+ ),
+ ) + $this->addAddressFields();
// If we have a campaign, build out the relevant elements
if ($campaignEnabled && !empty($this->activeCampaigns)) {
}
$this->_columns = array(
- 'civicrm_contact' => array(
- 'dao' => 'CRM_Contact_DAO_Contact',
- 'grouping' => 'contact-field',
- 'fields' => array(
- 'sort_name' => array(
- 'title' => ts('Donor Name'),
- 'required' => TRUE,
- ),
- 'first_name' => array(
- 'title' => ts('First Name'),
- ),
- 'last_name' => array(
- 'title' => ts('Last Name'),
- ),
- 'contact_type' => array(
- 'title' => ts('Contact Type'),
- ),
- 'contact_sub_type' => array(
- 'title' => ts('Contact Subtype'),
- ),
+ 'civicrm_contact' => array(
+ 'dao' => 'CRM_Contact_DAO_Contact',
+ 'grouping' => 'contact-field',
+ 'fields' => array(
+ 'sort_name' => array(
+ 'title' => ts('Donor Name'),
+ 'required' => TRUE,
),
- 'filters' => array(
- 'sort_name' => array(
- 'title' => ts('Donor Name'),
- 'operator' => 'like',
- ),
+ 'first_name' => array(
+ 'title' => ts('First Name'),
+ ),
+ 'last_name' => array(
+ 'title' => ts('Last Name'),
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
),
),
- 'civicrm_email' => array(
- 'dao' => 'CRM_Core_DAO_Email',
- 'grouping' => 'contact-field',
- 'fields' => array(
- 'email' => array(
- 'title' => ts('Email'),
- 'default' => TRUE,
- ),
+ 'filters' => array(
+ 'sort_name' => array(
+ 'title' => ts('Donor Name'),
+ 'operator' => 'like',
),
),
- 'civicrm_phone' => array(
- 'dao' => 'CRM_Core_DAO_Phone',
- 'grouping' => 'contact-field',
- 'fields' => array(
- 'phone' => array(
- 'title' => ts('Phone'),
- 'default' => TRUE,
- ),
+ ),
+ 'civicrm_email' => array(
+ 'dao' => 'CRM_Core_DAO_Email',
+ 'grouping' => 'contact-field',
+ 'fields' => array(
+ 'email' => array(
+ 'title' => ts('Email'),
+ 'default' => TRUE,
),
),
- )
- + $this->addAddressFields()
- + array(
- 'civicrm_contribution' => array(
- 'dao' => 'CRM_Contribute_DAO_Contribution',
- 'fields' => array(
- 'contact_id' => array(
- 'title' => ts('contactId'),
- 'no_display' => TRUE,
- 'required' => TRUE,
- 'no_repeat' => TRUE,
- ),
- 'total_amount' => array(
- 'title' => ts('Total Amount'),
- 'no_display' => TRUE,
- 'required' => TRUE,
- 'no_repeat' => TRUE,
- ),
- 'receive_date' => array(
- 'title' => ts('Year'),
- 'no_display' => TRUE,
- 'required' => TRUE,
- 'no_repeat' => TRUE,
- ),
+ ),
+ 'civicrm_phone' => array(
+ 'dao' => 'CRM_Core_DAO_Phone',
+ 'grouping' => 'contact-field',
+ 'fields' => array(
+ 'phone' => array(
+ 'title' => ts('Phone'),
+ 'default' => TRUE,
+ ),
+ ),
+ ),
+ );
+ $this->_columns += $this->addAddressFields();
+ $this->_columns += array(
+ 'civicrm_contribution' => array(
+ 'dao' => 'CRM_Contribute_DAO_Contribution',
+ 'fields' => array(
+ 'contact_id' => array(
+ 'title' => ts('contactId'),
+ 'no_display' => TRUE,
+ 'required' => TRUE,
+ 'no_repeat' => TRUE,
+ ),
+ 'total_amount' => array(
+ 'title' => ts('Total Amount'),
+ 'no_display' => TRUE,
+ 'required' => TRUE,
+ 'no_repeat' => TRUE,
),
- 'filters' => array(
- 'yid' => array(
- 'name' => 'receive_date',
- 'title' => ts('This Year'),
- 'operatorType' => CRM_Report_Form::OP_SELECT,
- 'options' => $optionYear,
- 'default' => date('Y'),
- ),
- 'financial_type_id' => array(
- 'title' => ts('Financial Type'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Contribute_PseudoConstant::financialType(),
- ),
- 'contribution_status_id' => array(
- 'title' => ts('Contribution Status'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
- 'default' => array('1'),
- ),
+ 'receive_date' => array(
+ 'title' => ts('Year'),
+ 'no_display' => TRUE,
+ 'required' => TRUE,
+ 'no_repeat' => TRUE,
),
),
- );
+ 'filters' => array(
+ 'yid' => array(
+ 'name' => 'receive_date',
+ 'title' => ts('This Year'),
+ 'operatorType' => CRM_Report_Form::OP_SELECT,
+ 'options' => $optionYear,
+ 'default' => date('Y'),
+ ),
+ 'financial_type_id' => array(
+ 'title' => ts('Financial Type'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Contribute_PseudoConstant::financialType(),
+ ),
+ 'contribution_status_id' => array(
+ 'title' => ts('Contribution Status'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
+ 'default' => array('1'),
+ ),
+ ),
+ ),
+ );
// If we have a campaign, build out the relevant elements
if ($campaignEnabled && !empty($this->activeCampaigns)) {
/**
* Validation rule for subtype.
*
- * @param array $groupType
- * Contains all groupTypes.
- *
* @param string $fieldType
* Type of field.
- *
+ * @param array $groupType
+ * Contains all groupTypes.
* @param array $errors
- *
- * @return array
- * list of errors to be posted back to the form
+ * List of errors to be posted back to the form.
*/
- public static function formRuleSubType($fieldType, $groupType, $errors) {
+ public static function formRuleSubType($fieldType, $groupType, &$errors) {
if (in_array($fieldType, array(
'Participant',
'Contribution',
foreach ($keys as $key) {
$name = $key['info'];
- if ($prefix == substr($name, 0, $lp)) { // Ours?
+ if ($prefix == substr($name, 0, $lp)) {
+ // Ours?
apc_delete($this->_prefix . $name);
}
}
require_once str_replace('_', DIRECTORY_SEPARATOR, $daoName) . ".php";
- $dao = new $daoName;
+ $dao = new $daoName();
$table = $dao->getTablename();
$fields = &$dao->fields();
$fieldlist = array_keys($fields);
'worldRegion',
'wysiwygEditor',
);
- $params = (array(
- 'name' => array(
+ $params = array(
+ 'name' => array(
'title' => 'Constant Name',
'name' => 'name',
'api.required' => 1,
- 'options' => array_combine($options, $options),
- ))
+ 'options' => array_combine($options, $options),
+ ),
);
}
* @return boolean
* returns true is successfully cancelled
*/
-
function civicrm_api3_contribution_recur_cancel($params) {
civicrm_api3_verify_one_mandatory($params, NULL, array('id'));
return CRM_Contribute_BAO_ContributionRecur::cancelRecurContribution($params['id'], CRM_Core_DAO::$_nullObject) ? civicrm_api3_create_success() : civicrm_api3_create_error(ts('Error while cancelling recurring contribution'));
* }
*/
+ /**
+ * Ensure that adding a script URL creates expected markup.
+ */
public function testAddScriptURL() {
$this->res
->addScriptUrl('/whiz/foo%20bar.js', 0, 'testAddScriptURL')
$this->assertTrue($this->isTextPresent("$name has been created."));
}
- /*
+ /**
* Webtest for CRM-12148
*/
public function testSearchBuilderfinancialType() {
$this->assertTrue($this->isTextPresent('6 Contacts'), 'Missing text: ' . '6 Contacts');
}
- /*
+ /**
* Webtest for CRM-12588
*/
public function testSearchBuilderMembershipType() {
}
///////////////// civicrm_contribution_
+
+ /**
+ * Create an contribution_id=FALSE and financial_type_id=Donation.
+ */
public function testCreateEmptyContributionIDUseDonation() {
$params = array(
'contribution_id' => FALSE,
$this->assertEquals(0, $lineItems['count']);
}
- /*
+ /**
* Test checks that passing in line items suppresses the create mechanism
*/
public function testCreateContributionChainedLineItems() {
-
$params = array(
'contact_id' => $this->_individualId,
'receive_date' => '20120511',
$this->contributionDelete($contributionId);
}
- /*
+ /**
* Function tests that additional financial records are created when fee amount is recorded
*/
public function testCreateContributionWithFee() {
$this->_checkFinancialRecords($contribution, 'payLater');
}
- /*
+ /**
* Function tests that additional financial records are created when online contribution with pending option
* is created
*/
$this->assertEquals('Check', $contribution['payment_instrument']);
}
- /*
+ /**
* Function tests that line items, financial records are updated when contribution amount is changed
*/
public function testCreateUpdateContributionChangeTotal() {
$this->assertEquals('125.00', $fitemAmount);
}
- /*
+ /**
* Function tests that line items, financial records are updated when pay later contribution is received
*/
public function testCreateUpdateContributionPayLater() {
$this->_checkFinancialTrxn($contribution, 'payLater');
}
- /*
+ /**
* Function tests that financial records are updated when Payment Instrument is changed
*/
public function testCreateUpdateContributionPaymentInstrument() {
$this->_checkFinancialTrxn($contribution, 'paymentInstrument', $instrumentId);
}
- /*
+ /**
* Function tests that financial records are added when Contribution is Refunded
*/
public function testCreateUpdateContributionRefund() {
$this->_checkFinancialItem($contribution['id'], 'refund');
}
- /*
+ /**
* Function tests invalid contribution status change
*/
public function testCreateUpdateContributionInValidStatusChange() {
}
- /*
+ /**
* Function tests that financial records are added when Pending Contribution is Canceled
*/
public function testCreateUpdateContributionCancelPending() {
$this->_checkFinancialItem($contribution['id'], 'cancelPending');
}
- /*
+ /**
* Function tests that financial records are added when Financial Type is Changed
*/
public function testCreateUpdateContributionChangeFinancialType() {
));
$this->assertEquals(2, $contribution['contribution_status_id']);
}
- //To Update Contribution
- //CHANGE: we require the API to do an incremental update
+
+ /**
+ * To Update Contribution
+ * CHANGE: we require the API to do an incremental update
+ */
public function testCreateUpdateContribution() {
$contributionID = $this->contributionCreate($this->_individualId, $this->_financialTypeId, 'idofsh', 212355);
}
///////////////// civicrm_contribution_delete methods
+
+ /**
+ * Attempt (but fail) to delete a contribution without parameters.
+ */
public function testDeleteEmptyParamsContribution() {
$params = array();
$this->callAPIFailure('contribution', 'delete', $params);
}
///////////////// civicrm_domain_create methods
- /*
+
+ /**
* This test checks for a memory leak observed when doing 2 gets on current domain
*/
-
-
public function testGetCurrentDomainTwice() {
$domain = $this->callAPISuccess('domain', 'getvalue', array(
'current_domain' => 1,
///////////////// civicrm_membership_status_delete methods
+
+ /**
+ * Attempt (and fail) to delete membership status without an parameters.
+ */
public function testDeleteEmptyParams() {
$result = $this->callAPIFailure('membership_status', 'delete', array());
}
// create entities
$baoObj1 = CRM_Core_DAO::createTestObject($baoString, array('currency' => 'USD'));
- $this->assertTrue(is_integer($baoObj1->id), 'check first id');
+ $this->assertTrue(is_int($baoObj1->id), 'check first id');
$this->deletableTestObjects[$baoString][] = $baoObj1->id;
$baoObj2 = CRM_Core_DAO::createTestObject($baoString, array('currency' => 'USD'));
- $this->assertTrue(is_integer($baoObj2->id), 'check second id');
+ $this->assertTrue(is_int($baoObj2->id), 'check second id');
$this->deletableTestObjects[$baoString][] = $baoObj2->id;
// fetch first by ID
}
}
- /** testing the _create **/
+ /* ---- testing the _create ---- */
/**
* @dataProvider toBeSkipped_create
while ($i < $count) {
// create entities
$baoObj = CRM_Core_DAO::createTestObject($baoString, array('currency' => 'USD'));
- $this->assertTrue(is_integer($baoObj->id), 'check first id');
+ $this->assertTrue(is_int($baoObj->id), 'check first id');
$this->deletableTestObjects[$baoString][] = $baoObj->id;
$baos[] = $baoObj;
$i++;