glpi / inc / computer.class.php @ 0d761a49
History | View | Annotate | Download (1.34 KB)
1 |
<?php
|
---|---|
2 |
|
3 |
if (!defined('GLPI_ROOT')) { |
4 |
die("Sorry. You can't access directly to this file"); |
5 |
} |
6 |
|
7 |
class PluginVigiloComputer extends Computer { |
8 |
static function showComputerInfo($item) { |
9 |
global $CFG_GLPI; |
10 |
$templates = PluginVigiloVigiloTemplate::getAllTemplates(); |
11 |
$value = array_search($item->getField('vigilo_template'), $templates); |
12 |
if (empty($value)) { |
13 |
$value = 0; |
14 |
} |
15 |
echo '<table class="tab_cadre_fixe tab_glpi" width="100%">'; |
16 |
echo '<tr class="tab_bg_1"><th colspan="4">Vigilo Template</th></tr>'; |
17 |
echo '<tr class="tab_bg_1">'; |
18 |
echo '<td>Vigilo Template</td>'; |
19 |
echo '<td>'; |
20 |
Dropdown::showFromArray('vigilo_template', $templates, array('value' => $value)); |
21 |
echo '</td></tr>'; |
22 |
echo '</table>'; |
23 |
return TRUE; |
24 |
} |
25 |
|
26 |
function getSearchOptions() { |
27 |
global $CFG_GLPI; |
28 |
|
29 |
$computer = new Computer(); |
30 |
$options = $computer->getSearchOptions(); |
31 |
|
32 |
$options['vigilo'] = 'Vigilo Template'; |
33 |
|
34 |
$options['7007']['table'] = 'glpi_computers'; |
35 |
$options['7007']['field'] = 'vigilo_template'; |
36 |
$options['7007']['name'] = 'vigilo_template'; |
37 |
//$options['7007']['searchtype'] = 'equals';
|
38 |
$options['7007']['datatype'] = 'dropdown'; |
39 |
|
40 |
return $options; |
41 |
} |
42 |
} |