<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
*/
class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
- /*
+ /**
* list of valid contexts
*
* @var array
- * @static
*/
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
*/
static $_modeValues = NULL;
* The contextMenu
*
* @var array
- * @access protected
*/
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
- * @access protected
*/
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 $_group;
public $_groupElement;
public $_groupIterator;
/**
- * the tag elements
+ * The tag elements
*
* @var array
- * @access protected
*/
public $_tag;
public $_tagElement;
* The params used for search
*
* @var array
- * @access protected
*/
protected $_params;
* The return properties used for search
*
* @var array
- * @access protected
*/
protected $_returnProperties;
* The sort by character
*
* @var string
- * @access protected
*/
protected $_sortByCharacter;
* The profile group id used for display
*
* @var integer
- * @access protected
*/
protected $_ufGroupID;
/**
- * csv - common search values
+ * 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
- * @static
+ * @return array
+ * the valid context set and the titles
*/
- static function &validContext() {
+ public static function &validContext() {
if (!(self::$_validContext)) {
self::$_validContext = array(
'smog' => 'Show members of group',
*
* @return bool
*/
- static function isSearchContext($context) {
+ public static function isSearchContext($context) {
$searchContext = CRM_Utils_Array::value($context, self::validContext());
return $searchContext ? TRUE : FALSE;
}
- static function setModeValues() {
+ public static function setModeValues() {
if (!self::$_modeValues) {
self::$_modeValues = array(
1 => array(
*
* @return mixed
*/
- static function getModeValue($mode = 1) {
+ public static function getModeValue($mode = 1) {
self::setModeValues();
if (!array_key_exists($mode, self::$_modeValues)) {
/**
* @return array
*/
- static function getModeSelect() {
+ public static function getModeSelect() {
self::setModeValues();
$select = array();
/**
* Build the common elements between the search/advanced form
*
- * @access public
*
* @return void
*/
- function buildQuickForm() {
+ public function buildQuickForm() {
parent::buildQuickForm();
CRM_Core_Resources::singleton()
// jsTree is needed for tags popup
}
else {
$className = $this->_modeValue['taskClassName'];
- $tasks += $className::permissionedTaskTitles($permission, false);
+ $tasks += $className::permissionedTaskTitles($permission, FALSE);
}
if (isset($this->_ssID)) {
// add the go button for the action form, note it is of type 'next' rather than of type 'submit'
if ($this->_context === 'amtg') {
- // check if _groupID exists, it might not if
- // we are displaying a hidden group
+ // check if _groupID exists, it might not if
+ // we are displaying a hidden group
if (!isset($this->_group[$this->_amtgID])) {
$this->assign('permissionedForGroup', FALSE);
$this->_group[$this->_amtgID] =
}
/**
- * processing needed for buildForm and later
+ * Processing needed for buildForm and later
*
* @return void
- * @access public
*/
- function preProcess() {
+ public function preProcess() {
// set the various class variables
$this->_group = CRM_Core_PseudoConstant::group();
// get user submitted values
// get it from controller only if form has been submitted, else preProcess has set this
- // $this->controller->isModal( ) returns true if page is
- // valid, i.e all the validations are true
+ // $this->controller->isModal( ) returns TRUE if page is
+ // valid, i.e all the validations are TRUE
if (!empty($_POST) && !$this->controller->isModal()) {
$this->_formValues = $this->controller->exportValues($this->_name);
// FIXME: we should generalise in a way that components could inject url-filters
// just like they build their own form elements
foreach (array(
- 'mailing_id', 'mailing_delivery_status', 'mailing_open_status',
- 'mailing_click_status', 'mailing_reply_status', 'mailing_optout',
- 'mailing_forward', 'mailing_unsubscribe', 'mailing_date_low',
- 'mailing_date_high',
- ) as $mailingFilter) {
+ 'mailing_id',
+ 'mailing_delivery_status',
+ 'mailing_open_status',
+ 'mailing_click_status',
+ 'mailing_reply_status',
+ 'mailing_optout',
+ 'mailing_forward',
+ 'mailing_unsubscribe',
+ 'mailing_date_low',
+ 'mailing_date_high',
+ ) as $mailingFilter) {
$type = 'String';
if ($mailingFilter == 'mailing_id' &&
$filterVal = CRM_Utils_Request::retrieve('mailing_id', 'Positive', $this)
$this->_params,
$this->_returnProperties,
$this->_action,
- false, true,
+ FALSE, TRUE,
$this->_context,
$this->_contextMenu
);
$selector = new self::$_selectorName(
$this->_params,
$this->_action,
- null, false, null,
+ NULL, FALSE, NULL,
"search", "advanced"
);
}
/**
* @return array
*/
- function &getFormValues() {
+ public function &getFormValues() {
return $this->_formValues;
}
* Common post processing
*
* @return void
- * @access public
*/
- function postProcess() {
+ public function postProcess() {
/*
* sometime we do a postProcess early on, so we dont need to repeat it
* this will most likely introduce some more bugs :(
$crmPID = CRM_Utils_Request::retrieve('crmPID', 'Integer', CRM_Core_DAO::$_nullObject);
if (array_key_exists($this->_searchButtonName, $_POST) ||
- ($this->_force && !$crmPID)) {
+ ($this->_force && !$crmPID)
+ ) {
//reset the cache table for new search
$cacheKey = "civicrm search {$this->controller->_key}";
CRM_Core_BAO_PrevNextCache::deleteItem(NULL, $cacheKey);
$this->_params,
$this->_returnProperties,
$this->_action,
- false,
+ FALSE,
$searchChildGroups,
$this->_context,
$this->_contextMenu
$setDynamic = TRUE;
}
else {
- $selector = new self::$_selectorName (
+ $selector = new self::$_selectorName(
$this->_params,
$this->_action,
- null,
- false,
- null,
+ NULL,
+ FALSE,
+ NULL,
"search",
"advanced"
);
}
/**
- * @return null
+ * @return NULL
*/
- function &returnProperties() {
+ public function &returnProperties() {
return CRM_Core_DAO::$_nullObject;
}
* Return a descriptive name for the page, used in wizard header
*
* @return string
- * @access public
*/
- function getTitle() {
+ public function getTitle() {
return ts('Search');
}
}
-