From 46005c19ced74baca942553c5781d2d9cd36bfaf Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Tue, 4 Dec 2012 14:46:18 +0000 Subject: [PATCH] Allow the deletion of a shortcut while preserving it from being edited through UI.php SVN:trunk[2499] --- application/shortcut.class.inc.php | 32 +++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/application/shortcut.class.inc.php b/application/shortcut.class.inc.php index 1fdb5d9a1..10114c902 100644 --- a/application/shortcut.class.inc.php +++ b/application/shortcut.class.inc.php @@ -25,13 +25,13 @@ * @license http://opensource.org/licenses/AGPL-3.0 */ -abstract class Shortcut extends cmdbAbstractObject +abstract class Shortcut extends DBObject implements iDisplay { public static function Init() { $aParams = array ( - "category" => "core/cmdb,view_in_gui,application", + "category" => "gui,view_in_gui", "key_type" => "autoincrement", "name_attcode" => "name", "state_attcode" => "", @@ -118,6 +118,32 @@ $('#shortcut_rename_dlg').dialog({ EOF ); } + + // Minimual implementation of iDisplay: to make the shortcut be listable + // + public static function MapContextParam($sContextParam) + { + return (($sContextParam == 'menu') ? null : $sContextParam); + } + + public function GetHilightClass() + { + return HILIGHT_CLASS_NONE; + } + + public static function GetUIPage() + { + return ''; + } + + function DisplayDetails(WebPage $oPage, $bEditMode = false) + { + } + + function DisplayBareProperties(WebPage $oPage, $bEditMode = false, $sPrefix = '', $aExtraParams = array()) + { + } + // End of the minimal implementation of iDisplay } class ShortcutOQL extends Shortcut @@ -126,7 +152,7 @@ class ShortcutOQL extends Shortcut { $aParams = array ( - "category" => "core/cmdb,view_in_gui,application", + "category" => "gui,view_in_gui", "key_type" => "autoincrement", "name_attcode" => "name", "state_attcode" => "",