X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FActivity%2FForm%2FSearch.php;h=0e4b018b351a4aa877fe0776eaf3d5e68b476cb1;hb=fc39f196c427ec3f13f2a240967bd36f426e9609;hp=d6b9d2502ef3fbd0163f643f61d2f69a3de3806e;hpb=bd6d55934fb8cec290b612b6c2d3d028800744ad;p=civicrm-core.git diff --git a/CRM/Activity/Form/Search.php b/CRM/Activity/Form/Search.php index d6b9d2502e..0e4b018b35 100644 --- a/CRM/Activity/Form/Search.php +++ b/CRM/Activity/Form/Search.php @@ -1,9 +1,9 @@ addElement('text', 'sort_name', ts('Name or Email'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name')); CRM_Activity_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); } $permission = CRM_Core_Permission::getPermission(); - $tasks = array('' => ts('- actions -')) + CRM_Activity_Task::permissionedTaskTitles($permission); - - $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', 'onchange' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );") - ); + $this->addTaskMenu(CRM_Activity_Task::permissionedTaskTitles($permission)); } - // add buttons - $this->addButtons(array( - array( - 'type' => 'refresh', - 'name' => ts('Search'), - 'isDefault' => TRUE, - ), - )); } /** @@ -480,6 +396,9 @@ class CRM_Activity_Form_Search extends CRM_Core_Form { } } + /** + * @return null + */ function getFormValues() { return NULL; }