commit 2a106d8b92f22efb96b77db136e2881669b6ee12
Author: Eric Seigne <eric.seigne@ryxeo.com>
Date:   Fri May 28 16:48:07 2010 +0200

    ajout des ports sur la liste

diff --git a/plugins/anet_epacks/front/plugin_anet_epacks.view_array_recap.php b/plugins/anet_epacks/front/plugin_anet_epacks.view_array_recap.php
index 491574f..a4d8ef1 100644
--- a/plugins/anet_epacks/front/plugin_anet_epacks.view_array_recap.php
+++ b/plugins/anet_epacks/front/plugin_anet_epacks.view_array_recap.php
@@ -86,11 +86,11 @@ include_once (GLPI_ROOT . "/inc/includes.php");
 //
 //
 function local_make_query($data, $entityid, $maintenance) {
-  $query = "SELECT e.*, e.FK_enduser as entityid, g3.name as client, g4.name as serveur, g4.os_license_number, g4.os_license_id, ssh.*,
+  $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.*,
 (g5.nbeleves+g5.nbprofs) as nbusers, g5.nbpc as nbpc
 FROM glpi_plugin_anet_epacks AS e
 LEFT JOIN glpi_plugin_anet_epacks_ssh_max AS ssh ON e.FK_serveur=ssh.FK_serveur
-LEFT JOIN glpi_entities AS g3 ON e.FK_client=g3.ID
+LEFT JOIN glpi_entities AS g3 ON e.FK_client=g3.ID OR e.FK_enduser=g3.ID
 LEFT JOIN glpi_computers AS g4 ON e.FK_serveur=g4.ID
 LEFT JOIN glpi_plugin_anet_epacks_recencement_max AS g5 ON e.FK_serveur=g5.FK_serveur\n";
 
@@ -152,8 +152,10 @@ function local_make_array($q,$maintenance) {
   $total_nbusers = 0;
   //La liste des entites qu'on affiche
   $tab_deja_affiche = array();
-    
+  $num_debut_ligne = 0;
+
   for($i = 0; $i < $DB->numrows($result); $i++) {
+    $num_debut_ligne++;
     $data=$DB->fetch_array($result);
     $tab_deja_affiche[] = $data['entityid'];
     $ssh_dateLastOK = "";
@@ -181,15 +183,15 @@ function local_make_array($q,$maintenance) {
     print "<tr class='tab_bg_2'>
   <td align=\"left\">\n";
     if($data['entityid'] > 0) {
-      print "    " . ($i+1) . ". <a href=\"../../manageentity/index.php?active_entity=" . $data['entityid'] . "\">" . $data['client'] . ": " . $data['serveur'] . "</a>\n";
+      print "    " . $num_debut_ligne . ". <a href=\"../../manageentity/index.php?active_entity=" . $data['entityid'] . "\">" . $data['client'] . ": " . $data['serveur'] . "</a>\n";
     }
     else {
-      print "    " . ($i+1) . ". " . $data['client'] . ": " . $data['serveur'] . "(abonnement zen jamais activé)\n";
+      print "    " . $num_debut_ligne . ". " . $data['client'] . ": " . $data['serveur'] . "(abonnement zen jamais activé)\n";
     }
     print "  </td>
   <td>" . $ssh_status . "</td>
   <td>" . $data['sshdate'] . $ssh_dateLastOK . "</td>
-  <td align=\"left\">" . $data['os_license_id'] . "<br />" . $data['os_license_number'] . "</td>
+  <td align=\"left\">" . $data['os_license_id'] . " " . $data['otherserial'] . "<br />" . $data['os_license_number'] . " " . $data['otherserial'] ."</td>
   <td>" . $data['nbpc'] . "</td>
   <td>" . $data['nbusers'] . "</td>
   <td>
@@ -219,11 +221,11 @@ function local_make_array($q,$maintenance) {
   }
   //$query = "SELECT ID FROM glpi_entities WHERE parentID='" . $entityparent . "'";
   
-  $query = "SELECT e.*, e.FK_enduser as entityid, g3.name as client, g4.name as serveur, g4.os_license_number, g4.os_license_id, ssh.*,
+  $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.*,
 (sum(g5.nbeleves)+sum(g5.nbprofs)) as nbusers, g5.nbpc as nbpc
 FROM glpi_plugin_anet_epacks AS e
 LEFT JOIN glpi_plugin_anet_epacks_ssh_max AS ssh ON e.FK_serveur=ssh.FK_serveur
-LEFT JOIN glpi_entities AS g3 ON e.FK_client=g3.ID
+LEFT JOIN glpi_entities AS g3 ON e.FK_client=g3.ID OR e.FK_enduser=g3.ID
 LEFT JOIN glpi_computers AS g4 ON e.FK_serveur=g4.ID
 LEFT JOIN glpi_plugin_anet_epacks_recencement_max AS g5 ON e.FK_serveur=g5.FK_serveur\n";
   //WHERE e.Fk_Serveur > '0'\n";
@@ -248,6 +250,7 @@ LIMIT 500;";
   $result = $DB->query($query) or die($DB->error());
   
   for($i = 0; $i < $DB->numrows($result); $i++) {
+    $num_debut_ligne++;
     $data=$DB->fetch_array($result);
     $ssh_dateLastOK = "";
     if(! in_array($data['entityid'],$tab_deja_affiche)) {
@@ -276,15 +279,15 @@ LIMIT 500;";
       print "<tr class='tab_bg_2'>
   <td align=\"left\">\n";
       if($data['entityid'] > 0) {
-	print "    " . ($i+1) . ". <a href=\"../../manageentity/index.php?active_entity=" . $data['entityid'] . "\">" . $data['client'] . ": " . $data['serveur'] . "</a>\n";
+	print "    " . $num_debut_ligne . ". <a href=\"../../manageentity/index.php?active_entity=" . $data['entityid'] . "\">" . $data['client'] . ": " . $data['serveur'] . "</a>\n";
       }
       else {
-	print "    " . ($i+1) . ". " . $data['client'] . ": " . $data['serveur'] . "(abonnement zen jamais activé)\n";
+	print "    " . $num_debut_ligne . ". " . $data['client'] . ": " . $data['serveur'] . "(abonnement zen jamais activé)\n";
       }
       print "  </td>
   <td>" . $ssh_status . "</td>
   <td>" . $data['sshdate'] . $ssh_dateLastOK . "</td>
-  <td align=\"left\">" . $data['os_license_id'] . "<br />" . $data['os_license_number'] . "</td>
+  <td align=\"left\">" . $data['os_license_id'] . " " . $data['otherserial'] . "<br />" . $data['os_license_number'] . " " . $data['otherserial'] . "</td>
   <td>" . $data['nbpc'] . "</td>
   <td>" . $data['nbusers'] . "</td>
   <td>
@@ -327,7 +330,7 @@ $glpiid = $_SESSION['glpiID'];
 
 global $DB;
 
-$query = "SELECT glpi_profiles.name AS name,glpi_users_profiles.FK_entities as FK_entities FROM glpi_profiles,glpi_users_profiles,glpi_users WHERE glpi_users_profiles.FK_users='" . $glpiid . "' AND glpi_users_profiles.FK_profiles=glpi_profiles.ID AND glpi_users.FK_entities=glpi_users_profiles.FK_entities GROUP BY FK_entities";
+$query = "SELECT glpi_profiles.name AS name,glpi_users_profiles.FK_entities as FK_entities FROM glpi_profiles,glpi_users_profiles,glpi_users WHERE glpi_users_profiles.FK_users='" . $glpiid . "' AND glpi_users_profiles.FK_profiles=glpi_profiles.ID GROUP BY FK_entities";
 
 //print $query;
 //exit;
