From 02c2877c52e41615c41fd8e3079c5e70ccd7234e Mon Sep 17 00:00:00 2001 From: btry Date: Wed, 18 Oct 2017 13:37:46 +0200 Subject: [PATCH] fix(wizard): bookmark was renamed into saved search i GLPI 9.2 fix #799 --- inc/wizard.class.php | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/inc/wizard.class.php b/inc/wizard.class.php index 9d00304a0..96b50f26a 100644 --- a/inc/wizard.class.php +++ b/inc/wizard.class.php @@ -99,28 +99,38 @@ public static function header($title) { echo ''; } - $query = "SELECT `glpi_bookmarks`.*, - `glpi_bookmarks_users`.`id` AS IS_DEFAULT - FROM `glpi_bookmarks` - LEFT JOIN `glpi_bookmarks_users` - ON (`glpi_bookmarks`.`itemtype` = `glpi_bookmarks_users`.`itemtype` - AND `glpi_bookmarks`.`id` = `glpi_bookmarks_users`.`bookmarks_id` - AND `glpi_bookmarks_users`.`users_id` = '".Session::getLoginUserID()."') - WHERE `glpi_bookmarks`.`is_private`='1' - AND `glpi_bookmarks`.`users_id`='".Session::getLoginUserID()."' - OR `glpi_bookmarks`.`is_private`='0' ". - getEntitiesRestrictRequest("AND", "glpi_bookmarks", "", "", true); + $query = "SELECT `glpi_savedsearches`.*, + `glpi_savedsearches_users`.`id` AS IS_DEFAULT + FROM `glpi_savedsearches` + LEFT JOIN `glpi_savedsearches_users` + ON (`glpi_savedsearches`.`itemtype` = `glpi_savedsearches_users`.`itemtype` + AND `glpi_savedsearches`.`id` = `glpi_savedsearches_users`.`savedsearches_id` + AND `glpi_savedsearches_users`.`users_id` = '".Session::getLoginUserID()."') + WHERE `glpi_savedsearches`.`is_private`='1' + AND `glpi_savedsearches`.`users_id`='".Session::getLoginUserID()."' + OR `glpi_savedsearches`.`is_private`='0' ". + getEntitiesRestrictRequest("AND", "glpi_savedsearches", "", "", true); if ($result = $DB->query($query)) { if ($DB->numrows($result)) { + Ajax::createSlidePanel( + 'showSavedSearches', + [ + 'title' => __('Saved searches'), + 'url' => $CFG_GLPI['root_doc'] . '/ajax/savedsearch.php?action=show', + 'icon' => '/pics/menu_config.png', + 'icon_url' => SavedSearch::getSearchURL(), + 'icon_txt' => __('Manage saved searches') + ] + ); echo '
  • '; Ajax::createIframeModalWindow('loadbookmark', - $CFG_GLPI["root_doc"]."/front/bookmark.php?action=load", - ['title' => __('Load a bookmark'), + $CFG_GLPI["root_doc"]."/front/savedsearch.php?action=load", + ['title' => __('Load a saved search'), 'reloadonclose' => true]); - echo ''; - echo ''; - echo ''; + echo ''; + echo ''; + echo ''; echo ''; echo '
  • '; }