glpi / src / inc / computer.class.php @ ad6689da
History | View | Annotate | Download (1.52 KB)
1 | 0d761a49 | Romain CHOLLET | <?php
|
---|---|---|---|
2 | |||
3 | 077e4de7 | Francois POIROTTE | class PluginVigiloComputer extends Computer |
4 | { |
||
5 | public static function showComputerInfo($item) |
||
6 | { |
||
7 | 0d761a49 | Romain CHOLLET | global $CFG_GLPI; |
8 | $templates = PluginVigiloVigiloTemplate::getAllTemplates(); |
||
9 | 79397eb3 | Romain CHOLLET | $value = $item->getField('vigilo_template'); |
10 | if ($value === 'NULL') { |
||
11 | 077e4de7 | Francois POIROTTE | $value = '-----'; |
12 | 0d761a49 | Romain CHOLLET | } |
13 | echo '<table class="tab_cadre_fixe tab_glpi" width="100%">'; |
||
14 | echo '<tr class="tab_bg_1"><th colspan="4">Vigilo Template</th></tr>'; |
||
15 | echo '<tr class="tab_bg_1">'; |
||
16 | echo '<td>Vigilo Template</td>'; |
||
17 | echo '<td>'; |
||
18 | 077e4de7 | Francois POIROTTE | Dropdown::show(
|
19 | 'PluginVigiloComputer',
|
||
20 | array(
|
||
21 | "name" => "vigilo_template", |
||
22 | "emptylabel" => $value, |
||
23 | "url" => $CFG_GLPI["root_doc"] . "/plugins/vigilo/ajax/getVTValue.php" |
||
24 | ) |
||
25 | ); |
||
26 | 79397eb3 | Romain CHOLLET | $ret = array(); |
27 | $tmp = PluginVigiloVigiloTemplate::getAllTemplates(); |
||
28 | 0d761a49 | Romain CHOLLET | echo '</td></tr>'; |
29 | echo '</table>'; |
||
30 | 077e4de7 | Francois POIROTTE | return true; |
31 | 0d761a49 | Romain CHOLLET | } |
32 | |||
33 | 077e4de7 | Francois POIROTTE | public function getSearchOptions() |
34 | { |
||
35 | 0d761a49 | Romain CHOLLET | global $CFG_GLPI; |
36 | |||
37 | $computer = new Computer(); |
||
38 | $options = $computer->getSearchOptions(); |
||
39 | |||
40 | $options['vigilo'] = 'Vigilo Template'; |
||
41 | |||
42 | $options['7007']['table'] = 'glpi_computers'; |
||
43 | $options['7007']['field'] = 'vigilo_template'; |
||
44 | $options['7007']['name'] = 'vigilo_template'; |
||
45 | //$options['7007']['searchtype'] = 'equals';
|
||
46 | $options['7007']['datatype'] = 'dropdown'; |
||
47 | |||
48 | return $options; |
||
49 | } |
||
50 | } |