commit f481f9eeb4d2151b203ae40d3b821820372cbdfc
Author: Eric Seigne <eric.seigne@ryxeo.com>
Date:   Wed Dec 1 15:10:43 2010 +0100

    mise en page pour impression mensuelle

diff --git a/css/print.css b/css/print.css
index 2e726ae..3162b30 100644
--- a/css/print.css
+++ b/css/print.css
@@ -1,4 +1,4 @@
-/*
+</*
  * @version $Id: print.css 7763 2009-01-06 18:44:50Z moyo $
  -------------------------------------------------------------------------
  GLPI - Gestionnaire Libre de Parc Informatique
@@ -34,24 +34,25 @@
 /* #################################### */
 /* ###### general ###### */
 /* #################################### */
-  body 
-  {  
-    padding :5px;
-	margin :0;
-	font-size : 12px;
- 	background-color : #FFFFFF;
-	color : #000000;
-	font-family: Verdana,Arial,Helvetica,sans-serif;
 
-  }
+body 
+{  
+    padding :5px;
+    margin :0;
+    background-color : #FFFFFF;
+    color : #000000;
+    font-family: Verdana,Arial,Helvetica,sans-serif;
+}
 
 
-div#header{
-	display: none;
-	}
+div#header
+{
+    display: none;
+}
 
-.over_link {
-	display: none;
+.over_link
+{
+    display: none;
 }
 
 /* #################################### */
@@ -59,170 +60,118 @@ div#header{
 /* #################################### */
 
 
-  a, a:link
-  {
-    font-weight: bold;
-    text-decoration: none;
-  	color : #659900;
-  }
-
-  /*
- a:visited   {
+a, a:link
+{
     font-weight: bold;
     text-decoration: none;
-     color : #659900;
-  }
-*/
-
-  a:hover
-  {
-    color: black;
-  }
+    color : #659900;
+}
 
-  hr{border: 1px solid #cccccc;
-       }
+hr{
+    border: 1px solid #cccccc;
+}
 
 
 /* #################################### */
  /* ###### form ###### */
  /* #################################### */
  
- form  {font-size: 12px;
-  margin:0;
-  padding:0;  }
+form  {
+    margin:0;
+    padding:0;
+}
 
- option {border:1px solid #ccc;
-        background-color:#ffffff;}
+option {
+    border:1px solid #ccc;
+    background-color:#ffffff;
+}
 
- .submit { 
- display:none;
- text-align:center;}
+.submit { 
+    display:none;
+    text-align:center;
+}
   
-select { font-size: 11px;
+select {
 }
 
 
 input.submit {
-        display:none;
-	border:1px solid #659900;
-        background-color:#eeeeee;
-        }
-        
+    display:none;
+    border:1px solid #659900;
+    background-color:#eeeeee;
+}
+
 input.submit:hover {
-        display:none;
-	border:1px solid #659900;
-       background-color:#ffffff;
-        }
+    display:none;
+    border:1px solid #659900;
+    background-color:#ffffff;
+}
 
 .button {
-        display:none;
-	border:1px solid #659900;
-        background-color:#eeeeee;
-        }
+    display:none;
+    border:1px solid #659900;
+    background-color:#eeeeee;
+}
 
 .button:hover{
-        display:none;
-	border:1px solid #659900;
-       background-color:#ffffff;
-        }
+    display:none;
+    border:1px solid #659900;
+    background-color:#ffffff;
+}
 
 
 .calendrier{
-       border:1px solid #659900;
-        background-color:#eeeeee;
-	vertical-align:middle;
-        }
-	
-.calendrier:hover{
-        border:1px solid #659900;
-       background-color:#ffffff;
-        }
-
-
-
-/* #################################### */
- /* ###### table ###### */
-/* #################################### */
- table {   }
-
-  th {  
-    font-size: 12px;
-    font-weight: bold;
-   /* background-color: #FFC65D;*/
-    background-color: #fccc6f;
-	vertical-align:bottom;}
-
-  
-  
-  td { font-size: 11px;}
-
-.tab_cadre{
- -moz-border-radius: 4px;
-  border: 1px solid #cccccc;
+    border:1px solid #659900;
+    background-color:#eeeeee;
+    vertical-align:middle;
 }
 
-.tab_cadre2{
-text-align:center;
- -moz-border-radius: 4px;
-  border: 1px solid #cccccc;
+.calendrier:hover{
+    border:1px solid #659900;
+    background-color:#ffffff;
 }
 
 
-.tab_bg_1 {
-background-color: #ccccc7;
-
+/* #################################### */
+/* ###### table ###### */
+/* #################################### */
+table {
+    border: none;
 }
-.tab_bg_1_2 {
-background-color: #cc5555;
 
+.tab_cadre {
+    border: 1px solid black;
 }
 
-.tab_bg_2 {
-background-color: #d7d7d2;
-
+th {  
+    font-weight: bold;
+    background-color: #fccc6f;
+    vertical-align:bottom;
 }
-
-.tab_bg_2_2 {
-background-color: #cc5555;
+  
+td { 
 
 }
 
-.tab_bg_3 {
-  /*background-color: #eeeeee;*/
-background-color: #e7e7e2;
-
+.tab_bg_3 tr {
+    border-bottom: 1px solid black;
 }  
-
-.tab_resa {
-border:1px dashed #cccccc;
-background-color: #d7d7d2;
-font-size:8px
-}
-
-.tab_resa:hover {
-
-background-color: #ffffff;
-border:1px dotted #000000;
-
-
-}
  
 
-/* #################################### */
- /* ###### login ###### */
-/* #################################### */
-#contenulogin {
-/* a voir je suis pas bien sr  */
-/*height: 100%;*/
-font-family : Verdana,Arial,Helvetica,sans-serif;
-font-size : 12px;
-/*position: relative; *//*ou absolute */
-left: 50%;
-width: 300px;
-/*margin-left: -150px;*/
-color :#659900;
-margin: 0 auto;
-}
+  /* #################################### */
+  /* ###### login ###### */
+  /* #################################### */
+  #contenulogin {
+      /* a voir je suis pas bien sr  */
+      /*height: 100%;*/
+      font-family : Verdana,Arial,Helvetica,sans-serif;
+      /*position: relative; *//*ou absolute */
+      left: 50%;
+      width: 300px;
+      /*margin-left: -150px;*/
+      color :#659900;
+      margin: 0 auto;
+  }
 
 #boxlogin {
 background-color: #FFFFFF;
@@ -242,7 +191,6 @@ padding-bottom:10px;
 
 #boxlogin legend {
 font-family:"Trebuchet MS",Verdana,Geneva,Arial,Helvetica,sans-serif;
-font-size: 16px;
 font-weight: 700;
 background-color: transparent;
 }
@@ -261,7 +209,6 @@ margin-top: 100px;
 
 .sous_logo {
   font-family: arial;
-	font-size: 9px;
 	color: #eeeeee;
 	text-decoration: none;
 	}
@@ -293,8 +240,6 @@ margin-top: 100px;
 
 	
 .menu_title {
-	font-size : 10px;
- 	
 	color : #000000;
 	font-family: Verdana,Arial,Helvetica,sans-serif;
 	font-weight: bold;
@@ -303,55 +248,51 @@ margin-top: 100px;
 	
 		
 .menu a {
-		font-family: "Trebuchet MS", Tahoma, Arial, Helvetica, sans-serif;
-	font-size : 11px;
-	color : #757575;
-	background-color: transparent;
-	text-decoration: none;
-	font-weight: bold;
+    font-family: "Trebuchet MS", Tahoma, Arial, Helvetica, sans-serif;
+    color : #757575;
+    background-color: transparent;
+    text-decoration: none;
+    font-weight: bold;
 }
 
 .menu a:hover {
-font-family: "Trebuchet MS", Tahoma, Arial, Helvetica, sans-serif;
-	font-size : 11px;
-	color : #FFFFFF;
-	text-decoration: none;
-	border: none;
-	font-weight:bold;
-background-color: #339966;
+    font-family: "Trebuchet MS", Tahoma, Arial, Helvetica, sans-serif;
+    color : #FFFFFF;
+    text-decoration: none;
+    border: none;
+    font-weight:bold;
+    background-color: #339966;
 }
 
 
 a.icon_logo img{
-	padding: 7px;
-	margin: 1px;
-	border: 1px solid #aaaaaa;
-	background-color: #ffffff;
-	-moz-border-radius: 5px;
-       	font-size : 12px;
-        font-weight: bold;
+    padding: 7px;
+    margin: 1px;
+    border: 1px solid #aaaaaa;
+    background-color: #ffffff;
+    -moz-border-radius: 5px;
+    font-weig<ht: bold;
 }
 
 
 a.icon_logo:hover img {
-	padding: 7px;
-	margin: 1px;
-	border: 1px solid #999999;
-	background-color: #e4e4e4;
-	-moz-border-radius: 5px;
+    padding: 7px;
+    margin: 1px;
+    border: 1px solid #999999;
+    background-color: #e4e4e4;
+    -moz-border-radius: 5px;
 }
 
 
 
 
 .icon_nav {
-	padding: 4px;
-	margin: 1px;
-	border: 1px solid #aaaaaa;
-	background-color: #C5DAC8;
-	-moz-border-radius: 5px;
-       	font-size : 12px;
-        font-weight: bold;
+    padding: 4px;
+    margin: 1px;
+    border: 1px solid #aaaaaa;
+    background-color: #C5DAC8;
+    -moz-border-radius: 5px;
+    font-weight: bold;
 }
 
 
@@ -378,8 +319,6 @@ a.icon_nav_move:hover img {
 	border: 1px solid #aaaaaa;
 	
 	-moz-border-radius: 5px;
-       	font-size : 9px;
-        
 }
 
 
@@ -394,7 +333,6 @@ a.icon_nav_move:hover img {
 
 .icon_consol {
 	font-family: "Trebuchet MS", Tahoma, Arial, Helvetica, sans-serif;
-	font-size : 12px;
         font-weight: bold;
         padding: 4px;
 	padding-right: 8px;
@@ -432,21 +370,13 @@ padding-bottom: 10px;
 	border: 2px outset #FFC65D;
 	padding: 5px;
 	margin-top: 200px;
-	 clear:both;
-	}
+	clear:both;
+}
 
-	
-	
 .copyright {
-	font-size : 10px;
- 	
 	color :#757575;
 	font-family: Verdana,Arial,Helvetica,sans-serif;
 	font-weight: bold;
-
-
-
-
 }	
 	
 	
@@ -522,7 +452,7 @@ ul#onglet li.actif a {
 /* #################################### */
 /* Raccourcis typo */
 /* #################################### */
-.verdana1 { font-family: Verdana, Arial, Sans, sans-serif; font-size: 10px; }
+.verdana1 { font-family: Verdana, Arial, Sans, sans-serif; }
 
 /* #################################### */
 /* ###### knowledge base / FAQ  ###### */
@@ -581,7 +511,6 @@ p.toolbar
 p.toolbar a
 {
 	
-	font-size: 12px;
 	font-family: Verdana, Arial, sans-serif;
 	padding: 5px;
 	margin: 2px;
@@ -615,5 +544,31 @@ p.toolbar a:hover
 
 .barre { text-decoration : line-through; }
 
+.tab_cadre {
+}
+
+.tab_bg_1 {
+}
+.tab_bg_1_2 {
+}
+
+.tab_bg_2 {
+}
 
+.tab_bg_2_2 {
+}
 
+.tab_bg_3 {
+}
+
+.tab_bg_4 {
+}
+
+.tab_bg_5 {
+}
+
+html { 
+    margin: 0px;
+    font-size: 7pt;
+    font-family: Verdana,Arial,Helvetica,sans-serif;
+}
diff --git a/plugins/anet_epacks/front/plugin_anet_epacks.view_recap_mensuel_rvd.php b/plugins/anet_epacks/front/plugin_anet_epacks.view_recap_mensuel_rvd.php
index b514299..429f3e2 100644
--- a/plugins/anet_epacks/front/plugin_anet_epacks.view_recap_mensuel_rvd.php
+++ b/plugins/anet_epacks/front/plugin_anet_epacks.view_recap_mensuel_rvd.php
@@ -7,14 +7,23 @@ if(!defined('GLPI_ROOT')){
 }
 include_once (GLPI_ROOT . "/inc/includes.php");
 
+//Les dates en francais svp
+setlocale(LC_TIME, "fr_FR");
+
 checkRight("config","w");
 //checkSeveralRightsOr(array("config" => "w", "profile" => "w"));
 
 commonHeader("anet_epacks",$_SERVER['PHP_SELF'],"config","plugins");
+print "<h1>Création du relevé mensuel</h1>";
 
-print "<h1>Relevé mensuel de " . $_GET['year'] . "-" . $_GET['month']  . "</h1>";
+$choix = "";
+for($i = 2009; $i <= date("Y"); $i++) {
+  for($j = 1; $j < 13; $j++) {
+    $choix .= "<a href=\"" . $PHP_SELF . "?year=$i&month=$j\">$j/$i</a> :: ";
+  }
+ }
 
-print "<p>Récapitulatif pour la période : <a href=\"" . $PHP_SELF . "\">Tous</a> - <a href=\"" . $PHP_SELF . "?year=2009&month=12\">Déc. 2009</a> - <a href=\"" . $PHP_SELF . "?year=2010&month=01\">Jan 2010</a> - <a href=\"" . $PHP_SELF . "?year=2010&month=02\">Fev 2010</a> - <a href=\"" . $PHP_SELF . "?year=2010&month=03\">Mars 2010</a>.</p>";
+print "<p>Choix de la période : $choix</p>";
 
 global $DB;
 
@@ -26,6 +35,7 @@ LEFT JOIN glpi_entities AS g2 ON FK_activation=g2.ID
 LEFT JOIN glpi_entities AS g3 ON FK_client=g3.ID
 LEFT JOIN glpi_computers AS g4 ON FK_serveur=g4.ID
 WHERE creation_date>'0000-00-00'
+AND creation_date<'" . $_GET['year'] . "-" . $_GET['month'] . "-00'
 AND FK_clientderyxeo='" . $id . "'
 AND FK_contract>='0'
 ORDER BY activation_date";
@@ -33,22 +43,22 @@ ORDER BY activation_date";
 
   //La liste des epacks clairement hors maintenance
 
-  $txt = "<table class='tab_cadre' width='100%' cellpadding='2'>\n";
+  $txt = "<table width='100%' cellpadding='2'>\n";
   $txt .= "<tr class='tab_bg_3'>
-  <td>Création</td>
-  <td>Activation</td>
-  <td>Activé par</td>
-  <td>Client final</td>
+  <td>Créat. / Activat.</td>
+  <td>Activé</td>
+  <td>Client</td>
   <td>ePack</td>
-</tr>\n";
+  <td>Maintenance</td>
+</tr style=\"border-bottom: 1px solid black;\">\n";
   for($i = 0; $i < $DB->numrows($result2); $i++) {
     $data2=$DB->fetch_array($result2);
     $txt .= "<tr class='tab_bg_3'>\n";
-    $txt .= "  <td>" . $data2['creation_date'] . "</td>
-  <td>" . $data2['activation_date'] . "</td>
-  <td>" . $data2['activation'] . "</td>
-  <td>" . $data2['client'] . " (" . $data2['serveur'] . ")</td>
-  <td>" . $data2['code'] . "<br><br></td>
+    $txt .= "  <td style=\"text-align:left\" nowrap>Cré: " . strftime("%d/%m/%Y", strtotime($data2['creation_date'])) . "<br />Act: " . strftime("%d/%m/%Y", strtotime($data2['activation_date'])) . "</td>
+  <td valign=\"top\">" . $data2['activation'] . "</td>
+  <td valign=\"top\">" . $data2['client'] . " (" . $data2['serveur'] . ")</td>
+  <td valign=\"top\" nowrap>" . $data2['code'] . "</td>
+  <td nowrap></td>
 </tr>\n";
     unset($data2);
   }
@@ -57,7 +67,9 @@ ORDER BY activation_date";
 </tr>\n";
 
   $txt .= "</table>";
- return $txt;
+  if($i == 0)
+    unset($txt);
+  return $txt;
 }
 
 //Le tableau global pour avoir la liste des revendeurs
@@ -65,26 +77,42 @@ ORDER BY activation_date";
 $query = "SELECT e.FK_clientderyxeo,g.name as clientderyxeo FROM glpi_plugin_anet_epacks AS e LEFT JOIN glpi_entities AS g ON FK_clientderyxeo=g.ID WHERE parentID='3' GROUP BY FK_clientderyxeo";
 $result = $DB->query($query) or die($DB->error());
 
-print "<table class='tab_cadre' width='100%' cellpadding='2'>\n";
-print "<tr class='tab_bg_3'>
-  <td>Nom</td>
-  <td>Détails</td>
-  <td>Documents</td>
-</tr>\n";
 for($i = 0; $i < $DB->numrows($result); $i++) {
+
   $data=$DB->fetch_array($result);
 
-  print "<tr class='tab_bg_3'>\n";
-  print "  <td>" . $data['clientderyxeo'] . " </td>
-  <td>" . rvd_get_details($data['FK_clientderyxeo']) . "</td>
-  <td>" . $documents . "<br><br></td>
+  /*
+   print "<table class='tab_cadre' width='100%' cellpadding='2'>\n";
+   print "<tr class='tab_bg_3'>
+   <td>Nom</td>
+   <td>Détails</td>
+   </tr>\n";
+print "<tr class='tab_bg_3'>\n";
+  print "  <td valign=\"top\">" . $data['clientderyxeo'] . " </td>
+  <td valign=\"top\">" . rvd_get_details($data['FK_clientderyxeo']) . "</td>
 </tr>\n";
-  unset($data);
+  */
+  $txt = rvd_get_details($data['FK_clientderyxeo']);
+  if($txt != "") {
+    print "<p style=\"page-break-after: always\">&nbsp;</p>\n";
+    print "  <h2 style=\"text-align: left\"> Relevé mensuel (" . strftime("%B", strtotime($_GET['year'] . "/" . $_GET['month'] . "/01")) . " " . $_GET['year']  . ") pour " . $data['clientderyxeo'] . " </h2>";
+    print $txt;
+    unset($data);
+  }
+  /*
+  print "</table>";
+  */
  }
-print "<tr class='tab_bg_3'>
+
+/*
+print "<p style=\"page-break-after: always\">&nbsp;</p>\n";
+print "  <h2 style=\"text-align: left\"> Synthèse du relevé mensuel de " . $_GET['month'] . "/" . $_GET['year']  . "</h2>";
+print "<table>
+<tr class='tab_bg_3'>
   <td colspan=\"3\"><br />Nombre total de revendeurs: " . $i . "<br /></td>
 </tr>\n";
 print "</table>";
+*/
 
 //Les packs attribués
 //Permet de limiter un peu l'affichage, il faudra faire un système de recherche ou pagination à terme
