Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

glpi / inc / computer.class.php @ 8b28e91d

History | View | Annotate | Download (1.6 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 = $item->getField('vigilo_template');
12
        if ($value === 'NULL') {
13
           $value = '-----';
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::show('PluginVigiloComputer', array("name" => "vigilo_template",
21
                                                     "emptylabel" => $value,
22
                                                     "url" => $CFG_GLPI["root_doc"] . "/plugins/vigilo/ajax/getVTValue.php"));
23
        $ret = array();
24
        $tmp = PluginVigiloVigiloTemplate::getAllTemplates();
25
        echo '</td></tr>';
26
        echo '</table>';
27
        return TRUE;
28
    }
29

    
30
    function getSearchOptions() {
31
        global $CFG_GLPI;
32

    
33
        $computer = new Computer();
34
        $options  = $computer->getSearchOptions();
35

    
36
        $options['vigilo']             = 'Vigilo Template';
37

    
38
        $options['7007']['table']      = 'glpi_computers';
39
        $options['7007']['field']      = 'vigilo_template';
40
        $options['7007']['name']       = 'vigilo_template';
41
        //$options['7007']['searchtype'] = 'equals';
42
        $options['7007']['datatype']   = 'dropdown';
43

    
44
        return $options;
45
    }
46
}