$this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array(
'CRM_Core_DAO_Job',
- $this->_id
+ $this->_id,
));
$this->add('text', 'description', ts('Description'),
/**
* Class constructor
*/
- function __construct($controller, $action = CRM_Core_Action::NONE) {
+ public function __construct($controller, $action = CRM_Core_Action::NONE) {
parent::__construct($controller, $action);
$this->_pages = array();
*
* @return array|null
*/
- static function defaultReturnProperties(
+ public static function defaultReturnProperties(
$mode,
$includeCustomFields = TRUE
) {
*
* @return void
*/
- function preProcess() {
+ public function preProcess() {
$this->_caseID = CRM_Utils_Request::retrieve('caseid', 'Integer', $this, TRUE);
$this->_clientID = CRM_Utils_Request::retrieve('cid', 'Integer', $this, TRUE);
$this->_activitySetName = CRM_Utils_Request::retrieve('asn', 'String', $this, TRUE);
* @param array $duplicates
* (reference ) store ids of duplicate contribs.
*
- * @return boolean
+ * @return bool
* true if duplicate, false otherwise
*/
public static function checkDuplicate($params, &$duplicates) {
public static $status = NULL;
- static $_recurringEntityHelper =
- array(
+ static $_recurringEntityHelper
+ = array(
'civicrm_event' => array(
'helper_class' => 'CRM_Event_DAO_Event',
'delete_func' => 'delete',
- 'pre_delete_func' => 'CRM_Event_Form_ManageEvent_Repeat::checkRegistrationForEvents'
+ 'pre_delete_func' => 'CRM_Event_Form_ManageEvent_Repeat::checkRegistrationForEvents',
),
'civicrm_activity' => array(
'helper_class' => 'CRM_Activity_DAO_Activity',
'delete_func' => 'delete',
- 'pre_delete_func' => ''
- )
+ 'pre_delete_func' => '',
+ ),
);
- static $_dateColumns =
- array(
+ static $_dateColumns
+ = array(
'civicrm_event' => array(
'dateColumns' => array('start_date'),
'excludeDateRangeColumns' => array('start_date', 'end_date'),
- 'intervalDateColumns' => array('end_date')
+ 'intervalDateColumns' => array('end_date'),
),
'civicrm_activity' => array(
'dateColumns' => array('activity_date_time'),
- )
+ ),
);
- static $_tableDAOMapper =
- array(
+ static $_tableDAOMapper
+ = array(
'civicrm_event' => 'CRM_Event_DAO_Event',
'civicrm_price_set_entity' => 'CRM_Price_DAO_PriceSetEntity',
'civicrm_uf_join' => 'CRM_Core_DAO_UFJoin',
'civicrm_activity_contact' => 'CRM_Activity_DAO_ActivityContact',
);
- static $_updateSkipFields =
- array(
+ static $_updateSkipFields
+ = array(
'civicrm_event' => array('start_date', 'end_date'),
'civicrm_tell_friend' => array('entity_id'),
'civicrm_pcp_block' => array('entity_id'),
'civicrm_activity' => array('activity_date_time'),
);
- static $_linkedEntitiesInfo =
- array(
+ static $_linkedEntitiesInfo
+ = array(
'civicrm_tell_friend' => array(
'entity_id_col' => 'entity_id',
- 'entity_table_col' => 'entity_table'
+ 'entity_table_col' => 'entity_table',
),
'civicrm_price_set_entity' => array(
'entity_id_col' => 'entity_id',
),
'civicrm_pcp_block' => array(
'entity_id_col' => 'entity_id',
- 'entity_table_col' => 'entity_table'
+ 'entity_table_col' => 'entity_table',
),
);
* @return object
*/
public static function quickAdd($parentId, $entityId, $entityTable) {
- $params =
- array(
+ $params
+ = array(
'parent_id' => $parentId,
'entity_id' => $entityId,
- 'entity_table' => $entityTable
+ 'entity_table' => $entityTable,
);
return self::add($params);
}
$query .= " AND entity_id != " . ($initiatorId ? "%3" : "%1");
}
- if ($mode == '1') { // MODE = SINGLE
+ // MODE = SINGLE
+ if ($mode == '1') {
$query .= " AND entity_id = %3";
}
- elseif ($mode == '2') { // MODE = FUTURE
+ // MODE = FUTURE
+ elseif ($mode == '2') {
$recurringEntityID = CRM_Core_DAO::singleValueQuery("SELECT id FROM civicrm_recurring_entity WHERE entity_id = %3 AND entity_table = %2", $queryParams);
if ($recurringEntityID) {
$query .= $includeParent ? " AND id >= %4" : " AND id > %4";
if (!$includeParent) {
$query .= " AND parent_id != %1";
}
- $parentId =
- CRM_Core_DAO::singleValueQuery($query,
+ $parentId
+ = CRM_Core_DAO::singleValueQuery($query,
array(
1 => array($entityId, 'Integer'),
2 => array($entityTable, 'String'),
// linked entity doesn't exist. lets create them
$newCriteria = array(
$idCol => $val['id'],
- $tableCol => $val['table']
+ $tableCol => $val['table'],
);
$linkedObj = CRM_Core_BAO_RecurringEntity::copyCreateEntity($obj->__table,
array('id' => $obj->id),
* Name of the entity table
*
*
- * @return boolean|CRM_Core_DAO_RecurringEntity
+ * @return bool|CRM_Core_DAO_RecurringEntity
*/
static public function delEntity($entityId, $entityTable, $isDelLinkedEntities = FALSE) {
if (empty($entityId) || empty($entityTable)) {
}
$dao = CRM_Core_DAO::executeQuery($query,
array(
- 1 => array($scheduleReminderId, 'Integer')
+ 1 => array($scheduleReminderId, 'Integer'),
)
);
$dao->fetch();
}
$params = array(
1 => array($entityId, 'Integer'),
- 2 => array($used_for, 'String')
+ 2 => array($used_for, 'String'),
);
$dao = CRM_Core_DAO::executeQuery($query, $params);
$dao->fetch();
}
else {
CRM_Core_Session::setStatus('Could not update mode for linked entities');
- return;
+ return NULL;
}
$entityTable = $linkedEntityTable;
$params = array(
'entity_id' => $entityId,
- 'entity_table' => $mainEntityTable
+ 'entity_table' => $mainEntityTable,
);
$defaults = array();
CRM_Core_DAO::commonRetrieve($dao, $params, $defaults);
* @return array
* the fields that are listings related
*/
- static function getListingFields(
+ public static function getListingFields(
$action,
$visibility,
$considerSelector = FALSE,
* @return array
* the fields that belong to this ufgroup(s)
*/
- static function getFields(
+ public static function getFields(
$id,
$register = FALSE,
$action = NULL,
*
* @param CRM_Core_DAO_UFGroup|CRM_Core_DAO $group
* @param CRM_Core_DAO_UFField|CRM_Core_DAO $field
+ * @param array $customFields
* @param array $addressCustomFields
* @param array $importableFields
- * @param array $customFields
* @param int $permissionType
* Eg CRM_Core_Permission::CREATE.
* @return array
* The action of the form.
*
* @pram boolean $register is this the registrtion form
- * @return boolean
+ * @return bool
* true if form is valid
*/
public static function isValid($userID, $title, $register = FALSE, $action = NULL) {
* @return string
* the html for the form on success, otherwise empty string
*/
- static function getEditHTML(
+ public static function getEditHTML(
$userID,
$title,
$action = NULL,
* @param int $id
* Profile Id.
*
- * @return boolean
+ * @return bool
*
*/
public static function usedByModule($id) {
* @param int $id
* Profile Id.
*
- * @return boolean
+ * @return bool
*
*/
public static function del($id) {
* Uf group id (profile id).
* @param int $contactID
*
- * @return boolean
+ * @return bool
* true or false
*/
public static function filterUFGroups($ufGroupId, $contactID = NULL) {
*
* @return null
*/
- static function buildProfile(
+ public static function buildProfile(
&$form,
&$field,
$mode,
// do not display view fields in drupal registration form
// CRM-4632
if ($view && $mode == CRM_Profile_Form::MODE_REGISTER) {
- return;
+ return NULL;
}
if ($usedFor == 'onbehalf') {
if ($fieldName == 'image_URL' && $mode == CRM_Profile_Form::MODE_EDIT) {
$deleteExtra = ts('Are you sure you want to delete contact image.');
$deleteURL = array(
- CRM_Core_Action::DELETE =>
- array(
- 'name' => ts('Delete Contact Image'),
- 'url' => 'civicrm/contact/image',
- 'qs' => 'reset=1&id=%%id%%&gid=%%gid%%&action=delete',
- 'extra' =>
- 'onclick = "if (confirm( \'' . $deleteExtra . '\' ) ) this.href+=\'&confirmed=1\'; else return false;"',
- ),
+ CRM_Core_Action::DELETE => array(
+ 'name' => ts('Delete Contact Image'),
+ 'url' => 'civicrm/contact/image',
+ 'qs' => 'reset=1&id=%%id%%&gid=%%gid%%&action=delete',
+ 'extra' =>
+ 'onclick = "if (confirm( \'' . $deleteExtra . '\' ) ) this.href+=\'&confirmed=1\'; else return false;"',
+ ),
);
$deleteURL = CRM_Core_Action::formLink($deleteURL,
CRM_Core_Action::DELETE,
list($products, $options) = CRM_Contribute_BAO_Premium::getPremiumProductInfo();
$sel = &$form->addElement('hierselect', $name, $title);
$products = array(
- '0' => ts('- select -'),
- ) + $products;
+ '0' => ts('- select -'),
+ ) + $products;
$sel->setOptions(array($products, $options));
}
elseif ($fieldName == 'payment_instrument') {
* @param int $componentId
* Id for specific components like contribute, event etc.
* @param null $component
- *
- * @return null
*/
- static function setProfileDefaults(
+ public static function setProfileDefaults(
$contactId, &$fields, &$defaults,
$singleProfile = TRUE, $componentId = NULL, $component = NULL
) {
*/
public static function getValidProfiles($required, $optional = NULL) {
if (!is_array($required) || empty($required)) {
- return;
+ return NULL;
}
$profiles = array();
*
* @return void
*/
-
public static function commonSendMail($contactID, &$values) {
if (!$contactID || !$values) {
return;
* @param array $groupTypes
* With key having group type names.
*
- * @return Boolean
+ * @return bool
*/
public static function updateGroupTypes($gId, $groupTypes = array()) {
if (!is_array($groupTypes) || !$gId) {
}
elseif ($name == 'membership_type') {
// since membership_type field is a hierselect -
- $defaults[$fldName][0] =
- CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $values['membership_type_id'], 'member_of_contact_id', 'id');
+ $defaults[$fldName][0]
+ = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $values['membership_type_id'], 'member_of_contact_id', 'id');
$defaults[$fldName][1] = $values['membership_type_id'];
}
elseif ($name == 'membership_status') {
* @param array $profileIds
* Associated array of profile ids.
*
- * @return boolean
+ * @return bool
* true if profile is mixed
*/
public static function checkForMixProfiles($profileIds) {
/**
* Determine of we show overlay profile or not
*
- * @return boolean
+ * @return bool
* true if profile should be shown else false
*/
public static function showOverlayProfile() {
* @param int $profileId
* @param string $groupType
*
- * @return Array
+ * @return array
* group type values
*/
public static function groupTypeValues($profileId, $groupType = NULL) {
*
* @param int $contactID
*
- * @return boolean
+ * @return bool
* true if yes, else false
*/
public function check($str, $contactID = NULL) {
* @param array $array
* The roles to check.
*
- * @return boolean
+ * @return bool
* true if yes, else false
*/
public function checkGroupRole($array) {
case 'jquery':
$snippet['script'] = sprintf("CRM.\$(function(\$) {\n%s\n});", $snippet['jquery']);
- // no break - continue processing as script
+ // no break - continue processing as script
case 'script':
if (!$allowCmsOverride || !$cms->addScript($snippet['script'], $this->_name)) {
$html .= sprintf("<script type=\"text/javascript\">\n%s\n</script>\n", $snippet['script']);
$customPluginsDir = NULL;
if (isset($config->customPHPPathDir)) {
- $customPluginsDir =
- $config->customPHPPathDir . DIRECTORY_SEPARATOR .
+ $customPluginsDir
+ = $config->customPHPPathDir . DIRECTORY_SEPARATOR .
'CRM' . DIRECTORY_SEPARATOR .
'Core' . DIRECTORY_SEPARATOR .
'Smarty' . DIRECTORY_SEPARATOR .
'badge_id',
ts('Name Badge Format'),
array(
- '' => ts('- select -')
+ '' => ts('- select -'),
) + $label, TRUE
);
* @param string $key
* A string which might be an extension key.
*
- * @return boolean
+ * @return bool
* true if given string is an extension name
*/
public function isExtensionKey($key) {
* @param string $clazz
* A string which might be an extension class name.
*
- * @return boolean
+ * @return bool
* true if given string is an extension class name
*/
public function isExtensionClass($clazz) {
return $og;
}
- /**
- * Retrieve statistics for grants.
- *
- *
- * @param bool $admin
- *
- * @return array
- * Array of grant summary statistics
- */
- public static function getGrantStatistics($admin = FALSE) {
- $grantStatuses = array();
- }
-
/**
* Fetch object based on array of properties
*
'title' => ts('Grant Note'),
'name' => 'grant_note',
'data_type' => CRM_Utils_Type::T_TEXT,
- )
+ ),
);
$fields = array_merge($fields, $grantFields, $grantNote,
CRM_Core_BAO_CustomField::getFieldsForImport('Grant')
CRM_Mailing_BAO_MailingJob::runJobs_post();
}
- $this->_sortByCharacter =
- CRM_Utils_Request::retrieve('sortByCharacter', 'String', $this);
+ $this->_sortByCharacter
+ = CRM_Utils_Request::retrieve('sortByCharacter', 'String', $this);
// CRM-11920 all should set sortByCharacter to null, not empty string
if (strtolower($this->_sortByCharacter) == 'all' || !empty($_POST)) {
*/
public static function postProcessMembers(&$form, $membershipIDs, $skipOnHold, $skipDeceased, $contactIDs) {
- list($formValues, $categories, $html_message, $messageToken, $returnProperties) =
- self::processMessageTemplate($form);
+ list($formValues, $categories, $html_message, $messageToken, $returnProperties)
+ = self::processMessageTemplate($form);
- $html =
- self::generateHTML(
+ $html
+ = self::generateHTML(
$membershipIDs,
$returnProperties,
$skipOnHold,
/**
* called when action is browse
*
- * @return null
+ * @return void
*/
public function browse() {
$controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_Search', ts('Pledges'), $this->_action);
),
),
'filters' => array(
- 'activity_date_time' => //'default' => 'this.month',
- array(
- 'operatorType' => CRM_Report_Form::OP_DATE,
- ),
+ 'activity_date_time' => array(
+ 'operatorType' => CRM_Report_Form::OP_DATE,
+ ),
'subject' => array(
'title' => ts('Activity Subject'),
'operator' => 'like',
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,
- 'no_repeat' => TRUE,
- ),
- 'first_name' => array(
- 'title' => ts('First Name'),
- 'no_repeat' => TRUE,
- ),
- 'last_name' => array(
- 'title' => ts('Last Name'),
- 'no_repeat' => TRUE,
- ),
- 'contact_type' => array(
- 'title' => ts('Contact Type'),
- 'no_repeat' => TRUE,
- ),
- 'contact_sub_type' => array(
- 'title' => ts('Contact Subtype'),
- 'no_repeat' => TRUE,
- ),
- 'do_not_email' => array(
- 'title' => ts('Do Not Email'),
- 'no_repeat' => TRUE,
- ),
- 'is_opt_out' => array(
- 'title' => ts('No Bulk Email(Is Opt Out)'),
- 'no_repeat' => TRUE,
- ),
- 'id' => array(
- 'no_display' => TRUE,
- 'required' => TRUE,
- 'csv_display' => TRUE,
- 'title' => ts('Contact ID'),
- ),
+ 'civicrm_contact' => array(
+ 'dao' => 'CRM_Contact_DAO_Contact',
+ 'fields' => array(
+ 'sort_name' => array(
+ 'title' => ts('Donor Name'),
+ 'required' => TRUE,
+ 'no_repeat' => TRUE,
),
- 'filters' => array(
- 'sort_name' => array(
- 'title' => ts('Donor Name'),
- 'operator' => 'like',
- ),
- 'id' => array(
- 'title' => ts('Contact ID'),
- 'no_display' => TRUE,
- ),
+ 'first_name' => array(
+ 'title' => ts('First Name'),
+ 'no_repeat' => TRUE,
+ ),
+ 'last_name' => array(
+ 'title' => ts('Last Name'),
+ 'no_repeat' => TRUE,
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ 'no_repeat' => TRUE,
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ 'no_repeat' => TRUE,
+ ),
+ 'do_not_email' => array(
+ 'title' => ts('Do Not Email'),
+ 'no_repeat' => TRUE,
+ ),
+ 'is_opt_out' => array(
+ 'title' => ts('No Bulk Email(Is Opt Out)'),
+ 'no_repeat' => TRUE,
+ ),
+ 'id' => array(
+ 'no_display' => TRUE,
+ 'required' => TRUE,
+ 'csv_display' => TRUE,
+ 'title' => ts('Contact ID'),
),
- 'grouping' => 'contact-fields',
),
- 'civicrm_email' => array(
- 'dao' => 'CRM_Core_DAO_Email',
- 'fields' => array(
- 'email' => array(
- 'title' => ts('Donor Email'),
- 'default' => TRUE,
- 'no_repeat' => TRUE,
- ),
+ 'filters' => array(
+ 'sort_name' => array(
+ 'title' => ts('Donor Name'),
+ 'operator' => 'like',
+ ),
+ 'id' => array(
+ 'title' => ts('Contact ID'),
+ 'no_display' => TRUE,
),
- '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_email' => array(
+ 'dao' => 'CRM_Core_DAO_Email',
+ 'fields' => array(
+ 'email' => array(
+ 'title' => ts('Donor Email'),
+ 'default' => TRUE,
+ 'no_repeat' => TRUE,
),
- 'grouping' => 'contact-fields',
),
- 'first_donation' => array(
- 'dao' => 'CRM_Contribute_DAO_Contribution',
- 'fields' => array(
- 'first_donation_date' => array(
- 'title' => ts('First Contribution Date'),
- 'base_field' => 'receive_date',
- 'no_repeat' => TRUE,
- ),
- 'first_donation_amount' => array(
- 'title' => ts('First Contribution Amount'),
- 'base_field' => 'total_amount',
- 'no_repeat' => TRUE,
- ),
+ 'grouping' => 'contact-fields',
+ ),
+ 'civicrm_phone' => array(
+ 'dao' => 'CRM_Core_DAO_Phone',
+ 'fields' => array(
+ 'phone' => array(
+ 'title' => ts('Donor Phone'),
+ 'default' => TRUE,
+ 'no_repeat' => TRUE,
),
),
- 'civicrm_contribution' => array(
- 'dao' => 'CRM_Contribute_DAO_Contribution',
- 'fields' => array(
- 'contribution_id' => array(
- 'name' => 'id',
- 'no_display' => TRUE,
- 'required' => TRUE,
- 'csv_display' => TRUE,
- 'title' => ts('Contribution ID'),
- ),
- 'financial_type_id' => array(
- 'title' => ts('Financial Type'),
- 'default' => TRUE,
- ),
- 'contribution_recur_id' => array(
- 'title' => ts('Recurring Contribution Id'),
- 'name' => 'contribution_recur_id',
- 'required' => TRUE,
- 'no_display' => TRUE,
- 'csv_display' => TRUE,
- ),
- 'contribution_status_id' => array(
- 'title' => ts('Contribution Status'),
- ),
- 'payment_instrument_id' => array(
- 'title' => ts('Payment Type'),
- ),
- 'contribution_source' => array(
- 'name' => 'source',
- 'title' => ts('Contribution Source'),
- ),
- 'currency' => array(
- 'required' => TRUE,
- 'no_display' => TRUE,
- ),
- 'trxn_id' => NULL,
- 'receive_date' => array('default' => TRUE),
- 'receipt_date' => NULL,
- 'fee_amount' => NULL,
- 'net_amount' => NULL,
- 'total_amount' => array(
- 'title' => ts('Amount'),
- 'required' => TRUE,
- ),
+ 'grouping' => 'contact-fields',
+ ),
+ 'first_donation' => array(
+ 'dao' => 'CRM_Contribute_DAO_Contribution',
+ 'fields' => array(
+ 'first_donation_date' => array(
+ 'title' => ts('First Contribution Date'),
+ 'base_field' => 'receive_date',
+ 'no_repeat' => TRUE,
),
- 'filters' => array(
- 'receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
- 'financial_type_id' => array(
- 'title' => ts('Financial Type'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Contribute_PseudoConstant::financialType(),
- ),
- '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,
- ),
- 'payment_instrument_id' => array(
- 'title' => ts('Payment Type'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Contribute_PseudoConstant::paymentInstrument(),
- ),
- 'contribution_status_id' => array(
- 'title' => ts('Contribution Status'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
- 'default' => array(1),
- ),
- 'total_amount' => array('title' => ts('Contribution Amount')),
+ 'first_donation_amount' => array(
+ 'title' => ts('First Contribution Amount'),
+ 'base_field' => 'total_amount',
+ 'no_repeat' => TRUE,
),
- 'grouping' => 'contri-fields',
),
- 'civicrm_product' => array(
- 'dao' => 'CRM_Contribute_DAO_Product',
- 'fields' => array(
- 'product_name' => array(
- 'name' => 'name',
- 'title' => ts('Premium'),
- ),
+ ),
+ 'civicrm_contribution' => array(
+ 'dao' => 'CRM_Contribute_DAO_Contribution',
+ 'fields' => array(
+ 'contribution_id' => array(
+ 'name' => 'id',
+ 'no_display' => TRUE,
+ 'required' => TRUE,
+ 'csv_display' => TRUE,
+ 'title' => ts('Contribution ID'),
+ ),
+ 'financial_type_id' => array(
+ 'title' => ts('Financial Type'),
+ 'default' => TRUE,
+ ),
+ 'contribution_recur_id' => array(
+ 'title' => ts('Recurring Contribution Id'),
+ 'name' => 'contribution_recur_id',
+ 'required' => TRUE,
+ 'no_display' => TRUE,
+ 'csv_display' => TRUE,
+ ),
+ 'contribution_status_id' => array(
+ 'title' => ts('Contribution Status'),
+ ),
+ 'payment_instrument_id' => array(
+ 'title' => ts('Payment Type'),
+ ),
+ 'contribution_source' => array(
+ 'name' => 'source',
+ 'title' => ts('Contribution Source'),
+ ),
+ 'currency' => array(
+ 'required' => TRUE,
+ 'no_display' => TRUE,
+ ),
+ 'trxn_id' => NULL,
+ 'receive_date' => array('default' => TRUE),
+ 'receipt_date' => NULL,
+ 'fee_amount' => NULL,
+ 'net_amount' => NULL,
+ 'total_amount' => array(
+ 'title' => ts('Amount'),
+ 'required' => TRUE,
),
),
- 'civicrm_contribution_product' => array(
- 'dao' => 'CRM_Contribute_DAO_ContributionProduct',
- 'fields' => array(
- 'product_id' => array(
- 'no_display' => TRUE,
- ),
- 'product_option' => array(
- 'title' => ts('Premium Option'),
- ),
- 'contribution_id' => array(
- 'no_display' => TRUE,
- ),
+ 'filters' => array(
+ 'receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
+ 'financial_type_id' => array(
+ 'title' => ts('Financial Type'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Contribute_PseudoConstant::financialType(),
+ ),
+ '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,
),
+ 'payment_instrument_id' => array(
+ 'title' => ts('Payment Type'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Contribute_PseudoConstant::paymentInstrument(),
+ ),
+ 'contribution_status_id' => array(
+ 'title' => ts('Contribution Status'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
+ 'default' => array(1),
+ ),
+ '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',
- ),
- ),
+ 'grouping' => 'contri-fields',
+ ),
+ 'civicrm_product' => array(
+ 'dao' => 'CRM_Contribute_DAO_Product',
+ 'fields' => array(
+ 'product_name' => array(
+ 'name' => 'name',
+ 'title' => ts('Premium'),
),
),
- 'civicrm_membership' => array(
- 'dao' => 'CRM_Member_DAO_Membership',
- 'fields' => array(
- 'membership_type_id' => array(
- 'title' => ts('Membership Type'),
- 'required' => TRUE,
- 'no_repeat' => TRUE,
- ),
- 'membership_start_date' => array(
- 'title' => ts('Start Date'),
- 'default' => TRUE,
- ),
- 'membership_end_date' => array(
- 'title' => ts('End Date'),
- 'default' => TRUE,
- ),
- 'join_date' => array(
- 'title' => ts('Join Date'),
- 'default' => TRUE,
- ),
- 'source' => array('title' => ts('Membership Source')),
- ),
- 'filters' => array(
- 'join_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
- 'membership_start_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
- 'membership_end_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
- 'owner_membership_id' => array(
- 'title' => ts('Membership Owner ID'),
- 'operatorType' => CRM_Report_Form::OP_INT,
- ),
- 'tid' => array(
- 'name' => 'membership_type_id',
- 'title' => ts('Membership Types'),
- 'type' => CRM_Utils_Type::T_INT,
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Member_PseudoConstant::membershipType(),
- ),
+ ),
+ 'civicrm_contribution_product' => array(
+ 'dao' => 'CRM_Contribute_DAO_ContributionProduct',
+ 'fields' => array(
+ 'product_id' => array(
+ 'no_display' => TRUE,
+ ),
+ 'product_option' => array(
+ 'title' => ts('Premium Option'),
+ ),
+ 'contribution_id' => array(
+ 'no_display' => TRUE,
),
- 'grouping' => 'member-fields',
),
- 'civicrm_membership_status' => array(
- 'dao' => 'CRM_Member_DAO_MembershipStatus',
- 'alias' => 'mem_status',
- 'fields' => array(
- 'membership_status_name' => array(
- 'name' => 'name',
- 'title' => ts('Membership Status'),
- 'default' => TRUE,
+ ),
+ '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',
),
),
- 'filters' => array(
- 'sid' => array(
- 'name' => 'id',
- 'title' => ts('Membership Status'),
- 'type' => CRM_Utils_Type::T_INT,
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label'),
- ),
+ ),
+ ),
+ 'civicrm_membership' => array(
+ 'dao' => 'CRM_Member_DAO_Membership',
+ 'fields' => array(
+ 'membership_type_id' => array(
+ 'title' => ts('Membership Type'),
+ 'required' => TRUE,
+ 'no_repeat' => TRUE,
+ ),
+ 'membership_start_date' => array(
+ 'title' => ts('Start Date'),
+ 'default' => TRUE,
),
- 'grouping' => 'member-fields',
+ 'membership_end_date' => array(
+ 'title' => ts('End Date'),
+ 'default' => TRUE,
+ ),
+ 'join_date' => array(
+ 'title' => ts('Join Date'),
+ 'default' => TRUE,
+ ),
+ 'source' => array('title' => ts('Membership Source')),
),
- 'civicrm_note' => array(
- 'dao' => 'CRM_Core_DAO_Note',
- 'fields' => array(
- 'contribution_note' => array(
- 'name' => 'note',
- 'title' => ts('Contribution Note'),
- ),
+ 'filters' => array(
+ 'join_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
+ 'membership_start_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
+ 'membership_end_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
+ 'owner_membership_id' => array(
+ 'title' => ts('Membership Owner ID'),
+ 'operatorType' => CRM_Report_Form::OP_INT,
),
- 'filters' => array(
- 'note' => array(
- 'name' => 'note',
- 'title' => ts('Contribution Note'),
- 'operator' => 'like',
- 'type' => CRM_Utils_Type::T_STRING,
- ),
+ 'tid' => array(
+ 'name' => 'membership_type_id',
+ 'title' => ts('Membership Types'),
+ 'type' => CRM_Utils_Type::T_INT,
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Member_PseudoConstant::membershipType(),
+ ),
+ ),
+ 'grouping' => 'member-fields',
+ ),
+ 'civicrm_membership_status' => array(
+ 'dao' => 'CRM_Member_DAO_MembershipStatus',
+ 'alias' => 'mem_status',
+ 'fields' => array(
+ 'membership_status_name' => array(
+ 'name' => 'name',
+ 'title' => ts('Membership Status'),
+ 'default' => TRUE,
+ ),
+ ),
+ 'filters' => array(
+ 'sid' => array(
+ 'name' => 'id',
+ 'title' => ts('Membership Status'),
+ 'type' => CRM_Utils_Type::T_INT,
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label'),
+ ),
+ ),
+ 'grouping' => 'member-fields',
+ ),
+ '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;
$dao = CRM_Core_DAO::executeQuery($sql);
$totalAmount = $average = array();
while ($dao->fetch()) {
- $totalAmount[] =
- CRM_Utils_Money::format($dao->amount, $dao->currency) . "(" .
+ $totalAmount[]
+ = CRM_Utils_Money::format($dao->amount, $dao->currency) . "(" .
$dao->count . ")";
$average[] = CRM_Utils_Money::format($dao->avg, $dao->currency);
}
$optionValue = CRM_Core_OptionValue::addOptionValue($params, $groupParams, $this->_action, $this->_id);
CRM_Core_Session::setStatus(ts('The %1 \'%2\' has been saved.', array(
1 => 'Report Template',
- 2 => $optionValue->label
+ 2 => $optionValue->label,
)), ts('Saved'), 'success');
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/report/options/report_template', "reset=1"));
}
$document = JFactory::getDocument();
$document->setTitle($title);
-
- return;
}
/**
}
}
$template->assign_by_ref('breadcrumb', $bc);
- return;
}
/**
* @return void
*/
public function resetBreadCrumb() {
- return;
}
/**
* @return string
* an HTML string containing a link to the given path.
*/
- function url(
+ public function url(
$path = NULL, $query = NULL, $absolute = TRUE,
$fragment = NULL, $htmlize = TRUE,
$frontend = FALSE, $forceBackend = FALSE
$joomlaVersion = JVERSION;
}
else {
- $jversion = new JVersion;
+ $jversion = new JVersion();
$joomlaVersion = $jversion->getShortVersion();
}
* Rewrite various system urls to https
*
* @return void
- * access public
+ * access public
*/
public function mapConfigToSSL() {
// dont need to do anything, let CMS handle their own switch to SSL
- return;
}
/**
$joomlaBase = dirname(dirname(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__))))))));
if (!defined('JVERSION')) {
require $joomlaBase . '/libraries/cms/version/version.php';
- $jversion = new JVersion;
+ $jversion = new JVersion();
define('JVERSION', $jversion->getShortVersion());
}
* The message to set.
*/
public function setMessage($message) {
- return;
}
/**
*/
public function getVersion() {
if (class_exists('JVersion')) {
- $version = new JVersion;
+ $version = new JVersion();
return $version->getShortVersion();
}
else {
// Files may be in different places depending on Joomla version
if (!defined('JVERSION')) {
require $joomlaBase . '/libraries/cms/version/version.php';
- $jversion = new JVersion;
+ $jversion = new JVersion();
define('JVERSION', $jversion->getShortVersion());
}
/**
* Check is user logged in.
*
- * @return boolean
+ * @return bool
*/
public function isUserLoggedIn() {
$user = JFactory::getUser();
*
* @return array
* array
- * - $url, (Joomla - non admin url)
- * - $siteName,
- * - $siteRoot
+ * - $url, (Joomla - non admin url)
+ * - $siteName,
+ * - $siteRoot
*/
public function getDefaultSiteSettings($dir) {
$config = CRM_Core_Config::singleton();
* @param string $str
* The string to search.
*
- * @return boolean
+ * @return bool
* Was there a match
*/
public static function token_match($type, $var, &$str) {
* The processed string
*/
public static function &replaceOrgTokens($str, &$org, $html = FALSE, $escapeSmarty = FALSE) {
- self::$_tokens['org'] =
- array_merge(
+ self::$_tokens['org']
+ = array_merge(
array_keys(CRM_Contact_BAO_Contact::importableFields('Organization')),
array('address', 'display_name', 'checksum', 'contact_id')
);
if (self::$_tokens[$key] == NULL) {
/* This should come from UF */
- self::$_tokens[$key] =
- array_merge(
+ self::$_tokens[$key]
+ = array_merge(
array_keys(CRM_Contact_BAO_Contact::exportableFields('All')),
array('checksum', 'contact_id')
);
if (self::$_tokens['contact'] == NULL) {
/* This should come from UF */
- self::$_tokens['contact'] =
- array_merge(
+ self::$_tokens['contact']
+ = array_merge(
array_keys(CRM_Contact_BAO_Contact::exportableFields('All')),
array('checksum', 'contact_id')
);
if ($escapeSmarty
&& !($returnBlankToken && $noReplace)
- ) { // $returnBlankToken means the caller wants to do further attempts at processing unreplaced tokens -- so don't escape them yet in this case.
+ ) {
+ // $returnBlankToken means the caller wants to do further attempts at
+ // processing unreplaced tokens -- so don't escape them yet in this case.
$value = self::tokenEscapeSmarty($value);
}
* Replace tokens with html or plain text.
* @param int $contact_id
* The contact ID.
- * @param string hash The security hash of the unsub event
+ * @param string $hash The security hash of the unsub event
*
* @return string
* The processed string
* Replace tokens with html or plain text.
* @param int $contact_id
* The contact ID.
- * @param string hash The security hash of the resub event
+ * @param string $hash The security hash of the resub event
*
* @return string
* The processed string
* @param $contactIDs
* @param array $returnProperties
* Of required properties.
- * @param bool $skipOnHoldDon 't return on_hold contact info also.
+ * @param bool $skipOnHold Don't return on_hold contact info also.
* Don't return on_hold contact info also.
- * @param bool $skipDeceasedDon 't return deceased contact info.
+ * @param bool $skipDeceased Don't return deceased contact info.
* Don't return deceased contact info.
* @param array $extraParams
* Extra params.
*
* @return array
*/
- static function getTokenDetails(
+ public static function getTokenDetails(
$contactIDs,
$returnProperties = NULL,
$skipOnHold = TRUE,
foreach (array(
'email_greeting',
'postal_greeting',
- 'addressee'
+ 'addressee',
) as $val) {
if (!empty($contactDetails[$contactID][$val])) {
$contactDetails[$contactID][$val] = $contactDetails[$contactID]["{$val}_display"];
* contactDetails with hooks swapped out
*/
public function getAnonymousTokenDetails($contactIDs = array(
- 0
+ 0,
),
$returnProperties = NULL,
$skipOnHold = TRUE,
*
* @return array
*/
- static function getContributionTokenDetails(
+ public static function getContributionTokenDetails(
$contributionIDs,
$returnProperties = NULL,
$extraParams = NULL,
$tokens = array(),
$className = NULL
) {
- //@todo - this function basically replications calling civicrm_api3('contribution', 'get', array('id' => array('IN' => array())
+ //@todo - this function basically replicates calling
+ //civicrm_api3('contribution', 'get', array('id' => array('IN' => array())
if (empty($contributionIDs)) {
// putting a fatal here so we can track if/when this happens
CRM_Core_Error::fatal();
public static function getMembershipTokenDetails($membershipIDs) {
$memberships = civicrm_api3('membership', 'get', array(
'options' => array('limit' => 200000),
- 'membership_id' => array('IN' => (array) $membershipIDs)
+ 'membership_id' => array('IN' => (array) $membershipIDs),
));
return $memberships['values'];
}
// check if there are any unevaluated tokens
$greetingTokens = self::getTokens($tokenString);
- // $greetingTokens not empty, means there are few tokens which are not evaluated, like custom data etc
+ // $greetingTokens not empty, means there are few tokens which are not
+ // evaluated, like custom data etc
// so retrieve it from database
if (!empty($greetingTokens) && array_key_exists('contact', $greetingTokens)) {
$greetingsReturnProperties = array_flip(CRM_Utils_Array::value('contact', $greetingTokens));
foreach (array(
'html',
'text',
- 'subject'
+ 'subject',
) as $prop) {
if (!isset($tokens[$prop])) {
continue;
try {
$value = civicrm_api3('membership_type', 'getvalue', array(
'id' => $membership['membership_type_id'],
- 'return' => 'minimum_fee'
+ 'return' => 'minimum_fee',
));
}
catch (CiviCRM_API3_Exception $e) {
*
* @return array
* API Result
- * {@getfields GroupOrganization_delete}
+ * {@getfields GroupOrganization_delete}
* @example GroupOrganizationDelete.php
*/
function civicrm_api3_group_organization_delete($params) {
/**
* Retrieve one or more IM
*
- * @param mixed[] (reference ) input parameters
- * {@getfields im_get}
* @param array $params
* An associative array of name/value pairs.
*
*
* @return array
* (reference ) membership_payment_id of created or updated record
- * {@getfields MembershipPayment_create}
+ * {@getfields MembershipPayment_create}
* @example MembershipPaymentCreate.php
*/
function civicrm_api3_membership_payment_create($params) {
* @param array $params
* @return array
*/
-
function civicrm_api3_setting_getfields($params) {
if (!empty($params['action']) && strtolower($params['action']) == 'getvalue') {
$result = array(
'title' => 'Setting Group',
'description' => 'Settings Group. This is required if the setting is not stored in config',
'type' => CRM_Utils_Type::T_STRING),
- );
+ );
return civicrm_api3_create_success($result, $params, 'setting', 'getfields');
}
if (!empty($params['name'])) {
*
* @return array
* api result array
- * {@getfields setting_create}
+ * {@getfields setting_create}
*/
function civicrm_api3_setting_create($params) {
$domains = _civicrm_api3_setting_getDomainArray($params);
'title' => 'Setting Domain',
'description' => 'if you do not pass in a domain id this will default to the current domain
an array or "all" are acceptable values for multiple domains',
- );
+ );
$params['group'] = array(
- 'title' => 'Setting Group',
- 'description' => 'if you know the group defining it will make the api more efficient',
- );
+ 'title' => 'Setting Group',
+ 'description' => 'if you know the group defining it will make the api more efficient',
+ );
}
/**
*
* @return array
* Array of matching settings
- * {@getfields setting_get}
+ * {@getfields setting_get}
*/
function civicrm_api3_setting_get($params) {
$domains = _civicrm_api3_setting_getDomainArray($params);
*
* @return array
* Array of matching settings
- * {@getfields setting_get}
+ * {@getfields setting_get}
*/
function civicrm_api3_setting_getvalue($params) {
$config = CRM_Core_Config::singleton();
function _civicrm_api3_setting_getvalue_spec(&$params) {
$params['group'] = array(
- 'title' => 'Settings Group',
- 'api.required' => TRUE,
+ 'title' => 'Settings Group',
+ 'api.required' => TRUE,
);
$params['name'] = array(
- 'title' => 'Setting Name',
- 'api.aliases' => array('return'),
+ 'title' => 'Setting Name',
+ 'api.aliases' => array('return'),
);
$params['default_value'] = array(
- 'title' => 'Default Value',
+ 'title' => 'Default Value',
);
$params['component_id'] = array(
- 'title' => 'Component Id',
+ 'title' => 'Component Id',
);
$params['contact_id'] = array(
- 'title' => 'Contact Id',
+ 'title' => 'Contact Id',
);
$params['domain_id'] = array(
'title' => 'Setting Domain',
* AllIMs() method - get all IMs for our contact, with primary IM first
*/
public function testAllIMs() {
- $op = new PHPUnit_Extensions_Database_Operation_Insert;
+ $op = new PHPUnit_Extensions_Database_Operation_Insert();
$op->execute(
$this->_dbconn,
$this->createFlatXMLDataSet(dirname(__FILE__) . '/dataset/im_test.xml')
// add participant payment entry
$this->callAPISuccess('participant_payment', 'create', array(
'participant_id' => $participant['id'],
- 'contribution_id' => $contributionId
+ 'contribution_id' => $contributionId,
));
// -- processing priceSet using the BAO
*/
private static function getInstance() {
if (is_null(self::$instance)) {
- self::$instance = new self;
+ self::$instance = new self();
}
return self::$instance;
}