X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FActivity%2FForm%2FSearch.php;h=b00e600880b50acd92a7879fea354a97bcaba780;hb=4847317168ff439c83d103d231d7326d992a9c29;hp=fbc77f0ece2640c919dde6019a973dfe0ebee96e;hpb=50ef07fe947ec74e0272cbfb5753bbaf0d785627;p=civicrm-core.git diff --git a/CRM/Activity/Form/Search.php b/CRM/Activity/Form/Search.php index fbc77f0ece..b00e600880 100644 --- a/CRM/Activity/Form/Search.php +++ b/CRM/Activity/Form/Search.php @@ -1,9 +1,9 @@ _searchButtonName = $this->getButtonName('refresh'); - $this->_printButtonName = $this->getButtonName('next', 'print'); $this->_actionButtonName = $this->getButtonName('next', 'action'); $this->_done = FALSE; @@ -232,6 +175,7 @@ class CRM_Activity_Form_Search extends CRM_Core_Form { * @return void */ function buildQuickForm() { + parent::buildQuickForm(); $this->addElement('text', 'sort_name', ts('Name or Email'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name')); CRM_Activity_BAO_Query::buildSearchForm($this); @@ -243,54 +187,29 @@ class CRM_Activity_Form_Search extends CRM_Core_Form { $rows = $this->get('rows'); if (is_array($rows)) { - CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js'); if (!$this->_single) { $this->addElement('checkbox', 'toggleSelect', NULL, NULL, - array('onclick' => "toggleTaskAction( true ); return toggleCheckboxVals('mark_x_',this);") + array('onclick' => "toggleTaskAction( true );", 'class' => 'select-rows') ); foreach ($rows as $row) { $this->addElement('checkbox', $row['checkbox'], NULL, NULL, - array('onclick' => "toggleTaskAction( true ); return checkSelectedBox('" . $row['checkbox'] . "');") + array('onclick' => "toggleTaskAction( true );", 'class' => 'select-row') ); } } $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);", - ) - ); - - $this->add('submit', $this->_printButtonName, ts('Print'), - array( - 'class' => 'form-submit', - 'onclick' => "return checkPerformAction('mark_x', '" . $this->getName() . "', 1);", - ) - ); + $this->addTaskMenu(CRM_Activity_Task::permissionedTaskTitles($permission)); // 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('onchange' => $this->getName() . ".toggleSelect.checked = false; toggleCheckboxVals('mark_x_',this); toggleTaskAction( true );") + array('class' => 'select-rows', 'onchange' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );") ); } - // add buttons - $this->addButtons(array( - array( - 'type' => 'refresh', - 'name' => ts('Search'), - 'isDefault' => TRUE, - ), - )); } /** @@ -341,7 +260,7 @@ class CRM_Activity_Form_Search extends CRM_Core_Form { $this->set('queryParams', $this->_queryParams); $buttonName = $this->controller->getButtonName(); - if ($buttonName == $this->_actionButtonName || $buttonName == $this->_printButtonName) { + if ($buttonName == $this->_actionButtonName) { // check actionName and if next, then do not repeat a search, since we are going to the next page // hack, make sure we reset the task values $stateMachine = $this->controller->getStateMachine(); @@ -496,6 +415,9 @@ class CRM_Activity_Form_Search extends CRM_Core_Form { } } + /** + * @return null + */ function getFormValues() { return NULL; }