}
/**
- * 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
*/
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();
*
* @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);
}
*
* @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);
}
*
* @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);
}
*
* @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);
}
*
* @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);
}
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
'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,