Merge pull request #6350 from PalanteJon/CRM-16939-4.6
[civicrm-core.git] / CRM / Contact / Page / SavedSearch.php
index f1168dfc151764e4be7f1238fffdf5c1d60780ed..08841d861c4abe8479716cde85da074c8315bed3 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
 class CRM_Contact_Page_SavedSearch extends CRM_Core_Page {
 
   /**
-   * The action links that we need to display for the browse screen
+   * The action links that we need to display for the browse screen.
    *
    * @var array
-   * @static
    */
   static $_links = NULL;
 
   /**
    * Delete a saved search.
    *
-   * @param int $id - id of saved search
+   * @param int $id
+   *   Id of saved search.
    *
    * @return void
-   *
    */
-  function delete($id) {
+  public function delete($id) {
     // first delete the group associated with this saved search
     $group = new CRM_Contact_DAO_Group();
     $group->saved_search_id = $id;
@@ -67,16 +66,15 @@ class CRM_Contact_Page_SavedSearch extends CRM_Core_Page {
     $savedSearch->id = $id;
     $savedSearch->is_active = 0;
     $savedSearch->save();
-    return;
   }
 
   /**
    * Browse all saved searches.
    *
-   * @return content of the parents run method
-   *
+   * @return mixed
+   *   content of the parents run method
    */
-  function browse() {
+  public function browse() {
     $rows = array();
 
     $savedSearch = new CRM_Contact_DAO_SavedSearch();
@@ -97,13 +95,13 @@ class CRM_Contact_Page_SavedSearch extends CRM_Core_Page {
           $row['name'] = $group->title;
           $row['description'] = $group->description;
 
-          $row['id']           = $savedSearch->id;
-          $formValues          = unserialize($savedSearch->form_values);
-          $query               = new CRM_Contact_BAO_Query($formValues);
+          $row['id'] = $savedSearch->id;
+          $formValues = unserialize($savedSearch->form_values);
+          $query = new CRM_Contact_BAO_Query($formValues);
           $row['query_detail'] = $query->qill();
 
-          $action        = array_sum(array_keys(self::links()));
-          $action        = $action & CRM_Core_Action::mask($permissions);
+          $action = array_sum(array_keys(self::links()));
+          $action = $action & CRM_Core_Action::mask($permissions);
           $row['action'] = CRM_Core_Action::formLink(
             self::links(),
             $action,
@@ -129,7 +127,7 @@ class CRM_Contact_Page_SavedSearch extends CRM_Core_Page {
    *
    * @return void
    */
-  function run() {
+  public function run() {
     $action = CRM_Utils_Request::retrieve('action', 'String',
       $this, FALSE, 'browse'
     );
@@ -146,12 +144,12 @@ class CRM_Contact_Page_SavedSearch extends CRM_Core_Page {
   }
 
   /**
-   * Get action Links
+   * Get action Links.
    *
-   * @return array (reference) of action links
-   * @static
+   * @return array
+   *   (reference) of action links
    */
-  static function &links() {
+  public static function &links() {
 
     if (!(self::$_links)) {
 
@@ -174,5 +172,5 @@ class CRM_Contact_Page_SavedSearch extends CRM_Core_Page {
     }
     return self::$_links;
   }
-}
 
+}