Revision 79397eb3
[#1572] Chargement du champ vigilo_template en ajax
Change-Id: I2874cda44e4f06a0f5f5c6dc3c9081229f73627f
Reviewed-on: https://vigilo-dev.si.c-s.fr/review/2322
Reviewed-by: Francois POIROTTE <francois.poirotte@c-s.fr>
Tested-by: Francois POIROTTE <francois.poirotte@c-s.fr>
Vigilo/VigiloHost.php | ||
---|---|---|
43 | 43 |
if ($template_name && $template_name !== "N/A") { |
44 | 44 |
$this->children[] = new VigiloHostTemplate($this->computer->getField("template_name")); |
45 | 45 |
} |
46 |
/*$refs = array( |
|
47 |
"glpi_operatingsystems" => "operatingsystems_id", |
|
48 |
"glpi_operatingsystemversions" => "operatingsystemversions_id", |
|
49 |
"glpi_operatingsystemservicepacks" => "operatingsystemservicepacks_id", |
|
50 |
); |
|
51 |
|
|
52 |
$model = array(); |
|
53 |
foreach ($refs as $table => $field) { |
|
54 |
$id = $this->computer->fields[$field]; |
|
55 |
$value = Dropdown::getDropdownName($table, $id); |
|
56 |
if ($value !== "" && $value !== null && $value !== " " |
|
57 |
&& $value !== false && $value !== "-----" && $value !== 'N/A' |
|
58 |
) { |
|
59 |
$model[] = $value; |
|
60 |
} |
|
61 |
} |
|
62 |
|
|
63 |
if (!count($model)) { |
|
64 |
$model = "default"; |
|
65 |
} else { |
|
66 |
$model = implode(" - ", $model); |
|
67 |
} |
|
68 |
|
|
69 |
$this->children[] = new VigiloHostTemplate($model);*/ |
|
70 |
|
|
71 | 46 |
|
72 | 47 |
$template_number = $this->computer->getField("vigilo_template"); |
73 | 48 |
if ($template_number !== '0' && $template_number !== 'N/A') { |
Also available in: Unified diff