Allow the deletion of a shortcut while preserving it from being edited through UI.php

SVN:trunk[2499]
This commit is contained in:
Romain Quetiez
2012-12-04 14:46:18 +00:00
parent 442c0d6956
commit 46005c19ce

View File

@@ -25,13 +25,13 @@
* @license http://opensource.org/licenses/AGPL-3.0 * @license http://opensource.org/licenses/AGPL-3.0
*/ */
abstract class Shortcut extends cmdbAbstractObject abstract class Shortcut extends DBObject implements iDisplay
{ {
public static function Init() public static function Init()
{ {
$aParams = array $aParams = array
( (
"category" => "core/cmdb,view_in_gui,application", "category" => "gui,view_in_gui",
"key_type" => "autoincrement", "key_type" => "autoincrement",
"name_attcode" => "name", "name_attcode" => "name",
"state_attcode" => "", "state_attcode" => "",
@@ -118,6 +118,32 @@ $('#shortcut_rename_dlg').dialog({
EOF 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 class ShortcutOQL extends Shortcut
@@ -126,7 +152,7 @@ class ShortcutOQL extends Shortcut
{ {
$aParams = array $aParams = array
( (
"category" => "core/cmdb,view_in_gui,application", "category" => "gui,view_in_gui",
"key_type" => "autoincrement", "key_type" => "autoincrement",
"name_attcode" => "name", "name_attcode" => "name",
"state_attcode" => "", "state_attcode" => "",