6 /util/barcode.mas - generate a barcode from an identifier and prints text alongside the barcode
10 This mason component calls SGN::Controller::Barcode.
14 $identifier (required) - will be converted to barcode
15 $text - what's printed alongside barcode (human readable)
20 Lukas Mueller <lam87@cornell.edu>
39 my $uri = URI::Encode->new( { encode_reserved => 0 } );
42 my $encoded_id = $urlencode{$identifier};
43 my $encoded_text = $urlencode{$text};
47 if ($format eq "code128") {
48 $link = "/barcode/code128png/$encoded_id/$encoded_text";
50 if ($format eq "trial_qrcode"){
51 $link = "/barcode/trial/$trial_id/$format";
52 $barcode_name = $trial_name." ".$identifier;
54 if ($format eq "stock_qrcode") {
55 my $encoded = $uri->encode($encoded_text);
56 $link = "/barcode/trial/$encoded/$format";
57 #$link = "/barcode/trial/$encoded_text/$format";
58 $barcode_name = $text;
60 if ($format eq "qrcode") {
61 $link = "/barcode/trial/$trial_id";
62 #my $info = "http://solgenomics.net/stock/$identifier/view";
63 #$link = "/barcode/qrcodepng/$info/$encoded_text";
64 #$link = "/barcode/qrcodepng/$identifier/$encoded_text";
71 <center><img src="<% $link %>" /> </br><% $barcode_name%> </center>