Merge remote-tracking branch 'upstream/4.5' into 4.5-master-2015-03-02-21-30-06
authorkurund <kurund@civicrm.org>
Mon, 2 Mar 2015 16:11:34 +0000 (21:41 +0530)
committerkurund <kurund@civicrm.org>
Mon, 2 Mar 2015 16:11:34 +0000 (21:41 +0530)
Conflicts:
CRM/Contact/Form/Search.php
CRM/Contact/Form/Search/Custom.php
CRM/Contact/Form/Search/Custom/ActivitySearch.php
CRM/Contact/Form/Search/Custom/ContribSYBNT.php
CRM/Contact/Form/Search/Custom/ContributionAggregate.php
CRM/Contact/Form/Search/Custom/EmployerListing.php
CRM/Contact/Form/Search/Custom/EventAggregate.php
CRM/Contact/Form/Search/Custom/TagContributions.php
CRM/Contact/Form/Search/Interface.php

14 files changed:
1  2 
CRM/Contact/Form/Search.php
CRM/Contact/Form/Search/Custom.php
CRM/Contact/Form/Search/Custom/ActivitySearch.php
CRM/Contact/Form/Search/Custom/Base.php
CRM/Contact/Form/Search/Custom/ContribSYBNT.php
CRM/Contact/Form/Search/Custom/ContributionAggregate.php
CRM/Contact/Form/Search/Custom/EventAggregate.php
CRM/Contact/Form/Search/Custom/FullText.php
CRM/Contact/Form/Search/Custom/TagContributions.php
CRM/Contact/Form/Search/Interface.php
CRM/Core/Form/Search.php
CRM/Report/Form/Grant/Detail.php
CRM/Utils/Check/Security.php
tests/phpunit/CiviTest/CiviUnitTestCase.php

index cc48430312b37ab4b52b539f4bde269355115918,79824f368b2cbfd9b76249433bb397b6ff5ad03c..94bc48551768312d09fc0e294a545d77e4eb47ef
@@@ -313,8 -329,34 +313,34 @@@ class CRM_Contact_Form_Search extends C
    }
  
    /**
-    * Build the common elements between the search/advanced form
+    * Builds the list of tasks or actions that a searcher can perform on a result set.
     *
 -  function buildTaskList() {
+    * @return array
+    */
++  public function buildTaskList() {
+     if ($this->_context !== 'amtg') {
+       $permission = CRM_Core_Permission::getPermission();
+       if ($this->_componentMode == 1 || $this->_componentMode == 7) {
+         $this->_taskList += CRM_Contact_Task::permissionedTaskTitles($permission,
+           CRM_Utils_Array::value('deleted_contacts', $this->_formValues)
+         );
+       } else {
+         $className = $this->_modeValue['taskClassName'];
+         $this->_taskList += $className::permissionedTaskTitles($permission, false);
+       }
+       // Only offer the "Update Smart Group" task if a smart group/saved search is already in play
+       if (isset($this->_ssID) && $permission == CRM_Core_Permission::EDIT) {
+         $this->_taskList += CRM_Contact_Task::optionalTaskTitle();
+       }
+     }
+     return $this->_taskList;
+   }
+   /**
+    * Build the common elements between the search/advanced form.
     *
     * @return void
     */
index 919b315c5dfdc4c990bcc7bbaf054155509db246,0638a9d31011db5453d0fa70ca463abafe8f780a..dfe38dff059e44b3273e4ad2eba3b1c44b16bb64
@@@ -112,7 -108,24 +112,24 @@@ class CRM_Contact_Form_Search_Custom ex
      return $this->_formValues;
    }
  
 -  function buildTaskList() {
+   /**
+    * Builds the list of tasks or actions that a searcher can perform on a result set.
+    *
+    * @return array
+    */
 -  function buildQuickForm() {
++  public function buildTaskList() {
+     // call the parent method to populate $this->_taskList for the custom search
+     parent::buildTaskList();
+     // @todo: When CRM_Contact_Form_Search_Interface is updated in 4.6, remove this check
+     if (is_callable(array($this->_customClass, 'buildTaskList'))) {
+       return $this->_customClass->buildTaskList($this);
+     } else {
+       return $this->_taskList;
+     }
+   }
 +  public function buildQuickForm() {
      $this->_customClass->buildForm($this);
  
      parent::buildQuickForm();
index daa784f8bbee1fabbec2d104652fc6b65ffb960c,2ad3b5be3febaae8cc960107da6891d574feb88a..d8578e2510f2296736358f5ff0ea617222a412bc
@@@ -381,7 -377,7 +382,7 @@@ ORDER BY contact_a.sort_name'
     *
     * @return string
     */
-   public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) {
 -  function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = TRUE) {
++  public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = TRUE) {
      return $this->all($offset, $rowcount, $sort, FALSE, TRUE);
    }
  
index f6ef408762965fae5bb7d5fde0a44f53ebd76273,a72397d45f20871dcce366989ad99a08a4ec2bfe..48927a2835ca4a9c7bd4ece57f890483c2585e28
@@@ -131,7 -130,7 +132,7 @@@ class CRM_Contact_Form_Search_Custom_Co
     *
     * @return string
     */
-   public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) {
 -  function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = TRUE) {
++  public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = TRUE) {
      return $this->all($offset, $rowcount, $sort, FALSE, TRUE);
    }
  
index 75469ebe337bbde088cd4a8a900e7f7b0b4ab070,3c7f67a9a16eadec9f099f8515fa55f5d80529b9..cd1abd2a63cccb128cd226d2fd558e8f7998dd6f
@@@ -275,7 -265,7 +276,7 @@@ civicrm_contact AS contact_
     *
     * @return string
     */
-   public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) {
 -  function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = TRUE) {
++  public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = TRUE) {
      return $this->all($offset, $rowcount, $sort, FALSE, TRUE);
    }
  
index a2029c9a10ae2e3fcc28b133f3957cf3297e9628,a4dd867da4680fd45ed4ed79d8c8059bb1667396..2bb47f89d0014a56c376c2200b6dad062c834e68
@@@ -323,7 -319,7 +324,7 @@@ class CRM_Contact_Form_Search_Custom_Ev
     *
     * @return string
     */
-   public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) {
 -  function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = TRUE) {
++  public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = TRUE) {
      return $this->all($offset, $rowcount, $sort);
    }
  
index 9b26887ac6f9d41938f05e51de969893ff26765b,2f7133f4b821fcb3adb42bd28712872f822884c5..1cc010ca2e6afc72bcfb94e32c1c516c686b5004
@@@ -229,7 -229,7 +230,7 @@@ WHERE  $wher
     *
     * @return string
     */
-   public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) {
 -  function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = TRUE) {
++  public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = TRUE) {
      return $this->all($offset, $rowcount, $sort, FALSE, TRUE);
    }
  
index 63769df56c0e972c0b0a9eea11429b61286a0b3b,a90cd723219a9379c69a45c1da485a37652ebd64..110503443011f2ead579b2ad8042c85aefe6c58a
  interface CRM_Contact_Form_Search_Interface {
  
    /**
 -   * The constructor gets the submitted form values
 +   * The constructor gets the submitted form values.
 +   *
 +   * @param array $formValues
     */
 -  function __construct(&$formValues);
 +  public function __construct(&$formValues);
  
    /**
-    * Builds the quickform for this search.
+    * Builds the list of tasks or actions that a searcher can perform on a result set.
     *
-    * @param CRM_Core_Form $form
+    * @param CRM_Core_Form_Search $form
+    * @return array
+    */
+   // @todo: This interface change should not go into a minor version; save for 4.6
 -  // function buildTaskList(CRM_Core_Form_Search $form);
++  // public function buildTaskList(CRM_Core_Form_Search $form);
+   /**
+    * Builds the quickform for this search
     */
 -  function buildForm(&$form);
 +  public function buildForm(&$form);
  
    /**
     * Builds the search query for various cases. We break it down into finer cases
Simple merge
index 3799eac34cd842934b724d23523e3b00635f7cb1,24a6ead3aadc21c95c585c11fe270b66953d874e..6220d85798a3d87923fe773f1c53c89306e91dd4
@@@ -161,20 -186,26 +161,22 @@@ class CRM_Report_Form_Grant_Detail exte
              'title' => ts('Amount Requested'),
              'operatorType' => CRM_Report_Form::OP_INT,
            ),
 -          'application_received_date' =>
 -          array(
 +          'application_received_date' => array(
              'title' => ts('Application Received'),
              'operatorType' => CRM_Report_Form::OP_DATE,
+             'type' => CRM_Utils_Type::T_DATE,
            ),
 -          'money_transfer_date' =>
 -          array(
 +          'money_transfer_date' => array(
              'title' => ts('Money Transfer Date'),
              'operatorType' => CRM_Report_Form::OP_DATE,
+             'type' => CRM_Utils_Type::T_DATE,
            ),
 -          'grant_due_date' =>
 -          array(
 +          'grant_due_date' => array(
              'title' => ts('Grant Report Due'),
              'operatorType' => CRM_Report_Form::OP_DATE,
-             'type' => CRM_Report_Form::OP_DATE,
+             'type' => CRM_Utils_Type::T_DATE,
            ),
 -          'decision_date' =>
 -          array(
 +          'decision_date' => array(
              'title' => ts('Grant Decision Date'),
              'operatorType' => CRM_Report_Form::OP_DATE,
              'type' => CRM_Utils_Type::T_DATE,
Simple merge
index 6f761fbbeabcf725def9d673b0a749e6718ddd2e,35402a16a7e6dc8ddbd18d1cddf938e3259d2e3e..10388ebc58e0565ec0d343635be4acd2ea7279e1
mode 100755,100644..100755