*
* @return void
*/
-
public function postProcess() {
$formparams = $this->exportValues();
$caseId = $formparams['unclosed_case_id'];
else {
CRM_Core_Session::setStatus(ts('Not permitted to file activity %1 %2.', array(
1 => empty($defaults['subject']) ? '' : $defaults['subject'],
- 2 => $defaults['activity_date_time']
+ 2 => $defaults['activity_date_time'],
)),
ts("Error"), "error");
}
if (count($this->_activityHolderIds) > $this->_maxActivities) {
CRM_Core_Session::setStatus(ts("The maximum number of Activities you can select for Batch Update is %1. You have selected %2. Please select fewer Activities from your search results and try again.", array(
1 => $this->_maxActivities,
- 2 => count($this->_activityHolderIds)
+ 2 => count($this->_activityHolderIds),
)), ts('Maximum Exceeded'), 'error');
$validate = TRUE;
}
$ufGroupElement = $this->add('select', 'uf_group_id', ts('Select Profile'),
array(
- '' => ts('- select profile -')
+ '' => ts('- select profile -'),
) + $profiles, TRUE
);
$this->addDefaultButtons(ts('Continue'));
foreach ($fields as $f) {
if (in_array($f, array(
'is_default',
- 'is_ssl'
+ 'is_ssl',
))) {
$params[$f] = CRM_Utils_Array::value($f, $formValues, FALSE);
}
$from = '"' . $domainEmailName . '" <' . $domainEmailAddress . '>';
$testMailStatusMsg = ts('Sending test email. FROM: %1 TO: %2.<br />', array(
1 => $domainEmailAddress,
- 2 => $toEmail
+ 2 => $toEmail,
));
$params = array();
'url' => CRM_Utils_System::url('civicrm/admin',
'reset=1'
),
- )
+ ),
);
CRM_Utils_System::appendBreadCrumb($breadCrumb);
return parent::run();
$jobName = NULL;
if ($jid) {
- $jobName =
- CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Job', $jid);
+ $jobName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Job', $jid);
}
$this->assign('jobName', $jobName);
'url' => CRM_Utils_System::url('civicrm/admin/access',
'reset=1'
),
- )
+ ),
);
CRM_Utils_System::appendBreadCrumb($breadCrumb);
}
'url' => 'civicrm/contact/search/custom',
'qs' => 'reset=1&csid=%%value%%',
'title' => ts('Run %1', array(1 => self::$_gName)),
- )
+ ),
);
self::$_links = $runLink + self::$_links;
}
public function browse() {
$statusTypes = array();
- $dao = new CRM_Event_DAO_ParticipantStatusType;
+ $dao = new CRM_Event_DAO_ParticipantStatusType();
$dao->orderBy('weight');
$dao->find();
'Awaiting approval',
'Pending from waitlist',
'Pending from approval',
- 'Rejected'
+ 'Rejected',
);
while ($dao->fetch()) {
//CRM-15546
$paymentProcessorTypes = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_PaymentProcessor', 'payment_processor_type_id', array(
'labelColumn' => 'name',
- 'flip' => 1
+ 'flip' => 1,
));
$this->assign('defaultPaymentProcessorType', $paymentProcessorTypes['PayPal']);
$breadCrumb = array(
'url' => CRM_Utils_System::url('civicrm/admin',
'reset=1'
),
- )
+ ),
);
CRM_Utils_System::appendBreadCrumb($breadCrumb);
return parent::run();
*/
public static function create(&$params) {
if (empty($params)) {
- return;
+ return NULL;
}
if (!(CRM_Utils_Array::value('id', $params))) {
*/
public function createSignature(&$params) {
if (empty($params)) {
- return;
+ return NULL;
}
if (!isset($params['sid'])) {
)
) . "@$emailDomain";
-
$confirmUrl = CRM_Utils_System::url('civicrm/petition/confirm',
"reset=1&cid={$se->contact_id}&sid={$se->id}&h={$se->hash}&a={$params['activityId']}&pid={$params['sid']}",
TRUE
* Set default values for the form. Note that in edit/view mode
* the default values are retrieved from the database
*
- * @param null
- *
* @return array
* array of default values
*/
// custom group id
$this->add('select', 'contact_profile_id', ts('Contact Profile'),
array(
- '' => ts('- select -')
+ '' => ts('- select -'),
) + $customContactProfiles, TRUE
);
*
* @return void
*/
- function preProcess() {
+ public function preProcess() {
$this->_search = CRM_Utils_Array::value('search', $_GET);
$this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE, FALSE);
$this->_searchTab = CRM_Utils_Request::retrieve('type', 'String', $this, FALSE, 'survey');
$surveyTypes = CRM_Campaign_BAO_Survey::getSurveyActivityType();
$this->add('select', 'activity_type_id',
ts('Activity Type'), array(
- '' => ts('- select -')
+ '' => ts('- select -'),
) + $surveyTypes
);
$this->set('surveyTypes', $surveyTypes);
->addSetting(array(
'tabSettings' => array(
'active' => strtolower(CRM_Utils_Array::value('subPage', $_GET, 'campaign')),
- )
+ ),
));
}
* @param int $activity_id
* @param int $petition_id
*
- * @return boolean
+ * @return bool
* True on success
*/
public static function confirm($contact_id, $subscribe_id, $hash, $activity_id, $petition_id) {
// since the pcm - preferred comminication method is logically
// grouped hence we'll use groups of HTML_QuickForm
-
// checkboxes for DO NOT phone, email, mail
// we take labels from SelectValues
$privacy = $commPreff = $commPreference = array();
if (!empty($greetingTokens)) {
$form->addElement('select', $fields['field'], $fields['label'],
array(
- '' => ts('- select -')
+ '' => ts('- select -'),
) + $greetingTokens
);
//custom addressee
if ($form->_action & CRM_Core_Action::ADD) {
foreach (CRM_Contact_BAO_Contact::$_greetingTypes as $greeting) {
if (empty($defaults[$greeting . '_id'])) {
- if ($defaultGreetingTypeId =
- CRM_Contact_BAO_Contact_Utils::defaultGreeting($form->_contactType, $greeting)
+ if ($defaultGreetingTypeId = CRM_Contact_BAO_Contact_Utils::defaultGreeting($form->_contactType, $greeting)
) {
$defaults[$greeting . '_id'] = $defaultGreetingTypeId;
}
$this->prev = $this->next = NULL;
foreach (array(
'prev',
- 'next'
+ 'next',
) as $position) {
if (!empty($pos[$position])) {
if ($pos[$position]['id1'] && $pos[$position]['id2']) {
$buttons[] = array(
'type' => 'done',
'name' => ts('Merge and View Result'),
- 'icon' => 'circle-check'
+ 'icon' => 'circle-check',
);
}
'entity' => 'group_contact',
'label' => ts('in'),
'context' => 'search',
- 'placeholder' => ts('- any group -')
+ 'placeholder' => ts('- any group -'),
));
}
'entity' => 'entity_tag',
'label' => ts('with'),
'context' => 'search',
- 'placeholder' => ts('- any tag -')
+ 'placeholder' => ts('- any tag -'),
));
}
}
$this->_formValues['tag'][$tag] = 1;
}
- return;
+ return NULL;
}
/**
'city',
'state_province',
'postal_code',
- 'country'
+ 'country',
)) && empty($addressOptions[$field])
) {
unset($this->_columns[$name]);
$this->_formValues['tag'][$tag] = 1;
}
- return;
+ return NULL;
}
/**
*
* @return CRM_Contact_DAO_Contact
*/
- function all(
+ public function all(
$offset = 0,
$rowCount = 0,
$sort = NULL,
'end_date',
'show_payees',
'event_type_id',
- 'event_id'
+ 'event_id',
));
}
/**
* Construct the search query
*/
- function all(
+ public function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
*
* @return string
*/
- function all(
+ public function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
// the temporary tables are dropped automatically
// so we don't do it here
// but let mysql clean up
- return;
+ return NULL;
}
}
$count_success = count($form->_toContactDetails);
CRM_Core_Session::setStatus(ts('One message was sent successfully.', array(
'plural' => '%count messages were sent successfully.',
- 'count' => $count_success
+ 'count' => $count_success,
)), ts('Message Sent', array('plural' => 'Messages Sent', 'count' => $count_success)), 'success');
}
$status = '(' . ts('because no email address on file or communication preferences specify DO NOT EMAIL or Contact is deceased or Primary email address is On Hold') . ')<ul><li>' . implode('</li><li>', $not_sent) . '</li></ul>';
CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array(
'count' => count($emailsNotSent),
- 'plural' => '%count Messages Not Sent'
+ 'plural' => '%count Messages Not Sent',
)), 'info');
}
$params = array(
1 => array($contact_id, 'Integer'),
- 2 => array($isTest, 'Integer')
+ 2 => array($isTest, 'Integer'),
);
$cs = CRM_Core_DAO::executeQuery($query, $params);
*
* @param int $contact_id
* Contact id.
- * @param int $isTest
* @param string $filter
+ * @param int $isTest
* Additional filter criteria, later used in where clause.
*
* @return array
if (!empty($dupeParams['onbehalf'])) {
unset($dupeParams['onbehalf']);
}
+ if (!empty($dupeParams['honor'])) {
+ unset($dupeParams['honor']);
+ }
$dedupeParams = CRM_Dedupe_Finder::formatParams($dupeParams, 'Individual');
$dedupeParams['check_permission'] = FALSE;
'pcp_display_in_roll',
'pcp_is_anonymous',
'pcp_roll_nickname',
- 'pcp_personal_note'
+ 'pcp_personal_note',
) as $val) {
if (!empty($this->_params[$val])) {
$this->assign($val, $this->_params[$val]);
elseif (in_array($name, array(
'addressee',
'email_greeting',
- 'postal_greeting'
+ 'postal_greeting',
)) && !empty($contact[$name . '_custom'])
) {
$defaults[$name . '_custom'] = $contact[$name . '_custom'];
'last_name',
'suffix_id',
'organization_name',
- 'household_name'
+ 'household_name',
);
if ($profileContactType == 'honor' && in_array($field['name'], $honoreeNamefields)) {
unset($fields[$field['name']]);
* When we get the control back from payment gate way
* lets delete the recurring and related contribution.
*
- **/
+ */
public function cancelRecurring() {
$isCancel = CRM_Utils_Request::retrieve('cancel', 'Boolean', CRM_Core_DAO::$_nullObject);
if ($isCancel) {
$entities[] = array(
'entity_name' => 'contribution_1',
'entity_type' => 'ContributionModel',
- 'entity_sub_type' => '*'
+ 'entity_sub_type' => '*',
);
// If applicable, register 'membership_1'
$entities[] = array(
'entity_name' => 'membership_1',
'entity_type' => 'MembershipModel',
- 'entity_sub_type' => '*'
+ 'entity_sub_type' => '*',
);
$allowCoreTypes[] = 'Membership';
$allowSubTypes['MembershipType'] = explode(',', $member['membership_types']);
->addSetting(array(
'tabSettings' => array(
'active' => self::getCurrentTab($tabs),
- )
+ ),
));
return $tabs;
}
$tabs[$key]['qfKey'] = NULL;
}
- $tabs[$key]['link'] =
- CRM_Utils_System::url(
+ $tabs[$key]['link'] = CRM_Utils_System::url(
"civicrm/admin/contribute/{$key}",
"{$reset}action=update&id={$contribPageId}{$tabs[$key]['qfKey']}"
);
*
* @return void
*/
- function preProcess() {
+ public function preProcess() {
//check for delete
if (!CRM_Core_Permission::checkActionPermission('CiviContribute', CRM_Core_Action::DELETE)) {
CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
}
$status = ts('Deleted Contribution(s): %1 (Total Selected: %2) ', array(
1 => $deletedContributions,
- 2 => count($this->_contributionIds)
+ 2 => count($this->_contributionIds),
));
CRM_Core_Session::setStatus($status, '', 'info');
}
*
* @return void
*/
- function preProcess() {
+ public function preProcess() {
$id = CRM_Utils_Request::retrieve('id', 'Positive',
$this, FALSE
);
array(
'url' => $url,
'title' => ts('Search Results'),
- )
+ ),
);
CRM_Utils_System::appendBreadCrumb($breadCrumb);
if (count($this->_contributionIds) > $this->_maxContributions) {
CRM_Core_Session::setStatus(ts("The maximum number of contributions you can select for Batch Update is %1. You have selected %2. Please select fewer contributions from your search results and try again.", array(
1 => $this->_maxContributions,
- 2 => count($this->_contributionIds)
+ 2 => count($this->_contributionIds),
)), ts('Batch Update Error'), 'error');
$validate = TRUE;
}
$ufGroupElement = $this->add('select', 'uf_group_id', ts('Select Profile'),
array(
- '' => ts('- select profile -')
+ '' => ts('- select profile -'),
) + $profiles, TRUE
);
$this->addDefaultButtons(ts('Continue'));
$session->setStatus($status, $msgTitle, $msgType);
}
elseif (!$userID) {
- if ($status)
+ if ($status) {
CRM_Utils_System::setUFMessage($status);
+ }
$result = (int) ($updateSubscription && isset($ctype));
- if (isset($tplParams))
+ if (isset($tplParams)) {
$session->set('resultParams', $tplParams);
+ }
return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/subscriptionstatus',
"reset=1&task=billing&result={$result}"));
}
foreach (array(
'contribution_id',
'invoice_id',
- 'trxn_id'
+ 'trxn_id',
) as $key) {
$this->_mapperFields[$key] .= ' (match to contribution record)';
$highlightedFields[] = $key;
'email',
'first_name',
'last_name',
- 'external_identifier'
+ 'external_identifier',
);
foreach ($highlightedFieldsArray as $name) {
$highlightedFields[] = $name;
* @return bool
*/
public function validateDocument($document) {
- if (!isset($document['ttl']) || !is_integer($document['ttl'])) {
+ if (!isset($document['ttl']) || !is_int($document['ttl'])) {
return FALSE;
}
- if (!isset($document['retry']) || !is_integer($document['retry'])) {
+ if (!isset($document['retry']) || !is_int($document['retry'])) {
return FALSE;
}
if (!isset($document['messages']) || !is_array($document['messages'])) {
* Provides information whether given component is currently
* marked as enabled in configuration.
*
- * @return boolean
+ * @return bool
* true if component is enabled, false if not
*/
public function isEnabled() {
/**
* Provides information whether given component uses system wide search.
*
- * @return boolean
+ * @return bool
* true if component needs search integration
*/
public function usesSearch() {
CRM_Core_Transaction::addCallback(
CRM_Core_Transaction::PHASE_POST_COMMIT,
function () {
- CRM_Core_ManagedEntities::singleton(TRUE)->reconcile();
+ CRM_Core_ManagedEntities::singleton(TRUE)->reconcile();
},
array(),
'ManagedEntities::reconcile'
if (empty($params['key'])) {
$smarty->trigger_error("Missing required parameter, 'key', in isValueChange plugin.");
- return;
+ return NULL;
}
$is_changed = FALSE;
$smarty->assign($params['assign'], $is_changed);
}
- return;
+ return NULL;
}
* @return string
* the formatted string
*
- * For alternate decimal point and thousands separator, delimit values with single quotes in the template.
- * EXAMPLE: {$number|crmNumberFormat:2:',':' '} for French notation - 1234.56 becomes 1 234,56
+ * For alternate decimal point and thousands separator, delimit values with single quotes in the template.
+ * EXAMPLE: {$number|crmNumberFormat:2:',':' '} for French notation - 1234.56 becomes 1 234,56
*/
function smarty_modifier_crmNumberFormat($number, $decimals = NULL, $dec_point = NULL, $thousands_sep = NULL) {
if (is_numeric($number)) {
/**
* Setter for name
*
- * @param string
+ * @param string $name
*
* @return void
*/
* beginning from the final state, but retain the same session
* values
*
- * @return boolean
+ * @return bool
*/
public function shouldReset() {
return TRUE;
'dst_html_type',
ts('New HTML Type'),
array(
- '' => ts('- select -')
+ '' => ts('- select -'),
) + $this->_htmlTypeTransitions,
TRUE
);
if ($dstHtmlType == 'Text' && in_array($srcHtmlType, array(
'Select',
'Radio',
- 'Autocomplete-Select'
+ 'Autocomplete-Select',
))
) {
$customField->option_group_id = "NULL";
* @return mixed
* @throws Exception
*/
- function run(
+ public function run(
$fileName,
$separator = ',',
&$mapper,
* Given a list of the importable field keys that the user has selected
* set the active fields array to this list
*
- * @param array mapped array of values
+ * @param array $fieldKeys mapped array of values
*
* @return void
*/
/**
* Get the action links for this page.
*
- * @param null
*
* @return array
* array of action links that we need to display for the browse screen
* type of action and executes that action.
* Finally it calls the parent's run method.
*
- * @param null
- *
* @return void
*/
public function run() {
/**
* find fields related to a rule group.
*
- * @param array contains the rule group property to identify rule group
+ * @param array $params contains the rule group property to identify rule group
*
* @return array
* rule fields array associated to rule group
*/
public static function validateContacts($cid, $oid) {
if (!$cid || !$oid) {
- return;
+ return NULL;
}
$exception = new CRM_Dedupe_DAO_Exception();
$exception->contact_id1 = $cid;
/**
* Get all of the combinations of fields that would work with a rule
*/
-
public static function combos($rgFields, $threshold, &$combos, $running = array()) {
foreach ($rgFields as $rgField => $weight) {
unset($rgFields[$rgField]);
$dao->find();
$result = array();
while ($dao->fetch()) {
- $title =
- !empty($dao->title) ? $dao->title : (!empty($dao->name) ? $dao->name : $dao->contact_type);
+ $title = !empty($dao->title) ? $dao->title : (!empty($dao->name) ? $dao->name : $dao->contact_type);
$name = "$title - {$dao->used}";
$result[$dao->id] = $name;
* @return array
* matching contact ids
*/
- static function dupesByParams(
+ public static function dupesByParams(
$params,
$ctype,
$used = 'Unsupervised',
// handle {birth,deceased}_date
foreach (array(
'birth_date',
- 'deceased_date'
+ 'deceased_date',
) as $date) {
if (!empty($fields[$date])) {
$flat[$date] = $fields[$date];
/**
* @param array $params
*
- * @return $this|CRM_Event_Cart_BAO_EventInCart
+ * @return object $this|CRM_Event_Cart_BAO_EventInCart
* @throws Exception
*/
public static function create(&$params) {
'payment_instrument_id',
'contribution_status_id',
'receive_date',
- 'total_amount'
+ 'total_amount',
) as $f) {
if ($f == 'receive_date') {
list($defaults[$form->_pId]['receive_date']) = CRM_Utils_Date::setDateDefaults($contribution->$f);
$element = $form->add('select', 'discount_id',
ts('Discount Set'),
array(
- 0 => ts('- select -')
+ 0 => ts('- select -'),
) + $discounts,
FALSE,
array('onchange' => "buildFeeBlock( {$form->_eventId}, this.value );")
array(
'title' => ts('Manage Events'),
'url' => $this->_doneUrl,
- )
+ ),
);
}
}
array(
'title' => ts('Manage Event Templates'),
'url' => $this->_doneUrl,
- )
+ ),
);
}
CRM_Utils_System::appendBreadCrumb($breadCrumb);
foreach ($discountFields['options'] as $discountFieldsval) {
$defaults['discounted_label'][$discountFieldsval['weight']] = $discountFieldsval['label'];
- $defaults['discounted_value'][$discountFieldsval['weight']][$rowCount] =
- CRM_Utils_Money::format($discountFieldsval['amount'], NULL, '%a');
+ $defaults['discounted_value'][$discountFieldsval['weight']][$rowCount] = CRM_Utils_Money::format($discountFieldsval['amount'], NULL, '%a');
$defaults['discount_option_id'][$rowCount][$discountFieldsval['weight']] = $discountFieldsval['id'];
if (!empty($discountFieldsval['is_default'])) {
$defaults['discounted_default'] = $discountFieldsval['weight'];
}
$this->add('select', 'price_set_id', ts('Price Set'),
array(
- '' => ts('- none -')
+ '' => ts('- none -'),
) + $price,
NULL, array('onchange' => "return showHideByValue('price_set_id', '', 'map-field', 'block', 'select', false);")
);
$this->addRadio('location_option', ts("Choose Location"), $optionTypes);
if (!isset($locationEvents[$this->_oldLocBlockId]) || (!$this->_oldLocBlockId)) {
- $locationEvents = array(
- '' => ts('- select -')
- ) + $locationEvents;
+ $locationEvents = array('' => ts('- select -')) + $locationEvents;
}
$this->add('select', 'loc_event_id', ts('Use Location'), $locationEvents);
}
foreach (array(
'address',
'phone',
- 'email'
+ 'email',
) as $block) {
if (empty($params[$block]) || !is_array($params[$block])) {
continue;
->addSetting(array(
'tabSettings' => array(
'active' => self::getCurrentTab($tabs),
- )
+ ),
));
CRM_Event_Form_ManageEvent::addProfileEditScripts();
return $tabs;
'name' => "<a href=\"$url\">{$dao->display_name}</a>",
'email' => $dao->email,
// FIXME: translate this
- 'type' => (empty($dao->bounce_type)
- ? ts('Unknown') : $dao->bounce_type
+ 'type' => (empty($dao->bounce_type) ? ts('Unknown') : $dao->bounce_type
),
'reason' => $dao->reason,
'date' => CRM_Utils_Date::customFormat($dao->date),
*/
class CRM_Queue_Task {
- /** Task was performed successfully */
+ /**
+ * Task was performed successfully
+ */
const TASK_SUCCESS = 1;
- /** Task failed and should not be retried */
+ /**
+ * Task failed and should not be retried
+ */
const TASK_FAIL = 2;
/**
$this->_where = "WHERE {$this->_aliases['civicrm_contact']}.employer_id!='null' ";
}
else {
- $this->_where =
- "WHERE ({$this->_aliases['civicrm_contact']}.employer_id!='null') AND " .
- implode(' AND ', $clauses);
+ $this->_where = "WHERE ({$this->_aliases['civicrm_contact']}.employer_id!='null') AND " . implode(' AND ', $clauses);
}
if ($this->_aclWhere) {
$op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
if ($op) {
if ($fieldName == 'relationship_type_id') {
- $clause =
- "{$this->_aliases['civicrm_relationship']}.relationship_type_id=" .
- $this->relationshipId;
+ $clause = "{$this->_aliases['civicrm_relationship']}.relationship_type_id=" . $this->relationshipId;
}
else {
$clause = $this->whereClause($field,
$this->_absoluteUrl
);
- $rows[$rowNum]['civicrm_contact_household_household_name'] =
- "<a href='$url' title='" .
- ts('View contact summary for this househould') . "'>" . $value .
- '</a>';
+ $rows[$rowNum]['civicrm_contact_household_household_name'] = "<a href='$url' title='" . ts('View contact summary for this househould') . "'>" . $value . '</a>';
}
$entryFound = TRUE;
}
public function statistics(&$rows) {
$statistics = parent::statistics($rows);
- $select =
- "SELECT SUM({$this->_aliases['civicrm_pcp']}.goal_amount) as goal_total, " .
- "SUM({$this->_aliases['civicrm_contribution_soft']}.amount) as committed_total, " .
- "COUNT({$this->_aliases['civicrm_contribution_soft']}.id) as donors_total, " .
- "SUM(IF( contribution_civireport.contribution_status_id > 1, 0, contribution_soft_civireport.amount)) AS received_total ";
+ $select
+ = "SELECT SUM({$this->_aliases['civicrm_pcp']}.goal_amount) as goal_total, " .
+ "SUM({$this->_aliases['civicrm_contribution_soft']}.amount) as committed_total, " .
+ "COUNT({$this->_aliases['civicrm_contribution_soft']}.id) as donors_total, " .
+ "SUM(IF( contribution_civireport.contribution_status_id > 1, 0, contribution_soft_civireport.amount)) AS received_total ";
$sql = "{$select} {$this->_from} {$this->_where}";
$dao = CRM_Core_DAO::executeQuery($sql);
$dao->fetch();
'bounce_rate',
'open_rate',
'CTR',
- 'CTO'
+ 'CTO',
))) {
$isError = FALSE;
}
if ($isError) {
$errors['_qf_default'] = ts('For Chart view, please select at least one field from %1 OR %2.', array(
1 => implode(', ', $criterias['count']),
- 2 => implode(', ', $criterias['rate'])
+ 2 => implode(', ', $criterias['rate']),
));
}
}
if (!empty($this->_params['group_bys_freq'][$fieldName])) {
$this->_interval = $field['title'];
- $this->_columnHeaders["{$tableName}_{$fieldName}_start"]['title'] =
- $field['title'] . ' Beginning';
+ $this->_columnHeaders["{$tableName}_{$fieldName}_start"]['title'] = $field['title'] . ' Beginning';
$this->_columnHeaders["{$tableName}_{$fieldName}_start"]['type'] = $field['type'];
$this->_columnHeaders["{$tableName}_{$fieldName}_start"]['group_by'] = $this->_params['group_bys_freq'][$fieldName];
ON payment.contribution_id = {$this->_aliases['civicrm_contribution']}.id";
}
- // end of from
-
public function where() {
$this->_whereClauses[] = "{$this->_aliases['civicrm_membership']}.is_test = 0 AND
{$this->_aliases['civicrm_contact']}.is_deleted = 0";
$totalAmount = $average = array();
$count = $memberCount = 0;
while ($dao->fetch()) {
- $totalAmount[] =
- CRM_Utils_Money::format($dao->amount, $dao->currency) . "(" .
- $dao->count . ")";
+ $totalAmount[] = CRM_Utils_Money::format($dao->amount, $dao->currency) . "(" . $dao->count . ")";
$average[] = CRM_Utils_Money::format($dao->avg, $dao->currency);
$count += $dao->count;
$memberCount += $dao->memberCount;
foreach (array(
'name',
'group_id',
- 'is_sms'
+ 'is_sms',
) as $n) {
if (!empty($values[$n])) {
$params[$n] = $values[$n];
// delete previous includes/excludes, if mailing already existed
foreach (array(
'groups',
- 'mailings'
+ 'mailings',
) as $entity) {
$mg = new CRM_Mailing_DAO_MailingGroup();
$mg->mailing_id = $ids['mailing_id'];
* formatted address string
*
*/
- static function format(
+ public static function format(
$fields,
$format = NULL,
$microformat = FALSE,
static $config = NULL;
if (!$format) {
- $format =
- CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'address_format');
+ $format = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'address_format');
}
if ($mailing) {
- $format =
- CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'mailing_format');
+ $format = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'mailing_format');
}
$formatted = $format;
}
$this->returnMessages[] = ts("Addresses Evaluated: %1", array(
- 1 => $totalAddresses
+ 1 => $totalAddresses,
)) . "\n";
if ($processGeocode) {
$this->returnMessages[] = ts("Addresses Geocoded: %1", array(
- 1 => $totalGeocoded
+ 1 => $totalGeocoded,
)) . "\n";
}
if ($parseStreetAddress) {
$this->returnMessages[] = ts("Street Addresses Parsed: %1", array(
- 1 => $totalAddressParsed
+ 1 => $totalAddressParsed,
)) . "\n";
if ($unparseableContactAddress) {
$this->returnMessages[] = "<br />\n" . ts("Following is the list of contacts whose address is not parsed:") . "<br />\n";
*
* @return array
*
- * {@getfields action_schedule_create}
+ * {@getfields action_schedule_create}
*/
function civicrm_api3_action_schedule_create($params) {
civicrm_api3_verify_one_mandatory($params, NULL, array('start_action_date', 'absolute_date'));
/**
* Retrieve one or more PaymentProcessor
*
- * @param mixed[] (reference) input parameters
- * {@getfields payment_processor_get}
* @param array $params
* An associative array of name/value pairs.
+ * {@getfields payment_processor_get}
*
* @return array
* details of found PaymentProcessor
class CRM_UpdateMembershipRecord {
/**
*/
- function __construct() {
+ public function __construct() {
// you can run this program either from an apache command, or from the cli
if (php_sapi_name() == "cli") {
require_once "cli.php";
}
}
- function initialize() {
+ public function initialize() {
require_once '../civicrm.config.php';
require_once 'CRM/Core/Config.php';
class CRM_UpdateMembershipReminderDate {
/**
*/
- function __construct() {
+ public function __construct() {
// you can run this program either from an apache command, or from the cli
if (php_sapi_name() == "cli") {
require_once "cli.php";
}
}
- function initialize() {
+ public function initialize() {
require_once '../civicrm.config.php';
require_once 'CRM/Core/Config.php';
class CRM_UpdatePledgeRecord {
/**
*/
- function __construct() {
+ public function __construct() {
$config = CRM_Core_Config::singleton();
// this does not return on failure
require_once 'CRM/Utils/System.php';
foreach (array(
'Completed',
'Cancelled',
- 'Failed'
+ 'Failed',
) as $statusKey) {
if ($key = CRM_Utils_Array::key($statusKey, $allStatus)) {
unset($allStatus[$key]);
class CRM_Cron_Action {
/**
*/
- function __construct() {
+ public function __construct() {
// you can run this program either from an apache command, or from the cli
if (php_sapi_name() == "cli") {
require_once "cli.php";
}
}
- function initialize() {
+ public function initialize() {
require_once '../civicrm.config.php';
require_once 'CRM/Core/Config.php';
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
+
+/**
+ *
+ * @package CRM
+ * @copyright CiviCRM LLC (c) 2004-2014
+ * $Id$
+ *
+ */
function run() {
session_start();
$output = $targetDir . '/civicrm.xml';
$fd = fopen($output, "w");
- fputs($fd, $xml);
+ fwrite($fd, $xml);
fclose($fd);
require_once 'CRM/Core/Config.php';
$output = $targetDir . '/admin/access.xml';
$xml = $smarty->fetch('access.tpl');
$fd = fopen($output, "w");
- fputs($fd, $xml);
+ fwrite($fd, $xml);
fclose($fd);
}
*/
return array(
'event_enable_cart' =>
- array(
- 'name' => 'enable_cart',
- 'group_name' => 'Event Preferences',
- 'group' => 'event',
- 'type' => 'String',
- 'quick_form_type' => 'Element',
- 'default' => 0,
- 'add' => 4.1,
- 'title' => 'Enable Event Cart',
- 'is_domain' => 1,
- 'is_contact' => 1,
- 'description' => "WRITE ME",
- 'help_text' => 'WRITE ME',
- ),
+ array(
+ 'name' => 'enable_cart',
+ 'group_name' => 'Event Preferences',
+ 'group' => 'event',
+ 'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'default' => 0,
+ 'add' => 4.1,
+ 'title' => 'Enable Event Cart',
+ 'is_domain' => 1,
+ 'is_contact' => 1,
+ 'description' => "WRITE ME",
+ 'help_text' => 'WRITE ME',
+ ),
);
*/
private static function getInstance() {
if (is_null(self::$instance)) {
- self::$instance = new self;
+ self::$instance = new self();
}
return self::$instance;
}
*/
private static function getInstance() {
if (is_null(self::$instance)) {
- self::$instance = new self;
+ self::$instance = new self();
}
return self::$instance;
}
}
}
-/* --- Library of test hook implementations ---- */
-
+/**
+ * Library of test hook implementations
+ */
function hooktesta_civicrm_testRunHooks_outer() {
$test = CRM_Utils_HookTest::$activeTest;
$test->log[] = 'a-outer';
return array('from-module-a1', 'from-module-a2');
}
-// OMIT: function hooktestb_civicrm_testRunHooks_merge
-
+/**
+ * OMIT: function hooktestb_civicrm_testRunHooks_merge
+ */
function hooktestc_civicrm_testRunHooks_merge() {
return array();
}
'option.limit' => 15,
'option.foo' => array('bar'),
'options' => array('whiz' => 'bang'),
- 'optionnotreally' => 'data'
+ 'optionnotreally' => 'data',
), // requestParams
array('limit' => 15, 'foo' => array('bar'), 'whiz' => 'bang'), // expectedOptions
array('optionnotreally' => 'data'), // expectedData
'return' => array('field1', 'field2'),
'return.field3' => 1,
'return.field4' => 0,
- 'returnontreally' => 'data'
+ 'returnontreally' => 'data',
), // requestParams
array('return' => array('field1', 'field2', 'field3')), // expectedOptions
array('returnontreally' => 'data'), // expectedData
'FakeFile',
'create',
array(),
- "/Mandatory key\\(s\\) missing from params array: 'id' or 'entity_table/"
+ "/Mandatory key\\(s\\) missing from params array: 'id' or 'entity_table/",
);
$cases[] = array(
'FakeFile',
'get',
array(),
- "/Mandatory key\\(s\\) missing from params array: 'id' or 'entity_table/"
+ "/Mandatory key\\(s\\) missing from params array: 'id' or 'entity_table/",
);
$cases[] = array('FakeFile', 'create', array('entity_table' => 'unknown'), '/Unrecognized target entity/');
'edit-2-access-all-cases-and-activities',
'edit-2-access-my-cases-and-activities',
'edit-2-administer-civicase',
- 'edit-2-delete-in-civicase'
+ 'edit-2-delete-in-civicase',
);
$this->changePermissions($permission);
'edit-2-access-all-cases-and-activities',
'edit-2-access-my-cases-and-activities',
'edit-2-administer-civicase',
- 'edit-2-delete-in-civicase'
+ 'edit-2-delete-in-civicase',
);
$this->changePermissions($permission);
'edit-2-access-all-cases-and-activities',
'edit-2-access-my-cases-and-activities',
'edit-2-administer-civicase',
- 'edit-2-delete-in-civicase'
+ 'edit-2-delete-in-civicase',
);
$this->changePermissions($permission);
'edit-2-access-all-cases-and-activities',
'edit-2-access-my-cases-and-activities',
'edit-2-administer-civicase',
- 'edit-2-delete-in-civicase'
+ 'edit-2-delete-in-civicase',
);
$this->changePermissions($permission);
$this->waitForElementPresent('_qf_Fee_upload_done-bottom');
$this->click('CIVICRM_QFID_1_is_monetary');
$this->click("xpath=//tbale[@id='paymentProcessor']/tbody/tr[1]/td[2]/label[text()='$processorName']");
- $this->select('financial_type_id','label=Event Fee');
+ $this->select('financial_type_id', 'label=Event Fee');
$this->select('price_set_id', 'label=' . $setTitle);
// intro text for registration page
* @param string $theClass
* @param string $name
*/
- function __construct($theClass = '', $name = '') {
+ public function __construct($theClass = '', $name = '') {
parent::__construct($theClass, $name);
}
*/
private static function getInstance() {
if (is_null(self::$instance)) {
- self::$instance = new self;
+ self::$instance = new self();
}
return self::$instance;
}
array('label' => 'my goat', 'value' => 'goat', 'is_active' => TRUE, 'weight' => 2),
array('label' => 'mohair', 'value' => 'wool', 'is_active' => TRUE, 'weight' => 3),
array('label' => 'hungry', 'value' => '', 'is_active' => TRUE, 'weight' => 3),
- )
+ ),
));
$columnName = $result['values'][$result['id']]['column_name'];
$ids['custom_field_id'] = $result['id'];
$this->assertEquals(0, $checkDeleted['count'], 'In line ' . __LINE__);
}
- /*
- * This is a test to check if setting fields one at a time alters other fields
- * Issues Hit so far =
- * 1) Currency keeps getting reset to USD - BUT this may be the only enabled currency
- * - in which case it is valid
- * 2)
- */
-
+ /**
+ * This is a test to check if setting fields one at a time alters other fields
+ * Issues Hit so far =
+ * 1) Currency keeps getting reset to USD - BUT this may be the only enabled currency
+ * - in which case it is valid
+ * 2)
+ */
public function testCreateAutoGrant() {
$entityName = $this->_entity;
$baoString = 'CRM_Grant_BAO_Grant';
);
}
- ///////////////// civicrm_group_contact_get methods
+ /**
+ * civicrm_group_contact_get methods
+ */
public function testGet() {
$params = array(
'contact_id' => $this->_contactId,
$this->assertEquals($result['total_count'], 2, "in line " . __LINE__);
}
- ///////////////// civicrm_group_contact_remove methods
+ /**
+ * civicrm_group_contact_remove methods
+ */
public function testDelete() {
$params = array(
'contact_id' => $this->_contactId,
'note' => 'note',
'contact_id' => $this->_contactID,
'modified_date' => '2011-01-31',
- 'subject' => NULL
+ 'subject' => NULL,
);
try {
'end_date' => '',
'membership_end_date' => '0',
'join_date' => '2010-12-20',
- 'membership_start_date' => '2010-12-20'
+ 'membership_start_date' => '2010-12-20',
);
$fields = civicrm_api3('Membership', 'getfields', array('action' => 'get'));
_civicrm_api3_validate_fields('Membership', 'get', $params, $fields['values']);