X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FSelector.php;h=dcac1ec94758fec79aa1c25cf0f850df2f1959f1;hb=76f1a3f2a53b1a3a03df8cf3ff33a1a32c84cc6b;hp=8a6ac5b19760c77a46de6aee1a7d43be150dbdd2;hpb=42bf93368ea81b2fa70fab038f3c884755e1ab88;p=civicrm-core.git diff --git a/CRM/Contact/Selector.php b/CRM/Contact/Selector.php index 8a6ac5b197..dcac1ec947 100644 --- a/CRM/Contact/Selector.php +++ b/CRM/Contact/Selector.php @@ -1,7 +1,7 @@ _options = &$this->_query->_options; } - //end of constructor /** * This method returns the links that are given for each search row. @@ -230,10 +222,9 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se * - Edit * * @return array - * @access public * */ - static function &links() { + public static function &links() { list($context, $contextMenu, $key) = func_get_args(); $extraParams = ($key) ? "&key={$key}" : NULL; $searchContext = ($context) ? "&context=$context" : NULL; @@ -299,18 +290,15 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se } 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) { + public function getPagerParams($action, &$params) { $params['status'] = ts('Contact %%StatusMessage%%'); $params['csvString'] = NULL; $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT; @@ -318,7 +306,6 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se $params['buttonTop'] = 'PagerTopButton'; $params['buttonBottom'] = 'PagerBottomButton'; } - //end of function /** * @param null $action @@ -326,23 +313,22 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se * * @return array */ - function &getColHeads($action = NULL, $output = NULL) { + public function &getColHeads($action = NULL, $output = NULL) { $colHeads = self::_getColumnHeaders(); $colHeads[] = array('desc' => ts('Actions'), 'name' => ts('Action')); return $colHeads; } /** - * 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 * @param enum $output what should the result set include (web/email/csv) * * @return array the column headers that need to be displayed - * @access public */ - function &getColumnHeaders($action = NULL, $output = NULL) { + public function &getColumnHeaders($action = NULL, $output = NULL) { $headers = NULL; // unset return property elements that we don't care @@ -492,9 +478,8 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se * @param * * @return int Total number of rows - * @access public */ - function getTotalCount($action) { + public function getTotalCount($action) { // Use count from cache during paging/sorting if (!empty($_GET['crmPID']) || !empty($_GET['crmSID'])) { $count = CRM_Core_BAO_Cache::getItem('Search Results Count', $this->_key); @@ -507,7 +492,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se } /** - * 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 @@ -517,7 +502,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se * * @return int the total number of rows for this action */ - function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { + public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { $config = CRM_Core_Config::singleton(); if (($output == CRM_Core_Selector_Controller::EXPORT || @@ -825,11 +810,11 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se } /** - * @param $sort + * @param CRM_Utils_Sort $sort * * @return string */ - function buildPrevNextCache($sort) { + public function buildPrevNextCache($sort) { $cacheKey = 'civicrm search ' . $this->_key; // We should clear the cache in following conditions: @@ -885,7 +870,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se /** * @param $rows */ - function addActions(&$rows) { + public function addActions(&$rows) { $config = CRM_Core_Config::singleton(); $permissions = array(CRM_Core_Permission::getPermission()); @@ -981,7 +966,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se /** * @param $rows */ - function removeActions(&$rows) { + public function removeActions(&$rows) { foreach ($rows as $rid => & $rValue) { unset($rValue['contact_type']); unset($rValue['action']); @@ -989,12 +974,12 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se } /** - * @param object $sort + * @param CRM_Utils_Sort $sort * @param string $cacheKey * @param int $start * @param int $end */ - function fillupPrevNextCache($sort, $cacheKey, $start = 0, $end = 500) { + public function fillupPrevNextCache($sort, $cacheKey, $start = 0, $end = 500) { $coreSearch = TRUE; // For custom searches, use the contactIDs method if (is_a($this, 'CRM_Contact_Selector_Custom')) { @@ -1051,13 +1036,12 @@ SELECT DISTINCT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', cont * * @param int $start start for limit clause * @param int $end end for limit clause - * @param $sort + * @param CRM_Utils_Sort $sort * @param string $cacheKey cache key * - * @internal param $object $sort sort object * @return void */ - function rebuildPreNextCache($start, $end, $sort, $cacheKey) { + public function rebuildPreNextCache($start, $end, $sort, $cacheKey) { // generate full SQL $sql = $this->_query->searchQuery($start, $end, $sort, FALSE, $this->_query->_includeContactIds, FALSE, FALSE, TRUE); @@ -1087,7 +1071,6 @@ SELECT DISTINCT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', cont reference) $formValues submitted formValues * * @return array $qill which contains an array of strings - * @access public */ // the current internationalisation is bad, but should more or less work @@ -1097,22 +1080,21 @@ SELECT DISTINCT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', cont } /** - * name of export file. + * Name of export file. * * @param string $output type of output * * @return string name of the file */ - function getExportFileName($output = 'csv') { + public function getExportFileName($output = 'csv') { return ts('CiviCRM Contact Search'); } /** - * get colunmn headers for search selector + * Get colunmn headers for search selector * * * @return array $_columnHeaders - * @access private */ private static function &_getColumnHeaders() { if (!isset(self::$_columnHeaders)) { @@ -1173,27 +1155,27 @@ SELECT DISTINCT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', cont /** * @return CRM_Contact_BAO_Query */ - function &getQuery() { + public function &getQuery() { return $this->_query; } /** * @return CRM_Contact_DAO_Contact */ - function alphabetQuery() { + public function alphabetQuery() { return $this->_query->searchQuery(NULL, NULL, NULL, FALSE, FALSE, TRUE); } /** - * @param $params + * @param array $params * @param $action - * @param $sortID + * @param int $sortID * @param null $displayRelationshipType * @param string $queryOperator * * @return CRM_Contact_DAO_Contact */ - function contactIDQuery($params, $action, $sortID, $displayRelationshipType = NULL, $queryOperator = 'AND') { + public function contactIDQuery($params, $action, $sortID, $displayRelationshipType = NULL, $queryOperator = 'AND') { $sortOrder = &$this->getSortOrder($this->_action); $sort = new CRM_Utils_Sort($sortOrder, $sortID); @@ -1230,7 +1212,7 @@ SELECT DISTINCT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', cont * * @return array */ - function &makeProperties(&$returnProperties) { + public function &makeProperties(&$returnProperties) { $properties = array(); foreach ($returnProperties as $name => $value) { if ($name != 'location') { @@ -1260,5 +1242,3 @@ SELECT DISTINCT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', cont return $properties; } } -//end of class -