X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCase%2FForm%2FSearch.php;h=c2b74f8f1f2ed3fbed54beb4ab0e8fc4d3b54e24;hb=3838662faff56daff7b4fbbd25c60a4b7242a484;hp=405fa510a1abf52f23a1b259b76265b8c04163c3;hpb=475364e0009b154850a9140551d7a123e9e33892;p=civicrm-core.git diff --git a/CRM/Case/Form/Search.php b/CRM/Case/Form/Search.php index 405fa510a1..c2b74f8f1f 100644 --- a/CRM/Case/Form/Search.php +++ b/CRM/Case/Form/Search.php @@ -1,9 +1,9 @@ get('rows'); if (is_array($rows)) { if (!$this->_single) { - $this->addElement('checkbox', - 'toggleSelect', - NULL, - NULL, - array('onclick' => "toggleTaskAction( true );", 'class' => 'select-rows') - ); - - foreach ($rows as $row) { - $this->addElement('checkbox', $row['checkbox'], - NULL, NULL, - array('onclick' => "toggleTaskAction( true );", 'class' => 'select-row') - ); - } + $this->addRowSelectors($rows); } - $total = $cancel = 0; - $permission = CRM_Core_Permission::getPermission(); - $tasks = array('' => ts('- actions -')) + CRM_Case_Task::permissionedTaskTitles($permission); + $tasks = CRM_Case_Task::permissionedTaskTitles($permission); if (!empty($this->_formValues['case_deleted'])) { unset($tasks[1]); @@ -271,18 +205,7 @@ class CRM_Case_Form_Search extends CRM_Core_Form_Search { unset($tasks[4]); } - $this->add('select', 'task', ts('Actions:') . ' ', $tasks); - $this->add('submit', $this->_actionButtonName, ts('Go'), - array( - 'class' => 'form-submit', - 'id' => 'Go', - 'onclick' => "return checkPerformAction('mark_x', '" . $this->getName() . "', 0);", - ) - ); - - // need to perform tasks on all or selected items ? using radio_ts(task selection) for it - $this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked')); - $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('class' => 'select-rows', 'onclick' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );")); + $this->addTaskMenu($tasks); } } @@ -410,7 +333,8 @@ class CRM_Case_Form_Search extends CRM_Core_Form_Search { * global validation rules for the form * * @param array $fields posted values of the form - * @param array $errors list of errors to be posted back to the form + * + * @internal param array $errors list of errors to be posted back to the form * * @return void * @static @@ -513,6 +437,9 @@ class CRM_Case_Form_Search extends CRM_Core_Form_Search { } } + /** + * @return null + */ function getFormValues() { return NULL; }