X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCase%2FForm%2FSearch.php;h=c2b74f8f1f2ed3fbed54beb4ab0e8fc4d3b54e24;hb=3838662faff56daff7b4fbbd25c60a4b7242a484;hp=e637bb5efe7f32e42af3944ee8445f33e851468e;hpb=2ffa020727c31e3993eb9e3bad8bd80d17af9884;p=civicrm-core.git diff --git a/CRM/Case/Form/Search.php b/CRM/Case/Form/Search.php index e637bb5efe..c2b74f8f1f 100644 --- a/CRM/Case/Form/Search.php +++ b/CRM/Case/Form/Search.php @@ -1,9 +1,9 @@ set('searchFormName', 'Search'); - // js for changing activity status - CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'templates/CRM/Case/Form/ActivityChangeStatus.js'); - //check for civicase access. if (!CRM_Case_BAO_Case::accessCiviCase()) { CRM_Core_Error::fatal(ts('You are not authorized to access this page.')); @@ -230,6 +179,7 @@ class CRM_Case_Form_Search extends CRM_Core_Form { * @return void */ function buildQuickForm() { + parent::buildQuickForm(); $this->addElement('text', 'sort_name', ts('Client Name or Email'), @@ -238,34 +188,15 @@ class CRM_Case_Form_Search extends CRM_Core_Form { CRM_Case_BAO_Query::buildSearchForm($this); - /* - * add form checkboxes for each row. This is needed out here to conform to QF protocol - * of all elements being declared in builQuickForm - */ $rows = $this->get('rows'); if (is_array($rows)) { - CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.searchForm.js'); 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]); @@ -274,28 +205,9 @@ class CRM_Case_Form_Search extends CRM_Core_Form { 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); } - // add buttons - $this->addButtons(array( - array( - 'type' => 'refresh', - 'name' => ts('Search'), - 'isDefault' => TRUE, - ), - )); } /** @@ -421,7 +333,8 @@ class CRM_Case_Form_Search extends CRM_Core_Form { * 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 @@ -524,6 +437,9 @@ class CRM_Case_Form_Search extends CRM_Core_Form { } } + /** + * @return null + */ function getFormValues() { return NULL; }