From: kurund Date: Mon, 2 Mar 2015 16:11:34 +0000 (+0530) Subject: Merge remote-tracking branch 'upstream/4.5' into 4.5-master-2015-03-02-21-30-06 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e98a98049142cec1b405f66dab5ced1be07336ec;p=civicrm-core.git Merge remote-tracking branch 'upstream/4.5' into 4.5-master-2015-03-02-21-30-06 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 --- e98a98049142cec1b405f66dab5ced1be07336ec diff --cc CRM/Contact/Form/Search.php index cc48430312,79824f368b..94bc485517 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@@ -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. * + * @return array + */ - function buildTaskList() { ++ 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 */ diff --cc CRM/Contact/Form/Search/Custom.php index 919b315c5d,0638a9d310..dfe38dff05 --- a/CRM/Contact/Form/Search/Custom.php +++ b/CRM/Contact/Form/Search/Custom.php @@@ -112,7 -108,24 +112,24 @@@ class CRM_Contact_Form_Search_Custom ex return $this->_formValues; } + /** + * Builds the list of tasks or actions that a searcher can perform on a result set. + * + * @return array + */ - function buildTaskList() { ++ 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; + } + } + - function buildQuickForm() { + public function buildQuickForm() { $this->_customClass->buildForm($this); parent::buildQuickForm(); diff --cc CRM/Contact/Form/Search/Custom/ActivitySearch.php index daa784f8bb,2ad3b5be3f..d8578e2510 --- a/CRM/Contact/Form/Search/Custom/ActivitySearch.php +++ b/CRM/Contact/Form/Search/Custom/ActivitySearch.php @@@ -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); } diff --cc CRM/Contact/Form/Search/Custom/ContribSYBNT.php index f6ef408762,a72397d45f..48927a2835 --- a/CRM/Contact/Form/Search/Custom/ContribSYBNT.php +++ b/CRM/Contact/Form/Search/Custom/ContribSYBNT.php @@@ -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); } diff --cc CRM/Contact/Form/Search/Custom/ContributionAggregate.php index 75469ebe33,3c7f67a9a1..cd1abd2a63 --- a/CRM/Contact/Form/Search/Custom/ContributionAggregate.php +++ b/CRM/Contact/Form/Search/Custom/ContributionAggregate.php @@@ -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); } diff --cc CRM/Contact/Form/Search/Custom/EventAggregate.php index a2029c9a10,a4dd867da4..2bb47f89d0 --- a/CRM/Contact/Form/Search/Custom/EventAggregate.php +++ b/CRM/Contact/Form/Search/Custom/EventAggregate.php @@@ -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); } diff --cc CRM/Contact/Form/Search/Custom/TagContributions.php index 9b26887ac6,2f7133f4b8..1cc010ca2e --- a/CRM/Contact/Form/Search/Custom/TagContributions.php +++ b/CRM/Contact/Form/Search/Custom/TagContributions.php @@@ -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); } diff --cc CRM/Contact/Form/Search/Interface.php index 63769df56c,a90cd72321..1105034430 --- a/CRM/Contact/Form/Search/Interface.php +++ b/CRM/Contact/Form/Search/Interface.php @@@ -35,18 -35,23 +35,25 @@@ 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 diff --cc CRM/Report/Form/Grant/Detail.php index 3799eac34c,24a6ead3aa..6220d85798 --- a/CRM/Report/Form/Grant/Detail.php +++ b/CRM/Report/Form/Grant/Detail.php @@@ -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, diff --cc tests/phpunit/CiviTest/CiviUnitTestCase.php index 6f761fbbea,35402a16a7..10388ebc58 mode 100755,100644..100755 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php