Projet

Général

Profil

Révision e528a503

Voir les différences:

plugins/pdf/inc/plugin_pdf.functions.php
400 400
		$spec_x = 468;
401 401
		
402 402
		$pdf->saveState();
403
		$pdf->setColor(0.95,0.95,0.95);
404
		$pdf->filledRectangle(25,($start_tab-25)-(20*$i),15,15);
405
		$pdf->filledRectangle(45,($start_tab-25)-(20*$i),75,15);
406
		$pdf->filledRectangle(125,($start_tab-25)-(20*$i),230,15);
407
		$pdf->filledRectangle(360,($start_tab-25)-(20*$i),101,15);
408
		$pdf->filledRectangle(466,($start_tab-25)-(20*$i),105,15);
403

  
404
		//erics pour avoir la couleur une ligne sur deux
405
		if($i%2){
406
		  $pdf->setColor(0.95,0.95,0.95);
407
		}
408
		else {
409
		  $pdf->setColor(1,1,1);
410
		}
411
		
412
		//$pdf->setColor(0.95,0.95,0.95);
413
		//un seul rectangle qui fait toute la ligne
414
		$pdf->filledRectangle(25,$start_tab-20-(15*$i),$width-50,15);
409 415
		$pdf->restoreState();
410 416
		
411 417
		switch($device->devtype) {
412 418
		case HDD_DEVICE :
413
			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
414
			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][1]));
415
			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
416
			$pdf->addTextWrap($spec_x,($start_tab-20)-(20*$i),99,9,utf8_decode('<b><i>'.$LANG["device_hdd"][4].' :</i></b> '.$val["specificity"]));
417
			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"]));
418
			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"])));
419
			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"]));
419
			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
420
			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][1]));
421
			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
422
			$pdf->addTextWrap($spec_x,($start_tab-15)-(15*$i),99,9,utf8_decode('<b><i>'.$LANG["device_hdd"][4].' :</i></b> '.$val["specificity"]));
423
			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"]));
424
			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"])));
425
			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"]));
420 426
			break;
421 427
		case GFX_DEVICE :
422
			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
423
			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][2]));
424
			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
425
			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"]));
426
			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"]));
428
			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
429
			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][2]));
430
			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
431
			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"]));
432
			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"]));
427 433
			break;
428 434
		case NETWORK_DEVICE :
429
			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
430
			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][3]));
431
			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
432
			$pdf->addTextWrap($spec_x,($start_tab-20)-(20*$i),99,9,utf8_decode('<b><i>'.$LANG["networking"][15].' :</i></b> '.$val["specificity"]));
433
			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"]));
435
			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
436
			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][3]));
437
			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
438
			$pdf->addTextWrap($spec_x,($start_tab-15)-(15*$i),99,9,utf8_decode('<b><i>'.$LANG["networking"][15].' :</i></b> '.$val["specificity"]));
439
			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"]));
434 440
			break;
435 441
		case MOBOARD_DEVICE :
436
			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
437
			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][5]));
438
			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
439
			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"]));
442
			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
443
			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][5]));
444
			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
445
			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"]));
440 446
			break;
441 447
		case PROCESSOR_DEVICE :
442
			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
443
			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][4]));
444
			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
445
			$pdf->addTextWrap($spec_x,($start_tab-20)-(20*$i),99,9,utf8_decode('<b><i>'.$LANG["device_ram"][1].' :</i></b> '.$val["specificity"]));
448
			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
449
			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][4]));
450
			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
451
			$pdf->addTextWrap($spec_x,($start_tab-15)-(15*$i),99,9,utf8_decode('<b><i>'.$LANG["device_ram"][1].' :</i></b> '.$val["specificity"]));
446 452
			break;
447 453
		case RAM_DEVICE :
448
			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
449
			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][6]));
450
			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
451
			$pdf->addTextWrap($spec_x,($start_tab-20)-(20*$i),99,9,utf8_decode('<b><i>'.$LANG["monitors"][21].' :</i></b> '.$val["specificity"]));
454
			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
455
			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][6]));
456
			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
457
			$pdf->addTextWrap($spec_x,($start_tab-15)-(15*$i),99,9,utf8_decode('<b><i>'.$LANG["monitors"][21].' :</i></b> '.$val["specificity"]));
452 458
			if (empty($device->fields["frequence"])) {
453
				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"])));
459
				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"])));
454 460
			} else {
455
				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"])));
456
				$pdf->addTextWrap($other_x+75,($start_tab-20)-(20*$i),28,9,utf8_decode($device->fields["frequence"]));
461
				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"])));
462
				$pdf->addTextWrap($other_x+75,($start_tab-15)-(15*$i),28,9,utf8_decode($device->fields["frequence"]));
457 463
			}	
458 464
			break;
459 465
		case SND_DEVICE :
460
			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
461
			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][7]));
462
			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
463
			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"]));
466
			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
467
			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][7]));
468
			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
469
			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"]));
464 470
			break;
465 471
		case DRIVE_DEVICE : 
466
			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
467
			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][19]));
468
			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
469
			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"])));
470
			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"]));
471
			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"]));
472
			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
473
			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][19]));
474
			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
475
			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"])));
476
			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"]));
477
			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"]));
472 478
			break;
473 479
		case CONTROL_DEVICE :;
474
			$pdf->addTextWrap($nb_x,($start_tab-20)-(25*$i),13,9,utf8_decode($val["quantity"].'x'));
475
			$pdf->addTextWrap($device_x,($start_tab-20)-(25*$i),73,9,utf8_decode($LANG["devices"][20]));
476
			$pdf->addTextWrap($design_x,($start_tab-20)-(25*$i),228,9,utf8_decode($device->fields["designation"]));
477
			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"])));
478
			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"])));
480
			$pdf->addTextWrap($nb_x,($start_tab-15)-(25*$i),13,9,utf8_decode($val["quantity"].'x'));
481
			$pdf->addTextWrap($device_x,($start_tab-15)-(25*$i),73,9,utf8_decode($LANG["devices"][20]));
482
			$pdf->addTextWrap($design_x,($start_tab-15)-(25*$i),228,9,utf8_decode($device->fields["designation"]));
483
			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"])));
484
			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"])));
479 485
			break;
480 486
		case PCI_DEVICE :
481
			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
482
			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][21]));
483
			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
487
			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
488
			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][21]));
489
			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
484 490
			break;
485 491
		case POWER_DEVICE :
486
			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
487
			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][23]));
488
			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
489
			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"]));
490
			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"])));
492
			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
493
			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][23]));
494
			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
495
			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"]));
496
			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"])));
491 497
			break;
492 498
		case CASE_DEVICE :
493
			$pdf->addTextWrap($nb_x,($start_tab-20)-(20*$i),13,9,utf8_decode($val["quantity"].'x'));
494
			$pdf->addTextWrap($device_x,($start_tab-20)-(20*$i),73,9,utf8_decode($LANG["devices"][22]));
495
			$pdf->addTextWrap($design_x,($start_tab-20)-(20*$i),228,9,utf8_decode($device->fields["designation"]));
496
			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"])));
499
			$pdf->addTextWrap($nb_x,($start_tab-15)-(15*$i),13,9,utf8_decode($val["quantity"].'x'));
500
			$pdf->addTextWrap($device_x,($start_tab-15)-(15*$i),73,9,utf8_decode($LANG["devices"][22]));
501
			$pdf->addTextWrap($design_x,($start_tab-15)-(15*$i),228,9,utf8_decode($device->fields["designation"]));
502
			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"])));
497 503
			break;
498 504
		}
499 505
	$i++;
500 506
	
501
	if(($start_tab-20)-(20*$i)<50){
507
	if(($start_tab-20)-(15*$i)<50){
502 508
		$pdf = plugin_pdf_newPage($pdf,$ID,$type);
503 509
		$i=0;
504 510
		$start_tab = 750;
505 511
		}
506 512
	}
507 513
	
508
	$start_tab = ($start_tab-20)-(20*$i) - 20;
514
	$start_tab = ($start_tab-20)-(15*$i) - 20;
509 515
	
510 516
	$tab["start_tab"] = $start_tab;
511 517
	$tab["pdf"] = $pdf;

Formats disponibles : Unified diff

Redmine Appliance - Powered by TurnKey Linux