Merge pull request #15808 from civicrm/5.20
[civicrm-core.git] / CRM / Contact / Page / SavedSearch.php
index ed8fedd4a2b16086c9c1cd04f93f006440ba088d..686eafb14240a9bee6ae0793aba23ce0476733ee 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018                                |
+ | Copyright CiviCRM LLC (c) 2004-2020                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2020
  */
 
 /**
@@ -41,7 +41,7 @@ class CRM_Contact_Page_SavedSearch extends CRM_Core_Page {
    *
    * @var array
    */
-  static $_links = NULL;
+  public static $_links = NULL;
 
   /**
    * Delete a saved search.
@@ -70,14 +70,14 @@ class CRM_Contact_Page_SavedSearch extends CRM_Core_Page {
    *   content of the parents run method
    */
   public function browse() {
-    $rows = array();
+    $rows = [];
 
     $savedSearch = new CRM_Contact_DAO_SavedSearch();
     $savedSearch->is_active = 1;
     $savedSearch->selectAdd();
     $savedSearch->selectAdd('id, form_values');
     $savedSearch->find();
-    $properties = array('id', 'name', 'description');
+    $properties = ['id', 'name', 'description'];
     while ($savedSearch->fetch()) {
       // get name and description from group object
       $group = new CRM_Contact_DAO_Group();
@@ -85,7 +85,7 @@ class CRM_Contact_Page_SavedSearch extends CRM_Core_Page {
       if ($group->find(TRUE)) {
         $permissions = CRM_Contact_BAO_Group::checkPermission($group->id, TRUE);
         if (!CRM_Utils_System::isNull($permissions)) {
-          $row = array();
+          $row = [];
 
           $row['name'] = $group->title;
           $row['description'] = $group->description;
@@ -100,7 +100,7 @@ class CRM_Contact_Page_SavedSearch extends CRM_Core_Page {
           $row['action'] = CRM_Core_Action::formLink(
             self::links(),
             $action,
-            array('id' => $row['id']),
+            ['id' => $row['id']],
             ts('more'),
             FALSE,
             'savedSearch.manage.action',
@@ -148,20 +148,20 @@ class CRM_Contact_Page_SavedSearch extends CRM_Core_Page {
 
       $deleteExtra = ts('Do you really want to remove this Smart Group?');
 
-      self::$_links = array(
-        CRM_Core_Action::VIEW => array(
+      self::$_links = [
+        CRM_Core_Action::VIEW => [
           'name' => ts('Search'),
           'url' => 'civicrm/contact/search/advanced',
           'qs' => 'reset=1&force=1&ssID=%%id%%',
           'title' => ts('Search'),
-        ),
-        CRM_Core_Action::DELETE => array(
+        ],
+        CRM_Core_Action::DELETE => [
           'name' => ts('Delete'),
           'url' => 'civicrm/contact/search/saved',
           'qs' => 'action=delete&id=%%id%%',
           'extra' => 'onclick="return confirm(\'' . $deleteExtra . '\');"',
-        ),
-      );
+        ],
+      ];
     }
     return self::$_links;
   }