<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
static $_validContext = NULL;
/**
- * list of values used when we want to display other objects
+ * List of values used when we want to display other objects
*
* @var array
* @static
protected $_contextMenu;
/**
- * the groupId retrieved from the GET vars
+ * The groupId retrieved from the GET vars
*
* @var int
* @access public
public $_groupID;
/**
- * the Group ID belonging to Add Member to group ID
+ * The Group ID belonging to Add Member to group ID
* retrieved from the GET vars
*
* @var int
protected $_amtgID;
/**
- * the saved search ID retrieved from the GET vars
+ * The saved search ID retrieved from the GET vars
*
* @var int
* @access protected
protected $_ssID;
/**
- * the group elements
+ * The group elements
*
* @var array
* @access public
public $_groupIterator;
/**
- * the tag elements
+ * The tag elements
*
* @var array
* @access protected
*/
protected $_ufGroupID;
- /*
- * csv - common search values
- *
- * @var array
- * @access protected
- * @static
- */
-
+ /**
+ * Csv - common search values
+ *
+ * @var array
+ * @access protected
+ * @static
+ */
static $csv = array('contact_type', 'group', 'tag');
/**
protected $_modeValue;
/**
- * name of the selector to use
+ * Name of the selector to use
*/
static $_selectorName = 'CRM_Contact_Selector';
protected $_customSearchID = NULL;
protected $_openedPanes = array();
/**
- * define the set of valid contexts that the search form operates on
+ * Define the set of valid contexts that the search form operates on
*
* @return array the valid context set and the titles
* @access protected
*/
function buildQuickForm() {
parent::buildQuickForm();
- $this->setAttribute('class', 'crm-search-form crm-ajax-selection-form');
CRM_Core_Resources::singleton()
// jsTree is needed for tags popup
->addScriptFile('civicrm', 'packages/jquery/plugins/jstree/jquery.jstree.js', 0, 'html-header', FALSE)
)
);
$this->add('hidden', 'task', CRM_Contact_Task::GROUP_CONTACTS);
+ $selectedRowsRadio = $this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked'));
+ $allRowsRadio = $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all');
+ $this->assign('ts_sel_id', $selectedRowsRadio->_attributes['id']);
+ $this->assign('ts_all_id', $allRowsRadio->_attributes['id']);
}
else {
$this->addTaskMenu($tasks);
}
- if ($qfKeyParam = CRM_Utils_Array::value('qfKey', $this->_formValues)) {
+ $selectedContactIds = array();
+ $qfKeyParam = CRM_Utils_Array::value('qfKey', $this->_formValues);
+ // We use ajax to handle selections only if the search results component_mode is set to "contacts"
+ if ($qfKeyParam && ($this->get('component_mode') <= 1 || $this->get('component_mode') == 7)) {
+ $this->addClass('crm-ajax-selection-form');
$qfKeyParam = "civicrm search {$qfKeyParam}";
$selectedContactIdsArr = CRM_Core_BAO_PrevNextCache::getSelection($qfKeyParam);
$selectedContactIds = array_keys($selectedContactIdsArr[$qfKeyParam]);
}
/**
- * processing needed for buildForm and later
+ * Processing needed for buildForm and later
*
* @return void
* @access public