Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-04-03-23-46-36
authorTim Otten <totten@civicrm.org>
Fri, 4 Apr 2014 07:07:02 +0000 (00:07 -0700)
committerTim Otten <totten@civicrm.org>
Fri, 4 Apr 2014 07:07:02 +0000 (00:07 -0700)
Conflicts:
CRM/Activity/Page/AJAX.php
CRM/Member/Form/Membership.php
js/rest.js
templates/CRM/Campaign/Form/Task/Interview.tpl

13 files changed:
CRM/Activity/Page/AJAX.php
CRM/Core/Payment/PayJunction.php
CRM/Core/Payment/eWAY.php
CRM/Price/Form/Option.php
CRM/Profile/Selector/Listings.php
CRM/Upgrade/Incremental/sql/4.3.alpha1.mysql.tpl
CRM/Upgrade/Incremental/sql/4.4.5.mysql.tpl
CRM/Utils/System/Drupal.php
CRM/Utils/System/Drupal6.php
api/v3/Activity.php
api/v3/Contribution.php
api/v3/Job.php
templates/CRM/Campaign/Form/Task/Interview.tpl

index 7e5906545d26ba068c5104ce083bce1cd51dd2d5..999b07ab0eb58ccbb2626d0cdf73a3f56627ba3a 100644 (file)
@@ -258,7 +258,7 @@ class CRM_Activity_Page_AJAX {
       }
       // email column links/icon
       if ($row['email']) {
-        $row['email'] = '<a class="crm-hover-button crm-popup" href="'.CRM_Utils_System::url('civicrm/activity/email/add', 'reset=1&action=add&atype=3&cid='.$row['cid']).'" title="'. ts('Send an Email') . '"><span class="icon email-icon"></span></a>';
+        $row['email'] = '<a class="crm-hover-button crm-popup" href="'.CRM_Utils_System::url('civicrm/activity/email/add', 'reset=1&action=add&atype=3&cid='.$row['cid']).'&caseid='.$caseID.'" title="'. ts('Send an Email') . '"><span class="icon email-icon"></span></a>';
       }
       // edit links
       if ($hasAccessToAllCases) {
index 708028869514692d9e8d2da65f2203d7a9058ce2..1be136f40b3b60bbe17d4a1968c639d1902b0d4c 100644 (file)
@@ -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);
index d071a5db960f72253210efbf9f043be9526dfd4d..10f2a3236d4d66c670035883c6925a7b175434fd 100644 (file)
@@ -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);
index b2364ccc98f98ae4ae435bbae88b5efd8bb823d0..a0c6e7c6830669e5eef99174f961609bbaceee1d 100644 (file)
@@ -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)) {
index d88d38520c280c8c3f375506497d9bf2382150aa..ae43ba1e75f4cd0702d0f0b1c93a0e390322130d 100644 (file)
@@ -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
     );
index a547a77f08a3c4cb311af8f7d86093284c1db3a1..dd8510d6f8fdb56a69570f9c1663ef0273bc3d67 100644 (file)
@@ -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
 
index d887e8b90b97e5462cd643f46edd57c85cd1af14..5c57e2f1a72bc8460a9b0a38c5864fb932705f35 100644 (file)
@@ -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
index f7a7d12cb69561cca609d718e802a5934902304b..29af79e2c775dafa03c38d1806aa1372f2a46caf 100644 (file)
@@ -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;
index 9b719f82c9645f595a9171090fa168a3ad0a5117..363ec0c931b70fc3a6639f083de5afa9151193bc 100644 (file)
@@ -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;
     }
index 6181029b71d8aba0905f64953c2cc216f38d315a..88b2a7a274914b3b76bcea90830eb5f381914448 100644 (file)
@@ -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
index d923a8ab09a54708c50650d43495deab7cdc4057..4394e0628fa769faa016c0f2d0a6dd3049ee1e8d 100644 (file)
@@ -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,
+  );
 }
index bff3f5fc8bdb1deb01b84303634f2ad6ba0dfaa9..aa5d8ae351df3ce1ddae0c928b485ced265eaab6 100644 (file)
@@ -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();
index bd6e3b53cb2453670091b332a94bcd4a84d838d2..242d5787bdad1ac7ef430f145ed87dd28d2b2708 100644 (file)
                 {continue}
               {/if}
               <td class="compressed {$field.data_type} {$fieldName}">
-                {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'}