Révision f4699b2f
plugins/anet_epacks/front/plugin_anet_epacks.view_array_recap.php | ||
---|---|---|
90 | 90 |
(g5.nbeleves+g5.nbprofs) as nbusers, g5.nbpc as nbpc |
91 | 91 |
FROM glpi_plugin_anet_epacks AS e |
92 | 92 |
LEFT JOIN glpi_plugin_anet_epacks_ssh_max AS ssh ON e.FK_serveur=ssh.FK_serveur |
93 |
LEFT JOIN glpi_entities AS g3 ON e.FK_client=g3.ID OR e.FK_enduser=g3.ID
|
|
93 |
LEFT JOIN glpi_entities AS g3 ON e.FK_client=g3.ID |
|
94 | 94 |
LEFT JOIN glpi_computers AS g4 ON e.FK_serveur=g4.ID |
95 | 95 |
LEFT JOIN glpi_plugin_anet_epacks_recencement_max AS g5 ON e.FK_serveur=g5.FK_serveur\n"; |
96 | 96 |
|
... | ... | |
135 | 135 |
(g5.nbeleves+g5.nbprofs) as nbusers, g5.nbpc as nbpc |
136 | 136 |
FROM glpi_plugin_anet_epacks AS e |
137 | 137 |
LEFT JOIN glpi_plugin_anet_epacks_ssh_max AS ssh ON e.FK_serveur=ssh.FK_serveur |
138 |
LEFT JOIN glpi_entities AS g3 ON e.FK_client=g3.ID OR e.FK_enduser=g3.ID
|
|
138 |
LEFT JOIN glpi_entities AS g3 ON e.FK_client=g3.ID |
|
139 | 139 |
LEFT JOIN glpi_computers AS g4 ON e.FK_serveur=g4.ID |
140 | 140 |
LEFT JOIN glpi_plugin_anet_epacks_recencement_max AS g5 ON e.FK_serveur=g5.FK_serveur\n"; |
141 | 141 |
$query .= "WHERE e.FK_enduser='0' AND e.FK_client!='0'\n"; |
... | ... | |
153 | 153 |
(g5.nbeleves+g5.nbprofs) as nbusers, g5.nbpc as nbpc |
154 | 154 |
FROM glpi_plugin_anet_epacks AS e |
155 | 155 |
LEFT JOIN glpi_plugin_anet_epacks_ssh_max AS ssh ON e.FK_serveur=ssh.FK_serveur |
156 |
LEFT JOIN glpi_entities AS g3 ON e.FK_client=g3.ID OR e.FK_enduser=g3.ID
|
|
156 |
LEFT JOIN glpi_entities AS g3 ON e.FK_client=g3.ID |
|
157 | 157 |
LEFT JOIN glpi_computers AS g4 ON e.FK_serveur=g4.ID |
158 | 158 |
LEFT JOIN glpi_plugin_anet_epacks_recencement_max AS g5 ON e.FK_serveur=g5.FK_serveur\n"; |
159 | 159 |
|
... | ... | |
239 | 239 |
$s .= " " . $num_debut_ligne . ". <a href=\"../../manageentity/index.php?active_entity=" . $data['entityid'] . "\">" . $data['client'] . ": " . $data['serveur'] . "</a>\n"; |
240 | 240 |
} |
241 | 241 |
else { |
242 |
$s .= " " . $num_debut_ligne . ". " . $data['client'] . ": " . $data['serveur'] . "(abonnement zen jamais activé)\n";
|
|
242 |
$s .= " " . $num_debut_ligne . ". " . $data['client'] . ": " . $data['serveur'] . "(abonnement zen jamais activé, serveur fantôme ?)\n";
|
|
243 | 243 |
} |
244 | 244 |
|
245 | 245 |
$s .= " </td> |
... | ... | |
281 | 281 |
(sum(g5.nbeleves)+sum(g5.nbprofs)) as nbusers, g5.nbpc as nbpc |
282 | 282 |
FROM glpi_plugin_anet_epacks AS e |
283 | 283 |
LEFT JOIN glpi_plugin_anet_epacks_ssh_max AS ssh ON e.FK_serveur=ssh.FK_serveur |
284 |
LEFT JOIN glpi_entities AS g3 ON e.FK_client=g3.ID OR e.FK_enduser=g3.ID
|
|
284 |
LEFT JOIN glpi_entities AS g3 ON e.FK_client=g3.ID |
|
285 | 285 |
LEFT JOIN glpi_computers AS g4 ON e.FK_serveur=g4.ID |
286 | 286 |
LEFT JOIN glpi_plugin_anet_epacks_recencement_max AS g5 ON e.FK_serveur=g5.FK_serveur\n"; |
287 | 287 |
//WHERE e.Fk_Serveur > '0'\n"; |
... | ... | |
305 | 305 |
LIMIT 500;"; |
306 | 306 |
} |
307 | 307 |
else { |
308 |
//LEFT JOIN glpi_entities AS g3 ON e.FK_client=g3.ID OR e.FK_enduser=g3.ID |
|
308 | 309 |
$query = "SELECT e.*, e.FK_client as entityid, g3.name as client, g4.name as serveur, g4.os_license_number, g4.os_license_id, g4.otherserial, ssh.* |
309 | 310 |
FROM glpi_plugin_anet_epacks AS e |
310 | 311 |
LEFT JOIN glpi_plugin_anet_epacks_ssh_max AS ssh ON e.FK_serveur=ssh.FK_serveur |
311 |
LEFT JOIN glpi_entities AS g3 ON e.FK_client=g3.ID OR e.FK_enduser=g3.ID
|
|
312 |
LEFT JOIN glpi_entities AS g3 ON e.FK_client=g3.ID |
|
312 | 313 |
LEFT JOIN glpi_computers AS g4 ON e.FK_serveur=g4.ID |
313 | 314 |
LEFT JOIN glpi_plugin_anet_epacks_recencement_max AS g5 ON e.FK_serveur=g5.FK_serveur |
314 | 315 |
WHERE e.FK_enduser='0' AND e.FK_client!='0' |
... | ... | |
355 | 356 |
$s .= " " . $num_debut_ligne . ". <a href=\"../../manageentity/index.php?active_entity=" . $data['entityid'] . "\">" . $data['client'] . ": " . $data['serveur'] . "</a>\n"; |
356 | 357 |
} |
357 | 358 |
else { |
358 |
$s .= " " . $num_debut_ligne . ". " . $data['client'] . ": " . $data['serveur'] . "(abonnement zen jamais activé)\n"; |
|
359 |
$s .= " " . $num_debut_ligne . ". " . $data['client'] . ": " . $data['serveur'] . "(abonnement zen jamais activé, serveur fantôme ?)\n";
|
|
359 | 360 |
} |
361 |
|
|
360 | 362 |
$s .= " </td> |
361 | 363 |
<td>" . $ssh_status . "</td> |
362 | 364 |
<td>" . $data['sshdate'] . $ssh_dateLastOK . "</td> |
... | ... | |
434 | 436 |
//print $query; |
435 | 437 |
//exit; |
436 | 438 |
|
437 |
$total_nbpc_maint = 0; |
|
438 |
$total_nbusers_maint = 0; |
|
439 |
$total_nbpc_maint = 0;
|
|
440 |
$total_nbusers_maint = 0;
|
|
439 | 441 |
$total_nbpc_hors_maint = 0; |
440 | 442 |
$total_nbusers_hors_maint = 0; |
441 |
$tab_deja_affiche = array(); |
|
443 |
$tab_deja_affiche = array(); |
|
444 |
$num_debut_ligne_maint = 0; |
|
445 |
$num_debut_ligne_horsmaint = 0; |
|
442 | 446 |
|
443 | 447 |
$result = $DB->query($query); |
444 | 448 |
if($result) { |
445 | 449 |
while($data=$DB->fetch_array($result)) { |
446 | 450 |
$entityid = $data['FK_entities']; |
447 | 451 |
if($data['name'] == "revendeur" || $data['name'] == "dsi" || $data['name'] == "super-admin") { |
452 |
$num_debut_ligne = $num_debut_ligne_maint; |
|
448 | 453 |
//print $query; |
449 | 454 |
$entityid = $data['FK_entities']; |
450 | 455 |
|
451 |
//print $query; |
|
452 |
//exit; |
|
453 |
|
|
454 | 456 |
$maintenance = 0; |
455 | 457 |
$querySM = local_make_query($data, $entityid, $maintenance); |
456 | 458 |
$str_sous_maint .= local_make_array($querySM,$maintenance); |
... | ... | |
460 | 462 |
if($querySM != "") |
461 | 463 |
$str_sous_maint .= local_make_array($querySM,$maintenance); |
462 | 464 |
|
465 |
$num_debut_ligne_maint = $num_debut_ligne; |
|
463 | 466 |
$num_debut_ligne = 0; |
464 | 467 |
$maintenance = -1; |
465 | 468 |
$queryHM = local_make_query($data, $entityid, $maintenance); |
... | ... | |
468 | 471 |
//et maintenant les epacks dont le FK_enduser=0 mais FK_serveur!=0 |
469 | 472 |
//Uniquement pour ryxeo |
470 | 473 |
if($data['name'] == "super-admin") { |
474 |
$num_debut_ligne_horsmaint = $num_debut_ligne; |
|
471 | 475 |
$num_debut_ligne = 0; |
472 | 476 |
$queryZarb = local_make_query_zarb(); |
473 | 477 |
//print "<pre>$queryZarb</pre>"; |
... | ... | |
476 | 480 |
} |
477 | 481 |
} |
478 | 482 |
} |
479 |
|
|
483 |
|
|
480 | 484 |
print "<h1>Tableau récapitulatif de vos serveurs sous maintenance</h1>"; |
481 | 485 |
print local_make_array_header(); |
482 | 486 |
print $str_sous_maint; |
483 | 487 |
print local_make_array_footer($total_nbpc_maint,$total_nbusers_maint); |
484 |
|
|
488 |
|
|
485 | 489 |
print "<h1>Tableau récapitulatif de vos serveurs hors maintenance</h1>"; |
486 | 490 |
print local_make_array_header(); |
487 | 491 |
print $str_hors_maint; |
488 | 492 |
print local_make_array_footer($total_nbpc_hors_maint,$total_nbusers_hors_maint); |
489 |
|
|
493 |
|
|
490 | 494 |
//Uniquement pour ryxeo |
491 | 495 |
if($str_zarb != "") { |
492 | 496 |
print "<h1>Tableau récapitulatif des serveurs étranges [dont la maintenance n'a pas été activée (abonnement zen sur webadmin) ??]</h1>"; |
... | ... | |
494 | 498 |
print $str_zarb; |
495 | 499 |
print local_make_array_footer(0,0); |
496 | 500 |
} |
497 |
|
|
501 |
|
|
498 | 502 |
commonFooter(); |
499 | 503 |
exit; |
500 | 504 |
} |
Formats disponibles : Unified diff