Skip to content

Commit

Permalink
feat(wizard): always show saved searches menu item
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <[email protected]>
  • Loading branch information
btry committed Apr 21, 2020
1 parent bfe91dc commit 1ffcc10
Showing 1 changed file with 20 additions and 36 deletions.
56 changes: 20 additions & 36 deletions inc/wizard.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,42 +127,26 @@ public static function header($title) {
echo '</a></li>';
}

$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 '<li class="' . ($activeMenuItem == self::MENU_BOOKMARKS ? 'plugin_formcreator_selectedMenuItem' : '') . '">';
Ajax::createIframeModalWindow('loadbookmark',
$CFG_GLPI["root_doc"]."/front/savedsearch.php?action=load",
['title' => __('Saved searches'),
'reloadonclose' => true]);
echo '<a href="#" id="showSavedSearchesLink">';
echo '<span class="fa fa-star fc_list_icon" title="'.__('Saved searches').'"></span>';
echo '<span class="label">'.__('Saved searches').'</span>';
echo '</a>';
echo '</li>';
}
}
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 '<li class="' . ($activeMenuItem == self::MENU_BOOKMARKS ? 'plugin_formcreator_selectedMenuItem' : '') . '">';
Ajax::createIframeModalWindow('loadbookmark',
$CFG_GLPI["root_doc"]."/front/savedsearch.php?action=load",
['title' => __('Saved searches'),
'reloadonclose' => true]);
echo '<a href="#" id="showSavedSearchesLink">';
echo '<span class="fa fa-star fc_list_icon" title="'.__('Saved searches').'"></span>';
echo '<span class="label">'.__('Saved searches').'</span>';
echo '</a>';
echo '</li>';

if (isset($CFG_GLPI["helpdesk_doc_url"]) && !empty($CFG_GLPI["helpdesk_doc_url"])) {
echo '<li class="' . ($activeMenuItem == self::MENU_HELP ? 'plugin_formcreator_selectedMenuItem' : '') . 'plugin_formcreator_helpIcon">';
Expand Down

0 comments on commit 1ffcc10

Please sign in to comment.