From 1d573b94d348836cc6fd4d0181c639a57da7dcd1 Mon Sep 17 00:00:00 2001 From: remicollet Date: Tue, 29 Nov 2011 15:22:52 +0000 Subject: [PATCH] implement getSpecificValueToDisplay() in Example class git-svn-id: https://forge.glpi-project.org/svn/example/trunk@176 349b9182-4a13-0410-896f-e5e9767dd1b3 --- hook.php | 2 +- inc/example.class.php | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hook.php b/hook.php index 672de6f..aa18a03 100644 --- a/hook.php +++ b/hook.php @@ -82,7 +82,7 @@ function plugin_example_getAddSearchOptions($itemtype) { return $sopt; } - +// See also PluginExampleExample::getSpecificValueToDisplay() function plugin_example_giveItem($type,$ID,$data,$num) { $searchopt = &Search::getOptions($type); diff --git a/inc/example.class.php b/inc/example.class.php index 7795e1f..b1ad247 100644 --- a/inc/example.class.php +++ b/inc/example.class.php @@ -171,6 +171,16 @@ class PluginExampleExample extends CommonDBTM { } return true; } + + static function getSpecificValueToDisplay($field, &$values, $options=array()) { + global $LANG; + + switch ($field) { + case 'serial' : + return "S/N: ".$values[$field]; + } + return ''; + } } ?>