From 12bb399d48222b5014ed1c052f163e6c100247b0 Mon Sep 17 00:00:00 2001 From: james Date: Sat, 19 Mar 2011 20:49:06 +0000 Subject: [PATCH] Fix the conference logo not working on reports (FINALLY! god for such a stupid bug it took me forever to realize it), also tweaked the barcode code a bit --- admin/reports.inc.php | 36 +++++++++++++++++------------------- tcpdf.inc.php | 1 + 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/admin/reports.inc.php b/admin/reports.inc.php index bf24c4e..c9e6fc7 100644 --- a/admin/reports.inc.php +++ b/admin/reports.inc.php @@ -807,32 +807,30 @@ foreach($report_stock as $n=>$v) { case 'static_box': $rep->label_rect($d['x'], $d['y'], $d['w'], $d['h']); break; - case 'fair_logo': + case 'conference_logo': $rep->label_fair_logo($d['x'], $d['y'], $d['w'], $d['h'], $show_box); break; + case "projectbarcode": + $style = array( + 'border' => 2, + 'vpadding' => 'auto', + 'hpadding' => 'auto', + 'fgcolor' => array(0,0,0), + 'bgcolor' => false, //array(255,255,255) + 'module_width' => 3, // width of a single module in points + 'module_height' => 3 // height of a single module in points + ); + $rep->barcode($v, 'QRCODE,H', $d['x'], $d['y'], $d['w'], $d['h'], $style, 'N'); + break; default: if($f == 'static_text') $v = $d['value']; - if($f=="projectbarcode") { - $style = array( - 'border' => 2, - 'vpadding' => 'auto', - 'hpadding' => 'auto', - 'fgcolor' => array(0,0,0), - 'bgcolor' => false, //array(255,255,255) - 'module_width' => 3, // width of a single module in points - 'module_height' => 3 // height of a single module in points - ); - $rep->barcode($v, 'QRCODE,H', $d['x'], $d['y'], $d['w'], $d['h'], $style, 'N'); - } - else { - $rep->label_text($d['x'], $d['y'], $d['w'], $d['h'], - $v, $show_box, $d['align'], $d['valign'], - $d['fontname'],$d['fontstyle'],$d['fontsize'], - $d['on_overflow']); - } + $rep->label_text($d['x'], $d['y'], $d['w'], $d['h'], + $v, $show_box, $d['align'], $d['valign'], + $d['fontname'],$d['fontstyle'],$d['fontsize'], + $d['on_overflow']); break; } diff --git a/tcpdf.inc.php b/tcpdf.inc.php index 0b8c690..6223725 100644 --- a/tcpdf.inc.php +++ b/tcpdf.inc.php @@ -398,6 +398,7 @@ class pdf extends TCPDF { function label_fair_logo($x, $y, $w, $h, $show_box) { global $config; + global $conference; $img_dir = $_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY'].'/data'; /* Scale image to proportinally fit in w x h */ $this->Image($img_dir."/".$conference['id']."-logo-500.png", $this->lMargin + $x, $this->tMargin + $y,