mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-05-04 18:08:42 +02:00
Updated to reflect fix https://github.com/glpi-project/glpi/issues/801
Updated to reflect commit 0e2cf13655
This commit is contained in:
parent
1db4385559
commit
10b63cf645
@ -128,6 +128,7 @@ class PluginExampleShowtabitem {
|
||||
* @param array $params is an array like following
|
||||
* array( 'item', 'options')
|
||||
* where 'item' is the object to show (like 'Ticket', 'TicketTask', ...),
|
||||
* BEWARE that sometimes it can be an array of data and not an object (ex: for solution item)
|
||||
* and 'options' are options like following
|
||||
* if item is a main object like a ticket, change, problem, ... then it contains
|
||||
* array( 'id' )
|
||||
@ -140,6 +141,7 @@ class PluginExampleShowtabitem {
|
||||
* Note: you may pass datas to post_show_item using the $param['options'] array
|
||||
*/
|
||||
static function pre_show_item($params) {
|
||||
if(!is_array($params['item'])) {
|
||||
switch( $params['item']->getType() ) {
|
||||
case 'Ticket':
|
||||
//echo 'test' ;
|
||||
@ -151,6 +153,9 @@ class PluginExampleShowtabitem {
|
||||
//echo 'test' ;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// here we are going to view a Solution
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -170,6 +175,7 @@ class PluginExampleShowtabitem {
|
||||
* Note: you may get datas from pre_show_item using the $param['options'] array
|
||||
*/
|
||||
static function post_show_item($params) {
|
||||
if(!is_array($params['item'])) {
|
||||
switch( $params['item']->getType() ) {
|
||||
case 'Ticket':
|
||||
//echo 'test' ;
|
||||
@ -181,6 +187,9 @@ class PluginExampleShowtabitem {
|
||||
//echo 'test' ;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// here we are going to view a Solution
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user