X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FEvent%2FForm%2FSearch.php;h=f69f4d63b91df1c3656bc90f03290f87fc6d0cbb;hb=4233eb144f167d3a60e27ca055e0ddb3b018e473;hp=e4be22736d02a0a43abab8e61674158bfde1f5b3;hpb=ac30252393b3b9d8162994f59bb63e2b89ddacdc;p=civicrm-core.git diff --git a/CRM/Event/Form/Search.php b/CRM/Event/Form/Search.php index e4be22736d..f69f4d63b9 100644 --- a/CRM/Event/Form/Search.php +++ b/CRM/Event/Form/Search.php @@ -42,38 +42,6 @@ */ class CRM_Event_Form_Search extends CRM_Core_Form_Search { - /** - * Are we forced to run a search - * - * @var int - * @access protected - */ - protected $_force; - - /** - * name of search button - * - * @var string - * @access protected - */ - protected $_searchButtonName; - - /** - * name of action button - * - * @var string - * @access protected - */ - protected $_actionButtonName; - - /** - * form values that we will be using - * - * @var array - * @access protected - */ - protected $_formValues; - /** * the params that are sent to the query * @@ -82,14 +50,6 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { */ protected $_queryParams; - /** - * have we already done this search - * - * @access protected - * @var boolean - */ - protected $_done; - /** * are we restricting ourselves to a single contact * @@ -106,14 +66,6 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { */ protected $_limit = NULL; - /** - * what context are we being invoked from - * - * @access protected - * @var string - */ - protected $_context = NULL; - /** * prefix for the controller * @@ -229,29 +181,14 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { CRM_Event_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)) { $lineItems = $eventIds = array(); if (!$this->_single) { - $this->addElement('checkbox', - 'toggleSelect', - NULL, - NULL, - array('onclick' => "toggleTaskAction( true );", 'class' => 'select-rows') - ); + $this->addRowSelectors($rows); } foreach ($rows as $row) { $eventIds[$row['event_id']] = $row['event_id']; - if (!$this->_single) { - $this->addElement('checkbox', $row['checkbox'], - NULL, NULL, - array('onclick' => "toggleTaskAction( true );", 'class' => 'select-row') - ); - } if (CRM_Event_BAO_Event::usesPriceSet($row['event_id'])) { // add line item details if applicable $lineItems[$row['participant_id']] = CRM_Price_BAO_LineItem::getLineItems($row['participant_id']); @@ -275,6 +212,13 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { $roles = array_keys($this->_formValues['participant_role_id']); $seatClause[] = '( participant.role_id IN ( ' . implode(' , ', $roles) . ' ) )'; } + // CRM-15379 + if (!empty($this->_formValues['participant_fee_id'])) { + $participant_fee_id = $this->_formValues['participant_fee_id']; + $feeLabel = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $participant_fee_id, 'label'); + $feeLabel = CRM_Core_DAO::escapeString(trim($feeLabel)); + $seatClause[] = "( participant.fee_level LIKE '%$feeLabel%' )"; + } $clause = NULL; if (!empty($seatClause)) { $clause = implode(' AND ', $seatClause); @@ -285,11 +229,9 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { $this->assign('participantCount', $participantCount); $this->assign('lineItems', $lineItems); - $total = $cancel = 0; - $permission = CRM_Core_Permission::getPermission(); - $tasks = array('' => ts('- actions -')) + CRM_Event_Task::permissionedTaskTitles($permission); + $tasks = CRM_Event_Task::permissionedTaskTitles($permission); if (isset($this->_ssID)) { if ($permission == CRM_Core_Permission::EDIT) { $tasks = $tasks + CRM_Event_Task::optionalTaskTitle(); @@ -303,22 +245,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { $this->assign('ssID', $this->_ssID); } - $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); } } @@ -528,6 +455,9 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { } } + /** + * @return null + */ function getFormValues() { return NULL; }