static $_links = NULL;
/**
- * we use desc to remind us what that column is, name is used in the tpl
+ * We use desc to remind us what that column is, name is used in the tpl
*
* @var array
* @static
static $_properties = array('contact_id', 'contact_type', 'display_name');
/**
- * formValues is the array returned by exportValues called on
+ * FormValues is the array returned by exportValues called on
* the HTML_QuickForm_Controller for that page.
*
* @var array
public $_formValues;
/**
- * params is the array in a value used by the search query creator
+ * Params is the array in a value used by the search query creator
*
* @var array
* @access protected
public $_params;
/**
- * represent the type of selector
+ * Represent the type of selector
*
* @var int
* @access protected
protected $_query;
/**
- * the public visible fields to be shown to the user
+ * The public visible fields to be shown to the user
*
* @var array
* @access protected
$this->_search = new $className($formValues);
}
}
- //end of constructor
/**
* This method returns the links that are given for each search row.
*
*/
static function &links() {
+ list($key) = func_get_args();
+ $searchContext = "&context=custom";
+ $extraParams = ($key) ? "&key={$key}" : NULL;
+
if (!(self::$_links)) {
self::$_links = array(
CRM_Core_Action::VIEW => array(
'name' => ts('View'),
'url' => 'civicrm/contact/view',
- 'qs' => 'reset=1&cid=%%id%%',
+ 'qs' => "reset=1&cid=%%id%%{$extraParams}{$searchContext}",
+ 'class' => 'no-popup',
'title' => ts('View Contact Details'),
),
CRM_Core_Action::UPDATE => array(
'name' => ts('Edit'),
'url' => 'civicrm/contact/add',
'qs' => 'reset=1&action=update&cid=%%id%%',
+ 'class' => 'no-popup',
'title' => ts('Edit Contact Details'),
),
);
'name' => ts('Map'),
'url' => 'civicrm/contact/map',
'qs' => 'reset=1&cid=%%id%%&searchType=custom',
+ 'class' => 'no-popup',
'title' => ts('Map Contact'),
);
}
}
return self::$_links;
}
- //end of function
/**
- * getter for array of the parameters required for creating pager.
+ * Getter for array of the parameters required for creating pager.
*
* @param $action
- * @param $params
+ * @param array $params
*
- * @internal param $
* @access public
*/
function getPagerParams($action, &$params) {
$params['buttonTop'] = 'PagerTopButton';
$params['buttonBottom'] = 'PagerBottomButton';
}
- //end of function
/**
- * returns the column headers as an array of tuples:
+ * Returns the column headers as an array of tuples:
* (name, sortName (key to the sort array))
*
* @param string $action the action being performed
}
/**
- * returns all the rows in the given offset and rowCount
+ * Returns all the rows in the given offset and rowCount
*
* @param enum $action the action being performed
* @param int $offset the row number to start from
$columns = $this->_search->columns();
$columnNames = array_values($columns);
- $links = self::links();
+ $links = self::links($this->_key);
$permissions = array(CRM_Core_Permission::getPermission());
if (CRM_Core_Permission::check('delete contacts')) {
return NULL;
}
+ /**
+ * @return mixed
+ */
public function getSummary() {
return $this->_search->summary();
}
/**
- * name of export file.
+ * Name of export file.
*
* @param string $output type of output
*
return ts('CiviCRM Custom Search');
}
+ /**
+ * @return null
+ */
function alphabetQuery() {
return NULL;
}
+ /**
+ * @param array $params
+ * @param $action
+ * @param int $sortID
+ * @param null $displayRelationshipType
+ * @param string $queryOperator
+ *
+ * @return Object
+ */
function &contactIDQuery($params, $action, $sortID, $displayRelationshipType = NULL, $queryOperator = 'AND') {
$params = array();
$sql = $this->_search->contactIDs($params);
return CRM_Core_DAO::executeQuery($sql, $params);
}
+ /**
+ * @param $rows
+ */
function addActions(&$rows) {
- $links = self::links();
+ $links = self::links($this->_key);
$permissions = array(CRM_Core_Permission::getPermission());
if (CRM_Core_Permission::check('delete contacts')) {
}
}
+ /**
+ * @param $rows
+ */
function removeActions(&$rows) {
foreach ($rows as $rid => & $rValue) {
unset($rValue['action']);