87 |
87 |
//
|
88 |
88 |
function local_make_query($data, $entityid, $maintenance) {
|
89 |
89 |
$query = "SELECT e.*, e.FK_enduser as entityid, g3.name as client, g4.name as serveur, g4.os_license_number, g4.os_license_id, g4.otherserial, ssh.*,
|
90 |
|
(g5.nbeleves+g5.nbprofs) as nbusers, g5.nbpc as nbpc
|
|
90 |
(g5.nbeleves+g5.nbprofs) as nbusers, g5.nbpc as nbpc, g6.name as contract
|
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 |
93 |
LEFT JOIN glpi_entities AS g3 ON (e.FK_client=g3.ID OR e.FK_enduser=g3.ID)
|
94 |
94 |
LEFT JOIN glpi_computers AS g4 ON e.FK_serveur=g4.ID
|
95 |
|
LEFT JOIN glpi_plugin_anet_epacks_recencement_max AS g5 ON e.FK_serveur=g5.FK_serveur\n";
|
|
95 |
LEFT JOIN glpi_plugin_anet_epacks_recencement_max AS g5 ON e.FK_serveur=g5.FK_serveur
|
|
96 |
LEFT JOIN glpi_contracts AS g6 ON e.FK_contract=g6.ID\n";
|
96 |
97 |
|
97 |
98 |
//WHERE e.Fk_Serveur > '0'\n";
|
98 |
99 |
if($data['name'] == "revendeur" || $data['name'] == "dsi") {
|
... | ... | |
132 |
133 |
//special pour trouver les serveurs existants mais les enduser=0 (abonnement zen pas fait ou autre ?)
|
133 |
134 |
function local_make_query_zarb() {
|
134 |
135 |
$query = "SELECT e.*, e.FK_enduser as entityid, g3.name as client, g4.name as serveur, g4.os_license_number, g4.os_license_id, g4.otherserial, ssh.*,
|
135 |
|
(g5.nbeleves+g5.nbprofs) as nbusers, g5.nbpc as nbpc
|
|
136 |
(g5.nbeleves+g5.nbprofs) as nbusers, g5.nbpc as nbpc, g6.name as contract
|
136 |
137 |
FROM glpi_plugin_anet_epacks AS e
|
137 |
138 |
LEFT JOIN glpi_plugin_anet_epacks_ssh_max AS ssh ON e.FK_serveur=ssh.FK_serveur
|
138 |
139 |
LEFT JOIN glpi_entities AS g3 ON (e.FK_client=g3.ID OR e.FK_enduser=g3.ID)
|
139 |
140 |
LEFT JOIN glpi_computers AS g4 ON e.FK_serveur=g4.ID
|
140 |
|
LEFT JOIN glpi_plugin_anet_epacks_recencement_max AS g5 ON e.FK_serveur=g5.FK_serveur\n";
|
|
141 |
LEFT JOIN glpi_plugin_anet_epacks_recencement_max AS g5 ON e.FK_serveur=g5.FK_serveur
|
|
142 |
LEFT JOIN glpi_contracts AS g6 ON e.FK_contract=g6.ID\n";
|
141 |
143 |
$query .= "WHERE e.FK_enduser='0' AND e.FK_client!='0'\n";
|
142 |
144 |
$query .= "GROUP BY e.FK_serveur
|
143 |
145 |
ORDER BY client ASC
|
... | ... | |
150 |
152 |
//Special pour les "dsi" quand on convertis a la vollee les comptes post-only en dsi pour les animtice
|
151 |
153 |
function local_make_query_dsi($data, $entityid, $maintenance) {
|
152 |
154 |
$query = "SELECT e.*, e.FK_enduser as entityid, g3.name as client, g4.name as serveur, g4.os_license_number, g4.os_license_id, g4.otherserial, ssh.*,
|
153 |
|
(g5.nbeleves+g5.nbprofs) as nbusers, g5.nbpc as nbpc
|
|
155 |
(g5.nbeleves+g5.nbprofs) as nbusers, g5.nbpc as nbpc, g6.name as contract
|
154 |
156 |
FROM glpi_plugin_anet_epacks AS e
|
155 |
157 |
LEFT JOIN glpi_plugin_anet_epacks_ssh_max AS ssh ON e.FK_serveur=ssh.FK_serveur
|
156 |
158 |
LEFT JOIN glpi_entities AS g3 ON (e.FK_client=g3.ID OR e.FK_enduser=g3.ID)
|
157 |
159 |
LEFT JOIN glpi_computers AS g4 ON e.FK_serveur=g4.ID
|
158 |
|
LEFT JOIN glpi_plugin_anet_epacks_recencement_max AS g5 ON e.FK_serveur=g5.FK_serveur\n";
|
|
160 |
LEFT JOIN glpi_plugin_anet_epacks_recencement_max AS g5 ON e.FK_serveur=g5.FK_serveur
|
|
161 |
LEFT JOIN glpi_contracts AS g6 ON e.FK_contract=g6.ID\n";
|
159 |
162 |
|
160 |
163 |
//WHERE e.Fk_Serveur > '0'\n";
|
161 |
164 |
if($data['name'] == "dsi") {
|
... | ... | |
248 |
251 |
<td align=\"left\">" . $data['os_license_id'] . " " . $data['otherserial'] . "<br />" . $data['os_license_number'] . " " . $data['otherserial'] ."</td>
|
249 |
252 |
<td>" . $data['nbpc'] . "</td>
|
250 |
253 |
<td>" . $data['nbusers'] . "</td>
|
251 |
|
<td>
|
252 |
|
</td>
|
|
254 |
<td>" . $data['contract'] . "</td>
|
253 |
255 |
</tr>\n";
|
254 |
256 |
/*
|
255 |
257 |
<a href=\"../../../front/contract.php?contains[0]=" . $data['client'] . "\"><img src=\"img/stock_hand-signed.png\" title=\"Contrat\"></a>
|
... | ... | |
278 |
280 |
|
279 |
281 |
if($enduser == 1) {
|
280 |
282 |
$query = "SELECT e.*, e.FK_enduser as entityid, g3.name as client, g4.name as serveur, g4.os_license_number, g4.os_license_id, g4.otherserial, ssh.*,
|
281 |
|
(sum(g5.nbeleves)+sum(g5.nbprofs)) as nbusers, g5.nbpc as nbpc
|
|
283 |
(sum(g5.nbeleves)+sum(g5.nbprofs)) as nbusers, g5.nbpc as nbpc, g6.name as contract
|
282 |
284 |
FROM glpi_plugin_anet_epacks AS e
|
283 |
285 |
LEFT JOIN glpi_plugin_anet_epacks_ssh_max AS ssh ON e.FK_serveur=ssh.FK_serveur
|
284 |
286 |
LEFT JOIN glpi_entities AS g3 ON (e.FK_client=g3.ID OR e.FK_enduser=g3.ID)
|
285 |
287 |
LEFT JOIN glpi_computers AS g4 ON e.FK_serveur=g4.ID
|
286 |
|
LEFT JOIN glpi_plugin_anet_epacks_recencement_max AS g5 ON e.FK_serveur=g5.FK_serveur\n";
|
|
288 |
LEFT JOIN glpi_plugin_anet_epacks_recencement_max AS g5 ON e.FK_serveur=g5.FK_serveur
|
|
289 |
LEFT JOIN glpi_contracts AS g6 ON e.FK_contract=g6.ID\n";
|
287 |
290 |
//WHERE e.Fk_Serveur > '0'\n";
|
288 |
291 |
|
289 |
292 |
if($maintenance == 0 || $maintenance == 1) {
|
... | ... | |
306 |
309 |
}
|
307 |
310 |
else {
|
308 |
311 |
//LEFT JOIN glpi_entities AS g3 ON e.FK_client=g3.ID OR e.FK_enduser=g3.ID
|
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.*
|
|
312 |
$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.*, g6.name as contract
|
310 |
313 |
FROM glpi_plugin_anet_epacks AS e
|
311 |
314 |
LEFT JOIN glpi_plugin_anet_epacks_ssh_max AS ssh ON e.FK_serveur=ssh.FK_serveur
|
312 |
315 |
LEFT JOIN glpi_entities AS g3 ON (e.FK_client=g3.ID OR e.FK_enduser=g3.ID)
|
313 |
316 |
LEFT JOIN glpi_computers AS g4 ON e.FK_serveur=g4.ID
|
314 |
317 |
LEFT JOIN glpi_plugin_anet_epacks_recencement_max AS g5 ON e.FK_serveur=g5.FK_serveur
|
|
318 |
LEFT JOIN glpi_contracts AS g6 ON e.FK_contract=g6.ID
|
315 |
319 |
WHERE e.FK_enduser='0' AND e.FK_client!='0'
|
316 |
320 |
ORDER BY client\n";
|
317 |
321 |
//print $query;
|
... | ... | |
365 |
369 |
<td align=\"left\">" . $data['os_license_id'] . " " . $data['otherserial'] . "<br />" . $data['os_license_number'] . " " . $data['otherserial'] . "</td>
|
366 |
370 |
<td>" . $data['nbpc'] . "</td>
|
367 |
371 |
<td>" . $data['nbusers'] . "</td>
|
368 |
|
<td>
|
369 |
|
</td>
|
|
372 |
<td>" . $data['contract'] . "</td>
|
370 |
373 |
</tr>\n";
|
371 |
374 |
/*
|
372 |
375 |
<a href=\"../../../front/contract.php?contains[0]=" . $data['client'] . "\"><img src=\"img/stock_hand-signed.png\" title=\"Contrat\"></a>
|