Skip to content

Commit

Permalink
upgrade 4.2.4 to 4.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Nov 1, 2012
1 parent d312fa0 commit 3a32d90
Show file tree
Hide file tree
Showing 62 changed files with 1,559 additions and 1,305 deletions.
50 changes: 17 additions & 33 deletions CRM/Activity/BAO/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,7 @@ public static function logActivityAction($activity, $logMessage = NULL) {
* @access public
* @static
*/
static
function &getActivities($input) {
static function &getActivities($input) {
//step 1: Get the basic activity data
$bulkActivityTypeID = CRM_Core_OptionGroup::getValue('activity_type',
'Bulk Email',
Expand Down Expand Up @@ -933,8 +932,7 @@ function &getActivities($input) {
* return an array of component id and name.
* @static
**/
static
function activityComponents() {
static function activityComponents() {
$components = array();
$compInfo = CRM_Core_Component::getEnabledComponents();
foreach ($compInfo as $compObj) {
Expand Down Expand Up @@ -975,8 +973,7 @@ function activityComponents() {
* @access public
* @static
*/
static
function &getActivitiesCount($input) {
static function &getActivitiesCount($input) {
$input['count'] = TRUE;
list($sqlClause, $params) = self::getActivitySQLClause($input);

Expand Down Expand Up @@ -1013,8 +1010,7 @@ function &getActivitiesCount($input) {
* @access public
* @static
*/
static
function getActivitySQLClause($input) {
static function getActivitySQLClause($input) {
$params = array();
$sourceWhere = $targetWhere = $assigneeWhere = $caseWhere = 1;

Expand Down Expand Up @@ -1231,8 +1227,7 @@ function getActivitySQLClause($input) {
* @access public
* @static
*/
static
function sendEmail(&$contactDetails,
static function sendEmail(&$contactDetails,
&$subject,
&$text,
&$html,
Expand Down Expand Up @@ -1415,8 +1410,7 @@ function sendEmail(&$contactDetails,
return array($sent, $activity->id);
}

static
function sendSMS(&$contactDetails,
static function sendSMS(&$contactDetails,
&$activityParams,
&$smsParams = array(),
&$contactIds,
Expand Down Expand Up @@ -1535,8 +1529,7 @@ function sendSMS(&$contactDetails,
* @static
*/

static
function sendSMSMessage($toID,
static function sendSMSMessage($toID,
&$tokenText,
&$tokenHtml,
$smsParams = array(),
Expand Down Expand Up @@ -1600,8 +1593,7 @@ function sendSMSMessage($toID,
* @access public
* @static
*/
static
function sendMessage($from,
static function sendMessage($from,
$fromID,
$toID,
&$subject,
Expand Down Expand Up @@ -1667,8 +1659,7 @@ function sendMessage($from,
* @access public
* @static
*/
static
function &importableFields($status = FALSE) {
static function &importableFields($status = FALSE) {
if (!self::$_importableFields) {
if (!self::$_importableFields) {
self::$_importableFields = array();
Expand Down Expand Up @@ -1911,8 +1902,7 @@ static function addActivity(&$activity,
* @return int $parentId Id of parent acyivity otherwise false.
* @access public
*/
static
function getParentActivity($activityId) {
static function getParentActivity($activityId) {
static $parentActivities = array();

$activityId = CRM_Utils_Type::escape($activityId, 'Integer');
Expand All @@ -1939,8 +1929,7 @@ function getParentActivity($activityId) {
* @return int $params count of prior acyivities otherwise false.
* @access public
*/
static
function getPriorCount($activityID) {
static function getPriorCount($activityID) {
static $priorCounts = array();

$activityID = CRM_Utils_Type::escape($activityID, 'Integer');
Expand Down Expand Up @@ -1977,8 +1966,7 @@ function getPriorCount($activityID) {
* @return array $result prior acyivities info.
* @access public
*/
static
function getPriorAcitivities($activityID, $onlyPriorRevisions = FALSE) {
static function getPriorAcitivities($activityID, $onlyPriorRevisions = FALSE) {
static $priorActivities = array();

$activityID = CRM_Utils_Type::escape($activityID, 'Integer');
Expand Down Expand Up @@ -2028,8 +2016,7 @@ function getPriorAcitivities($activityID, $onlyPriorRevisions = FALSE) {
* @return int $params current activity id.
* @access public
*/
static
function getLatestActivityId($activityID) {
static function getLatestActivityId($activityID) {
static $latestActivityIds = array();

$activityID = CRM_Utils_Type::escape($activityID, 'Integer');
Expand Down Expand Up @@ -2062,8 +2049,7 @@ function getLatestActivityId($activityID) {
*
* @access public
*/
static
function createFollowupActivity($activityId, $params) {
static function createFollowupActivity($activityId, $params) {
if (!$activityId) {
return;
}
Expand Down Expand Up @@ -2101,8 +2087,7 @@ function createFollowupActivity($activityId, $params) {
*
* @static
*/
static
function getFileForActivityTypeId($activityTypeId, $crmDir = 'Activity') {
static function getFileForActivityTypeId($activityTypeId, $crmDir = 'Activity') {
$activityTypes = CRM_Case_PseudoConstant::caseActivityType(FALSE, TRUE);

if ($activityTypes[$activityTypeId]['name']) {
Expand Down Expand Up @@ -2154,8 +2139,7 @@ public static function restoreActivity(&$params) {
* @access public
* @static
*/
static
function &exportableFields($name = 'Activity') {
static function &exportableFields($name = 'Activity') {
if (!isset(self::$_exportableFields[$name])) {
self::$_exportableFields[$name] = array();

Expand Down Expand Up @@ -2485,7 +2469,7 @@ public static function getContactActivitySelector(&$params) {
$contactActivities[$activityId]['source_contact'] = '<em>n/a</em>';
}

if (isset($values['mailingId'])) {
if (isset($values['mailingId']) && !empty($values['mailingId'])) {
$contactActivities[$activityId]['target_contact'] = CRM_Utils_System::href($values['recipients'], 'civicrm/mailing/report', "mid={$values['source_record_id']}&reset=1&cid={$values['source_contact_id']}&context=activitySelector");
}
elseif (CRM_Utils_Array::value('recipients', $values)) {
Expand Down
32 changes: 11 additions & 21 deletions CRM/Contact/BAO/ProximityQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ static function initialize() {
* Default to an approximate average radius for the United States.
*/

static
function earthRadius($latitude) {
static function earthRadius($latitude) {
$lat = deg2rad($latitude);

$x = cos($lat) / self::$_earthRadiusSemiMajor;
Expand All @@ -92,8 +91,7 @@ function earthRadius($latitude) {
* Convert longitude and latitude to earth-centered earth-fixed coordinates.
* X axis is 0 long, 0 lat; Y axis is 90 deg E; Z axis is north pole.
*/
static
function earthXYZ($longitude, $latitude, $height = 0) {
static function earthXYZ($longitude, $latitude, $height = 0) {
$long = deg2rad($longitude);
$lat = deg2rad($latitude);

Expand All @@ -114,16 +112,14 @@ function earthXYZ($longitude, $latitude, $height = 0) {
/**
* Convert a given angle to earth-surface distance.
*/
static
function earthArcLength($angle, $latitude) {
static function earthArcLength($angle, $latitude) {
return deg2rad($angle) * self::earthRadius($latitude);
}

/**
* Estimate the earth-surface distance between two locations.
*/
static
function earthDistance($longitudeSrc, $latitudeSrc,
static function earthDistance($longitudeSrc, $latitudeSrc,
$longitudeDst, $latitudeDst
) {

Expand All @@ -141,8 +137,7 @@ function earthDistance($longitudeSrc, $latitudeSrc,
/**
* Estimate the min and max longitudes within $distance of a given location.
*/
static
function earthLongitudeRange($longitude, $latitude, $distance) {
static function earthLongitudeRange($longitude, $latitude, $distance) {
$long = deg2rad($longitude);
$lat = deg2rad($latitude);
$radius = self::earthRadius($latitude);
Expand All @@ -168,8 +163,7 @@ function earthLongitudeRange($longitude, $latitude, $distance) {
/**
* Estimate the min and max latitudes within $distance of a given location.
*/
static
function earthLatitudeRange($longitude, $latitude, $distance) {
static function earthLatitudeRange($longitude, $latitude, $distance) {
$long = deg2rad($longitude);
$lat = deg2rad($latitude);
$radius = self::earthRadius($latitude);
Expand Down Expand Up @@ -212,8 +206,7 @@ function earthLatitudeRange($longitude, $latitude, $distance) {
* @param $latitude
*/

static
function earthDistanceSQL($longitude, $latitude) {
static function earthDistanceSQL($longitude, $latitude) {
$long = deg2rad($longitude);
$lat = deg2rad($latitude);
$radius = self::earthRadius($latitude);
Expand All @@ -231,8 +224,7 @@ function earthDistanceSQL($longitude, $latitude) {
";
}

static
function where($latitude, $longitude, $distance, $tablePrefix = 'civicrm_address') {
static function where($latitude, $longitude, $distance, $tablePrefix = 'civicrm_address') {
self::initialize();

$params = array();
Expand Down Expand Up @@ -260,8 +252,7 @@ function where($latitude, $longitude, $distance, $tablePrefix = 'civicrm_address
return $where;
}

static
function process(&$query, &$values) {
static function process(&$query, &$values) {
list($name, $op, $distance, $grouping, $wildcard) = $values;

// also get values array for all address related info
Expand Down Expand Up @@ -324,7 +315,7 @@ function process(&$query, &$values) {
$distance = $distance * 1609.344;
}
else {
$qillUnits .= " {$distance} " . ts('km');
$qillUnits = " {$distance} " . ts('km');
$distance = $distance * 1000.00;
}

Expand All @@ -344,8 +335,7 @@ function process(&$query, &$values) {
return;
}

static
function fixInputParams(&$input) {
static function fixInputParams(&$input) {
foreach ($input as $param) {
if (CRM_Utils_Array::value('0', $param) == 'prox_distance') {
// add prox_ prefix to these
Expand Down
8 changes: 4 additions & 4 deletions CRM/Contact/Form/Task/SMSCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function buildQuickForm(&$form) {
$value = $form->_contactDetails[$contactId];

//to check if the phone type is "Mobile"
$phoneTypes = CRM_Core_PseudoConstant::phoneType();
$phoneTypes = CRM_Core_OptionGroup::values('phone_type', TRUE, FALSE, FALSE, NULL, 'name');

if (CRM_Utils_System::getClassName($form) == 'CRM_Activity_Form_Task_SMS') {
//to check for "if the contact id belongs to a specified activity type"
Expand All @@ -207,11 +207,11 @@ function buildQuickForm(&$form) {
}
}

if ((isset($value['phone_type_id']) && $value['phone_type_id'] != CRM_Utils_Array::key('Mobile', $phoneTypes)) || $value['do_not_sms'] || empty($value['phone']) || CRM_Utils_Array::value('is_deceased', $value)) {
if ((isset($value['phone_type_id']) && $value['phone_type_id'] != CRM_Utils_Array::value('Mobile', $phoneTypes)) || $value['do_not_sms'] || empty($value['phone']) || CRM_Utils_Array::value('is_deceased', $value)) {

//if phone is not primary check if non-primary phone is "Mobile"
if (!empty($value['phone'])
&& $value['phone_type_id'] != CRM_Utils_Array::key('Mobile', $phoneTypes)
&& $value['phone_type_id'] != CRM_Utils_Array::value('Mobile', $phoneTypes)
&& !CRM_Utils_Array::value('is_deceased', $value)
) {
$filter = array('do_not_sms' => 0);
Expand All @@ -220,7 +220,7 @@ function buildQuickForm(&$form) {
$mobilePhone = CRM_Utils_Array::retrieveValueRecursive($contactPhones, 'phone');
$form->_contactDetails[$contactId]['phone_id'] = CRM_Utils_Array::retrieveValueRecursive($contactPhones, 'id');
$form->_contactDetails[$contactId]['phone'] = $mobilePhone;
$form->_contactDetails[$contactId]['phone_type_id'] = CRM_Utils_Array::key('Mobile', $phoneTypes);
$form->_contactDetails[$contactId]['phone_type_id'] = CRM_Utils_Array::value('Mobile', $phoneTypes);
}
else {
$suppressedSms++;
Expand Down
6 changes: 3 additions & 3 deletions CRM/Contact/Page/AJAX.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static function getContactList() {
'version' => 3,
);

$result = civicrm_api('Contact', 'quicksearch', $params);
$result = civicrm_api('Contact', 'getquick', $params);
if ($result['is_error'] == 0 && is_array($result['values'])) {
foreach ($result['values'] as $key => & $values) {
echo $contactList = "{$values['data']}|{$values['id']}\n";
Expand Down Expand Up @@ -760,8 +760,8 @@ static function getContactPhone() {

$queryString = NULL;
//check for mobile type
$phoneTypes = CRM_Core_PseudoConstant::phoneType();
$mobileType = CRM_Utils_Array::key('Mobile', $phoneTypes);
$phoneTypes = CRM_Core_OptionGroup::values('phone_type', TRUE, FALSE, FALSE, NULL, 'name');
$mobileType = CRM_Utils_Array::value('Mobile', $phoneTypes);

if ($name = CRM_Utils_Array::value('name', $_GET)) {
$name = CRM_Utils_Type::escape($name, 'String');
Expand Down
24 changes: 12 additions & 12 deletions CRM/Contribute/BAO/Contribution/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ static function processConfirm(&$form,
}
else {
if (!$form->_params['is_pay_later']) {
if (is_object($payment))
if (is_object($payment))
$result = &$payment->doTransferCheckout($form->_params, 'contribute');
else
else
CRM_Core_Error::fatal($paymentObjError);
}
else {
Expand Down Expand Up @@ -177,15 +177,15 @@ static function processConfirm(&$form,

// determine if express + recurring and direct accordingly
if ($paymentParams['is_recur'] == 1) {
if (is_object($payment))
if (is_object($payment))
$result = &$payment->createRecurringPayments($paymentParams);
else
else
CRM_Core_Error::fatal($paymentObjError);
}
else {
if (is_object($payment))
if (is_object($payment))
$result = &$payment->doExpressCheckout($paymentParams);
else
else
CRM_Core_Error::fatal($paymentObjError);
}
}
Expand Down Expand Up @@ -218,9 +218,9 @@ static function processConfirm(&$form,
}
}

if (is_object($payment))
if (is_object($payment))
$result = &$payment->doDirectPayment($paymentParams);
else
else
CRM_Core_Error::fatal($paymentObjError);
}

Expand All @@ -229,8 +229,7 @@ static function processConfirm(&$form,
}

if (is_a($result, 'CRM_Core_Error')) {

//make sure to cleanup db for recurring case.
// make sure to cleanup db for recurring case.
if (CRM_Utils_Array::value('contributionID', $paymentParams)) {
CRM_Contribute_BAO_Contribution::deleteContribution($paymentParams['contributionID']);
}
Expand Down Expand Up @@ -290,8 +289,9 @@ static function processConfirm(&$form,
if ($component == 'membership') {
return $membershipResult;
}
//Do not send an email if Recurring contribution is done via Direct Mode
//We will send email once the IPN is received.

// Do not send an email if Recurring contribution is done via Direct Mode
// We will send email once the IPN is received.
if (!empty($paymentParams['is_recur']) && $form->_contributeMode == 'direct') {
return TRUE;
}
Expand Down
Loading

0 comments on commit 3a32d90

Please sign in to comment.