foreach (array(
'surveyId',
'contactIds',
- 'interviewerId'
+ 'interviewerId',
) as $fld) {
$this->{"_$fld"} = $this->get($fld);
}
$this->addElement('select', "order_bys[{$i}][column]", ts('Order by Column'), $options);
$this->addElement('select', "order_bys[{$i}][order]", ts('Order by Order'), array(
'ASC' => 'Ascending',
- 'DESC' => 'Descending'
+ 'DESC' => 'Descending',
));
}
if (!empty($this->_resultOptions)) {
$this->add('select', "field[$contactId][result]", ts('Result'),
array(
- '' => ts('- select -')
+ '' => ts('- select -'),
) +
array_combine($this->_resultOptions, $this->_resultOptions)
);
'name' => ts('Done'),
'subName' => 'interview',
'isDefault' => TRUE,
- )
+ ),
);
$buttons[] = array(
else {
$defaults['order_bys'] =
array(
- 1 =>
- array(
- 'column' => 'contact_a.sort_name',
- 'order' => 'ASC',
- ),
+ 1 => array(
+ 'column' => 'contact_a.sort_name',
+ 'order' => 'ASC',
+ ),
);
}
return $defaults;
foreach (array(
'surveyId',
'contactIds',
- 'interviewerId'
+ 'interviewerId',
) as $fld) {
$this->controller->set($fld, $this->{"_$fld"});
}
}
// vote is done through ajax
- return;
}
/**
/**
* Create case contact record
*
- * @param array case_id, contact_id
+ * @param array $params
+ * case_id, contact_id
*
* @return object
*/
/**
* Delet case contact record
*
- * @param int case_id
+ * @param int $caseID
*
* @return Void
*/
*
* @return int|NULL
*/
- static function mergeCases(
+ public static function mergeCases(
$mainContactId, $mainCaseId = NULL, $otherContactId = NULL,
$otherCaseId = NULL, $changeClient = FALSE) {
$moveToTrash = TRUE;
* @param bool $checkComponent
* Do we need to check component enabled.
*
- * @return boolean
+ * @return bool
*/
public static function checkPermission($activityId, $operation, $actTypeId = NULL, $contactId = NULL, $checkComponent = TRUE) {
$allow = FALSE;
* @param int $activityID
* Activity id.
*
- * @return boolean
+ * @return bool
*/
public static function isCaseActivity($activityID) {
$isCaseActivity = FALSE;
* @param array $props
* Whatever is known about this dao object.
*
- * @return Array|bool
+ * @return array|bool
*/
public static function buildOptions($fieldName, $context = NULL, $props = array()) {
$className = __CLASS__;
'title' => ts('Contribution Page'),
'name' => 'contribution_page',
'where' => 'civicrm_contribution_page.title',
- 'data_type' => CRM_Utils_Type::T_STRING
- ));
+ 'data_type' => CRM_Utils_Type::T_STRING,
+ )
+ );
$contributionNote = array(
- 'contribution_note' =>
- array(
- 'title' => ts('Contribution Note'),
- 'name' => 'contribution_note',
- 'data_type' => CRM_Utils_Type::T_TEXT,
- ),
+ 'contribution_note' => array(
+ 'title' => ts('Contribution Note'),
+ 'name' => 'contribution_note',
+ 'data_type' => CRM_Utils_Type::T_TEXT,
+ ),
);
$contributionRecurId = array(
* (reference) store ids of duplicate contribs.
* @param int $id
*
- * @return boolean
+ * @return bool
* true if duplicate, false otherwise
*/
public static function checkDuplicate($input, &$duplicates, $id = NULL) {
WHERE membership_id=$membership->id
ORDER BY id DESC
LIMIT 1;";
- $dao = new CRM_Core_DAO;
+ $dao = new CRM_Core_DAO();
$dao->query($sql);
if ($dao->fetch()) {
if (!empty($dao->membership_type_id)) {
*
* @param bool $isNotCancelled
*
- * @return boolean
+ * @return bool
*/
public static function isCancelSubscriptionSupported($contributionId, $isNotCancelled = TRUE) {
$cacheKeyString = "$contributionId";
* @param array $props
* whatever is known about this dao object.
*
- * @return Array|bool
+ * @return array|bool
*/
public static function buildOptions($fieldName, $context = NULL, $props = array()) {
$className = __CLASS__;
$form->addSelect("soft_credit_type[{$rowNumber}]", array(
'entity' => 'contribution_soft',
'field' => 'soft_credit_type_id',
- 'label' => ts('Type')
+ 'label' => ts('Type'),
));
if (!empty($form->_softCreditInfo['soft_credit'][$rowNumber]['soft_credit_id'])) {
$form->add('hidden', "soft_credit_id[{$rowNumber}]",
*
* @return array
*/
- function &actionLinks() {
+ public function &actionLinks() {
// check if variable _actionsLinks is populated
if (!isset(self::$_actionLinks)) {
// helper variable for nicer formatting
'url' => CRM_Utils_System::url(CRM_Utils_System::currentPath(),
'reset=1'
),
- )
+ ),
);
// what action to take ?
*
* @return int[]
*/
- function getCampaignIds() {
+ pubic function getCampaignIds() {
// The unfiltered value from the session cannot be trusted, it needs to be
// processed to get a clean array of positive integers.
$ids = array();
* @param $whereClause
* @param array $whereParams
*/
- function pager($whereClause, $whereParams) {
+ public function pager($whereClause, $whereParams) {
$params['status'] = ts('Contribution %%StatusMessage%%');
$params['csvString'] = NULL;
/**
* Get all fields of the type Date
*/
-
public static function getDateFields() {
$allFields = CRM_Core_BAO_CustomField::getFields('');
$dateFields = array('birth_date' => ts('Birth Date'));
foreach (array(
'text',
'html',
- 'sms_text'
+ 'sms_text',
) as $elem) {
$$elem = $smarty->fetch("string:{$$elem}");
}
$smsParams = array(
'To' => $phoneNumber,
'provider_id' => $schedule->sms_provider_id,
- 'activity_subject' => $messageSubject
+ 'activity_subject' => $messageSubject,
);
$activityTypeID = CRM_Core_OptionGroup::getValue('activity_type',
'SMS',
$activityStatusID = FALSE;
if ($actionSchedule->record_activity) {
if ($mapping->entity == 'civicrm_membership') {
- $activityTypeID =
- CRM_Core_OptionGroup::getValue('activity_type', 'Membership Renewal Reminder', 'name');
+ $activityTypeID
+ = CRM_Core_OptionGroup::getValue('activity_type', 'Membership Renewal Reminder', 'name');
}
else {
- $activityTypeID =
- CRM_Core_OptionGroup::getValue('activity_type', 'Reminder Sent', 'name');
+ $activityTypeID
+ = CRM_Core_OptionGroup::getValue('activity_type', 'Reminder Sent', 'name');
}
- $activityStatusID =
- CRM_Core_OptionGroup::getValue('activity_status', 'Completed', 'name');
+ $activityStatusID
+ = CRM_Core_OptionGroup::getValue('activity_status', 'Completed', 'name');
}
if ($mapping->entity == 'civicrm_activity') {
'fee_amount',
'contact_email',
'contact_phone',
- 'balance'
+ 'balance',
);
$extraSelect = ', ov.label as event_type, ev.title, ev.id as event_id, ev.start_date, ev.end_date, ev.summary, ev.description, address.street_address, address.city, address.state_province_id, address.postal_code, email.email as contact_email, phone.phone as contact_phone ';
if ($toEmail || !(empty($toPhoneNumber) or $toDoNotSms)) {
$to['email'] = $toEmail;
$to['phone'] = $toPhoneNumber;
- $result =
- CRM_Core_BAO_ActionSchedule::sendReminder(
+ $result
+ = CRM_Core_BAO_ActionSchedule::sendReminder(
$dao->contactID,
$to,
$actionSchedule->id,
$activityParams = array(
'subject' => $actionSchedule->title,
'details' => $actionSchedule->body_html,
- 'source_contact_id' =>
- $session->get('userID') ? $session->get('userID') : $dao->contactID,
+ 'source_contact_id' => $session->get('userID') ? $session->get('userID') : $dao->contactID,
'target_contact_id' => $dao->contactID,
'activity_date_time' => date('YmdHis'),
'status_id' => $activityStatusID,
$valsqlInsertValues = CRM_Core_DAO::executeQuery($sqlInsertValues, array(
1 => array(
$actionSchedule->id,
- 'Integer'
- )
- ));
+ 'Integer',
+ ),
+ )
+ );
$arrValues = array();
while ($valsqlInsertValues->fetch()) {
/**
* Get the location values of a domain
*
- * @param NULL
- *
* @return array
* Location::getValues
*/
ts('Allow Online Registration'),
NULL,
array(
- 'onclick' => "return showHideByValue('is_online_registration',
- '',
- 'registration_blocks',
- 'block',
- 'radio',
- false );",
+ 'onclick' => "return showHideByValue('is_online_registration'," .
+ "''," .
+ "'registration_blocks'," .
+ "'block'," .
+ "'radio'," .
+ "false );",
)
);
* Label.
* @param array $configs
* Optional, for addProfileSelector(), defaults to using getProfileSelectorTypes().
- **/
+ */
public function buildMultipleProfileBottom(&$form, $count, $prefix = '', $label = 'Include Profile', $configs = NULL) {
extract((is_null($configs)) ? self::getProfileSelectorTypes() : $configs);
$element = $prefix . "custom_post_id_multiple[$count]";
*
* @return array
* ['allowCoreTypes' => array, 'allowSubTypes' => array, 'profileEntities' => array]
- **/
+ */
public static function getProfileSelectorTypes() {
$configs = array(
'allowCoreTypes' => array(),
$configs['allowCoreTypes'] = array_merge(array(
'Contact',
- 'Individual'
+ 'Individual',
), CRM_Contact_BAO_ContactType::subTypes('Individual'));
$configs['allowCoreTypes'][] = 'Participant';
//CRM-15427
$configs['profileEntities'][] = array(
'entity_name' => 'participant_1',
'entity_type' => 'ParticipantModel',
- 'entity_sub_type' => '*'
+ 'entity_sub_type' => '*',
);
return $configs;
* Collect all email fields for an array of profile ids
*
* @param $profileIds
- * @return boolean
+ * @return bool
*/
public static function getEmailFields($profileIds) {
$emailFields = array();
* Check if a profile contains required fields
*
* @param $profileIds
- * @return boolean
+ * @return bool
*/
public static function isProfileComplete($profileIds) {
$profileReqFields = array();
*
* @param $profileIds
* @param int $rgId
- * @return boolean
+ * @return bool
*/
-
public function canProfilesDedupe($profileIds, $rgId = 0) {
// find the unsupervised rule
array(
'title' => ts('CiviEvent Dashboard'),
'url' => CRM_Utils_System::url('civicrm/event', 'reset=1'),
- )
+ ),
);
CRM_Utils_System::appendBreadCrumb($breadCrumbs);
if ($this->_single && $this->_context == 'standalone') {
$this->addEntityRef('contact_id', ts('Contact'), array(
'create' => TRUE,
- 'api' => array('extra' => array('email'))
+ 'api' => array('extra' => array('email')),
), TRUE);
}
CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name')
);
$checkCancelledJs = array(
- 'onchange' =>
- "checkCancelled( this.value, {$cancelledparticipantStatusId},{$cancelledContributionStatusId});",
+ 'onchange' => "checkCancelled( this.value, {$cancelledparticipantStatusId},{$cancelledContributionStatusId});",
);
$participantStatusId = array_search('Pending from pay later',
$this->addSelect('status_id', $checkCancelledJs + array(
'options' => $statusOptions,
- 'option_url' => 'civicrm/admin/participant_status'
+ 'option_url' => 'civicrm/admin/participant_status',
), TRUE);
$this->addElement('checkbox', 'is_notify', ts('Send Notification'), NULL);
$contactId = $self->_contactId;
$eventId = CRM_Utils_Array::value('event_id', $values);
if (!empty($contactId) && !empty($eventId)) {
- $dupeCheck = new CRM_Event_BAO_Participant;
+ $dupeCheck = new CRM_Event_BAO_Participant();
$dupeCheck->contact_id = $contactId;
$dupeCheck->event_id = $eventId;
$dupeCheck->find(TRUE);
$duplicateContacts = 0;
while (list($k, $dupeCheckContactId) = each($this->_contactIds)) {
// Eliminate contacts that have already been assigned to this event.
- $dupeCheck = new CRM_Event_BAO_Participant;
+ $dupeCheck = new CRM_Event_BAO_Participant();
$dupeCheck->contact_id = $dupeCheckContactId;
$dupeCheck->event_id = $event_id;
$dupeCheck->find(TRUE);
CRM_Core_Error::fatal(ts('Selected Event is not Paid Event '));
}
- $eventTitle =
- CRM_Core_DAO::getFieldValue(
+ $eventTitle
+ = CRM_Core_DAO::getFieldValue(
'CRM_Event_DAO_Event',
$params['event_id'],
'title'
if (empty($params['source'])) {
$this->_params['participant_source'] = ts('Offline Registration for Event: %2 by: %1', array(
1 => $userName,
- 2 => $eventTitle
+ 2 => $eventTitle,
));
}
else {
}
// also add location name to the array
- $params["address_name-{$this->_bltID}"] =
- CRM_Utils_Array::value('billing_first_name', $params) . ' ' .
+ $params["address_name-{$this->_bltID}"]
+ = CRM_Utils_Array::value('billing_first_name', $params) . ' ' .
CRM_Utils_Array::value('billing_middle_name', $params) . ' ' .
CRM_Utils_Array::value('billing_last_name', $params);
);
//add contribution record
- $this->_params['financial_type_id'] =
- CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $params['event_id'], 'financial_type_id');
+ $this->_params['financial_type_id']
+ = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $params['event_id'], 'financial_type_id');
$this->_params['mode'] = $this->_mode;
//add contribution reocord
if (empty($params['source'])) {
$contributionParams['source'] = ts('%1 : Offline registration (by %2)', array(
1 => $eventTitle,
- 2 => $userName
+ 2 => $userName,
));
}
else {
array(
'title' => ts('Manage Events'),
'url' => CRM_Utils_System::url(CRM_Utils_System::currentPath(), 'reset=1'),
- )
+ ),
);
CRM_Utils_System::appendBreadCrumb($breadCrumb);
}
// get the list of active event pcps
$eventPCPS = array();
- $pcpDao = new CRM_PCP_DAO_PCPBlock;
+ $pcpDao = new CRM_PCP_DAO_PCPBlock();
$pcpDao->entity_table = 'civicrm_event';
$pcpDao->find();
'query' => "reset=1&action=add&context=standalone",
'ref' => 'new-grant',
'title' => ts('Grant'),
- )
+ ),
));
}
}
}
$this->_columns = array(
- 'civicrm_contact' => array(
- 'dao' => 'CRM_Contact_DAO_Contact',
- 'grouping' => 'contact-field',
- 'fields' => array(
- 'sort_name' => array(
- 'title' => ts('Donor Name'),
- 'default' => TRUE,
- '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'),
+ 'default' => TRUE,
+ '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'),
+ ),
+ ),
+ 'filters' => array(
+ 'sort_name' => array(
+ 'title' => ts('Donor Name'),
+ 'operator' => 'like',
+ ),
+ ),
+ ),
+ 'civicrm_email' => array(
+ 'dao' => 'CRM_Core_DAO_Email',
+ 'grouping' => 'contact-field',
+ 'fields' => array(
+ 'email' => array(
+ 'title' => ts('Email'),
+ 'default' => TRUE,
),
),
- 'civicrm_email' => array(
- 'dao' => 'CRM_Core_DAO_Email',
- 'grouping' => 'contact-field',
- 'fields' => array(
- 'email' => array(
- 'title' => ts('Email'),
- 'default' => TRUE,
- ),
+ ),
+ 'civicrm_phone' => array(
+ 'dao' => 'CRM_Core_DAO_Phone',
+ 'grouping' => 'contact-field',
+ 'fields' => array(
+ 'phone' => array(
+ 'title' => ts('Phone'),
+ 'default' => TRUE,
),
),
- 'civicrm_phone' => array(
- 'dao' => 'CRM_Core_DAO_Phone',
- 'grouping' => 'contact-field',
- 'fields' => array(
- 'phone' => array(
- 'title' => ts('Phone'),
- '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,
),
),
- )
- + $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,
- ),
+ 'filters' => array(
+ 'yid' => array(
+ 'name' => 'receive_date',
+ 'title' => ts('This Year'),
+ 'operatorType' => CRM_Report_Form::OP_SELECT,
+ 'options' => $optionYear,
+ 'default' => date('Y'),
),
- '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'),
- ),
+ '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)) {
}
$this->_columns = array(
- 'civicrm_contact' => array(
- 'dao' => 'CRM_Contact_DAO_Contact',
- 'fields' => array(
- 'sort_name' => array(
- 'title' => ts('Contact Name'),
- 'required' => TRUE,
- 'no_repeat' => TRUE,
- ),
+ 'civicrm_contact' => array(
+ 'dao' => 'CRM_Contact_DAO_Contact',
+ 'fields' => array(
+ 'sort_name' => array(
+ 'title' => ts('Contact Name'),
+ 'required' => TRUE,
+ 'no_repeat' => TRUE,
),
- 'filters' => array(
- 'sort_name' => array('title' => ts('Contact Name')),
- 'id' => array('no_display' => TRUE),
- ),
- 'grouping' => 'contact-fields',
),
- 'civicrm_email' => array(
- 'dao' => 'CRM_Core_DAO_Email',
- 'fields' => array(
- 'email' => array('no_repeat' => TRUE),
- ),
- 'grouping' => 'contact-fields',
+ 'filters' => array(
+ 'sort_name' => array('title' => ts('Contact Name')),
+ 'id' => array('no_display' => TRUE),
+ ),
+ 'grouping' => 'contact-fields',
+ ),
+ 'civicrm_email' => array(
+ 'dao' => 'CRM_Core_DAO_Email',
+ 'fields' => array(
+ 'email' => array('no_repeat' => TRUE),
),
- 'civicrm_pledge' => array(
- 'dao' => 'CRM_Pledge_DAO_Pledge',
- 'fields' => array(
- 'id' => array(
- 'no_display' => TRUE,
- 'required' => TRUE,
- ),
- 'contact_id' => array(
- 'no_display' => TRUE,
- 'required' => TRUE,
- ),
- 'amount' => array(
- 'title' => ts('Pledge Amount'),
- 'required' => TRUE,
- 'type' => CRM_Utils_Type::T_MONEY,
- ),
- 'currency' => array(
- 'required' => TRUE,
- 'no_display' => TRUE,
- ),
- 'frequency_unit' => array(
- 'title' => ts('Frequency Unit'),
- ),
- 'installments' => array(
- 'title' => ts('Installments'),
- ),
- 'pledge_create_date' => array(
- 'title' => ts('Pledge Made Date'),
- ),
- 'start_date' => array(
- 'title' => ts('Pledge Start Date'),
- 'type' => CRM_Utils_Type::T_DATE,
- ),
- 'end_date' => array(
- 'title' => ts('Pledge End Date'),
- 'type' => CRM_Utils_Type::T_DATE,
- ),
- 'status_id' => array(
- 'title' => ts('Pledge Status'),
- 'required' => TRUE,
- ),
+ 'grouping' => 'contact-fields',
+ ),
+ 'civicrm_pledge' => array(
+ 'dao' => 'CRM_Pledge_DAO_Pledge',
+ 'fields' => array(
+ 'id' => array(
+ 'no_display' => TRUE,
+ 'required' => TRUE,
),
- 'filters' => array(
- 'pledge_create_date' => array(
- 'title' => 'Pledge Made Date',
- 'operatorType' => CRM_Report_Form::OP_DATE,
- ),
- 'pledge_amount' => array(
- 'title' => ts('Pledged Amount'),
- 'operatorType' => CRM_Report_Form::OP_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,
- ),
- 'sid' => array(
- 'name' => 'status_id',
- 'title' => ts('Pledge Status'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Core_OptionGroup::values('contribution_status'),
- ),
-
+ 'contact_id' => array(
+ 'no_display' => TRUE,
+ 'required' => TRUE,
+ ),
+ 'amount' => array(
+ 'title' => ts('Pledge Amount'),
+ 'required' => TRUE,
+ 'type' => CRM_Utils_Type::T_MONEY,
+ ),
+ 'currency' => array(
+ 'required' => TRUE,
+ 'no_display' => TRUE,
+ ),
+ 'frequency_unit' => array(
+ 'title' => ts('Frequency Unit'),
+ ),
+ 'installments' => array(
+ 'title' => ts('Installments'),
+ ),
+ 'pledge_create_date' => array(
+ 'title' => ts('Pledge Made Date'),
+ ),
+ 'start_date' => array(
+ 'title' => ts('Pledge Start Date'),
+ 'type' => CRM_Utils_Type::T_DATE,
+ ),
+ 'end_date' => array(
+ 'title' => ts('Pledge End Date'),
+ 'type' => CRM_Utils_Type::T_DATE,
+ ),
+ 'status_id' => array(
+ 'title' => ts('Pledge Status'),
+ 'required' => TRUE,
),
),
- 'civicrm_pledge_payment' => array(
- 'dao' => 'CRM_Pledge_DAO_PledgePayment',
- 'fields' => array(
- 'total_paid' => array(
- 'title' => ts('Total Amount Paid'),
- 'type' => CRM_Utils_Type::T_MONEY,
- ),
- 'balance_due' => array(
- 'title' => ts('Balance Due'),
- 'default' => TRUE,
- 'type' => CRM_Utils_Type::T_MONEY,
- ),
+ 'filters' => array(
+ 'pledge_create_date' => array(
+ 'title' => 'Pledge Made Date',
+ 'operatorType' => CRM_Report_Form::OP_DATE,
+ ),
+ 'pledge_amount' => array(
+ 'title' => ts('Pledged Amount'),
+ 'operatorType' => CRM_Report_Form::OP_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,
+ ),
+ 'sid' => array(
+ 'name' => 'status_id',
+ 'title' => ts('Pledge Status'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Core_OptionGroup::values('contribution_status'),
+ ),
+ ),
+ ),
+ 'civicrm_pledge_payment' => array(
+ 'dao' => 'CRM_Pledge_DAO_PledgePayment',
+ 'fields' => array(
+ 'total_paid' => array(
+ 'title' => ts('Total Amount Paid'),
+ 'type' => CRM_Utils_Type::T_MONEY,
+ ),
+ 'balance_due' => array(
+ 'title' => ts('Balance Due'),
+ 'default' => TRUE,
+ 'type' => CRM_Utils_Type::T_MONEY,
),
),
- )
- + $this->getAddressColumns(array('group_by' => FALSE))
- + $this->getPhoneColumns();
+ ),
+ );
+
+ $this->_columns += $this->getAddressColumns(array('group_by' => FALSE)) + $this->getPhoneColumns();
+
// If we have a campaign, build out the relevant elements
$this->_tagFilter = TRUE;
if ($campaignEnabled && !empty($this->activeCampaigns)) {
* Retrieve all the values that match the current input parameters
* Used by the selector
*/
- function all(
+ public function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE
);
$defaultLocation = $this->_location_types[$defaultLocationType->id];
unset($this->_location_types[$defaultLocationType->id]);
$this->_location_types = array(
- $defaultLocationType->id => $defaultLocation
+ $defaultLocationType->id => $defaultLocation,
) + $this->_location_types;
}
$showBestResult = FALSE;
if (in_array($ufField->field_name, array(
'country',
- 'state_province'
+ 'state_province',
)) && count($config->countryLimit) > 1
) {
// get state or country field weight if exists
'Participant',
'Contribution',
'Membership',
- 'Activity'
+ 'Activity',
))) {
$individualSubTypes = CRM_Contact_BAO_ContactType::subTypes('Individual');
foreach ($groupType as $value) {
* @param array $errors
* Collect errors.
*
- * @return Array
+ * @return array
* list of errors to be posted back to the form
*/
public static function formRuleCustomDataExtentColumnValue($customField, $gid, $fieldType, &$errors) {
'Contribution',
'Membership',
'Activity',
- 'Case'
+ 'Case',
))) {
$params = array('id' => $customField->custom_group_id);
$customGroup = array();
'Contribution',
'Participant',
'Membership',
- 'Activity'
+ 'Activity',
))
) {
$errors['in_selector'] = ts("'In Selector' cannot be checked for %1 fields.", array(1 => $entityName));
if ($fieldType != $profileType) {
$errors['field_name'] = ts('Cannot add or update profile field type "%1" with combination of "%2".', array(
1 => $fieldType,
- 2 => $profileType
+ 2 => $profileType,
));
}
}
) {
$errors['field_name'] = ts('Cannot add or update profile field type "%1" with combination of "%2".', array(
1 => $fieldType,
- 2 => $profileType
+ 2 => $profileType,
));
}
}
* @param string $author
* @param string $title
*/
- static function &pdflib(
+ pubic static function &pdflib(
$fileName,
$searchPath,
&$values,
* @package CiviCRM_APIv3
* @subpackage API_ActivityProfile
* @copyright CiviCRM LLC (c) 2004-2014
- * @version $Id: ActivityProfile.php 30486 2011-05-20 16:12:09Z rajan $
+ * @version $Id: Profile.php 30486 2011-05-20 16:12:09Z rajan $
*
*/
/**
* Retrieve Profile field values.
*
- * @param array $params
- * Associative array of property name/value.
- * pairs to get profile field values
- *
- * @throws API_Exception
- * @return array
- *
* NOTE this api is not standard & since it is tested we need to honour that
* but the correct behaviour is for it to return an id indexed array as this supports
* multiple instances - if a single profile is passed in we will not return a normal api result array
* in order to avoid breaking code. (This could still be confusing :-( but we have to keep the tested behaviour working
*
* Note that if contact_id is empty an array of defaults is returned
+ *
+ * @param array $params
+ * Associative array of property name/value.
+ * pairs to get profile field values
+ *
+ * @throws API_Exception
+ * @return array
*/
function civicrm_api3_profile_get($params) {
$nonStandardLegacyBehaviour = is_numeric($params['profile_id']) ? TRUE : FALSE;
'membership_type_id' => array(),
);
$files = array();
- $obj = new CRM_Member_Form_Membership;
+ $obj = new CRM_Member_Form_Membership();
$rc = $obj->formRule($params, $files, $obj);
$this->assertType('array', $rc,
'In line ' . __LINE__
'membership_type_id' => array('23', '3'),
);
$files = array();
- $obj = new CRM_Member_Form_Membership;
+ $obj = new CRM_Member_Form_Membership();
$rc = call_user_func(array('CRM_Member_Form_Membership', 'formRule'),
$params, $files, $obj
);
'membership_type_id' => array('23', '3'),
);
$files = array();
- $obj = new CRM_Member_Form_Membership;
+ $obj = new CRM_Member_Form_Membership();
$rc = $obj->formRule($params, $files, $obj);
$this->assertType('array', $rc,
'In line ' . __LINE__
'membership_type_id' => array('23', '3'),
);
$files = array();
- $obj = new CRM_Member_Form_Membership;
+ $obj = new CRM_Member_Form_Membership();
$rc = $obj->formRule($params, $files, $obj);
$this->assertType('array', $rc,
'In line ' . __LINE__
'membership_type_id' => array('23', '13'),
);
$files = array();
- $obj = new CRM_Member_Form_Membership;
+ $obj = new CRM_Member_Form_Membership();
$rc = $obj->formRule($params, $files, $obj);
$this->assertType('array', $rc);
$this->assertTrue(array_key_exists('status_id', $rc));
'is_override' => TRUE,
);
$files = array();
- $obj = new CRM_Member_Form_Membership;
+ $obj = new CRM_Member_Form_Membership();
$rc = $obj->formRule($params, $files, $obj);
$this->assertType('array', $rc,
'In line ' . __LINE__
'membership_type_id' => array('23', '3'),
);
$files = array();
- $obj = new CRM_Member_Form_Membership;
+ $obj = new CRM_Member_Form_Membership();
$rc = $obj->formRule($params, $files, $obj);
// Should have found no valid membership status
'membership_type_id' => array('23', '3'),
);
$files = array();
- $obj = new CRM_Member_Form_Membership;
+ $obj = new CRM_Member_Form_Membership();
$rc = $obj->formRule($params, $files, $obj);
// Should have found New membership status
'membership_type_id' => array('23', '3'),
);
$files = array();
- $obj = new CRM_Member_Form_Membership;
+ $obj = new CRM_Member_Form_Membership();
$rc = $obj->formRule($params, $files, $obj);
// Should have found New membership status
'membership_type_id' => array('23', '3'),
);
$files = array();
- $obj = new CRM_Member_Form_Membership;
+ $obj = new CRM_Member_Form_Membership();
$rc = $obj->formRule($params, $files, $obj);
// Should have found Current membership status
'membership_type_id' => array('23', '3'),
);
$files = array();
- $obj = new CRM_Member_Form_Membership;
+ $obj = new CRM_Member_Form_Membership();
$rc = $obj->formRule($params, $files, $obj);
// Should have found Grace membership status
'membership_type_id' => array('23', '3'),
);
$files = array();
- $obj = new CRM_Member_Form_Membership;
+ $obj = new CRM_Member_Form_Membership();
$rc = $obj->formRule($params, $files, $obj);
// Should have found Expired membership status
'membership_type_id' => array('23', '7'),
);
$files = array();
- $obj = new CRM_Member_Form_Membership;
+ $obj = new CRM_Member_Form_Membership();
$rc = $obj->formRule($params, $files, $obj);
// Should have found Current membership status
// also load the class loader
require_once 'CRM/Core/ClassLoader.php';
CRM_Core_ClassLoader::singleton()->register();
- if (function_exists('_civix_phpunit_setUp')) { // FIXME: loosen coupling
+ if (function_exists('_civix_phpunit_setUp')) {
+ // FIXME: loosen coupling
_civix_phpunit_setUp();
}
}
* @param $expectedValue
* @param $message
*/
- function assertDBCompareValue(
+ public function assertDBCompareValue(
$daoName, $searchValue, $returnColumn, $searchColumn,
$expectedValue, $message
) {
'debug' => 1,
);
$result = $this->civicrm_api($entity, 'getcount', $params);
- if (!is_integer($result) || !empty($result['is_error']) || isset($result['values'])) {
+ if (!is_int($result) || !empty($result['is_error']) || isset($result['values'])) {
throw new Exception('Invalid getcount result : ' . print_r($result, TRUE) . " type :" . gettype($result));
}
if (is_int($count)) {
);
$params = array('contact_type' => $contact_type);
foreach ($samples[$contact_type] as $key => $values) {
- $params[$key] = $values[$seq % sizeof($values)];
+ $params[$key] = $values[$seq % count($values)];
}
if ($contact_type == 'Individual') {
$params['email'] = strtolower(
* Contact ID to delete
*/
public function contactDelete($contactID) {
- $domain = new CRM_Core_BAO_Domain;
+ $domain = new CRM_Core_BAO_Domain();
$domain->contact_id = $contactID;
if (!$domain->find(TRUE)) {
$this->callAPISuccess('contact', 'delete', array(
public function membershipDelete($membershipID) {
$deleteParams = array('id' => $membershipID);
$result = $this->callAPISuccess('Membership', 'Delete', $deleteParams);
- return;
}
/**
return;
}
$result = $this->callAPISuccess('MembershipStatus', 'Delete', array('id' => $membershipStatusID));
- return;
}
/**
/**
* Delete a Location Type
*
- * @param int location type id
+ * @param int locationTypeId
*/
public function locationTypeDelete($locationTypeId) {
$locationType = new CRM_Core_DAO_LocationType();
*
* @param int $groupID
* @param int $totalCount
- * @return int groupId of created group
- * groupId of created group
+ * @return int
+ * groupId of created group
*/
public function groupContactCreate($groupID, $totalCount = 10) {
$params = array('group_id' => $groupID);
/**
* Delete a UF Join Entry
*
- * @param array with missing uf_group_id
+ * @param array $params
+ * with missing uf_group_id
*/
public function ufjoinDelete($params = NULL) {
if ($params === NULL) {
'contact_id' => $contactId,
'street_address' => '25 Big Street',
'city' => 'big city',
- 'location_type_id' => 5
+ 'location_type_id' => 5,
));
$this->callAPISuccess('email', 'create', array(
'contact_id' => $contactId,
'email' => 'big@once.com',
'location_type_id' => 2,
- 'is_billing' => 1
+ 'is_billing' => 1,
));
$expected = current($individual);
$this->_addCustomFieldToProfile($this->_profileID);
$result = $this->callAPIAndDocument('profile', 'getfields', array(
'action' => 'submit',
- 'profile_id' => $this->_profileID
+ 'profile_id' => $this->_profileID,
), __FUNCTION__, __FILE__,
'demonstrates retrieving profile fields passing in an id');
$this->assertArrayKeyExists('first_name', $result['values']);
$result = $this->callAPISuccess('profile', 'getfields', array(
'action' => 'submit',
'profile_id' => 'participant_status',
- 'get_options' => 'all'
+ 'get_options' => 'all',
)
);
$this->assertTrue(array_key_exists('participant_status_id', $result['values']));
$result = $this->callAPISuccess('profile', 'getfields', array(
'action' => 'submit',
'profile_id' => 'membership_batch_entry',
- 'get_options' => 'all'
+ 'get_options' => 'all',
)
);
$this->assertTrue(array_key_exists('total_amount', $result['values']));
$this->assertEquals(array(
'contribution_type_id',
'contribution_type',
- 'financial_type'
+ 'financial_type',
), $result['values']['financial_type_id']['api.aliases']);
$this->assertTrue(!array_key_exists('financial_type', $result['values']));
$this->assertEquals(12, $result['values']['receive_date']['type']);
$result = $this->callAPISuccess('profile', 'getfields', array(
'action' => 'submit',
'profile_id' => $profileID,
- 'get_options' => 'all'
+ 'get_options' => 'all',
)
);
}
$profileFields = $this->callAPISuccess('profile', 'getfields', array(
'get_options' => 'all',
'action' => 'submit',
- 'profile_id' => 'membership_batch_entry'
+ 'profile_id' => 'membership_batch_entry',
));
$getoptions = $this->callAPISuccess('membership', 'getoptions', array(
'field' => 'membership_type',
- 'context' => 'validate'
+ 'context' => 'validate',
));
$this->assertEquals(array_keys($membershipTypes['values']), array_keys($getoptions['values']));
$this->assertEquals(array_keys($membershipTypes['values']), array_keys($profileFields['values']['membership_type_id']['options']));
public function testMembershipGetFieldsOrder() {
$result = $this->callAPISuccess('profile', 'getfields', array(
'action' => 'submit',
- 'profile_id' => 'membership_batch_entry'
+ 'profile_id' => 'membership_batch_entry',
));
$weight = 1;
foreach ($result['values'] as $fieldName => $field) {
foreach (array(
'email',
'phone',
- 'address'
+ 'address',
) as $fieldType) {
$typeValues = array_pop($result['values'][$fieldType]);
foreach ($expected[$fieldType] as $field => $value) {
$this->uFFieldCreate(array(
'uf_group_id' => $profileID,
'field_name' => 'custom_' . $ids['custom_field_id'],
- 'contact_type' => 'Contact'
+ 'contact_type' => 'Contact',
));
}
}