X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=svc%2Fbarcode;h=bd9c8203bce5214c68e647450b9af0f09e0ae8c1;hb=998289850f373a6b83d1ee4387161575fd6d3def;hp=80b1504c229937df978c30da5be833f6d917ec13;hpb=7dacb45ce5ae3579283b2449cf32c6656188ecb4;p=koha-ffzg.git diff --git a/svc/barcode b/svc/barcode index 80b1504c22..bd9c8203bc 100755 --- a/svc/barcode +++ b/svc/barcode @@ -4,18 +4,18 @@ # # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 3 of the License, or (at your option) any later -# version. +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. # -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License along -# with Koha; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . use Modern::Perl; @@ -26,7 +26,7 @@ use C4::Auth qw(check_cookie_auth); =head1 NAME - /cgi-bin/koha/svc/barcode +/cgi-bin/koha/svc/barcode =head1 SYNOPSIS @@ -58,6 +58,13 @@ COOP2of5 If ommited,it defaults to Code39. +=item I + +Unless I is specified in the parameter list, the +value of the barcode will included as text below the +scannable barcode. + + =back =head2 EXAMPLES @@ -72,11 +79,19 @@ Returns a Code39 barcode image for barcode 123456789 Returns a UPCE barcode image for barcode 123456789 +=item /cgi-bin/koha/svc/barcode?barcode=123456789¬ext=1 + +Returns a Code39 barcode image for barcode 123456789 +which does not include the human readable text '123456789' +below the scannable barcode. + +=back + =cut -my $input = new CGI; +my $input = CGI->new; -my ( $auth_status, $sessionID ) = check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => '*' } ); +my ( $auth_status ) = check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => '*' } ); if ( $auth_status ne "ok" ) { exit 0; @@ -86,10 +101,17 @@ binmode(STDOUT); my $type = $input->param('type') || 'Code39'; my $barcode = $input->param('barcode'); +my $notext = $input->param('notext') ? 1 : 0; +my $height = $input->param('height') || 50; +my $qrcode_modulesize = $input->param('modulesize') || "5"; # 1+ my $image; eval { - $image = GD::Barcode->new( $type, $barcode )->plot()->png(); + if( $type eq "QRcode" ){ + $image = GD::Barcode->new('QRcode', $barcode, { Ecc => "M", ModuleSize => $qrcode_modulesize } )->plot->png(); + } else { + $image = GD::Barcode->new( $type, $barcode )->plot( NoText => $notext, Height => $height )->png(); + } }; if ( $@ ) {