Skip to content

Commit

Permalink
Merge pull request #4931 from davecivicrm/INFRA-132
Browse files Browse the repository at this point in the history
INFRA-132 - Batch #6
  • Loading branch information
totten committed Jan 14, 2015
2 parents 29d98e1 + a130e04 commit 9312b85
Show file tree
Hide file tree
Showing 20 changed files with 317 additions and 323 deletions.
20 changes: 9 additions & 11 deletions CRM/Campaign/Form/Task/Interview.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function preProcess() {
foreach (array(
'surveyId',
'contactIds',
'interviewerId'
'interviewerId',
) as $fld) {
$this->{"_$fld"} = $this->get($fld);
}
Expand Down Expand Up @@ -300,7 +300,7 @@ public function buildQuickForm() {
$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',
));
}

Expand All @@ -321,7 +321,7 @@ public function buildQuickForm() {
if (!empty($this->_resultOptions)) {
$this->add('select', "field[$contactId][result]", ts('Result'),
array(
'' => ts('- select -')
'' => ts('- select -'),
) +
array_combine($this->_resultOptions, $this->_resultOptions)
);
Expand Down Expand Up @@ -350,7 +350,7 @@ public function buildQuickForm() {
'name' => ts('Done'),
'subName' => 'interview',
'isDefault' => TRUE,
)
),
);

$buttons[] = array(
Expand Down Expand Up @@ -431,11 +431,10 @@ public function setDefaultValues() {
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;
Expand All @@ -458,15 +457,14 @@ public function postProcess() {
foreach (array(
'surveyId',
'contactIds',
'interviewerId'
'interviewerId',
) as $fld) {
$this->controller->set($fld, $this->{"_$fld"});
}
$this->controller->set('interviewToRelease', TRUE);
}

// vote is done through ajax
return;
}

/**
Expand Down
13 changes: 7 additions & 6 deletions CRM/Case/BAO/Case.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ public static function &create(&$params) {
/**
* Create case contact record
*
* @param array case_id, contact_id
* @param array $params
* case_id, contact_id
*
* @return object
*/
Expand Down Expand Up @@ -195,7 +196,7 @@ public static function addCaseToContact($params) {
/**
* Delet case contact record
*
* @param int case_id
* @param int $caseID
*
* @return Void
*/
Expand Down Expand Up @@ -2341,7 +2342,7 @@ public static function mergeContacts($mainContactId, $otherContactId) {
*
* @return int|NULL
*/
static function mergeCases(
public static function mergeCases(
$mainContactId, $mainCaseId = NULL, $otherContactId = NULL,
$otherCaseId = NULL, $changeClient = FALSE) {
$moveToTrash = TRUE;
Expand Down Expand Up @@ -2800,7 +2801,7 @@ public static function buildPermissionLinks(&$tplParams, $activityParams) {
* @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;
Expand Down Expand Up @@ -3111,7 +3112,7 @@ public static function accessCase($caseId, $denyClosed = TRUE) {
* @param int $activityID
* Activity id.
*
* @return boolean
* @return bool
*/
public static function isCaseActivity($activityID) {
$isCaseActivity = FALSE;
Expand Down Expand Up @@ -3382,7 +3383,7 @@ public static function getCaseClients($caseId) {
* @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__;
Expand Down
24 changes: 12 additions & 12 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -642,16 +642,16 @@ public static function &exportableFields() {
'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(
Expand Down Expand Up @@ -844,7 +844,7 @@ public static function deleteContribution($id) {
* (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) {
Expand Down Expand Up @@ -1580,7 +1580,7 @@ public static function transitionComponents($params, $processContributionObject
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)) {
Expand Down Expand Up @@ -2570,7 +2570,7 @@ public function _assignMessageVariablesToTemplate(&$values, $input, &$template,
*
* @param bool $isNotCancelled
*
* @return boolean
* @return bool
*/
public static function isCancelSubscriptionSupported($contributionId, $isNotCancelled = TRUE) {
$cacheKeyString = "$contributionId";
Expand Down Expand Up @@ -3156,7 +3156,7 @@ public static function deleteContactContribution($contactId) {
* @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__;
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contribute/Form/SoftCredit.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public static function buildQuickForm(&$form) {
$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}]",
Expand Down
8 changes: 4 additions & 4 deletions CRM/Contribute/Page/ContributionPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class CRM_Contribute_Page_ContributionPage extends CRM_Core_Page {
*
* @return array
*/
function &actionLinks() {
public function &actionLinks() {
// check if variable _actionsLinks is populated
if (!isset(self::$_actionLinks)) {
// helper variable for nicer formatting
Expand Down Expand Up @@ -294,7 +294,7 @@ public function run() {
'url' => CRM_Utils_System::url(CRM_Utils_System::currentPath(),
'reset=1'
),
)
),
);

// what action to take ?
Expand Down Expand Up @@ -624,7 +624,7 @@ public function whereClause(&$params, $sortBy = TRUE) {
*
* @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();
Expand All @@ -640,7 +640,7 @@ function getCampaignIds() {
* @param $whereClause
* @param array $whereParams
*/
function pager($whereClause, $whereParams) {
public function pager($whereClause, $whereParams) {

$params['status'] = ts('Contribution %%StatusMessage%%');
$params['csvString'] = NULL;
Expand Down
33 changes: 16 additions & 17 deletions CRM/Core/BAO/ActionSchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public static function getMapping($id = 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'));
Expand Down Expand Up @@ -489,7 +488,7 @@ public static function sendReminder($contactId, $to, $scheduleID, $from, $tokenP
foreach (array(
'text',
'html',
'sms_text'
'sms_text',
) as $elem) {
$$elem = $smarty->fetch("string:{$$elem}");
}
Expand Down Expand Up @@ -529,7 +528,7 @@ public static function sendReminder($contactId, $to, $scheduleID, $from, $tokenP
$smsParams = array(
'To' => $phoneNumber,
'provider_id' => $schedule->sms_provider_id,
'activity_subject' => $messageSubject
'activity_subject' => $messageSubject,
);
$activityTypeID = CRM_Core_OptionGroup::getValue('activity_type',
'SMS',
Expand Down Expand Up @@ -701,16 +700,16 @@ public static function sendMailings($mappingID, $now) {
$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') {
Expand Down Expand Up @@ -753,7 +752,7 @@ public static function sendMailings($mappingID, $now) {
'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 ';

Expand Down Expand Up @@ -880,8 +879,8 @@ public static function sendMailings($mappingID, $now) {
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,
Expand Down Expand Up @@ -913,8 +912,7 @@ public static function sendMailings($mappingID, $now) {
$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,
Expand Down Expand Up @@ -1333,9 +1331,10 @@ public static function buildRecipientContacts($mappingID, $now, $params = array(
$valsqlInsertValues = CRM_Core_DAO::executeQuery($sqlInsertValues, array(
1 => array(
$actionSchedule->id,
'Integer'
)
));
'Integer',
),
)
);

$arrValues = array();
while ($valsqlInsertValues->fetch()) {
Expand Down
2 changes: 0 additions & 2 deletions CRM/Core/BAO/Domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ public static function version($skipUsingCache = FALSE) {
/**
* Get the location values of a domain
*
* @param NULL
*
* @return array
* Location::getValues
*/
Expand Down
Loading

0 comments on commit 9312b85

Please sign in to comment.