X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FEvent%2FForm%2FSearch.php;h=e4be22736d02a0a43abab8e61674158bfde1f5b3;hb=0ae89576e5579be2e56db46a5249779d978a36bc;hp=b1c213f9b6d6fe1586ec23e5cc5d2b5877255519;hpb=5199546d3cd4bc40c0f08b079a1477979e033ac3;p=civicrm-core.git diff --git a/CRM/Event/Form/Search.php b/CRM/Event/Form/Search.php index b1c213f9b6..e4be22736d 100644 --- a/CRM/Event/Form/Search.php +++ b/CRM/Event/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; @@ -233,6 +224,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form { * @return void */ function buildQuickForm() { + parent::buildQuickForm(); $this->addElement('text', 'sort_name', ts('Participant Name or Email'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name')); CRM_Event_BAO_Query::buildSearchForm($this); @@ -243,14 +235,13 @@ class CRM_Event_Form_Search extends CRM_Core_Form { */ $rows = $this->get('rows'); if (is_array($rows)) { - CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js'); $lineItems = $eventIds = array(); 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) { @@ -258,7 +249,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form { if (!$this->_single) { $this->addElement('checkbox', $row['checkbox'], NULL, NULL, - array('onclick' => "toggleTaskAction( true ); return checkSelectedBox('" . $row['checkbox'] . "');") + array('onclick' => "toggleTaskAction( true );", 'class' => 'select-row') ); } if (CRM_Event_BAO_Event::usesPriceSet($row['event_id'])) { @@ -321,30 +312,15 @@ class CRM_Event_Form_Search extends CRM_Core_Form { ) ); - $this->add('submit', $this->_printButtonName, ts('Print'), - array( - 'class' => 'form-submit', - 'onclick' => "return checkPerformAction('mark_x', '" . $this->getName() . "', 1);", - ) - ); - // 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('onclick' => $this->getName() . ".toggleSelect.checked = false; toggleCheckboxVals('mark_x_',this); toggleTaskAction( true );") + array('class' => 'select-rows', 'onclick' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );") ); } - // add buttons - $this->addButtons(array( - array( - 'type' => 'refresh', - 'name' => ts('Search'), - 'isDefault' => TRUE, - ), - )); } /** @@ -399,7 +375,7 @@ class CRM_Event_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 @@ -461,36 +437,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form { * @access public * @see valid_date */ - function addRules() { - $this->addFormRule(array('CRM_Event_Form_Search', 'formRule')); - } - - /** - * 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 - * - * @return void - * @static - * @access public - */ - static function formRule($fields) { - $errors = array(); - - if ($fields['event_name'] && !is_numeric($fields['event_id'])) { - $errors['event_id'] = ts('Please select valid event.'); - } - - if ($fields['event_type'] && !is_numeric($fields['event_type_id'])) { - $errors['event_type'] = ts('Please select valid event type.'); - } - if (!empty($errors)) { - return $errors; - } - - return TRUE; - } + function addRules() {} /** * Set the default form values