From: Tim Otten Date: Fri, 4 Apr 2014 07:07:02 +0000 (-0700) Subject: Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-04-03-23-46-36 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=00ca8648aca9637f2678082ce09f98772533a8cc;hp=017f329569133bc6447bc5fa5cf9eb521e390e08;p=civicrm-core.git Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-04-03-23-46-36 Conflicts: CRM/Activity/Page/AJAX.php CRM/Member/Form/Membership.php js/rest.js templates/CRM/Campaign/Form/Task/Interview.tpl --- diff --git a/CRM/Activity/Page/AJAX.php b/CRM/Activity/Page/AJAX.php index 7e5906545d..999b07ab0e 100644 --- a/CRM/Activity/Page/AJAX.php +++ b/CRM/Activity/Page/AJAX.php @@ -258,7 +258,7 @@ class CRM_Activity_Page_AJAX { } // email column links/icon if ($row['email']) { - $row['email'] = ''; + $row['email'] = ''; } // edit links if ($hasAccessToAllCases) { diff --git a/CRM/Core/Payment/PayJunction.php b/CRM/Core/Payment/PayJunction.php index 7080288695..1be136f40b 100644 --- a/CRM/Core/Payment/PayJunction.php +++ b/CRM/Core/Payment/PayJunction.php @@ -53,7 +53,7 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment { * @static * */ - static function &singleton($mode, &$paymentProcessor) { + static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = false) { $processorName = $paymentProcessor['name']; if (self::$_singleton[$processorName] === NULL) { self::$_singleton[$processorName] = new CRM_Core_Payment_PayJunction($mode, $paymentProcessor); diff --git a/CRM/Core/Payment/eWAY.php b/CRM/Core/Payment/eWAY.php index d071a5db96..10f2a3236d 100644 --- a/CRM/Core/Payment/eWAY.php +++ b/CRM/Core/Payment/eWAY.php @@ -130,7 +130,7 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { * @static * */ - static function &singleton($mode, &$paymentProcessor) { + static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = false) { $processorName = $paymentProcessor['name']; if (self::$_singleton[$processorName] === NULL) { self::$_singleton[$processorName] = new CRM_Core_Payment_eWAY($mode, $paymentProcessor); diff --git a/CRM/Price/Form/Option.php b/CRM/Price/Form/Option.php index b2364ccc98..a0c6e7c683 100644 --- a/CRM/Price/Form/Option.php +++ b/CRM/Price/Form/Option.php @@ -82,6 +82,9 @@ class CRM_Price_Form_Option extends CRM_Core_Form { * @access public */ function setDefaultValues() { + if ($this->_action == CRM_Core_Action::DELETE) { + return; + } $defaults = array(); if (isset($this->_oid)) { diff --git a/CRM/Profile/Selector/Listings.php b/CRM/Profile/Selector/Listings.php index d88d38520c..ae43ba1e75 100644 --- a/CRM/Profile/Selector/Listings.php +++ b/CRM/Profile/Selector/Listings.php @@ -469,7 +469,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR if ($this->_multiRecordTableName) { $returnQuery = TRUE; } - + $this->_query->_useGroupBy = TRUE; $result = $this->_query->searchQuery($offset, $rowCount, $sort, NULL, NULL, NULL, NULL, $returnQuery, $additionalWhereClause ); diff --git a/CRM/Upgrade/Incremental/sql/4.3.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.alpha1.mysql.tpl index a547a77f08..dd8510d6f8 100644 --- a/CRM/Upgrade/Incremental/sql/4.3.alpha1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.3.alpha1.mysql.tpl @@ -606,19 +606,18 @@ SELECT @weight := MAX(value) FROM civicrm_option_value WHERE opt INSERT INTO `civicrm_option_value` (`option_group_id`, {localize field='label'}label{/localize}, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`) VALUES - (@option_group_id_batch_status, {localize}'Data Entry'{/localize}, @weight = @weight + 1, 'Data Entry', NULL, 0, 0, @weight = @weight + 1), - (@option_group_id_batch_status, {localize}'Reopened'{/localize}, @weight = @weight + 1, 'Reopened', NULL, 0, 0, @weight = @weight + 1), - (@option_group_id_batch_status, {localize}'Exported'{/localize}, @weight = @weight + 1, 'Exported' , NULL, 0, 0, @weight = @weight + 1); + (@option_group_id_batch_status, {localize}'Data Entry'{/localize}, @weight + 1, 'Data Entry', NULL, 0, 0, @weight + 1), + (@option_group_id_batch_status, {localize}'Reopened'{/localize}, @weight + 2, 'Reopened', NULL, 0, 0, @weight + 2), + (@option_group_id_batch_status, {localize}'Exported'{/localize}, @weight + 3, 'Exported' , NULL, 0, 0, @weight + 3); -- Insert Batch Modes. +SELECT @option_group_id_batch_modes := max(id) from civicrm_option_group where name = 'batch_mode'; -SELECT @option_group_id_batch_modes := max(id) from civicrm_option_group where name = 'batch_mode'; -SELECT @weight := MAX(value) FROM civicrm_option_value WHERE option_group_id = @option_group_id_batch_status; INSERT INTO `civicrm_option_value` (`option_group_id`, {localize field='label'}label{/localize}, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`) VALUES - (@option_group_id_batch_modes, {localize}'Manual Batch'{/localize}, @weight = @weight + 1, 'Manual Batch', NULL, 0, 0, @weight = @weight + 1), - (@option_group_id_batch_modes, {localize}'Automatic Batch'{/localize}, @weight = @weight + 1, 'Automatic Batch' , NULL, 0, 0, @weight = @weight + 1); + (@option_group_id_batch_modes, {localize}'Manual Batch'{/localize}, 1, 'Manual Batch', NULL, 0, 0, 1), + (@option_group_id_batch_modes, {localize}'Automatic Batch'{/localize}, 2, 'Automatic Batch' , NULL, 0, 0, 2); -- End of civiaccounts upgrade diff --git a/CRM/Upgrade/Incremental/sql/4.4.5.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.4.5.mysql.tpl index d887e8b90b..5c57e2f1a7 100644 --- a/CRM/Upgrade/Incremental/sql/4.4.5.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.4.5.mysql.tpl @@ -1 +1,17 @@ {* file to handle db changes in 4.4.5 during upgrade *} +-- CRM-14191 +SELECT @option_group_id_batch_status := max(id) from civicrm_option_group where name = 'batch_status'; +SELECT @weight := MAX(value) FROM civicrm_option_value WHERE option_group_id = @option_group_id_batch_status; + +UPDATE civicrm_option_value +SET value = (Select @weight := @weight +1), +weight = @weight +where option_group_id = @option_group_id_batch_status AND name IN ('Data Entry', 'Reopened', 'Exported') AND value = 0 ORDER BY id; + +SELECT @option_group_id_batch_modes := max(id) from civicrm_option_group where name = 'batch_mode'; +SELECT @weights := MAX(value) FROM civicrm_option_value WHERE option_group_id = @option_group_id_batch_modes; + +UPDATE civicrm_option_value +SET value = (Select @weights := @weights +1), +weight = @weights +where option_group_id = @option_group_id_batch_modes AND name IN ('Manual Batch', 'Automatic Batch') AND value = 0; \ No newline at end of file diff --git a/CRM/Utils/System/Drupal.php b/CRM/Utils/System/Drupal.php index f7a7d12cb6..29af79e2c7 100644 --- a/CRM/Utils/System/Drupal.php +++ b/CRM/Utils/System/Drupal.php @@ -978,7 +978,7 @@ AND u.status = 1 return false; } - $timeZoneOffset = sprintf("%02d:%02d", $tz / 3600, ($tz/60)%60 ); + $timeZoneOffset = sprintf("%02d:%02d", $tz / 3600, abs(($tz/60)%60)); if($timeZoneOffset > 0){ $timeZoneOffset = '+' . $timeZoneOffset; diff --git a/CRM/Utils/System/Drupal6.php b/CRM/Utils/System/Drupal6.php index 9b719f82c9..363ec0c931 100644 --- a/CRM/Utils/System/Drupal6.php +++ b/CRM/Utils/System/Drupal6.php @@ -952,7 +952,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { return false; } $hour = $user->timezone / 3600; - $timeZoneOffset = sprintf("%02d:%02d", $timezone / 3600, ($timezone/60)%60 ); + $timeZoneOffset = sprintf("%02d:%02d", $timezone / 3600, abs(($timeZoneOffset/60)%60)); if($timeZoneOffset > 0){ $timeZoneOffset = '+' . $timeZoneOffset; } diff --git a/api/v3/Activity.php b/api/v3/Activity.php index 6181029b71..88b2a7a274 100644 --- a/api/v3/Activity.php +++ b/api/v3/Activity.php @@ -235,6 +235,10 @@ function civicrm_api3_activity_get($params) { else { $activities = _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, FALSE); } + $options = _civicrm_api3_get_options_from_params($params, FALSE,'activity','get'); + if($options['is_count']) { + return civicrm_api3_create_success($activities, $params, 'activity', 'get'); + } $activities = _civicrm_api3_activity_get_formatResult($params, $activities); //legacy custom data get - so previous formatted response is still returned too diff --git a/api/v3/Contribution.php b/api/v3/Contribution.php index d923a8ab09..4394e0628f 100644 --- a/api/v3/Contribution.php +++ b/api/v3/Contribution.php @@ -380,7 +380,7 @@ function civicrm_api3_contribution_completetransaction(&$params) { $objects['contribution'] = &$contribution; $input['component'] = $contribution->_component; $input['is_test'] = $contribution->is_test; - $input['trxn_id']= $contribution->trxn_id; + $input['trxn_id']= !empty($params['trxn_id']) ? $params['trxn_id'] : $contribution->trxn_id; $input['amount'] = $contribution->total_amount; if(isset($params['is_email_receipt'])){ $input['is_email_receipt'] = $params['is_email_receipt']; @@ -396,5 +396,17 @@ function civicrm_api3_contribution_completetransaction(&$params) { } function _civicrm_api3_contribution_completetransaction(&$params) { - + $params['id'] = array( + 'title' => 'Contribution ID', + 'type' => CRM_Utils_Type::T_INT, + 'api.required' => TRUE, + ); + $params['trxn_id'] = array( + 'title' => 'Transaction ID', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['is_email_receipt'] = array( + 'title' => 'Send email Receipt?', + 'type' => CRM_Utils_Type::T_BOOLEAN, + ); } diff --git a/api/v3/Job.php b/api/v3/Job.php index bff3f5fc8b..aa5d8ae351 100644 --- a/api/v3/Job.php +++ b/api/v3/Job.php @@ -434,7 +434,7 @@ function civicrm_api3_job_process_participant($params) { function civicrm_api3_job_process_membership($params) { $lock = new CRM_Core_Lock('civimail.job.updateMembership'); if (!$lock->isAcquired()) { - return civicrm_api3_create_error('Could not acquire lock, another EmailProcessor process is running'); + return civicrm_api3_create_error('Could not acquire lock, another Membership Processing process is running'); } $result = CRM_Member_BAO_Membership::updateAllMembershipStatus(); diff --git a/templates/CRM/Campaign/Form/Task/Interview.tpl b/templates/CRM/Campaign/Form/Task/Interview.tpl index bd6e3b53cb..242d5787bd 100644 --- a/templates/CRM/Campaign/Form/Task/Interview.tpl +++ b/templates/CRM/Campaign/Form/Task/Interview.tpl @@ -155,8 +155,8 @@ {continue} {/if} - {if ( $field.data_type eq 'Date' and $field.is_view eq 0) or - ( $fieldName eq 'thankyou_date' ) or ( $fieldName eq 'cancel_date' ) or ( $fieldName eq 'receipt_date' ) or ( $fieldName eq 'activity_date_time') } + {if ( ($field.data_type eq 'Date') or + ( $fieldName eq 'thankyou_date' ) or ( $fieldName eq 'cancel_date' ) or ( $fieldName eq 'receipt_date' ) or ( $fieldName eq 'activity_date_time') ) and $field.is_view neq 1 } {include file="CRM/common/jcalendar.tpl" elementName=$fieldName elementIndex=$voterId batchUpdate=1} {elseif $fieldName|substr:0:5 eq 'phone'} {assign var="phone_ext_field" value=$fieldName|replace:'phone':'phone_ext'}