*/
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
*
*/
protected $_queryParams;
- /**
- * have we already done this search
- *
- * @access protected
- * @var boolean
- */
- protected $_done;
-
/**
* are we restricting ourselves to a single contact
*
*/
protected $_limit = NULL;
- /**
- * what context are we being invoked from
- *
- * @access protected
- * @var string
- */
- protected $_context = NULL;
-
/**
* prefix for the controller
*
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']);
$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();
$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);
}
}