Change color depend of states_id
This commit is contained in:
@@ -15,6 +15,8 @@ class PluginRemotesupportRemotesupport extends CommonDBTM
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$statusids = self::getStatusArray();
|
||||||
|
|
||||||
if ($config["fusion"] == true && $config["easy_novnc"] == true) {
|
if ($config["fusion"] == true && $config["easy_novnc"] == true) {
|
||||||
$pfInventoryComputerComputer = new PluginFusioninventoryInventoryComputerComputer();
|
$pfInventoryComputerComputer = new PluginFusioninventoryInventoryComputerComputer();
|
||||||
$a_computerextend = $pfInventoryComputerComputer->hasAutomaticInventory($item->getID());
|
$a_computerextend = $pfInventoryComputerComputer->hasAutomaticInventory($item->getID());
|
||||||
@@ -35,7 +37,9 @@ class PluginRemotesupportRemotesupport extends CommonDBTM
|
|||||||
echo '<tr class="tab_bg_1">';
|
echo '<tr class="tab_bg_1">';
|
||||||
echo '<td>';
|
echo '<td>';
|
||||||
|
|
||||||
$url = "<a target=\"_blank\" href=\"" . $href . "\"><li class=\"document\"><i class=\"fa fa-laptop-medical\"></i>" . $name . "</li></a>";
|
$url = "<a target=\"_blank\" href=\"" . $href . "\"><li class=\"document\" ".
|
||||||
|
$stastusids[$item->getID()] == 'Offline' ? "style=\"background-color: red\"" : "".
|
||||||
|
"><i class=\"fa fa-laptop-medical\"></i>" . $name . "</li></a>";
|
||||||
|
|
||||||
if ($url != "") {
|
if ($url != "") {
|
||||||
echo "<div><ul class=\"timeline_choices\"><h2>VNC connect : </h2>";
|
echo "<div><ul class=\"timeline_choices\"><h2>VNC connect : </h2>";
|
||||||
@@ -78,6 +82,22 @@ class PluginRemotesupportRemotesupport extends CommonDBTM
|
|||||||
return $contactids;
|
return $contactids;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getStatusArray()
|
||||||
|
{
|
||||||
|
global $DB;
|
||||||
|
|
||||||
|
$st = self::getContactArray();
|
||||||
|
|
||||||
|
$req = $DB->request('glpi_computers', ['FIELDS' => ['glpi_computers' => ['id', 'states_id']]]);
|
||||||
|
|
||||||
|
$statusids = [];
|
||||||
|
while ($ret = $req->next()) {
|
||||||
|
$stastusids[$ret["id"]] = $ret["states_id"] == $st["Offline"] ? "Offline" : "Online";
|
||||||
|
}
|
||||||
|
|
||||||
|
return $statusids;
|
||||||
|
}
|
||||||
|
|
||||||
public static function cronRemotesupport($task)
|
public static function cronRemotesupport($task)
|
||||||
{
|
{
|
||||||
global $DB;
|
global $DB;
|
||||||
|
|||||||
Reference in New Issue
Block a user