commit e528a5035cdac95270c45970011a66d3eb77a412
Author: Eric Seigne <eric.seigne@ryxeo.com>
Date:   Fri Aug 6 10:52:29 2010 +0200

    amelioration du tableau composants

diff --git a/plugins/pdf/inc/plugin_pdf.functions.php b/plugins/pdf/inc/plugin_pdf.functions.php
index efdc5c7..e4d023a 100644
--- a/plugins/pdf/inc/plugin_pdf.functions.php
+++ b/plugins/pdf/inc/plugin_pdf.functions.php
@@ -400,112 +400,118 @@ function plugin_pdf_device($tab,$width,$ID,$type){
 		$spec_x = 468;
 		
 		$pdf->saveState();
-		$pdf->setColor(0.95,0.95,0.95);
-		$pdf->filledRectangle(25,($start_tab-25)-(20*$i),15,15);
-		$pdf->filledRectangle(45,($start_tab-25)-(20*$i),75,15);
-		$pdf->filledRectangle(125,($start_tab-25)-(20*$i),230,15);
-		$pdf->filledRectangle(360,($start_tab-25)-(20*$i),101,15);
-		$pdf->filledRectangle(466,($start_tab-25)-(20*$i),105,15);
+
+		//erics pour avoir la couleur une ligne sur deux
+		if($i%2){
+		  $pdf->setColor(0.95,0.95,0.95);
+		}
+		else {
+		  $pdf->setColor(1,1,1);
+		}
+		
+		//$pdf->setColor(0.95,0.95,0.95);
+		//un seul rectangle qui fait toute la ligne
+		$pdf->filledRectangle(25,$start_tab-20-(15*$i),$width-50,15);
 		$pdf->restoreState();
 		
 		switch($device->devtype) {
 		case HDD_DEVICE :
-			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
-			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][1]));
-			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
-			$pdf->addTextWrap($spec_x,($start_tab-20)-(20*$i),99,9,utf8_decode('<b><i>'.$LANG["device_hdd"][4].' :</i></b> '.$val["specificity"]));
-			if (!empty($device->fields["rpm"]))	$pdf->addTextWrap($other_x,($start_tab-20)-(20*$i),103,9,utf8_decode('<b><i>'.$LANG["device_hdd"][0].' :</i></b> '.$device->fields["rpm"]));
-			else if (!empty($device->fields["interface"])) $pdf->addTextWrap($other_x,($start_tab-20)-(20*$i),103,9,utf8_decode('<b><i>'.$LANG["common"][65].' :</i></b> '.plugin_pdf_getDropdownName("glpi_dropdown_interface",$device->fields["interface"])));
-			else if (!empty($device->fields["cache"])) $pdf->addTextWrap($other_x,($start_tab-20)-(20*$i),103,9,utf8_decode('<b><i>'.$LANG["device_hdd"][1].' :</i></b> '.$device->fields["cache"]));
+			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
+			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][1]));
+			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
+			$pdf->addTextWrap($spec_x,($start_tab-15)-(15*$i),99,9,utf8_decode('<b><i>'.$LANG["device_hdd"][4].' :</i></b> '.$val["specificity"]));
+			if (!empty($device->fields["rpm"]))	$pdf->addTextWrap($other_x,($start_tab-15)-(15*$i),103,9,utf8_decode('<b><i>'.$LANG["device_hdd"][0].' :</i></b> '.$device->fields["rpm"]));
+			else if (!empty($device->fields["interface"])) $pdf->addTextWrap($other_x,($start_tab-15)-(15*$i),103,9,utf8_decode('<b><i>'.$LANG["common"][65].' :</i></b> '.plugin_pdf_getDropdownName("glpi_dropdown_interface",$device->fields["interface"])));
+			else if (!empty($device->fields["cache"])) $pdf->addTextWrap($other_x,($start_tab-15)-(15*$i),103,9,utf8_decode('<b><i>'.$LANG["device_hdd"][1].' :</i></b> '.$device->fields["cache"]));
 			break;
 		case GFX_DEVICE :
-			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
-			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][2]));
-			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
-			if (!empty($device->fields["ram"])) $pdf->addTextWrap($spec_x,($start_tab-20)-(20*$i),99,9,utf8_decode('<b><i>'.$LANG["device_gfxcard"][0].' :</i></b> '.$device->fields["ram"]));
-			if (!empty($device->fields["interface"])) $pdf->addTextWrap($other_x,($start_tab-20)-(20*$i),103,9,utf8_decode('<b><i>'.$LANG["common"][65].' :</i></b> '.$device->fields["interface"]));
+			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
+			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][2]));
+			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
+			if (!empty($device->fields["ram"])) $pdf->addTextWrap($spec_x,($start_tab-15)-(15*$i),99,9,utf8_decode('<b><i>'.$LANG["device_gfxcard"][0].' :</i></b> '.$device->fields["ram"]));
+			if (!empty($device->fields["interface"])) $pdf->addTextWrap($other_x,($start_tab-15)-(15*$i),103,9,utf8_decode('<b><i>'.$LANG["common"][65].' :</i></b> '.$device->fields["interface"]));
 			break;
 		case NETWORK_DEVICE :
-			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
-			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][3]));
-			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
-			$pdf->addTextWrap($spec_x,($start_tab-20)-(20*$i),99,9,utf8_decode('<b><i>'.$LANG["networking"][15].' :</i></b> '.$val["specificity"]));
-			if (!empty($device->fields["bandwidth"])) $pdf->addTextWrap($other_x,($start_tab-20)-(20*$i),103,9,utf8_decode('<b><i>'.$LANG["device_iface"][0].' :</i></b> '.$device->fields["bandwidth"]));
+			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
+			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][3]));
+			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
+			$pdf->addTextWrap($spec_x,($start_tab-15)-(15*$i),99,9,utf8_decode('<b><i>'.$LANG["networking"][15].' :</i></b> '.$val["specificity"]));
+			if (!empty($device->fields["bandwidth"])) $pdf->addTextWrap($other_x,($start_tab-15)-(15*$i),103,9,utf8_decode('<b><i>'.$LANG["device_iface"][0].' :</i></b> '.$device->fields["bandwidth"]));
 			break;
 		case MOBOARD_DEVICE :
-			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
-			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][5]));
-			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
-			if (!empty($device->fields["chipset"])) $pdf->addTextWrap($spec_x,($start_tab-20)-(20*$i),99,9,utf8_decode('<b><i>'.$LANG["device_moboard"][0].' :</i></b> '.$device->fields["chipset"]));
+			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
+			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][5]));
+			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
+			if (!empty($device->fields["chipset"])) $pdf->addTextWrap($spec_x,($start_tab-15)-(15*$i),99,9,utf8_decode('<b><i>'.$LANG["device_moboard"][0].' :</i></b> '.$device->fields["chipset"]));
 			break;
 		case PROCESSOR_DEVICE :
-			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
-			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][4]));
-			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
-			$pdf->addTextWrap($spec_x,($start_tab-20)-(20*$i),99,9,utf8_decode('<b><i>'.$LANG["device_ram"][1].' :</i></b> '.$val["specificity"]));
+			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
+			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][4]));
+			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
+			$pdf->addTextWrap($spec_x,($start_tab-15)-(15*$i),99,9,utf8_decode('<b><i>'.$LANG["device_ram"][1].' :</i></b> '.$val["specificity"]));
 			break;
 		case RAM_DEVICE :
-			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
-			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][6]));
-			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
-			$pdf->addTextWrap($spec_x,($start_tab-20)-(20*$i),99,9,utf8_decode('<b><i>'.$LANG["monitors"][21].' :</i></b> '.$val["specificity"]));
+			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
+			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][6]));
+			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
+			$pdf->addTextWrap($spec_x,($start_tab-15)-(15*$i),99,9,utf8_decode('<b><i>'.$LANG["monitors"][21].' :</i></b> '.$val["specificity"]));
 			if (empty($device->fields["frequence"])) {
-				if (!empty($device->fields["type"])) $pdf->addTextWrap($other_x,($start_tab-20)-(20*$i),103,9,utf8_decode('<b><i>'.$LANG["common"][17].' :</i></b> '.plugin_pdf_getDropdownName("glpi_dropdown_ram_type",$device->fields["type"])));
+				if (!empty($device->fields["type"])) $pdf->addTextWrap($other_x,($start_tab-15)-(15*$i),103,9,utf8_decode('<b><i>'.$LANG["common"][17].' :</i></b> '.plugin_pdf_getDropdownName("glpi_dropdown_ram_type",$device->fields["type"])));
 			} else {
-				if (!empty($device->fields["type"])) $pdf->addTextWrap($other_x,($start_tab-20)-(20*$i),73,9,utf8_decode('<b><i>'.$LANG["common"][17].' :</i></b> '.plugin_pdf_getDropdownName("glpi_dropdown_ram_type",$device->fields["type"])));
-				$pdf->addTextWrap($other_x+75,($start_tab-20)-(20*$i),28,9,utf8_decode($device->fields["frequence"]));
+				if (!empty($device->fields["type"])) $pdf->addTextWrap($other_x,($start_tab-15)-(15*$i),73,9,utf8_decode('<b><i>'.$LANG["common"][17].' :</i></b> '.plugin_pdf_getDropdownName("glpi_dropdown_ram_type",$device->fields["type"])));
+				$pdf->addTextWrap($other_x+75,($start_tab-15)-(15*$i),28,9,utf8_decode($device->fields["frequence"]));
 			}	
 			break;
 		case SND_DEVICE :
-			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
-			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][7]));
-			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
-			if (!empty($device->fields["type"])) $pdf->addTextWrap($spec_x,($start_tab-20)-(20*$i),99,9,utf8_decode('<b><i>'.$LANG["common"][17].' :</i></b> '.$device->fields["type"]));
+			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
+			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][7]));
+			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
+			if (!empty($device->fields["type"])) $pdf->addTextWrap($spec_x,($start_tab-15)-(15*$i),99,9,utf8_decode('<b><i>'.$LANG["common"][17].' :</i></b> '.$device->fields["type"]));
 			break;
 		case DRIVE_DEVICE : 
-			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
-			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][19]));
-			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
-			if (!empty($device->fields["is_writer"])) $pdf->addTextWrap($other_x,($start_tab-20)-(20*$i),99,9,utf8_decode('<b><i>'.$LANG["profiles"][11].' :</i></b> '.getYesNo($device->fields["is_writer"])));
-			else if (!empty($device->fields["speed"])) $pdf->addTextWrap($other_x,($start_tab-20)-(20*$i),99,9,utf8_decode('<b><i>'.$LANG["device_drive"][1].' :</i></b> '.$device->fields["speed"]));
-			else if (!empty($device->fields["frequence"])) $pdf->addTextWrap($other_x,($start_tab-20)-(20*$i),99,9,utf8_decode('<b><i>'.$LANG["device_ram"][1].' :</i></b> '.$device->fields["frequence"]));
+			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
+			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][19]));
+			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
+			if (!empty($device->fields["is_writer"])) $pdf->addTextWrap($other_x,($start_tab-15)-(15*$i),99,9,utf8_decode('<b><i>'.$LANG["profiles"][11].' :</i></b> '.getYesNo($device->fields["is_writer"])));
+			else if (!empty($device->fields["speed"])) $pdf->addTextWrap($other_x,($start_tab-15)-(15*$i),99,9,utf8_decode('<b><i>'.$LANG["device_drive"][1].' :</i></b> '.$device->fields["speed"]));
+			else if (!empty($device->fields["frequence"])) $pdf->addTextWrap($other_x,($start_tab-15)-(15*$i),99,9,utf8_decode('<b><i>'.$LANG["device_ram"][1].' :</i></b> '.$device->fields["frequence"]));
 			break;
 		case CONTROL_DEVICE :;
-			$pdf->addTextWrap($nb_x,($start_tab-20)-(25*$i),13,9,utf8_decode($val["quantity"].'x'));
-			$pdf->addTextWrap($device_x,($start_tab-20)-(25*$i),73,9,utf8_decode($LANG["devices"][20]));
-			$pdf->addTextWrap($design_x,($start_tab-20)-(25*$i),228,9,utf8_decode($device->fields["designation"]));
-			if (!empty($device->fields["interface"])) $pdf->addTextWrap($spec_x,($start_tab-20)-(20*$i),99,9,utf8_decode('<b><i>'.$LANG["common"][65].' :</i></b> '.plugin_pdf_getDropdownName("glpi_dropdown_interface",$device->fields["interface"])));
-			if (!empty($device->fields["raid"])) $pdf->addTextWrap($other_x,($start_tab-20)-(20*$i),103,9,utf8_decode('<b><i>'.$LANG["device_control"][0].' :</i></b> '.getYesNo($device->fields["raid"])));
+			$pdf->addTextWrap($nb_x,($start_tab-15)-(25*$i),13,9,utf8_decode($val["quantity"].'x'));
+			$pdf->addTextWrap($device_x,($start_tab-15)-(25*$i),73,9,utf8_decode($LANG["devices"][20]));
+			$pdf->addTextWrap($design_x,($start_tab-15)-(25*$i),228,9,utf8_decode($device->fields["designation"]));
+			if (!empty($device->fields["interface"])) $pdf->addTextWrap($spec_x,($start_tab-15)-(15*$i),99,9,utf8_decode('<b><i>'.$LANG["common"][65].' :</i></b> '.plugin_pdf_getDropdownName("glpi_dropdown_interface",$device->fields["interface"])));
+			if (!empty($device->fields["raid"])) $pdf->addTextWrap($other_x,($start_tab-15)-(15*$i),103,9,utf8_decode('<b><i>'.$LANG["device_control"][0].' :</i></b> '.getYesNo($device->fields["raid"])));
 			break;
 		case PCI_DEVICE :
-			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
-			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][21]));
-			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
+			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
+			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][21]));
+			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
 			break;
 		case POWER_DEVICE :
-			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
-			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][23]));
-			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
-			if (!empty($device->fields["power"])) $pdf->addTextWrap($other_x,($start_tab-20)-(20*$i),103,9,utf8_decode('<b><i>'.$LANG["device_power"][0].' :</i></b> '.$device->fields["power"]));
-			else if (!empty($device->fields["atx"])) $pdf->addTextWrap($other_x,($start_tab-20)-(20*$i),103,9,utf8_decode('<b><i>'.$LANG["device_power"][1].' :</i></b> '.getYesNo($device->fields["atx"])));
+			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
+			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][23]));
+			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
+			if (!empty($device->fields["power"])) $pdf->addTextWrap($other_x,($start_tab-15)-(15*$i),103,9,utf8_decode('<b><i>'.$LANG["device_power"][0].' :</i></b> '.$device->fields["power"]));
+			else if (!empty($device->fields["atx"])) $pdf->addTextWrap($other_x,($start_tab-15)-(15*$i),103,9,utf8_decode('<b><i>'.$LANG["device_power"][1].' :</i></b> '.getYesNo($device->fields["atx"])));
 			break;
 		case CASE_DEVICE :
-			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
-			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][22]));
-			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
-			if (!empty($device->fields["type"])) $pdf->addTextWrap($other_x,($start_tab-20)-(20*$i),103,9,utf8_decode('<b><i>'.$LANG["common"][17].' :</i></b> '.plugin_pdf_getDropdownName("glpi_dropdown_case_type",$device->fields["type"])));
+			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
+			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][22]));
+			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
+			if (!empty($device->fields["type"])) $pdf->addTextWrap($other_x,($start_tab-15)-(15*$i),103,9,utf8_decode('<b><i>'.$LANG["common"][17].' :</i></b> '.plugin_pdf_getDropdownName("glpi_dropdown_case_type",$device->fields["type"])));
 			break;
 		}
 	$i++;
 	
-	if(($start_tab-20)-(20*$i)<50){
+	if(($start_tab-20)-(15*$i)<50){
 		$pdf = plugin_pdf_newPage($pdf,$ID,$type);
 		$i=0;
 		$start_tab = 750;
 		}
 	}
 	
-	$start_tab = ($start_tab-20)-(20*$i) - 20;
+	$start_tab = ($start_tab-20)-(15*$i) - 20;
 	
 	$tab["start_tab"] = $start_tab;
 	$tab["pdf"] = $pdf;
