Merge branch '4.6' into master
authorColeman Watts <coleman@civicrm.org>
Fri, 19 Jun 2015 19:25:55 +0000 (15:25 -0400)
committerColeman Watts <coleman@civicrm.org>
Fri, 19 Jun 2015 19:25:55 +0000 (15:25 -0400)
Conflicts:
CRM/Contribute/Form/Contribution.php
CRM/Core/BAO/Mapping.php
CRM/Core/BAO/PdfFormat.php
CRM/Core/Payment/Form.php
CRM/Member/BAO/Membership.php
CRM/Utils/Hook.php
sql/civicrm_generated.mysql
xml/version.xml

35 files changed:
1  2 
CRM/Contact/BAO/Query.php
CRM/Contact/BAO/Relationship.php
CRM/Contact/Form/Relationship.php
CRM/Contact/Page/AJAX.php
CRM/Contribute/BAO/Contribution.php
CRM/Contribute/BAO/Contribution/Utils.php
CRM/Contribute/BAO/Query.php
CRM/Contribute/Form/AbstractEditPayment.php
CRM/Contribute/Form/AdditionalPayment.php
CRM/Contribute/Form/ContributionPage/Amount.php
CRM/Contribute/Form/SoftCredit.php
CRM/Contribute/Form/Task/Invoice.php
CRM/Contribute/Form/UpdateBilling.php
CRM/Contribute/Form/UpdateSubscription.php
CRM/Core/BAO/Address.php
CRM/Core/BAO/CustomField.php
CRM/Core/BAO/Navigation.php
CRM/Core/Payment/Form.php
CRM/Core/Payment/ProcessorForm.php
CRM/Event/BAO/Event.php
CRM/Event/Cart/Form/Checkout/Payment.php
CRM/Event/Form/EventFees.php
CRM/Mailing/BAO/Mailing.php
CRM/Member/Form.php
CRM/Report/Form/Activity.php
CRM/Utils/Cache.php
CRM/Utils/Hook.php
CRM/Utils/REST.php
js/crm.ajax.js
templates/CRM/Contact/Form/Task/PDFLetterCommon.tpl
templates/CRM/Contribute/Form/AdditionalPayment.tpl
templates/CRM/Contribute/Form/Contribution.tpl
templates/CRM/Core/BillingBlock.tpl
templates/CRM/Member/Form/Membership.tpl
tests/phpunit/api/v3/ContributionPageTest.php

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 3397f93ae4ffcbee6e671d7def0ee59e88850b96,87e9856ef8bf27baa64798bb68dfafae2ba12df1..9f6162a0051eb6e07a874c55a64aa5cc178741e5
@@@ -264,9 -276,10 +266,9 @@@ class CRM_Core_Payment_Form 
        return NULL;
      }
  
-     self::setPaymentFieldsByProcessor($form, $processor, empty($isBillingDataOptional));
+     self::setPaymentFieldsByProcessor($form, $processor, empty($isBillingDataOptional), $isBackOffice);
      self::addCommonFields($form, !$isBillingDataOptional, $form->_paymentFields);
      self::addRules($form, $form->_paymentFields);
 -    self::addPaypalExpressCode($form);
      return (!empty($form->_paymentFields));
    }
  
    }
  
    /**
++<<<<<<< HEAD
++=======
+    * Billing mode button is basically synonymous with paypal express  - this is probably a good example of 'odds & sods' code we
+    * need to find a way for the payment processor to assign. A tricky aspect is that the payment processor may need to set the order
+    *
+    * @param $form
+    */
+   protected static function addPaypalExpressCode(&$form) {
+     if (empty($form->isBackOffice)) {
+       if (in_array(CRM_Utils_Array::value('billing_mode', $form->_paymentProcessor), array(2, 3))) {
+         $form->_expressButtonName = $form->getButtonName('upload', 'express');
+         $form->assign('expressButtonName', $form->_expressButtonName);
+         $form->add('image',
+           $form->_expressButtonName,
+           $form->_paymentProcessor['url_button'],
+           array('class' => 'crm-form-submit')
+         );
+       }
+     }
+   }
+   /**
++>>>>>>> 65e3e1ce2d1e407fa768966606173c79b12ba81f
     * Validate the payment instrument values before passing it to the payment processor
     * We want this to be overrideable by the payment processor, and default to using
     * this object's validCreditCard for credit cards (implemented as the default in the Payment class).
Simple merge
Simple merge
Simple merge
Simple merge
index 1e873943e018f6567c1ef549eee9e8035aae1b5b,28295d2f7a7356f9ac83d8e93e02e7ef612a6500..46b0ac44a986876039b8ca27af816880af316667
@@@ -122,67 -129,8 +122,67 @@@ class CRM_Member_Form extends CRM_Contr
          $this->_processors, TRUE,
          array('onChange' => "buildAutoRenew( null, this.value );")
        );
-       CRM_Core_Payment_Form::buildPaymentForm($this, $this->_paymentProcessor, FALSE);
+       CRM_Core_Payment_Form::buildPaymentForm($this, $this->_paymentProcessor, FALSE, TRUE);
      }
 +    // Build the form for auto renew. This is displayed when in credit card mode or update mode.
 +    // The reason for showing it in update mode is not that clear.
 +    $autoRenew = array();
 +    $recurProcessor = array();
 +    if ($this->_mode || ($this->_action & CRM_Core_Action::UPDATE)) {
 +      if (!empty($recurProcessor)) {
 +        $autoRenew = array();
 +        if (!empty($membershipType)) {
 +          $sql = '
 +SELECT  id,
 +        auto_renew,
 +        duration_unit,
 +        duration_interval
 + FROM   civicrm_membership_type
 +WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
 +          $recurMembershipTypes = CRM_Core_DAO::executeQuery($sql);
 +          while ($recurMembershipTypes->fetch()) {
 +            $autoRenew[$recurMembershipTypes->id] = $recurMembershipTypes->auto_renew;
 +            foreach (array(
 +                       'id',
 +                       'auto_renew',
 +                       'duration_unit',
 +                       'duration_interval',
 +                     ) as $fld) {
 +              $this->_recurMembershipTypes[$recurMembershipTypes->id][$fld] = $recurMembershipTypes->$fld;
 +            }
 +          }
 +        }
 +
 +        if ($this->_mode) {
 +          if (!empty($this->_recurPaymentProcessors)) {
 +            $this->assign('allowAutoRenew', TRUE);
 +          }
 +        }
 +
 +        $this->assign('autoRenew', json_encode($autoRenew));
 +        $autoRenewElement = $this->addElement('checkbox', 'auto_renew', ts('Membership renewed automatically'),
 +          NULL, array('onclick' => "showHideByValue('auto_renew','','send-receipt','table-row','radio',true); showHideNotice( );")
 +        );
 +        if ($this->_action & CRM_Core_Action::UPDATE) {
 +          $autoRenewElement->freeze();
 +        }
 +      }
 +
 +    }
 +    $this->assign('recurProcessor', json_encode($recurProcessor));
 +
 +    if ($this->_mode || ($this->_action & CRM_Core_Action::UPDATE)) {
 +      $this->addElement('checkbox',
 +        'auto_renew',
 +        ts('Membership renewed automatically'),
 +        NULL,
 +        array('onclick' => "buildReceiptANDNotice( );")
 +      );
 +
 +      $this->assignPaymentRelatedVariables();
 +    }
 +    $this->assign('autoRenewOptions', json_encode($autoRenew));
 +
      if ($this->_action & CRM_Core_Action::RENEW) {
        $this->addButtons(array(
            array(
Simple merge
Simple merge
index 044457a4701cb960654a5397a7a87148fc84d075,60c1c088f00c851781ee790770f3e646be05a8ad..c669a972b8916ddf1ed45b3ad5a21a11defb1f3d
@@@ -1927,16 -1927,24 +1927,36 @@@ abstract class CRM_Utils_Hook 
      );
    }
  
 +  /**
 +   * Check system status.
 +   *
 +   * @param array $messages
 +   *   Array<CRM_Utils_Check_Message>. A list of messages regarding system status.
 +   * @return mixed
 +   */
 +  public static function check(&$messages) {
 +    return self::singleton()
 +      ->invoke(1, $messages, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_check');
 +  }
 +
+   /**
+    * This hook is called when a query string of the CSV Batch export is generated.
+    */
+   public static function batchQuery(&$query) {
+     return self::singleton()->invoke(1, $query, self::$_nullObject,
+       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
+       'civicrm_batchQuery'
+     );
+   }
+   /**
+    * This hook is called when the entries of the CSV Batch export are mapped.
+    */
+   public static function batchItems(&$results, &$items) {
+     return self::singleton()->invoke(2, $results, $items,
+       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
+       'civicrm_batchItems'
+     );
+   }
  }
Simple merge
diff --cc js/crm.ajax.js
Simple merge
Simple merge