X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FSelector%2FCustom.php;h=afaa3f82e9e8bdc7406fc0447b13a88f2e0a82de;hb=7a86e9ede3a83491f1e831da64537304e37ee837;hp=d5fc147ba199b77b8f24a473ba738ba65826e866;hpb=03298d98322f2da05e2ab30cb0e2d5b90df47ab3;p=civicrm-core.git diff --git a/CRM/Contact/Selector/Custom.php b/CRM/Contact/Selector/Custom.php index d5fc147ba1..afaa3f82e9 100644 --- a/CRM/Contact/Selector/Custom.php +++ b/CRM/Contact/Selector/Custom.php @@ -50,7 +50,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { 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 @@ -65,7 +65,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { 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 @@ -74,7 +74,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { 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 @@ -82,7 +82,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { public $_params; /** - * represent the type of selector + * Represent the type of selector * * @var int * @access protected @@ -92,7 +92,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { 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 @@ -157,7 +157,6 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { $this->_search = new $className($formValues); } } - //end of constructor /** * This method returns the links that are given for each search row. @@ -171,18 +170,24 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { * */ 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'), ), ); @@ -193,21 +198,20 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { '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) { @@ -218,10 +222,9 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { $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 @@ -266,7 +269,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { } /** - * 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 @@ -299,7 +302,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { $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')) { @@ -391,7 +394,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { } /** - * name of export file. + * Name of export file. * * @param string $output type of output * @@ -409,9 +412,9 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { } /** - * @param $params + * @param array $params * @param $action - * @param $sortID + * @param int $sortID * @param null $displayRelationshipType * @param string $queryOperator * @@ -428,7 +431,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { * @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')) {