Browse Source
Signed-off-by: Joshua Ferraro <jmf@liblime.com> Signed-off-by: Chris Cormack <crc@liblime.com>3.0.x
Ryan Higgins
17 years ago
committed by
Chris Cormack
43 changed files with 2504 additions and 2193 deletions
@ -1,161 +0,0 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
# script to generate items barcodes |
|||
# written 07/04 |
|||
# by Veleda Matias - matias_veleda@hotmail.com - Physics Library UNLP Argentina and |
|||
# Casta�eda Sebastian - seba3c@yahoo.com.ar - Physics Library UNLP Argentina and |
|||
|
|||
# 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 2 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. |
|||
# |
|||
# You should have received a copy of the GNU General Public License along with |
|||
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, |
|||
# Suite 330, Boston, MA 02111-1307 USA |
|||
|
|||
use strict; |
|||
use CGI; |
|||
use C4::Auth; |
|||
use C4::Output; |
|||
use C4::Context; |
|||
use C4::Barcodes::PrinterConfig; |
|||
|
|||
# This function returns the path to deal with the correct files, considering |
|||
# templates set and language. |
|||
sub getPath { |
|||
my $type = shift @_; |
|||
my $templatesSet = C4::Context->preference('template'); |
|||
my $lang = C4::Context->preference('opaclanguages'); |
|||
if ( $type eq "intranet" ) { |
|||
return "$ENV{'DOCUMENT_ROOT'}/intranet-tmpl/$templatesSet/$lang"; |
|||
} |
|||
else { |
|||
return "$ENV{'DOCUMENT_ROOT'}/opac-tmpl/$templatesSet/$lang"; |
|||
} |
|||
} |
|||
|
|||
# Load a configuration file. Before use this function, check if that file exists. |
|||
sub loadConfFromFile { |
|||
my $fileName = shift @_; |
|||
my %keyValues; |
|||
open FILE, "<$fileName"; |
|||
while (<FILE>) { |
|||
chomp; |
|||
if (/\s*([\w_]*)\s*=\s*([\[\]\<\>\w_\s:@,\.-]*)\s*/) { |
|||
$keyValues{$1} = $2; |
|||
} |
|||
} |
|||
close FILE; |
|||
return %keyValues; |
|||
} |
|||
|
|||
# Save settings to a configuration file. It delete previous configuration settings. |
|||
sub saveConfToFile { |
|||
my $fileName = shift @_; |
|||
my %keyValues = %{ shift @_ }; |
|||
my $i; |
|||
open FILE, ">$fileName"; |
|||
foreach $i ( keys(%keyValues) ) { |
|||
print FILE $i . " = " . $keyValues{$i} . "\n"; |
|||
} |
|||
close FILE; |
|||
} |
|||
|
|||
# Load the config file. |
|||
my $filenameConf = |
|||
&getPath("intranet") . "/includes/labelConfig/itemsLabelConfig.conf"; |
|||
my %labelConfig = &loadConfFromFile($filenameConf); |
|||
|
|||
my $input = new CGI; |
|||
|
|||
# Defines type of page to use in the printer process |
|||
my @labelTable = |
|||
C4::Barcodes::PrinterConfig::labelsPage( $labelConfig{'rows'}, |
|||
$labelConfig{'columns'} ); |
|||
|
|||
# It creates a list of posible intervals to choose codes to generate |
|||
my %list = ( |
|||
'continuous' => 'Continuous Range of items', |
|||
'individuals' => 'Individual Codes' |
|||
); |
|||
my @listValues = keys(%list); |
|||
my $rangeType = CGI::scrolling_list( |
|||
-name => 'rangeType', |
|||
-values => \@listValues, |
|||
-labels => \%list, |
|||
-size => 1, |
|||
-default => ['continuous'], |
|||
-multiple => 0, |
|||
-id => "rangeType", |
|||
-onChange => "changeRange(this)" |
|||
); |
|||
|
|||
# It creates a list of posible standard codifications. First checks if the user has just added a new code. |
|||
if ( $input->param('addCode') ) { |
|||
my $newCountryName = $input->param('countryName'); |
|||
my $newCountryCode = $input->param('countryCode'); |
|||
|
|||
my $countryCodesFilename = |
|||
&getPath("intranet") . "/includes/countryCodes/countryCodes.dat"; |
|||
open COUNTRY_CODES, ">>$countryCodesFilename"; |
|||
print COUNTRY_CODES $newCountryCode . " = " . $newCountryName . "\n"; |
|||
close COUNTRY_CODES; |
|||
} |
|||
|
|||
# Takes the country codes from a file and use them to set the country list. |
|||
my $countryCodes = |
|||
&getPath("intranet") . "/includes/countryCodes/countryCodes.dat"; |
|||
%list = &loadConfFromFile($countryCodes); |
|||
@listValues = keys(%list); |
|||
my $number_system = CGI::scrolling_list( |
|||
-name => 'numbersystem', |
|||
-values => \@listValues, |
|||
-labels => \%list, |
|||
-size => 1, |
|||
-multiple => 0 |
|||
); |
|||
|
|||
# Set the script name |
|||
my $script_name = "/cgi-bin/koha/barcodes/barcodesGenerator.pl"; |
|||
|
|||
# Get the template to use |
|||
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
|||
{ |
|||
template_name => "barcodes/barcodes.tmpl", |
|||
type => "intranet", |
|||
query => $input, |
|||
authnotrequired => 0, |
|||
flagsrequired => { tools => 1 }, |
|||
debug => 1, |
|||
} |
|||
); |
|||
|
|||
# Replace the template values with the real ones |
|||
$template->param( SCRIPT_NAME => $script_name ); |
|||
$template->param( NUMBER_SYSTEM => $number_system ); |
|||
$template->param( PAGES => $labelConfig{'pageType'} ); |
|||
$template->param( RANGE_TYPE => $rangeType ); |
|||
$template->param( LABEL_TABLE => \@labelTable ); |
|||
$template->param( COL_SPAN => $labelConfig{'columns'} ); |
|||
if ( $input->param('error') ) { |
|||
$template->param( ERROR => 1 ); |
|||
} |
|||
else { |
|||
$template->param( ERROR => 0 ); |
|||
} |
|||
$template->param( |
|||
intranetcolorstylesheet => |
|||
C4::Context->preference("intranetcolorstylesheet"), |
|||
intranetstylesheet => C4::Context->preference("intranetstylesheet"), |
|||
IntranetNav => C4::Context->preference("IntranetNav"), |
|||
); |
|||
|
|||
# Shows the template with the real values replaced |
|||
output_html_with_http_headers $input, $cookie, $template->output; |
@ -1,373 +0,0 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
# script to generate items barcodes |
|||
# written 07/04 |
|||
# by Veleda Matias - matias_veleda@hotmail.com - Physics Library UNLP Argentina and |
|||
# Castañeda Sebastian - seba3c@yahoo.com.ar - Physics Library UNLP Argentina and |
|||
|
|||
# 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 2 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. |
|||
# |
|||
# You should have received a copy of the GNU General Public License along with |
|||
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, |
|||
# Suite 330, Boston, MA 02111-1307 USA |
|||
|
|||
require Exporter; |
|||
|
|||
use strict; |
|||
|
|||
use CGI; |
|||
use C4::Context; |
|||
use C4::Output; |
|||
|
|||
|
|||
#FIXME : module deprecated ? |
|||
use PDF::API2; |
|||
use PDF::API2::Page; |
|||
use PDF::API2::Util; |
|||
use C4::Barcodes::PrinterConfig; |
|||
use Time::localtime; |
|||
|
|||
# This function returns the path to deal with the correct files, considering |
|||
# templates set and language. |
|||
sub getPath { |
|||
my $type = shift @_; |
|||
my $templatesSet = C4::Context->preference('template'); |
|||
my $lang = C4::Context->preference('opaclanguages'); |
|||
if ( $type eq "intranet" ) { |
|||
return "$ENV{'DOCUMENT_ROOT'}/intranet-tmpl/$templatesSet/$lang"; |
|||
} |
|||
else { |
|||
return "$ENV{'DOCUMENT_ROOT'}/opac-tmpl/$templatesSet/$lang"; |
|||
} |
|||
} |
|||
|
|||
# Load a configuration file. Before use this function, check if that file exists. |
|||
sub loadConfFromFile { |
|||
my $fileName = shift @_; |
|||
my %keyValues; |
|||
open FILE, "<$fileName"; |
|||
while (<FILE>) { |
|||
chomp; |
|||
if (/\s*([\w_]*)\s*=\s*([\[\]\<\>\w_\s:@,\.-]*)\s*/) { |
|||
$keyValues{$1} = $2; |
|||
} |
|||
} |
|||
close FILE; |
|||
return %keyValues; |
|||
} |
|||
|
|||
# Save settings to a configuration file. It delete previous configuration settings. |
|||
sub saveConfToFile { |
|||
my $fileName = shift @_; |
|||
my %keyValues = %{ shift @_ }; |
|||
my $i; |
|||
open FILE, ">$fileName"; |
|||
foreach $i ( keys(%keyValues) ) { |
|||
print FILE $i . " = " . $keyValues{$i} . "\n"; |
|||
} |
|||
close FILE; |
|||
} |
|||
|
|||
# Load the config file. |
|||
my $filenameConf = |
|||
&getPath("intranet") . "/includes/labelConfig/itemsLabelConfig.conf"; |
|||
my %labelConfig = &loadConfFromFile($filenameConf); |
|||
|
|||
# Creates a CGI object and take its parameters |
|||
my $cgi = new CGI; |
|||
my $from = $cgi->param('from'); |
|||
my $to = $cgi->param('to'); |
|||
my $individualCodes = $cgi->param('individualCodes'); |
|||
my $rangeType = $cgi->param('rangeType'); |
|||
my $pageType = $cgi->param('pages'); |
|||
my $label = $cgi->param('label'); |
|||
my $numbersystem = $cgi->param('numbersystem'); |
|||
my $text_under_label = $cgi->param('text_under_label'); |
|||
|
|||
# Generate the checksum from an inventary code |
|||
sub checksum { |
|||
|
|||
sub calculateDigit { |
|||
my $code = shift @_; |
|||
my $sum = 0; |
|||
my $odd_parity = 1; |
|||
my $i; |
|||
for ( $i = length($code) - 1 ; $i >= 0 ; $i-- ) { |
|||
if ($odd_parity) { |
|||
$sum = $sum + ( 3 * substr( $code, $i, 1 ) ); |
|||
} |
|||
else { |
|||
$sum = $sum + substr( $code, $i, 1 ); |
|||
} |
|||
$odd_parity = !$odd_parity; |
|||
} |
|||
my $check_digit = 10 - ( $sum % 10 ); |
|||
if ( $check_digit == 10 ) { |
|||
$check_digit = 0; |
|||
} |
|||
return $code . $check_digit; |
|||
} |
|||
|
|||
my $currentCode = shift @_; |
|||
$currentCode = &calculateDigit($currentCode); |
|||
return $currentCode; |
|||
} |
|||
|
|||
# Assigns a temporary name to the PDF file |
|||
sub assingFilename { |
|||
my ( $from, $to ) = @_; |
|||
my $ip = $cgi->remote_addr(); |
|||
my $random = int( rand(1000000) ); |
|||
my $timeObj = localtime(); |
|||
my ( $day, $month, $year, $hour, $min, $sec ) = ( |
|||
$timeObj->mday, |
|||
$timeObj->mon + 1, |
|||
$timeObj->year + 1900, |
|||
$timeObj->hour, $timeObj->min, $timeObj->sec |
|||
); |
|||
my $tmpFileName = |
|||
$random . '-' . $ip |
|||
. '-(From ' |
|||
. $from . ' to ' |
|||
. $to . ')-[' |
|||
. $day . '.' |
|||
. $month . '.' |
|||
. $year . ']-[' |
|||
. $hour . ':' |
|||
. $min . ':' |
|||
. $sec . '].pdf'; |
|||
return $tmpFileName; |
|||
} |
|||
|
|||
sub getCallnum { |
|||
|
|||
#grabs a callnumber for the specified barcode |
|||
my ($barcode) = @_; |
|||
my $query = |
|||
"select dewey from items,biblioitems where items.biblionumber=biblioitems.biblionumber and items.barcode=?"; |
|||
my $dbh = C4::Context->dbh; |
|||
my $sth = $dbh->prepare($query); |
|||
$sth->execute($barcode); |
|||
my ($callnum) = $sth->fetchrow_array(); |
|||
warn "Call number is:" . $barcode; |
|||
return $callnum; |
|||
} |
|||
|
|||
# Takes inventary codes from database and if they are between |
|||
# the interval specify by parameters, it generates the correspond barcodes |
|||
sub barcodesGenerator { |
|||
my ( $from, $to, $rangeType, $individualCodes, $text_under_label ) = @_; |
|||
|
|||
# Returns a database handler |
|||
my $dbh = C4::Context->dbh; |
|||
|
|||
# Create the query to database |
|||
# Assigns a temporary filename for the pdf file |
|||
my $tmpFileName = &assingFilename( $from, $to ); |
|||
|
|||
# warn "range type: ".$rangeType; |
|||
if ( $rangeType eq 'continuous' ) { |
|||
|
|||
# Set the temp directory for pdf´s files |
|||
if ( !defined( $ENV{'TEMP'} ) ) { |
|||
$ENV{'TEMP'} = '/tmp/'; |
|||
} |
|||
$tmpFileName = $ENV{'TEMP'} . $tmpFileName; |
|||
|
|||
# Creates a PDF object |
|||
my $pdf = PDF::API2->new( -file => $tmpFileName ); |
|||
|
|||
# Set the positions where barcodes are going to be placed |
|||
C4::Barcodes::PrinterConfig::setPositionsForX( |
|||
$labelConfig{'marginLeft'}, $labelConfig{'labelWidth'}, |
|||
$labelConfig{'columns'}, $labelConfig{'pageType'} |
|||
); |
|||
C4::Barcodes::PrinterConfig::setPositionsForY( |
|||
$labelConfig{'marginBottom'}, $labelConfig{'labelHeigth'}, |
|||
$labelConfig{'rows'}, $labelConfig{'pageType'} |
|||
); |
|||
|
|||
# Creates a font object |
|||
my $tr = $pdf->corefont('Helvetica-Bold'); |
|||
|
|||
# Barcode position |
|||
my ( $page, $gfx, $text ); |
|||
for ( my $code = $from ; $code <= $to ; $code++ ) { |
|||
|
|||
# Generetase checksum |
|||
my $codeC = &checksum($code); |
|||
|
|||
# Generate the corresponde barcode to $code |
|||
# warn "Code is :-->".$codeC."<--"; |
|||
my $barcode = $pdf->barcode( |
|||
-font => $tr, # The font object to use |
|||
-type => 'ean128', # Standard of codification |
|||
-code => $codeC, # Text to codify |
|||
-extn => '012345', # Barcode extension (if it is aplicable) |
|||
-umzn => 10, # Top limit of the finished bar |
|||
-lmzn => 10, # Bottom limit of the finished bar |
|||
-zone => 15, # Bars size |
|||
-quzn => 0, # Space destinated for legend |
|||
-ofwt => 0.01, # Bars width |
|||
-fnsz => 8, # Font size |
|||
-text => '' |
|||
); |
|||
|
|||
( my $x, my $y, $pdf, $page, $gfx, $text, $tr, $label ) = |
|||
C4::Barcodes::PrinterConfig::getLabelPosition( $label, $pdf, |
|||
$page, $gfx, $text, $tr, $pageType ); |
|||
|
|||
# Assigns a barcodes to $gfx |
|||
$gfx->barcode( $barcode, $x, $y, |
|||
( 72 / $labelConfig{'systemDpi'} ) ); |
|||
|
|||
# Assigns the additional information to the barcode (Legend) |
|||
$text->translate( $x - 48, $y - 22 ); |
|||
|
|||
#warn "code is ".$codeC; |
|||
if ($text_under_label) { |
|||
$text->text($text_under_label); |
|||
} |
|||
else { |
|||
$text->text( getCallnum($code) ); |
|||
} |
|||
} |
|||
|
|||
# Writes the objects added in $gfx to $page |
|||
$pdf->finishobjects( $page, $gfx, $text ); |
|||
|
|||
# Save changes to the PDF |
|||
$pdf->saveas; |
|||
|
|||
# Close the conection with the PDF file |
|||
$pdf->end; |
|||
|
|||
# Show the PDF file |
|||
print $cgi->redirect( |
|||
"/cgi-bin/koha/barcodes/pdfViewer.pl?tmpFileName=$tmpFileName"); |
|||
} |
|||
else { |
|||
my $rangeCondition; |
|||
if ( $individualCodes ne "" ) { |
|||
$rangeCondition = "AND (I.barcode IN " . $individualCodes . ")"; |
|||
} |
|||
else { |
|||
$rangeCondition = |
|||
"AND (I.barcode >= " . $from . " AND I.barcode <=" . $to . " )"; |
|||
} |
|||
|
|||
my $query = |
|||
"SELECT CONCAT('$numbersystem',REPEAT('0',((12 - LENGTH('$numbersystem')) - LENGTH(I.barcode))), I.barcode) AS Codigo, B.title, B.author FROM biblio B, items I WHERE (I.biblionumber = B.biblioNumber ) " |
|||
. $rangeCondition |
|||
. " AND (I.barcode <> 'FALTA') ORDER BY Codigo"; |
|||
|
|||
# Prepare the query |
|||
my $sth = $dbh->prepare($query); |
|||
|
|||
# Executes the query |
|||
$sth->execute; |
|||
if ( $sth->rows ) { # There are inventary codes |
|||
# Set the temp directory for pdf´s files |
|||
if ( !defined( $ENV{'TEMP'} ) ) { |
|||
$ENV{'TEMP'} = '/tmp/'; |
|||
} |
|||
|
|||
# Assigns a temporary filename for the pdf file |
|||
my $tmpFileName = &assingFilename( $from, $to ); |
|||
$tmpFileName = $ENV{'TEMP'} . $tmpFileName; |
|||
|
|||
# Creates a PDF object |
|||
my $pdf = PDF::API2->new( -file => $tmpFileName ); |
|||
|
|||
# Set the positions where barcodes are going to be placed |
|||
C4::Barcodes::PrinterConfig::setPositionsForX( |
|||
$labelConfig{'marginLeft'}, $labelConfig{'labelWidth'}, |
|||
$labelConfig{'columns'}, $labelConfig{'pageType'} |
|||
); |
|||
C4::Barcodes::PrinterConfig::setPositionsForY( |
|||
$labelConfig{'marginBottom'}, $labelConfig{'labelHeigth'}, |
|||
$labelConfig{'rows'}, $labelConfig{'pageType'} |
|||
); |
|||
|
|||
# Creates a font object |
|||
my $tr = $pdf->corefont('Helvetica-Bold'); |
|||
|
|||
# Barcode position |
|||
my ( $page, $gfx, $text ); |
|||
while ( my ( $code, $dewey, $title, $author ) = |
|||
$sth->fetchrow_array ) |
|||
{ |
|||
|
|||
# Generetase checksum |
|||
$code = &checksum($code); |
|||
|
|||
# Generate the corresponde barcode to $code |
|||
my $barcode = $pdf->barcode( |
|||
-font => $tr, # The font object to use |
|||
-type => 'ean13', # Standard of codification |
|||
-code => $code, # Text to codify |
|||
-extn => '012345', # Barcode extension (if it is aplicable) |
|||
-umzn => 10, # Top limit of the finished bar |
|||
-lmzn => 10, # Bottom limit of the finished bar |
|||
-zone => 15, # Bars size |
|||
-quzn => 0, # Space destinated for legend |
|||
-ofwt => 0.01, # Bars width |
|||
-fnsz => 8, # Font size |
|||
-text => '' |
|||
); |
|||
|
|||
( my $x, my $y, $pdf, $page, $gfx, $text, $tr, $label ) = |
|||
C4::Barcodes::PrinterConfig::getLabelPosition( $label, $pdf, |
|||
$page, $gfx, $text, $tr, $pageType ); |
|||
|
|||
# Assigns a barcodes to $gfx |
|||
$gfx->barcode( $barcode, $x, $y, |
|||
( 72 / $labelConfig{'systemDpi'} ) ); |
|||
|
|||
# Assigns the additional information to the barcode (Legend) |
|||
$text->translate( $x - 48, $y - 22 ); |
|||
if ($text_under_label) { |
|||
$text->text($text_under_label); |
|||
} |
|||
else { |
|||
$text->text( substr $title, 0, 30 ); |
|||
$text->translate( $x - 48, $y - 29 ); |
|||
|
|||
#$text->text(substr $author, 0, 30); |
|||
$text->text( substr $author, 0, 30 ); |
|||
} |
|||
} |
|||
|
|||
# Writes the objects added in $gfx to $page |
|||
$pdf->finishobjects( $page, $gfx, $text ); |
|||
|
|||
# Save changes to the PDF |
|||
$pdf->saveas; |
|||
|
|||
# Close the conection with the PDF file |
|||
$pdf->end; |
|||
|
|||
# Show the PDF file |
|||
print $cgi->redirect( |
|||
"/cgi-bin/koha/barcodes/pdfViewer.pl?tmpFileName=$tmpFileName"); |
|||
} |
|||
else { |
|||
|
|||
# Rollback and shows the error legend |
|||
print $cgi->redirect("/cgi-bin/koha/barcodes/barcodes.pl?error=1"); |
|||
} |
|||
$sth->finish; |
|||
} |
|||
} |
|||
|
|||
barcodesGenerator( $from, $to, $rangeType, $individualCodes, |
|||
$text_under_label ); |
@ -1,78 +0,0 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
# 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 2 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. |
|||
# |
|||
# You should have received a copy of the GNU General Public License along with |
|||
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, |
|||
# Suite 330, Boston, MA 02111-1307 USA |
|||
|
|||
use strict; |
|||
use CGI; |
|||
use C4::Auth; |
|||
use C4::Output; |
|||
use C4::Labels; |
|||
use C4::Context; |
|||
|
|||
|
|||
my $query = new CGI; |
|||
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
|||
{ |
|||
template_name => "barcodes/label-home.tmpl", |
|||
query => $query, |
|||
type => "intranet", |
|||
authnotrequired => 0, |
|||
flagsrequired => { tools => 1 }, |
|||
debug => 1, |
|||
} |
|||
); |
|||
|
|||
my $data = get_label_options(); |
|||
|
|||
my $active_template = GetActiveLabelTemplate(); |
|||
my @label_templates = GetAllLabelTemplates(); |
|||
|
|||
$template->param( guidebox => 1 ) if ( $data->{'guidebox'} ); |
|||
|
|||
$data->{'printingtype'} = 'both' if ( !$data->{'printingtype'} ); |
|||
$template->param( "printingtype_$data->{'printingtype'}" => 1 ); |
|||
$template->param( "papertype_$data->{'papertype'}" => 1 ); |
|||
|
|||
$template->param( "$data->{'barcodetype'}_checked" => 1 ); |
|||
|
|||
$template->param( "startrow" . $data->{'startrow'} . "_checked" => 1 ); |
|||
$template->param( |
|||
itemtype => $data->{'itemtype'}, |
|||
active_template => $data->{'active_template'}, |
|||
label_templates => \@label_templates, |
|||
|
|||
papertype => $data->{'papertype'}, |
|||
author => $data->{'author'}, |
|||
barcode => $data->{'barcode'}, |
|||
id => $data->{'id'}, |
|||
barcodetype => $data->{'barcodetype'}, |
|||
title => $data->{'title'}, |
|||
isbn => $data->{'isbn'}, |
|||
dewey => $data->{'dewey'}, |
|||
class => $data->{'class'}, |
|||
startrow => $data->{'startrow'}, |
|||
subclass => $data->{'subclass'}, |
|||
itemcallnumber => $data->{'itemcallnumber'}, |
|||
startlabel => $data->{'startlabel'}, |
|||
fontsize => $active_template->{'fontsize'}, |
|||
|
|||
intranetcolorstylesheet => |
|||
C4::Context->preference("intranetcolorstylesheet"), |
|||
intranetstylesheet => C4::Context->preference("intranetstylesheet"), |
|||
IntranetNav => C4::Context->preference("IntranetNav"), |
|||
); |
|||
|
|||
output_html_with_http_headers $query, $cookie, $template->output; |
@ -1,154 +0,0 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
# 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 2 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. |
|||
# |
|||
# You should have received a copy of the GNU General Public License along with |
|||
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, |
|||
# Suite 330, Boston, MA 02111-1307 USA |
|||
|
|||
use strict; |
|||
use CGI; |
|||
use C4::Auth; |
|||
use C4::Labels; |
|||
use C4::Output; |
|||
|
|||
use POSIX; |
|||
|
|||
my $dbh = C4::Context->dbh; |
|||
my $query = new CGI; |
|||
my $op = $query->param('op'); |
|||
my $barcodetype = $query->param('barcodetype'); |
|||
my $title = $query->param('title'); |
|||
my $isbn = $query->param('isbn'); |
|||
my $itemtype = $query->param('itemtype'); |
|||
my $bcn = $query->param('bcn'); |
|||
my $dcn = $query->param('dcn'); |
|||
my $classif = $query->param('classif'); |
|||
my $itemcallnumber = $query->param('itemcallnumber'); |
|||
my $subclass = $query->param('subclass'); |
|||
my $author = $query->param('author'); |
|||
my $tmpl_id = $query->param('tmpl_id'); |
|||
my $itemnumber = $query->param('itemnumber'); |
|||
my $summary = $query->param('summary'); |
|||
my $startlabel = $query->param('startlabel'); |
|||
my $printingtype = $query->param('printingtype'); |
|||
my $guidebox = $query->param('guidebox'); |
|||
my $fontsize = $query->param('fontsize'); |
|||
|
|||
#warn "ID =$tmpl_id"; |
|||
|
|||
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
|||
{ |
|||
template_name => "barcodes/label-manager.tmpl", |
|||
query => $query, |
|||
type => "intranet", |
|||
authnotrequired => 1, |
|||
flagsrequired => { tools => 1 }, |
|||
debug => 1, |
|||
} |
|||
); |
|||
|
|||
if ( $op eq 'save_conf' ) { |
|||
SaveConf( |
|||
$barcodetype, $title, $isbn, $itemtype, |
|||
$bcn, $dcn, $classif, $subclass, |
|||
$itemcallnumber, $author, $tmpl_id, $printingtype, |
|||
$guidebox, $startlabel |
|||
); |
|||
|
|||
} |
|||
elsif ( $op eq 'add' ) { |
|||
my $query2 = "INSERT INTO labels ( itemnumber ) values ( ? )"; |
|||
my $sth2 = $dbh->prepare($query2); |
|||
$sth2->execute($itemnumber); |
|||
$sth2->finish; |
|||
} |
|||
elsif ( $op eq 'deleteall' ) { |
|||
my $query2 = "DELETE FROM labels"; |
|||
my $sth2 = $dbh->prepare($query2); |
|||
$sth2->execute(); |
|||
$sth2->finish; |
|||
} |
|||
elsif ( $op eq 'delete' ) { |
|||
warn "MASON, deleting label.."; |
|||
my $query2 = "DELETE FROM labels where itemnumber = ?"; |
|||
my $sth2 = $dbh->prepare($query2); |
|||
$sth2->execute($itemnumber); |
|||
$sth2->finish; |
|||
} |
|||
|
|||
# first lets do a read of the labels table , to get the a list of the |
|||
# currently entered items to be prinited |
|||
|
|||
my @resultsloop = (); |
|||
my $count; |
|||
my @data; |
|||
my $query3 = "Select * from labels"; |
|||
my $sth = $dbh->prepare($query3); |
|||
$sth->execute(); |
|||
|
|||
my $cnt = $sth->rows; |
|||
my $i1 = 1; |
|||
while ( my $data = $sth->fetchrow_hashref ) { |
|||
|
|||
# lets get some summary info from each item |
|||
my $query1 = " |
|||
select * from biblio,biblioitems,items where itemnumber=? and |
|||
items.biblioitemnumber=biblioitems.biblioitemnumber and |
|||
biblioitems.biblionumber=biblio.biblionumber"; |
|||
|
|||
my $sth1 = $dbh->prepare($query1); |
|||
$sth1->execute( $data->{'itemnumber'} ); |
|||
my $data1 = $sth1->fetchrow_hashref(); |
|||
|
|||
$data1->{'labelno'} = $i1; |
|||
$data1->{'summary'} = |
|||
"$data1->{'barcode'}, $data1->{'title'}, $data1->{'isbn'}"; |
|||
|
|||
push( @resultsloop, $data1 ); |
|||
$sth1->finish; |
|||
|
|||
$i1++; |
|||
} |
|||
$sth->finish; |
|||
|
|||
# this script can be run from the side nav, and is not passed a value for $startrow |
|||
# so lets get it from the DB |
|||
|
|||
my $dbh = C4::Context->dbh; |
|||
my $query2 = "SELECT * FROM labels_conf LIMIT 1"; |
|||
my $sth = $dbh->prepare($query2); |
|||
$sth->execute(); |
|||
|
|||
my $data = $sth->fetchrow_hashref; |
|||
$sth->finish; |
|||
|
|||
#calc-ing number of sheets |
|||
|
|||
#$sheets_needed = ceil($sheets_needed); # rounding up int's |
|||
|
|||
#my $tot_labels = ( $sheets_needed * 8 ); |
|||
#my $start_results = ( $number_of_results + $startrow ); |
|||
#my $labels_remaining = ( $tot_labels - $start_results ); |
|||
|
|||
$template->param( |
|||
resultsloop => \@resultsloop, |
|||
|
|||
# startrow => $startrow, |
|||
# sheets => $sheets_needed, |
|||
# labels_remaining => $labels_remaining, |
|||
intranetcolorstylesheet => |
|||
C4::Context->preference("intranetcolorstylesheet"), |
|||
intranetstylesheet => C4::Context->preference("intranetstylesheet"), |
|||
IntranetNav => C4::Context->preference("IntranetNav"), |
|||
); |
|||
output_html_with_http_headers $query, $cookie, $template->output; |
@ -1,189 +0,0 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
# 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 2 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. |
|||
# |
|||
# You should have received a copy of the GNU General Public License along with |
|||
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, |
|||
# Suite 330, Boston, MA 02111-1307 USA |
|||
|
|||
use strict; |
|||
use CGI; |
|||
use C4::Labels; |
|||
use C4::Auth; |
|||
use C4::Output; |
|||
use C4::Context; |
|||
use PDF::Reuse; |
|||
use PDF::Reuse::Barcode; |
|||
use POSIX; |
|||
use Text::Wrap; |
|||
|
|||
|
|||
$Text::Wrap::columns = 39; |
|||
$Text::Wrap::separator = "\n"; |
|||
|
|||
my $htdocs_path = C4::Context->config('intrahtdocs'); |
|||
my $cgi = new CGI; |
|||
my $spine_text = ""; |
|||
|
|||
# get the printing settings |
|||
my $conf_data = get_label_options(); |
|||
my @resultsloop = get_label_items(); |
|||
my $barcodetype = $conf_data->{'barcodetype'}; |
|||
my $printingtype = $conf_data->{'printingtype'}; |
|||
my $guidebox = $conf_data->{'guidebox'}; |
|||
my $startrow = $conf_data->{'startrow'}; |
|||
|
|||
# if none selected, then choose 'both' |
|||
if ( !$printingtype ) { |
|||
$printingtype = 'both'; |
|||
} |
|||
|
|||
# opus paper dims. in *millimeters* |
|||
# multiply values by '2.83465', to find their value in Postscript points. |
|||
|
|||
# $xmargin = 12; |
|||
# $label_height = 34; |
|||
# $label_width = 74; |
|||
# $x_pos_spine = 12; |
|||
# $pageheight = 304; |
|||
# $pagewidth = 174; |
|||
# $line_spacer = 10; |
|||
# $label_rows = 8; |
|||
|
|||
# sheet dimensions in PS points. |
|||
|
|||
my $top_margin = 7; |
|||
my $left_margin = 34; |
|||
my $top_text_margin = 20; |
|||
my $left_text_margin = 10; |
|||
my $label_height = 96; |
|||
my $spine_width = 210; |
|||
my $colspace = 9; |
|||
my $rowspace = 11; |
|||
my $x_pos_spine = 36; |
|||
my $pageheight = 861; |
|||
my $pagewidth = 493; |
|||
my $line_spacer = 10; |
|||
my $label_rows = 8; |
|||
|
|||
# setting up the pdf doc |
|||
#remove the file before write, for testing |
|||
#unlink "$htdocs_path/barcodes/new.pdf"; |
|||
#prFile("$htdocs_path/barcodes/new.pdf"); |
|||
#prLogDir("$htdocs_path/barcodes"); |
|||
|
|||
# fix, no longer writes to temp dir |
|||
prInitVars(); # To initiate ALL global variables and tables |
|||
$| = 1; |
|||
print STDOUT "Content-Type: application/pdf \n\n"; |
|||
prFile(); |
|||
|
|||
prMbox( 0, 0, $pagewidth, $pageheight ); |
|||
prFont('courier'); # Just setting a font |
|||
prFontSize(9); |
|||
|
|||
my $str; |
|||
|
|||
my $y_pos_initial = ( ( $pageheight - $top_margin ) - $label_height ); |
|||
my $y_pos_initial_startrow = |
|||
( ( $pageheight - $top_margin ) - ( $label_height * $startrow ) ); |
|||
my $y_pos = $y_pos_initial_startrow; |
|||
|
|||
my $page_break_count = $startrow; |
|||
my $codetype = 'Code39'; |
|||
|
|||
#do page border |
|||
# commented out coz it was running into the side-feeds of the paper. |
|||
# drawbox( 0, 0 , $pagewidth, $pageheight ); |
|||
|
|||
my $item; |
|||
|
|||
# for loop |
|||
my $i2 = 1; |
|||
|
|||
foreach $item (@resultsloop) { |
|||
my $x_pos_spine_tmp = $x_pos_spine; |
|||
|
|||
for ( 1 .. 2 ) { |
|||
|
|||
if ( $guidebox == 1 ) { |
|||
warn |
|||
"COUNT1, PBREAKCNT=$page_break_count, y=$y_pos, labhght = $label_height"; |
|||
drawbox( $x_pos_spine_tmp, $y_pos, $spine_width, $label_height ); |
|||
} |
|||
|
|||
#-----------------draw spine text |
|||
if ( $printingtype eq 'spine' || $printingtype eq 'both' ) { |
|||
|
|||
#warn "PRINTTYPE = $printingtype"; |
|||
|
|||
# add your printable fields manually in here |
|||
my @fields = qw (itemtype dewey isbn classification); |
|||
my $vPos = ( $y_pos + ( $label_height - $top_text_margin ) ); |
|||
my $hPos = ( $x_pos_spine_tmp + $left_text_margin ); |
|||
foreach my $field (@fields) { |
|||
|
|||
# if the display option for this field is selected in the DB, |
|||
# and the item record has some values for this field, display it. |
|||
if ( $conf_data->{"$field"} && $item->{"$field"} ) { |
|||
|
|||
#warn "CONF_TYPE = $field"; |
|||
|
|||
# get the string |
|||
$str = $item->{"$field"}; |
|||
|
|||
# strip out naughty existing nl/cr's |
|||
$str =~ s/\n//g; |
|||
$str =~ s/\r//g; |
|||
|
|||
# chop the string up into _upto_ 12 chunks |
|||
# and seperate the chunks with newlines |
|||
|
|||
$str = wrap( "", "", "$str" ); |
|||
$str = wrap( "", "", "$str" ); |
|||
|
|||
# split the chunks between newline's, into an array |
|||
my @strings = split /\n/, $str; |
|||
|
|||
# then loop for each string line |
|||
foreach my $str (@strings) { |
|||
|
|||
warn "HPOS , VPOS $hPos, $vPos "; |
|||
prText( $hPos, $vPos, $str ); |
|||
$vPos = $vPos - $line_spacer; |
|||
} |
|||
} # if field is valid |
|||
} # foreach @field |
|||
} #if spine |
|||
|
|||
$x_pos_spine_tmp = ( $x_pos_spine_tmp + $spine_width + $colspace ); |
|||
} # for 1 ..2 |
|||
warn " $y_pos - $label_height - $rowspace"; |
|||
$y_pos = ( $y_pos - $label_height - $rowspace ); |
|||
warn " $y_pos - $label_height - $rowspace"; |
|||
|
|||
#-----------------draw spine text |
|||
|
|||
# the gaylord labels have 8 rows per sheet, this pagebreaks after 8 rows |
|||
if ( $page_break_count == $label_rows ) { |
|||
prPage(); |
|||
$page_break_count = 0; |
|||
$i2 = 0; |
|||
$y_pos = $y_pos_initial; |
|||
} |
|||
$page_break_count++; |
|||
$i2++; |
|||
} |
|||
prEnd(); |
|||
|
|||
#print $cgi->redirect("/intranet-tmpl/barcodes/new.pdf"); |
|||
|
@ -1,135 +0,0 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
# 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 2 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. |
|||
# |
|||
# You should have received a copy of the GNU General Public License along with |
|||
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, |
|||
# Suite 330, Boston, MA 02111-1307 USA |
|||
|
|||
use strict; |
|||
use CGI; |
|||
use C4::Auth; |
|||
use C4::Serials; |
|||
use C4::Output; |
|||
use C4::Context; |
|||
|
|||
use GD::Barcode::UPCE; |
|||
use Data::Random qw(:all); |
|||
|
|||
my $htdocs_path = C4::Context->config('intrahtdocs'); |
|||
|
|||
my $query = new CGI; |
|||
|
|||
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
|||
{ |
|||
template_name => "barcodes/label-print.tmpl", |
|||
query => $query, |
|||
type => "intranet", |
|||
authnotrequired => 0, |
|||
flagsrequired => { tools => 1 }, |
|||
debug => 1, |
|||
} |
|||
); |
|||
|
|||
my $dbh = C4::Context->dbh; |
|||
my $query2 = "SELECT * FROM labels_conf LIMIT 1"; |
|||
my $sth = $dbh->prepare($query2); |
|||
$sth->execute(); |
|||
|
|||
my $conf_data = $sth->fetchrow_hashref; |
|||
|
|||
$sth->finish; |
|||
|
|||
my @data; |
|||
my $query3 = "Select * from labels"; |
|||
my $sth = $dbh->prepare($query3); |
|||
$sth->execute(); |
|||
my @resultsloop; |
|||
my $cnt = $sth->rows; |
|||
my $i1 = 1; |
|||
while ( my $data = $sth->fetchrow_hashref ) { |
|||
|
|||
# lets get some summary info from each item |
|||
|
|||
my $query1 = " |
|||
select * from biblio,biblioitems,items where itemnumber=? and |
|||
items.biblioitemnumber=biblioitems.biblioitemnumber and |
|||
biblioitems.biblionumber=biblio.biblionumber"; |
|||
|
|||
my $sth1 = $dbh->prepare($query1); |
|||
$sth1->execute( $data->{'itemnumber'} ); |
|||
my $data1 = $sth1->fetchrow_hashref(); |
|||
|
|||
push( @resultsloop, $data1 ); |
|||
$sth1->finish; |
|||
|
|||
$i1++; |
|||
} |
|||
$sth->finish; |
|||
|
|||
#------------------------------------------------------ |
|||
|
|||
#lets write barcode files to tmp dir for every item in @resultsloop |
|||
|
|||
binmode(FILE); |
|||
foreach my $item (@resultsloop) { |
|||
|
|||
my $random = int( rand(100000000000) ) + 999999999999; |
|||
|
|||
#warn "$random\n"; |
|||
|
|||
$item->{'barcode'} = $random; |
|||
|
|||
# my $itembarcode = $item->{'barcode'}; |
|||
# warn $item->{'barcode'}; |
|||
|
|||
my $filename = "$htdocs_path/barcodes/$item->{'barcode'}.png"; |
|||
|
|||
#warn $filename; |
|||
open( FILE, ">$filename" ); |
|||
|
|||
print FILE GD::Barcode->new( 'EAN13', $item->{'barcode'} )->plot->png; |
|||
|
|||
# warn $GD::Barcode::errStr; |
|||
|
|||
close(FILE); |
|||
|
|||
#warn Dumper $item->{'barcode'}; |
|||
|
|||
} |
|||
|
|||
# lets pass the config setting |
|||
|
|||
$template->param( |
|||
|
|||
resultsloop => \@resultsloop, |
|||
|
|||
itemtype_opt => $conf_data->{'itemtype'}, |
|||
papertype_opt => $conf_data->{'papertype'}, |
|||
author_opt => $conf_data->{'author'}, |
|||
barcode_opt => $conf_data->{'barcode'}, |
|||
id_opt => $conf_data->{'id'}, |
|||
type_opt => $conf_data->{'type'}, |
|||
title_opt => $conf_data->{'title'}, |
|||
isbn_opt => $conf_data->{'isbn'}, |
|||
dewey_opt => $conf_data->{'dewey'}, |
|||
class_opt => $conf_data->{'class'}, |
|||
subclass_opt => $conf_data->{'subclass'}, |
|||
itemcallnumber_opt => $conf_data->{'itemcallnumber'}, |
|||
|
|||
intranetcolorstylesheet => |
|||
C4::Context->preference("intranetcolorstylesheet"), |
|||
intranetstylesheet => C4::Context->preference("intranetstylesheet"), |
|||
IntranetNav => C4::Context->preference("IntranetNav"), |
|||
); |
|||
output_html_with_http_headers $query, $cookie, $template->output; |
|||
|
@ -1,40 +0,0 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
# script to show a PDF file. |
|||
# written 07/04 |
|||
# by Veleda Matias - matias_veleda@hotmail.com - Physics Library UNLP Argentina and |
|||
# Castañeda Sebastian - seba3c@yahoo.com.ar - Physics Library UNLP Argentina and |
|||
|
|||
# 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 2 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. |
|||
# |
|||
# You should have received a copy of the GNU General Public License along with |
|||
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, |
|||
# Suite 330, Boston, MA 02111-1307 USA |
|||
|
|||
require Exporter; |
|||
|
|||
use strict; |
|||
use C4::Context; |
|||
use CGI; |
|||
|
|||
# This script take a pdf filename as a parameter and output it to the browser. |
|||
my $cgi = new CGI; |
|||
my $filename = "barcodes.pdf"; |
|||
my $tmpFileName = $cgi->param('tmpFileName'); |
|||
print "Content-Disposition: attachment; filename = $filename\n\n"; |
|||
print $cgi->header( -type => 'application/pdf' ), |
|||
$cgi->start_html( -title => "Codify to PDF" ); |
|||
open fh, "<$tmpFileName"; |
|||
while (<fh>) { |
|||
print; |
|||
} |
|||
print $cgi->end_html(); |
@ -1,128 +0,0 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
# script to set the labels configuration for the printer process. |
|||
# written 07/04 |
|||
# by Veleda Matias - matias_veleda@hotmail.com - Physics Library UNLP Argentina and |
|||
|
|||
# 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 2 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. |
|||
# |
|||
# You should have received a copy of the GNU General Public License along with |
|||
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, |
|||
# Suite 330, Boston, MA 02111-1307 USA |
|||
|
|||
require Exporter; |
|||
|
|||
use strict; |
|||
|
|||
use CGI; |
|||
use C4::Context; |
|||
use C4::Output; |
|||
use C4::Auth; |
|||
|
|||
use PDF::API2; |
|||
use PDF::API2::Page; |
|||
use PDF::API2::Util; |
|||
|
|||
# This function returns the path to deal with the correct files, considering |
|||
# templates set and language. |
|||
sub getPath { |
|||
my $type = shift @_; |
|||
my $templatesSet = C4::Context->preference('template'); |
|||
my $lang = C4::Context->preference('opaclanguages'); |
|||
if ( $type eq "intranet" ) { |
|||
return "$ENV{'DOCUMENT_ROOT'}/intranet-tmpl/$templatesSet/$lang"; |
|||
} |
|||
else { |
|||
return "$ENV{'DOCUMENT_ROOT'}/opac-tmpl/$templatesSet/$lang"; |
|||
} |
|||
} |
|||
|
|||
# Load a configuration file. |
|||
sub loadConfFromFile { |
|||
my $fileName = shift @_; |
|||
my %keyValues; |
|||
open FILE, "<$fileName"; |
|||
while (<FILE>) { |
|||
chomp; |
|||
if (/\s*([\w_]*)\s*=\s*([\[\]\<\>\w_\s:@,\.-]*)\s*/) { |
|||
$keyValues{$1} = $2; |
|||
} |
|||
} |
|||
close FILE; |
|||
return %keyValues; |
|||
} |
|||
|
|||
# Save settings to a configuration file. |
|||
sub saveConfToFile { |
|||
my $fileName = shift @_; |
|||
my %keyValues = %{ shift @_ }; |
|||
my $i; |
|||
open FILE, ">$fileName"; |
|||
my $i; |
|||
foreach $i ( keys(%keyValues) ) { |
|||
print FILE $i . " = " . $keyValues{$i} . "\n"; |
|||
} |
|||
close FILE; |
|||
} |
|||
|
|||
# Creates a CGI object and take his parameters |
|||
my $input = new CGI; |
|||
|
|||
if ( $input->param('saveSettings') ) { |
|||
my $labelConf = |
|||
&getPath("intranet") . "/includes/labelConfig/itemsLabelConfig.conf"; |
|||
my %newConfiguration = ( |
|||
pageType => $input->param('pageType'), |
|||
columns => $input->param('columns'), |
|||
rows => $input->param('rows'), |
|||
systemDpi => $input->param('systemDpi'), |
|||
labelWidth => $input->param('labelWidth'), |
|||
labelHeigth => $input->param('labelHeigth'), |
|||
marginBottom => $input->param('marginBottom'), |
|||
marginLeft => $input->param('marginLeft') |
|||
); |
|||
saveConfToFile( $labelConf, \%newConfiguration ); |
|||
print $input->redirect('/cgi-bin/koha/barcodes/barcodes.pl'); |
|||
} |
|||
|
|||
# Get the template to use |
|||
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
|||
{ |
|||
template_name => "barcodes/printerConfig.tmpl", |
|||
type => "intranet", |
|||
query => $input, |
|||
authnotrequired => 0, |
|||
flagsrequired => { tools => 1 }, |
|||
debug => 1, |
|||
} |
|||
); |
|||
|
|||
my $filenameConf = |
|||
&getPath("intranet") . "/includes/labelConfig/itemsLabelConfig.conf"; |
|||
my %labelConfig = &loadConfFromFile($filenameConf); |
|||
|
|||
$template->param( COLUMNS => $labelConfig{'columns'} ); |
|||
$template->param( ROWS => $labelConfig{'rows'} ); |
|||
$template->param( SYSTEM_DPI => $labelConfig{'systemDpi'} ); |
|||
$template->param( LABEL_WIDTH => $labelConfig{'labelWidth'} ); |
|||
$template->param( LABEL_HEIGTH => $labelConfig{'labelHeigth'} ); |
|||
$template->param( MARGIN_TOP => $labelConfig{'marginBottom'} ); |
|||
$template->param( MARGIN_LEFT => $labelConfig{'marginLeft'} ); |
|||
$template->param( SCRIPT_NAME => '/cgi-bin/koha/barcodes/printerConfig.pl' ); |
|||
$template->param( "$labelConfig{'pageType'}" => 1 ); |
|||
$template->param( |
|||
intranetcolorstylesheet => |
|||
C4::Context->preference("intranetcolorstylesheet"), |
|||
intranetstylesheet => C4::Context->preference("intranetstylesheet"), |
|||
IntranetNav => C4::Context->preference("IntranetNav"), |
|||
); |
|||
output_html_with_http_headers $input, $cookie, $template->output; |
@ -1,33 +0,0 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
use C4::Context; |
|||
use PDF::API2; |
|||
use PDF::Table; |
|||
|
|||
my $pdftable = new PDF::Table; |
|||
my $pdf = PDF::API2->new(); |
|||
|
|||
#$pdf->mediabox(612,792); |
|||
my $fnt = $pdf->corefont('Helvetica-Bold'); |
|||
my $page = $pdf->page; # returns the last page |
|||
my $txt = $page->text; |
|||
$txt->{' font'} = $fnt; |
|||
$text_to_place = "moo moo"; |
|||
|
|||
( $width_of_last_line, $ypos_of_last_line, $left_over_text ) = |
|||
$pdftable->text_block( |
|||
$txt, |
|||
$text_to_place, |
|||
-x => 100, |
|||
-y => 300, |
|||
-w => 50, |
|||
-h => 40, |
|||
|
|||
# -lead => 13, |
|||
# -font_size => 12, |
|||
# -parspace => 0, |
|||
# -align => "left", |
|||
# -hang => 1, |
|||
); |
|||
|
|||
$pdf->saveas("$htdocs_path/barcodes/foo.pdf"); |
@ -1,85 +0,0 @@ |
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --> |
|||
<title>Koha › Label and Barcode Printing</title> |
|||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> |
|||
|
|||
<!-- TMPL_INCLUDE NAME="menus.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="menu-barcodes.inc" --> |
|||
|
|||
<!-- START OF ADD COUNTRY CODE PANEL --> |
|||
<div class="countryPanel" id="addCountryCode"> |
|||
<form action="/cgi-bin/koha/barcodes/barcodes.pl" method="post" style="display:inline"> |
|||
<input type="hidden" name="addCode" value="1" /> |
|||
<h4>Add a new Country Code</h4> |
|||
<ul> |
|||
<li><label for="countryName">Country Name:</label> <input type="text" size="10" id="countryName" name="countryName" /></li> |
|||
<li><label for="countryCode">Country Code:</label> <input type="text" size="3" id="countryCode" name="countryCode" /></li> |
|||
</ul> |
|||
<input type="submit" name="submit" id="submit" value="Save Code"/> |
|||
<input type="button" name="cancel" id="cancel" value="Cancel" onclick="document.getElementById('addCountryCode').style.display = 'none'" /> |
|||
</form> |
|||
</div> |
|||
|
|||
<!-- END OF ADD COUNTRY CODE PANEL --> |
|||
|
|||
<h1>Barcodes Generator</h1> |
|||
<h3>Generate barcodes from inventory codes</h3> |
|||
<ul> |
|||
<li>Select a range of inventary codes. You can choose a continuous range or individual inventory codes</li> |
|||
<li>Select the standard type to generate barcodes.</li> |
|||
<li>Define the page size for output the PDF.</li> |
|||
<li>Depending on page size, Koha will show you how the page is arranged |
|||
for each barcode. You can define wich point to start printing the page. |
|||
</li> |
|||
</ul> |
|||
|
|||
<!-- TMPL_IF NAME="ERROR" -->Can't find inventory codes in that range. Please try again.<!-- /TMPL_IF --> |
|||
|
|||
<form id="formulario" method="post" action="<!-- TMPL_VAR NAME="SCRIPT_NAME" -->" name="form1" onsubmit="return checkFields(this);" target="_blank"> |
|||
<label for="rangeType">Type of Interval: </label><!-- TMPL_VAR NAME="RANGE_TYPE" --> |
|||
|
|||
<div id="continuous" class="panel" style="display:inline"> |
|||
<ul> |
|||
<li><label for="from">From:</label><input id="from" type="text" name="from" size="20" /></li> |
|||
<li><label for="to">To:</label><input id="to" type="text" name="to" size="20" /></li> |
|||
</ul> |
|||
</div> |
|||
|
|||
|
|||
<div id="individuals" class="panel" style="display:none; background-color: #ffffff;"> |
|||
<label for="inventaryCode">Inventory Code: </label><input id="inventaryCode" type="text" name="inventaryCode" size="20" /> |
|||
<a href="#" onclick="addItem(); return false;">[+]</a> |
|||
<a href="#" onclick="removeItem(); return false;">[-]</a> |
|||
<select id="inventaryList" size="5" style="width:150px"> |
|||
</select> |
|||
<input type="hidden" id="individualCodes" name="individualCodes"> |
|||
</div> |
|||
|
|||
<p> |
|||
<label for="numbersystem">Country Code: </label><!-- TMPL_VAR NAME="NUMBER_SYSTEM" --><a href="#" onClick="addCountryCode(); return false;">[+]</a></p> |
|||
|
|||
<p> <label for="pageType">Page Size</label><input type="text" id="pageType" name="pageType" readonly="readonly" disabled="disabled" value="<!-- TMPL_VAR NAME="PAGES" -->" size="10" /><a href="/cgi-bin/koha/barcodes/printerConfig.pl">[Go to Printer Configuration]</a></p> |
|||
|
|||
|
|||
<p><label for="text_under_label">Text under label</label> |
|||
<input type="text" id="text_under_label" name="text_under_label" size="40" value="<!-- TMPL_VAR name="text_under_label -->" /> If this field is empty, author and title will be used instead</p> |
|||
|
|||
<table> |
|||
<tr> |
|||
<th colspan="<!-- TMPL_VAR NAME="COL_SPAN" -->">Label number to start printing</th> |
|||
</tr> |
|||
<!-- TMPL_LOOP NAME="LABEL_TABLE" --> |
|||
<tr> |
|||
<!-- TMPL_LOOP NAME="columns" --> |
|||
<td> |
|||
<input type="radio" id="label" value="<!-- TMPL_VAR NAME="tagname" -->" name="label" <!-- TMPL_VAR NAME="check" -->> Label <!-- TMPL_VAR NAME="labelname" --></td> |
|||
<!-- /TMPL_LOOP --> |
|||
</tr> |
|||
<!-- /TMPL_LOOP --> |
|||
</table> |
|||
|
|||
<input type="submit" value="Generate Barcodes" name="B1"> |
|||
<input type="reset" value="Clear Fields" name="B2"> |
|||
</form> |
|||
|
|||
<!-- TMPL_INCLUDE name="intranet-bottom.inc" --> |
|||
|
@ -1,69 +0,0 @@ |
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --> |
|||
<title>Koha › Label and Barcode Printing</title> |
|||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> |
|||
<!-- TMPL_INCLUDE name="masthead.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="label-topmenu.inc" --> |
|||
<!-- TMPL_INCLUDE name="intranet-nav.inc" --> |
|||
|
|||
<div id="main"> |
|||
<form name="input" action="/cgi-bin/koha/barcodes/label-create-template.pl" method="get"> |
|||
|
|||
<h3> |
|||
Create Label Template |
|||
</h3> |
|||
|
|||
|
|||
|
|||
<h3>Template Settings</h3> |
|||
<table> |
|||
|
|||
Template Code: <input type="text" size="40" name="tmpl_code"><br> |
|||
Template Description: <textarea name="tmpl_desc" cols="40" rows="3" name="tmpl_desc" ></TEXTAREA><br> |
|||
|
|||
<tr> |
|||
<td>Page Width:</td><td><input type="text" size="2" name="page_width"></td> |
|||
<td>Page Height:</td><td><input type="text" size="2" name="page_height"></td> |
|||
</tr> |
|||
<tr> |
|||
<td>Label Width:</td><td><input type="text" size="2" name="label_width"></td> |
|||
<td>Label Height:</td><td><input type="text" size="2" name="label_height"></td> |
|||
</tr> |
|||
<tr> |
|||
<td>Top Page Margin:</td><td><input type="text" size="2" name="topmargin"></td> |
|||
<td>Left Page Margin:</td><td><input type="text" size="2" name="leftmargin"></td> |
|||
</tr> |
|||
<tr> |
|||
<td>Number of Columns:</td><td><input type="text" size="2" name="cols"></td> |
|||
<td>Number of Rows:</td><td><input type="text" size="2" name="rows"></td> |
|||
</tr> |
|||
<tr> |
|||
<td>Gap between Columns:</td><td><input type="text" size="2" name="colgap"></td> |
|||
<td>Gap between Rows:</td><td><input type="text" size="2" name="rowgap"></td> |
|||
</tr> |
|||
</table> |
|||
|
|||
|
|||
<br> |
|||
Units: <select name="units"> |
|||
<!-- TMPL_LOOP NAME="units" --> |
|||
<option value="<!-- TMPL_VAR NAME="unit" -->"><!-- TMPL_VAR NAME="desc" --></option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
|
|||
<br> |
|||
<br> |
|||
Font Size: <input type="textbox" name="fontsize" SIZE="1" |
|||
value=""> |
|||
<br> |
|||
<br> |
|||
Active: <input type="checkbox" name="active"> |
|||
|
|||
<input type="hidden" name="op" value="create"> |
|||
<br> |
|||
<br> |
|||
<input type="submit" value="Save"> |
|||
<input type="reset" value="Reset"> |
|||
</form> |
|||
</div> |
|||
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" --> |
|||
|
@ -1,189 +0,0 @@ |
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --> |
|||
<title>Koha › Label and Barcode Printing</title> |
|||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="menus.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="menu-barcodes.inc" --> |
|||
|
|||
<form name="input" action="/cgi-bin/koha/barcodes/label-manager.pl" method="get"> |
|||
|
|||
<h3> |
|||
Choose Fields to Print |
|||
</h3> |
|||
<table summary="fields to print"> |
|||
<tr> |
|||
<td> |
|||
<!-- TMPL_IF NAME="itemtype"--> |
|||
<input type="checkbox" name="itemtype" value=1 checked> |
|||
<!-- TMPL_ELSE --> |
|||
<input type="checkbox" name="itemtype" value=1> |
|||
<!-- /TMPL_IF --> |
|||
<label for="itemtype">Item Type</label> |
|||
</td> |
|||
|
|||
<td> |
|||
<!-- TMPL_IF NAME="isbn"--> |
|||
<input type="checkbox" name="isbn" value=1 checked> |
|||
<!-- TMPL_ELSE --> |
|||
<input type="checkbox" name="isbn" value=1> |
|||
<!-- /TMPL_IF --> |
|||
<label for="isbn">ISBN</label> |
|||
</td> |
|||
|
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<!-- TMPL_IF NAME="dcn"--> |
|||
<input type="checkbox" name="dcn" value=1 checked> |
|||
<!-- TMPL_ELSE --> |
|||
<input type="checkbox" name="dcn" value=1> |
|||
<!-- /TMPL_IF --> |
|||
<label for="dcn">Dewey / Call Number</label> |
|||
</td> |
|||
<td> |
|||
<!-- TMPL_IF NAME="classif"--> |
|||
<input type="checkbox" name="classif" value=1 checked> |
|||
<!-- TMPL_ELSE --> |
|||
<input type="checkbox" name="classif" value=1> |
|||
<!-- /TMPL_IF --> |
|||
<label for="classif">Classification</label> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<!-- TMPL_IF NAME="itemcallnumber"--> |
|||
<input type="checkbox" name="itemcallnumber" value=1 checked> |
|||
<!-- TMPL_ELSE --> |
|||
<input type="checkbox" name="itemcallnumber" value=1> |
|||
<!-- /TMPL_IF --> |
|||
<label for="itemcallnumber">Item Call Number</label> |
|||
</td> |
|||
<td> |
|||
<!-- TMPL_IF NAME="subclass"--> |
|||
<input type="checkbox" name="subclass" value=1 checked> |
|||
<!-- TMPL_ELSE --> |
|||
<input type="checkbox" name="subclass" value=1> |
|||
<!-- /TMPL_IF --> |
|||
<label for="subclass">Sub-Class</label> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<p> |
|||
|
|||
<h3>Confirm Label Template</h3> |
|||
<select name="tmpl_id"> |
|||
<!-- TMPL_LOOP NAME="label_templates" --> |
|||
<!-- TMPL_IF NAME="active" --> |
|||
<option value="<!-- TMPL_VAR NAME="tmpl_id" -->" selected> |
|||
<!-- TMPL_ELSE --> |
|||
<option value="<!-- TMPL_VAR NAME="tmpl_id" -->"> |
|||
<!-- /TMPL_IF --> |
|||
<!-- TMPL_VAR NAME="tmpl_code" --></option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
|
|||
|
|||
<h3>Confirm Barcode Type</h3> |
|||
<select name="barcodetype"> |
|||
<!-- TMPL_IF NAME="COOP2of5_checked" --> |
|||
<option value="COOP2of5" selected> |
|||
<!-- TMPL_ELSE --> |
|||
<option value="COOP2of5" selected> |
|||
<!-- /TMPL_IF -->COOP2of5</option> |
|||
<!-- TMPL_IF NAME="Code39_checked" --> |
|||
<option value="Code39" selected> |
|||
<!-- TMPL_ELSE --> |
|||
<option value="Code39" selected> |
|||
<!-- /TMPL_IF -->Code39</option> |
|||
<!-- TMPL_IF NAME="EAN13_checked" --> |
|||
<option value="EAN13" selected> |
|||
<!-- TMPL_ELSE --> |
|||
<option value="EAN13" selected> |
|||
<!-- /TMPL_IF -->EAN 13</option> |
|||
<!-- TMPL_IF NAME="EAN8_checked" --> |
|||
<option value="EAN8" selected> |
|||
<!-- TMPL_ELSE --> |
|||
<option value="EAN8" selected> |
|||
<!-- /TMPL_IF -->EAN8</option> |
|||
<!-- TMPL_IF NAME="ITF_checked" --> |
|||
<option value="ITF" selected> |
|||
<!-- TMPL_ELSE --> |
|||
<option value="ITF" selected> |
|||
<!-- /TMPL_IF -->ITF (Interleaved2of5)</option> |
|||
<!-- TMPL_IF NAME="Industrial2of5_checked" --> |
|||
<option value="Industrial2of5" selected> |
|||
<!-- TMPL_ELSE --> |
|||
<option value="Industrial2of5" selected> |
|||
<!-- /TMPL_IF -->Industrial2of5</option> |
|||
<!-- TMPL_IF NAME="Matrix2of5_checked" --> |
|||
<option value="Matrix2of5" selected> |
|||
<!-- TMPL_ELSE --> |
|||
<option value="Matrix2of5" selected> |
|||
<!-- /TMPL_IF -->Matrix2of5</option> |
|||
<!-- TMPL_IF NAME="NW7_checked" --> |
|||
<option value="NW7" selected> |
|||
<!-- TMPL_ELSE --> |
|||
<option value="NW7" selected> |
|||
<!-- /TMPL_IF -->NW7</option> |
|||
<!-- TMPL_IF NAME="QRcode_checked" --> |
|||
<option value="QRcode" selected> |
|||
<!-- TMPL_ELSE --> |
|||
<option value="QRcode" selected> |
|||
<!-- /TMPL_IF -->QRcode</option> |
|||
<!-- TMPL_IF NAME="UPC-A_checked" --> |
|||
<option value="UPC-A" selected> |
|||
<!-- TMPL_ELSE --> |
|||
<option value="UPC-A" selected> |
|||
<!-- /TMPL_IF -->UPC-A</option> |
|||
<!-- TMPL_IF NAME="UPC-E_checked" --> |
|||
<option value="UPC-E" selected> |
|||
<!-- TMPL_ELSE --> |
|||
<option value="UPC-E" selected> |
|||
<!-- /TMPL_IF -->UPC-E</option> |
|||
</select> |
|||
</h3> |
|||
|
|||
|
|||
<h3>Confirm Printing Type</h3> |
|||
|
|||
<!-- TMPL_IF NAME="printingtype_spine" --> |
|||
<input type="radio" name="printingtype" value="spine" checked/> |
|||
<!-- TMPL_ELSE --> |
|||
<input type="radio" name="printingtype" value="spine" /> |
|||
<!--/TMPL_IF --> |
|||
Spine Labels |
|||
<!-- TMPL_IF NAME="printingtype_barcode" --> |
|||
<input type="radio" name="printingtype" value="barcode" checked /> |
|||
<!-- TMPL_ELSE --> |
|||
<input type="radio" name="printingtype" value="barcode" /> |
|||
<!--/TMPL_IF --> |
|||
Barcode Labels |
|||
|
|||
<!-- TMPL_IF NAME="printingtype_both" --> |
|||
<input type="radio" name="printingtype" value="both" checked /> |
|||
<!-- TMPL_ELSE --> |
|||
<input type="radio" name="printingtype" value="both" /> |
|||
<!--/TMPL_IF --> |
|||
Both Labels |
|||
|
|||
<h3> |
|||
Start printing from Label number:<input type="textbox" name="startlabel" SIZE="1" |
|||
value="<!-- TMPL_VAR NAME="startlabel" -->"> |
|||
|
|||
</h3> |
|||
|
|||
<p> |
|||
<p> |
|||
<!-- TMPL_IF NAME="guidebox"--> |
|||
<input type="checkbox" name="guidebox" value=1 checked /> |
|||
<!-- TMPL_ELSE --> |
|||
<input type="checkbox" name="guidebox" value=1 /> |
|||
<!-- /TMPL_IF --> |
|||
<label for="guidebox">Draw Guide Boxes</label> |
|||
<p> |
|||
<input type="submit" value="Submit"> |
|||
<input type="hidden" name=op value="save_conf"> |
|||
</p> |
|||
</form> |
|||
</div> |
|||
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" --> |
|||
|
@ -1,60 +0,0 @@ |
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --> |
|||
<title>Koha › Label and Barcode Printing</title> |
|||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> |
|||
<!-- TMPL_INCLUDE name="masthead.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="label-topmenu.inc" --> |
|||
<!-- TMPL_INCLUDE name="intranet-nav.inc" --> |
|||
<div id="main"> |
|||
<h1>Labels to be Printed</h1> |
|||
<p> |
|||
Printing will start on <b>row <!-- TMPL_VAR NAME="startrow" --></b><br /> |
|||
Printing will use <b><!-- TMPL_VAR NAME="sheets"--> sheets</b><br /> |
|||
Currently <b><!-- TMPL_VAR NAME="labels_remaining"--> rows</b> spare on <b>sheet <!-- TMPL_VAR NAME="sheets"--></b> |
|||
</p> |
|||
|
|||
<!-- TMPL_IF NAME="resultsloop" --> |
|||
<h2>Items</h2> |
|||
<table> |
|||
<tr> |
|||
<th>Label Number</th> |
|||
<th>Summary</th> |
|||
<th>Item Type</th> |
|||
<th>Delete</th> |
|||
</tr> |
|||
<!-- TMPL_LOOP NAME="resultsloop" --> |
|||
<tr> |
|||
<td> |
|||
<!-- TMPL_VAR NAME="labelno" --> |
|||
</td> |
|||
<td> |
|||
<b> <a href="/cgi-bin/koha/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"> <!-- TMPL_VAR NAME="title" -->:</a></b> <!-- TMPL_VAR NAME="author" -->: |
|||
<!-- TMPL_VAR NAME="isbn" -->: <!-- TMPL_VAR NAME="barcode" --> |
|||
</td> |
|||
<td> |
|||
<!-- TMPL_VAR NAME="itemtype" --> |
|||
</td> |
|||
<td> |
|||
<a href="/cgi-bin/koha/barcodes/label-manager.pl?op=delete&itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->">Delete</a> |
|||
</td> |
|||
</tr> |
|||
<!-- /TMPL_LOOP --> |
|||
</table> |
|||
|
|||
<p><br /> |
|||
<a href="#" onclick="Plugin(); return false;">Add Item</a> |
|||
<a href="/cgi-bin/koha/barcodes/label-print.pl">Preview</a> |
|||
<a href="/cgi-bin/koha/barcodes/label-manager.pl?op=deleteall">Delete All</a> |
|||
</p> |
|||
<!-- TMPL_ELSE --> |
|||
<a href="#" onclick="Plugin(); return false;">Add Item</a> |
|||
<!-- /TMPL_IF --> |
|||
</form> |
|||
</div> |
|||
|
|||
<script type="text/javascript"> |
|||
function Plugin() { |
|||
window.open('label-item-search.pl','FindABibIndex','width=500,height=400,toolbar=no,scrollbars=yes'); |
|||
} |
|||
</script> |
|||
|
|||
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" --> |
@ -1,52 +0,0 @@ |
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --> |
|||
<title>Koha › Label and Barcode Printing</title> |
|||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> |
|||
<!-- TMPL_INCLUDE name="masthead.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="label-topmenu.inc" --> |
|||
<!-- TMPL_INCLUDE name="intranet-nav.inc" --> |
|||
<div id="main"> |
|||
<h1>Current Templates |
|||
|
|||
|
|||
</h1> |
|||
|
|||
<!-- TMPL_IF NAME="resultsloop" --> |
|||
<h2>Templates</h2> |
|||
<table> |
|||
<tr> |
|||
<th>Template Code</th> |
|||
<th>Description</th> |
|||
<th>Edit</th> |
|||
<th>Delete</th> |
|||
<th>Active</th> |
|||
</tr> |
|||
<!-- TMPL_LOOP NAME="resultsloop" --> |
|||
<tr> |
|||
<td> |
|||
<!-- TMPL_VAR NAME="tmpl_code" --> |
|||
</td> |
|||
<td> |
|||
<!-- TMPL_VAR NAME="tmpl_desc" --> |
|||
</td> |
|||
<td> |
|||
<a href="/cgi-bin/koha/barcodes/label-edit-template.pl?tmpl_code=<!-- TMPL_VAR NAME="tmpl_code" -->">Edit</a> |
|||
</td> |
|||
<td> |
|||
<a href="/cgi-bin/koha/barcodes/label-templates.pl?op=delete&tmpl_code=<!-- TMPL_VAR NAME="tmpl_code" -->">Delete</a> |
|||
</td> |
|||
<td> |
|||
<!-- TMPL_IF NAME="active" -->Active<!-- /TMPL_IF --> |
|||
</td> |
|||
</tr> |
|||
<!-- /TMPL_LOOP --> |
|||
</table> |
|||
|
|||
<p><br /> |
|||
|
|||
<a href="/cgi-bin/koha/barcodes/label-create-template.pl?op=blank">Create New Label Template</a> |
|||
|
|||
<!-- /TMPL_IF --> |
|||
</form> |
|||
</div> |
|||
|
|||
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" --> |
@ -1,88 +0,0 @@ |
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --> |
|||
<title>Koha › Printer Configuration</title> |
|||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="menus.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="menu-barcodes.inc" --> |
|||
|
|||
|
|||
<h1>Printer Configuration</h1> |
|||
<h3>Set printer configuration corresponding to your environment</h3> |
|||
<ul> |
|||
<li>Set width and height of the label that you are going to work with.</li> |
|||
<li>Set your system's default DPI.</li> |
|||
<li>Set the page type.</li> |
|||
<li>Select how many columns and rows are in your page type.</li> |
|||
<li>Set left- and bottom-margins of the page that you are going to use. This parameter will help to center the barcodes on the labels.</li> |
|||
</ul> |
|||
<br> |
|||
<form id="formulario" method="post" action="<!-- TMPL_VAR NAME="SCRIPT_NAME" -->" name="form1"> |
|||
<input type="hidden" name="saveSettings" value="1" /> |
|||
<table> |
|||
<tr> |
|||
<th scope="row"> |
|||
Label width (Expressed in mm) |
|||
</th><td> |
|||
<input id="labelWidth" type="text" name="labelWidth" size="5" |
|||
value="<!-- TMPL_VAR NAME="LABEL_WIDTH" -->"> |
|||
</td></tr> |
|||
<th scope="row"> |
|||
Label heigth (Expressed in mm) |
|||
</th><td> |
|||
<input id="labelHeigth" type="text" name="labelHeigth" size="5" |
|||
value="<!-- TMPL_VAR NAME="LABEL_HEIGTH" -->"> |
|||
</td></tr> |
|||
<th scope="row"> |
|||
System dpi |
|||
</th><td> |
|||
<input id="systemDpi" type="text" name="systemDpi" size="5" |
|||
value="<!-- TMPL_VAR NAME="SYSTEM_DPI" -->"> |
|||
</td></tr> |
|||
<th scope="row"> |
|||
Page Type |
|||
</th> <td> |
|||
<select name="pageType" id="pageType" size="1"> |
|||
<!-- TMPL_IF name="A4" --> |
|||
<option value="A4" selected>A4</option> |
|||
<!-- TMPL_ELSE --> |
|||
<option value="A4">A4</option> |
|||
<!-- /TMPL_IF --> |
|||
<!-- TMPL_IF name="Letter" --> |
|||
<option value="Letter" selected>Letter</option> |
|||
<!-- TMPL_ELSE --> |
|||
<option value="Letter">Letter</option> |
|||
<!-- /TMPL_IF --> |
|||
<!-- TMPL_IF name="Legal" --> |
|||
<option value="Legal" selected>Legal</option> |
|||
<!-- TMPL_ELSE --> |
|||
<option value="Legal">Legal</option> |
|||
<!-- /TMPL_IF --> |
|||
</select> |
|||
</td></tr> |
|||
<th scope="row"> |
|||
Columns |
|||
</th> <td> |
|||
<input id="columns" type="text" name="columns" size="5" |
|||
value="<!-- TMPL_VAR NAME="COLUMNS" -->"> |
|||
</td></tr> |
|||
<th scope="row"> |
|||
Rows |
|||
</th> <td> |
|||
<input id="rows" type="text" name="rows" size="5" |
|||
value="<!-- TMPL_VAR NAME="ROWS" -->"> |
|||
</td></tr> |
|||
<th scope="row"> |
|||
Margin Bottom (Expressed in mm) |
|||
</th> <td> |
|||
<input id="marginBottom" type="text" name="marginBottom" size="5" |
|||
value="<!-- TMPL_VAR NAME="MARGIN_TOP" -->"> |
|||
</td></tr> |
|||
<th scope="row"> |
|||
Margin Left (Expressed in mm) |
|||
</th> <td> |
|||
<input id="marginLeft" type="text" name="marginLeft" size="5" |
|||
value="<!-- TMPL_VAR NAME="MARGIN_LEFT" -->"> |
|||
</td></tr> |
|||
</table><input type="submit" value="Save Settings" /> |
|||
</form> |
|||
|
|||
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" --> |
@ -1,60 +0,0 @@ |
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --> |
|||
<title>Koha › Label and Barcode Printing › Search</title> |
|||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> |
|||
|
|||
<!-- TMPL_INCLUDE NAME="menus.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="menu-barcodes.inc" --> |
|||
|
|||
<div id="main-compact"> |
|||
|
|||
<h1>Catalogue Item Search</h1> |
|||
|
|||
<form name="f" method="post"> |
|||
<input type="hidden" name="op" value="do_search" /> |
|||
<input type="hidden" name="type" value="intranet" /> |
|||
<input type="hidden" name="nbstatements" value="<!-- TMPL_VAR NAME="nbstatements" -->" /> |
|||
|
|||
<table> |
|||
<tr><th scope="row"> |
|||
<label for="title">Title</label> |
|||
</th> |
|||
<td> |
|||
<input type="hidden" name="marclist" value="biblio.title" /> |
|||
<input type="hidden" name="and_or" value="and" /> |
|||
<input type="hidden" name="excluding" value="" /> |
|||
<input type="hidden" name="operator" value="contains" /> |
|||
<input type="text" id="title" name="value" /> |
|||
</td></tr> |
|||
<tr><th scope="row"> |
|||
<label for="issn">ISSN</label> |
|||
</th> |
|||
<td> |
|||
<input type="hidden" name="marclist" value="biblioitems.issn" /> |
|||
<input type="hidden" name="and_or" value="and" /> |
|||
<input type="hidden" name="excluding" value="" /> |
|||
<input type="hidden" name="operator" value="=" /> |
|||
<input type="text" name="value" id="issn" /> |
|||
</td></tr> |
|||
<tr><th scope="row"> |
|||
<label for="resultsperpage">Results per page:</label> |
|||
</th> |
|||
<td> |
|||
<select align="right" name="resultsperpage" id="resultsperpage" size="1"> |
|||
<option value="20">20</option> |
|||
<option value="50">50</option> |
|||
<option value="100">100</option> |
|||
</select> |
|||
<label for="orderby">Ordered by</label> |
|||
<select name="orderby" id="orderby" size="1"> |
|||
<option value="biblio.title">Title</option> |
|||
<option value="biblio.author">Author</option> |
|||
<option value="biblioitems.dewey">Dewey</option> |
|||
<option value="biblioitems.publicationyear">Publication Year</option> |
|||
<option value="biblioitems.publishercode">Publisher</option> |
|||
</select> |
|||
</td></tr> |
|||
</table> |
|||
<p> <input type="submit" value="Start search" class="submit" /></p> |
|||
</form> |
|||
</div> |
|||
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" --> |
@ -0,0 +1,7 @@ |
|||
<div class="details" style="width: 43%"> |
|||
<table> |
|||
<tr><th>Layout:</th><td><!-- TMPL_IF NAME="active_layout_name" --><!-- TMPL_VAR NAME="active_layout_name" --><!-- TMPL_ELSE --><span class="error">Select a Label Layout</span><!-- /TMPL_IF --> </td></tr> |
|||
<tr><th>Template: </th><td><!-- TMPL_IF NAME="active_template_name" --><!-- TMPL_VAR NAME="active_template_name" --><!-- TMPL_ELSE --><span class="error">Select a Label Template</span><!-- /TMPL_IF --> </td></tr> |
|||
<tr><th>Batch: </th><td><!-- TMPL_IF NAME="batch_id" --><!-- TMPL_VAR NAME="batch_id" --><!-- TMPL_ELSE --><span class="error">Select items to print</span><!-- /TMPL_IF --> </td></tr> |
|||
</table> |
|||
</div> |
@ -0,0 +1,8 @@ |
|||
<div id="submenu"> |
|||
<a href="/cgi-bin/koha/labels/label-home.pl">Label Layouts</a> | |
|||
<a href="/cgi-bin/koha/labels/label-templates.pl">Label Templates</a> | |
|||
<a href="/cgi-bin/koha/labels/label-manager.pl">Create or Print Label Batches</a> | |
|||
</div> |
|||
|
|||
|
|||
|
@ -1,6 +1,4 @@ |
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --> |
|||
<title>Koha › Label and Barcode Printing › Search</title> |
|||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- Barcodes and Labels: Search<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> |
|||
<div id="main-compact"> |
|||
|
|||
<h1>Search</h1> |
@ -0,0 +1,281 @@ |
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><title>Koha › Labels</title> |
|||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="menus.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="menu-labels.inc" --> |
|||
|
|||
<div id="main"> |
|||
<!-- TMPL_INCLUDE NAME="label-status.inc" --> |
|||
<form name="input" action="/cgi-bin/koha/labels/label-manager.pl" method="get"> |
|||
|
|||
|
|||
|
|||
<h3> |
|||
Layout Name |
|||
|
|||
</h3> |
|||
<input type="textbox" name="layoutname" SIZE="20" |
|||
value="<!-- TMPL_VAR NAME="layoutname" -->"> |
|||
|
|||
|
|||
<p> |
|||
<p> |
|||
<p> |
|||
|
|||
|
|||
|
|||
<h3> |
|||
Choose Order Of Fields to Print |
|||
</h3> |
|||
<table summary="fields to print"> |
|||
<tr> |
|||
<td> |
|||
<select name="tx_title"> |
|||
<option value="0" SELECTED></option> |
|||
<option value="1">1</option> |
|||
<option value="2">2</option> |
|||
<option value="3">3</option> |
|||
<option value="4">4</option> |
|||
<option value="5">5</option> |
|||
<option value="6">6</option> |
|||
<option value="7">7</option> |
|||
<option value="8">8</option> |
|||
<option value="9">9</option> |
|||
<option value="10">10</option> |
|||
</select> |
|||
<label>Title</label> |
|||
</td> |
|||
<td> |
|||
<select name="tx_subtitle"> |
|||
<option value="0" SELECTED></option> |
|||
<option value="1">1</option> |
|||
<option value="2">2</option> |
|||
<option value="3">3</option> |
|||
<option value="4">4</option> |
|||
<option value="5">5</option> |
|||
<option value="6">6</option> |
|||
<option value="7">7</option> |
|||
<option value="8">8</option> |
|||
<option value="9">9</option> |
|||
<option value="10">10</option> |
|||
</select> |
|||
<label>Subtitle</label> |
|||
</td> |
|||
|
|||
<td> |
|||
<select name="tx_author"> |
|||
<option value="0" SELECTED></option> |
|||
<option value="1">1</option> |
|||
<option value="2">2</option> |
|||
<option value="3">3</option> |
|||
<option value="4">4</option> |
|||
<option value="5">5</option> |
|||
<option value="6">6</option> |
|||
<option value="7">7</option> |
|||
<option value="8">8</option> |
|||
<option value="9">9</option> |
|||
<option value="10">10</option> |
|||
</select> |
|||
<label>Author</label> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<select name="tx_isbn"> |
|||
<option value="0" SELECTED></option> |
|||
<option value="1">1</option> |
|||
<option value="2">2</option> |
|||
<option value="3">3</option> |
|||
<option value="4">4</option> |
|||
<option value="5">5</option> |
|||
<option value="6">6</option> |
|||
<option value="7">7</option> |
|||
<option value="8">8</option> |
|||
<option value="9">9</option> |
|||
<option value="10">10</option> |
|||
</select> |
|||
<label>ISBN</label> |
|||
</td> |
|||
|
|||
<td> |
|||
<select name="tx_issn"> |
|||
<option value="0" SELECTED></option> |
|||
<option value="1">1</option> |
|||
<option value="2">2</option> |
|||
<option value="3">3</option> |
|||
<option value="4">4</option> |
|||
<option value="5">5</option> |
|||
<option value="6">6</option> |
|||
<option value="7">7</option> |
|||
<option value="8">8</option> |
|||
<option value="9">9</option> |
|||
<option value="10">10</option> |
|||
</select> |
|||
<label>ISSN</label> |
|||
</td> |
|||
|
|||
|
|||
<td> |
|||
<select name="tx_itemtype"> |
|||
<option value="0" SELECTED></option> |
|||
<option value="1">1</option> |
|||
<option value="2">2</option> |
|||
<option value="3">3</option> |
|||
<option value="4">4</option> |
|||
<option value="5">5</option> |
|||
<option value="6">6</option> |
|||
<option value="7">7</option> |
|||
<option value="8">8</option> |
|||
<option value="9">9</option> |
|||
<option value="10">10</option> |
|||
</select> |
|||
<label>Itemtype</label> |
|||
</td> |
|||
|
|||
|
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<select name="tx_dewey"> |
|||
<option value="0" SELECTED></option> |
|||
<option value="1">1</option> |
|||
<option value="2">2</option> |
|||
<option value="3">3</option> |
|||
<option value="4">4</option> |
|||
<option value="5">5</option> |
|||
<option value="6">6</option> |
|||
<option value="7">7</option> |
|||
<option value="8">8</option> |
|||
<option value="9">9</option> |
|||
<option value="10">10</option> |
|||
</select> |
|||
<label>Dewey</label> |
|||
</td> |
|||
|
|||
<td> |
|||
<select name="tx_barcode"> |
|||
<option value="0" SELECTED></option> |
|||
<option value="1">1</option> |
|||
<option value="2">2</option> |
|||
<option value="3">3</option> |
|||
<option value="4">4</option> |
|||
<option value="5">5</option> |
|||
<option value="6">6</option> |
|||
<option value="7">7</option> |
|||
<option value="8">8</option> |
|||
<option value="9">9</option> |
|||
<option value="10">10</option> |
|||
</select> |
|||
<label>Barcode</label> |
|||
</td> |
|||
|
|||
|
|||
<td> |
|||
<select name="tx_classif"> |
|||
<option value="0" SELECTED></option> |
|||
<option value="1">1</option> |
|||
<option value="2">2</option> |
|||
<option value="3">3</option> |
|||
<option value="4">4</option> |
|||
<option value="5">5</option> |
|||
<option value="6">6</option> |
|||
<option value="7">7</option> |
|||
<option value="8">8</option> |
|||
<option value="9">9</option> |
|||
<option value="10">10</option> |
|||
</select> |
|||
<label>Classification</label> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<select name="tx_subclass"> |
|||
<option value="0" SELECTED></option> |
|||
<option value="1">1</option> |
|||
<option value="2">2</option> |
|||
<option value="3">3</option> |
|||
<option value="4">4</option> |
|||
<option value="5">5</option> |
|||
<option value="6">6</option> |
|||
<option value="7">7</option> |
|||
<option value="8">8</option> |
|||
<option value="9">9</option> |
|||
<option value="10">10</option> |
|||
</select> |
|||
<label>Sub-Class</label> |
|||
</td> |
|||
|
|||
|
|||
<td> |
|||
<select name="tx_itemcallnumber"> |
|||
<option value="0" SELECTED></option> |
|||
<option value="1">1</option> |
|||
<option value="2">2</option> |
|||
<option value="3">3</option> |
|||
<option value="4">4</option> |
|||
<option value="5">5</option> |
|||
<option value="6">6</option> |
|||
<option value="7">7</option> |
|||
<option value="8">8</option> |
|||
<option value="9">9</option> |
|||
<option value="10">10</option> |
|||
</select> |
|||
<label>Call Number</label> |
|||
</td> |
|||
|
|||
|
|||
</tr> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
</table> |
|||
<p> |
|||
|
|||
|
|||
|
|||
<h3>Choose Barcode Type</h3> |
|||
<select name="barcodetype"> |
|||
<!-- TMPL_LOOP NAME="barcode_types" --> |
|||
<option value="<!-- TMPL_VAR NAME="code" -->" |
|||
<!-- TMPL_IF NAME="active" --> selected <!-- /TMPL_IF --> |
|||
><!-- TMPL_VAR NAME="desc" --></option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
|
|||
|
|||
|
|||
<h3>Choose Layout Type</h3> |
|||
<select name="printingtype"> |
|||
<!-- TMPL_LOOP NAME="printingtypes" --> |
|||
<option value="<!-- TMPL_VAR NAME="code" -->" |
|||
<!-- TMPL_IF NAME="active" --> selected <!-- /TMPL_IF --> |
|||
><!-- TMPL_VAR NAME="desc" --></option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
|
|||
|
|||
|
|||
|
|||
<h3> |
|||
Start printing from Label number:<input type="textbox" name="startlabel" SIZE="2" value="1"> |
|||
|
|||
|
|||
</h3> |
|||
|
|||
<p> |
|||
<p> |
|||
<h3>Draw Guide Boxes<input type="checkbox" name="guidebox" value=1></h3> |
|||
<p> |
|||
<p> |
|||
<p> |
|||
<input type="submit" value="Submit"> |
|||
<input type="hidden" name=op value="add_layout"> |
|||
</p> |
|||
</form> |
|||
</div> |
|||
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" --> |
|||
|
@ -0,0 +1,64 @@ |
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><title>Koha › Labels</title> |
|||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="menus.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="menu-labels.inc" --> |
|||
|
|||
<div id="main"> |
|||
|
|||
<form name="input" action="/cgi-bin/koha/labels/label-create-template.pl" method="get"> |
|||
|
|||
<h3> |
|||
Create Label Template |
|||
</h3> |
|||
|
|||
|
|||
|
|||
<h3>Template Settings</h3> |
|||
<table> |
|||
|
|||
Template Code: <input type="text" size="40" name="tmpl_code"><br> |
|||
Template Description: <textarea name="tmpl_desc" cols="40" rows="3" name="tmpl_desc" ></TEXTAREA><br> |
|||
|
|||
<tr> |
|||
<td>Page Width:</td><td><input type="text" size="4" name="page_width"></td> |
|||
<td>Page Height:</td><td><input type="text" size="4" name="page_height"></td> |
|||
</tr> |
|||
<tr> |
|||
<td>Label Width:</td><td><input type="text" size="4" name="label_width"></td> |
|||
<td>Label Height:</td><td><input type="text" size="4" name="label_height"></td> |
|||
</tr> |
|||
<tr> |
|||
<td>Top Page Margin:</td><td><input type="text" size="4" name="topmargin"></td> |
|||
<td>Left Page Margin:</td><td><input type="text" size="4" name="leftmargin"></td> |
|||
</tr> |
|||
<tr> |
|||
<td>Number of Columns:</td><td><input type="text" size="4" name="cols"></td> |
|||
<td>Number of Rows:</td><td><input type="text" size="4" name="rows"></td> |
|||
</tr> |
|||
<tr> |
|||
<td>Gap between Columns:</td><td><input type="text" size="4" name="colgap"></td> |
|||
<td>Gap between Rows:</td><td><input type="text" size="4" name="rowgap"></td> |
|||
</tr> |
|||
</table> |
|||
|
|||
|
|||
<br> |
|||
Units: <select name="units"> |
|||
<!-- TMPL_LOOP NAME="units" --> |
|||
<option value="<!-- TMPL_VAR NAME="unit" -->"><!-- TMPL_VAR NAME="desc" --></option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
|
|||
<br> |
|||
<br> |
|||
Font Size: <input type="textbox" name="fontsize" SIZE="2" |
|||
value=""> |
|||
<br> |
|||
<br> |
|||
<input type="submit" value="Create Template"> |
|||
<input type="reset" value="Reset"> |
|||
<input type="hidden" name=op value="create"> |
|||
</form> |
|||
</div> |
|||
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" --> |
|||
|
@ -0,0 +1,182 @@ |
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- Labels<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> |
|||
<!-- TMPL_INCLUDE name="masthead.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="label-topmenu.inc" --> |
|||
<!-- TMPL_INCLUDE name="intranet-nav.inc" --> |
|||
|
|||
<div id="main"> |
|||
|
|||
<form name="input" action="/cgi-bin/koha/labels/label-manager.pl" method="get"> |
|||
|
|||
<h3>Layout Name</h3> |
|||
<input type="textbox" name="layoutname" SIZE="20" value="<!-- TMPL_VAR NAME="layoutname" -->"> |
|||
|
|||
<br /> |
|||
<br /> |
|||
|
|||
<h3>Choose Barcode Type (encoding)</h3> |
|||
<select name="barcodetype"> |
|||
<!-- TMPL_LOOP NAME="barcode_types" --> |
|||
<option value="<!-- TMPL_VAR NAME="code" -->" |
|||
<!-- TMPL_IF NAME="active" --> selected <!-- /TMPL_IF --> |
|||
><!-- TMPL_VAR NAME="desc" --></option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
<br /> |
|||
|
|||
<h3>Choose Layout Type</h3> |
|||
<select name="printingtype"> |
|||
<!-- TMPL_LOOP NAME="printingtypes" --> |
|||
<option value="<!-- TMPL_VAR NAME="code" -->" |
|||
<!-- TMPL_IF NAME="active" --> selected <!-- /TMPL_IF -->> |
|||
<!-- TMPL_VAR NAME="desc" --></option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
|
|||
<br /> |
|||
<br /> |
|||
|
|||
<h3> |
|||
Choose Order Of Text Fields to Print |
|||
</h3> |
|||
<table summary="fields to print"> |
|||
<tr> |
|||
<td> |
|||
<select name="tx_title"> |
|||
<!-- TMPL_LOOP Name="tx_title" --> |
|||
<option value="<!-- TMPL_VAR Name="num" -->"<!-- TMPL_IF Name="selected" --> selected <!-- /TMPL_IF -->> |
|||
<!-- TMPL_VAR Name="num" --> |
|||
</option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
<label>Title</label> |
|||
</td> |
|||
<td> |
|||
<select name="tx_subtitle"> |
|||
<!-- TMPL_LOOP Name="tx_subtitle" --> |
|||
<option value="<!-- TMPL_VAR Name="num" -->"<!-- TMPL_IF Name="selected" --> selected <!-- /TMPL_IF -->> |
|||
<!-- TMPL_VAR Name="num" --> |
|||
</option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
<label>Subtitle</label> |
|||
</td> |
|||
|
|||
<td> |
|||
<select name="tx_author"> |
|||
<!-- TMPL_LOOP Name="tx_author" --> |
|||
<option value="<!-- TMPL_VAR Name="num" -->"<!-- TMPL_IF Name="selected" --> selected <!-- /TMPL_IF -->> |
|||
<!-- TMPL_VAR Name="num" --> |
|||
</option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
<label>Author</label> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<select name="tx_isbn"> |
|||
<!-- TMPL_LOOP Name="tx_isbn" --> |
|||
<option value="<!-- TMPL_VAR Name="num" -->"<!-- TMPL_IF Name="selected" --> selected <!-- /TMPL_IF -->> |
|||
<!-- TMPL_VAR Name="num" --> |
|||
</option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
<label>ISBN</label> |
|||
</td> |
|||
|
|||
<td> |
|||
<select name="tx_issn"> |
|||
<!-- TMPL_LOOP Name="tx_issn" --> |
|||
<option value="<!-- TMPL_VAR Name="num" -->"<!-- TMPL_IF Name="selected" --> selected <!-- /TMPL_IF -->> |
|||
<!-- TMPL_VAR Name="num" --> |
|||
</option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
<label>ISSN</label> |
|||
<td> |
|||
<select name="tx_itemtype"> |
|||
<!-- TMPL_LOOP Name="tx_itemtype" --> |
|||
<option value="<!-- TMPL_VAR Name="num" -->"<!-- TMPL_IF Name="selected" --> selected <!-- /TMPL_IF -->> |
|||
<!-- TMPL_VAR Name="num" --> |
|||
</option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
<label>Itemtype</label> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<select name="tx_dewey"> |
|||
<!-- TMPL_LOOP Name="tx_dewey" --> |
|||
<option value="<!-- TMPL_VAR Name="num" -->"<!-- TMPL_IF Name="selected" --> selected <!-- /TMPL_IF -->> |
|||
<!-- TMPL_VAR Name="num" --> |
|||
</option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
<label>Dewey</label> |
|||
</td> |
|||
<td> |
|||
<select name="tx_barcode"> |
|||
<!-- TMPL_LOOP Name="tx_barcode" --> |
|||
<option value="<!-- TMPL_VAR Name="num" -->"<!-- TMPL_IF Name="selected" --> selected <!-- /TMPL_IF -->> |
|||
<!-- TMPL_VAR Name="num" --> |
|||
</option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
<label>Barcode (as text)</label> |
|||
</td> |
|||
<td> |
|||
<select name="tx_classif"> |
|||
<!-- TMPL_LOOP Name="tx_classif" --> |
|||
<option value="<!-- TMPL_VAR Name="num" -->"<!-- TMPL_IF Name="selected" --> selected <!-- /TMPL_IF -->> |
|||
<!-- TMPL_VAR Name="num" --> |
|||
</option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
<label>Classification</label> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<select name="tx_subclass"> |
|||
<!-- TMPL_LOOP Name="tx_subclass" --> |
|||
<option value="<!-- TMPL_VAR Name="num" -->"<!-- TMPL_IF Name="selected" --> selected <!-- /TMPL_IF -->> |
|||
<!-- TMPL_VAR Name="num" --> |
|||
</option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
<label>Subclass</label> |
|||
</td> |
|||
<td> |
|||
<select name="tx_itemcallnumber"> |
|||
<!-- TMPL_LOOP Name="tx_itemcallnumber" --> |
|||
<option value="<!-- TMPL_VAR Name="num" -->"<!-- TMPL_IF Name="selected" --> selected <!-- /TMPL_IF -->> |
|||
<!-- TMPL_VAR Name="num" --> |
|||
</option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
<label>Call Number</label> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
|
|||
<br /> |
|||
<h3> |
|||
Start printing from Label number:<input type="textbox" name="startlabel" SIZE="1" value=" <!-- TMPL_VAR NAME="startlabel" --> "> |
|||
</h3> |
|||
|
|||
<br /> |
|||
<h3>Draw Guide Boxes<input type="checkbox" name="guidebox" value=1 |
|||
<!-- TMPL_IF NAME="guidebox"--> |
|||
checked |
|||
<!-- /TMPL_IF --> ></h3> |
|||
|
|||
<p> |
|||
<input type="submit" value="Submit"> |
|||
<input type="hidden" name=op value="save_layout"> |
|||
<input type="hidden" name=layout_id value="<!-- TMPL_VAR NAME="layout_id" -->"> |
|||
</p> |
|||
</form> |
|||
</div> |
|||
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" --> |
|||
|
@ -0,0 +1,57 @@ |
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><title>Koha › Labels</title> |
|||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="menus.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="menu-labels.inc" --> |
|||
|
|||
<div id="main"> |
|||
<!-- TMPL_INCLUDE NAME="label-status.inc" --> |
|||
|
|||
<!-- TMPL_IF NAME="layout_loop" --> |
|||
<h2>Select a Current Layout</h2> |
|||
<form name="input" action="/cgi-bin/koha/labels/label-manager.pl" method="get"> |
|||
<table> |
|||
<tr> |
|||
<th>Layout</th> |
|||
<th>Barcode Type</th> |
|||
<th>Print Type</th> |
|||
<th>Fields to Print</th> |
|||
<th>Edit</th> |
|||
<th>Delete</th> |
|||
<th>Active</th> |
|||
</tr> |
|||
<!-- TMPL_LOOP NAME="layout_loop" --> |
|||
<tr> |
|||
<td><!-- TMPL_VAR NAME="layoutname" --> </td> |
|||
<td> <!-- TMPL_VAR NAME="barcodetype" --> </td> |
|||
<td> <!-- TMPL_VAR NAME="printingtype" --> </td> |
|||
|
|||
<td> |
|||
<!-- TMPL_VAR NAME="fieldlist" --> |
|||
</td> |
|||
|
|||
<td> |
|||
<a href="/cgi-bin/koha/labels/label-edit-layout.pl?layout_id=<!-- TMPL_VAR NAME="id" -->">Edit</a> |
|||
</td> |
|||
<td> |
|||
<a href="/cgi-bin/koha/label-home.pl?op=delete_layout&layout_id=<!-- TMPL_VAR NAME="id"-->">Delete</a> |
|||
</td> |
|||
<td> |
|||
<input type="radio" name="layout_id" value="<!-- TMPL_VAR NAME="id" -->" |
|||
<!-- TMPL_IF NAME="active" --> |
|||
checked |
|||
<!-- /TMPL_IF --> |
|||
> |
|||
</td> |
|||
</tr> |
|||
|
|||
<!-- /TMPL_LOOP --> |
|||
<tr><td colspan="7" align="right"> |
|||
<input type="submit" value="Set Active Layout"> |
|||
<input type="hidden" name=op value="set_active_layout"> |
|||
</table> |
|||
</form> |
|||
<!-- /TMPL_IF --> |
|||
<p><a href="/cgi-bin/koha/labels/label-create-layout.pl">Create New Layout</a></p> |
|||
</div> |
|||
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" --> |
|||
|
@ -0,0 +1,111 @@ |
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><title>Koha › Labels</title> |
|||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="menus.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="menu-labels.inc" --> |
|||
|
|||
<div id="main"> |
|||
<!-- TMPL_INCLUDE NAME="label-status.inc" --> |
|||
|
|||
<!-- TMPL_UNLESS NAME="batch_id" --> |
|||
<div class="details"> |
|||
<a class="button" href="/cgi-bin/koha/labels/label-manager.pl?op=add_batch">Create New Batch</a> |
|||
|
|||
<!-- <form style="padding: 3px 30px; border-left: 1px solid black;border-right: 1px solid black;margin: 0 20px;" name="input" action="/cgi-bin/koha/labels/label-manager.pl" method="get"> |
|||
<select name="batch_id"> |
|||
<!-- TMPL_LOOP NAME="batches" --> |
|||
<option value="<!-- TMPL_VAR NAME="batch_id" -->" <!-- TMPL_IF NAME="active" --> selected <!-- /TMPL_IF -->> |
|||
<!-- TMPL_VAR NAME="batch_id" --></option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
<input type="submit" value="Open Existing Batch"> |
|||
</form> |
|||
--> |
|||
</div> |
|||
<!-- TMPL_IF NAME="batches" --> |
|||
<h2>Label Batches</h2> |
|||
<table> |
|||
<tr> |
|||
<th>Batch id</th> |
|||
<th>#</th> |
|||
<th>Edit</th> |
|||
<th>Delete</th> |
|||
<th>Print</th> |
|||
</tr> |
|||
<!-- TMPL_LOOP NAME="batches" --> |
|||
<tr> |
|||
<td> |
|||
<!-- TMPL_VAR NAME="batch_id" --> |
|||
</td> |
|||
<td> |
|||
<!-- TMPL_VAR NAME="num" --> records |
|||
</td> |
|||
<td> |
|||
<a href="/cgi-bin/koha/labels/label-manager.pl?batch_id=<!-- TMPL_VAR NAME="batch_id" -->">Edit</a> |
|||
</td> |
|||
<td> |
|||
<a href="/cgi-bin/koha/labels/label-manager.pl?op=delete_batch&batch_id=<!-- TMPL_VAR NAME="batch_id" -->">Delete</a> |
|||
</td> |
|||
<td> |
|||
<a class="button" style="float: right;" href="/cgi-bin/koha/labels/label-print-pdf.pl?batch_id=<!-- TMPL_VAR NAME="batch_id" -->">Generate PDF for Batch <!-- TMPL_VAR NAME="batch_id" --></a> |
|||
</td></tr> |
|||
<!-- /TMPL_LOOP --> |
|||
</table> |
|||
|
|||
<!-- /TMPL_IF --> |
|||
|
|||
<!-- TMPL_ELSE --> |
|||
<div class="details"> |
|||
<br /> |
|||
|
|||
<a class="button" href="#" onclick="Plugin(<!-- TMPL_VAR NAME="batch_id" -->); return false;">Add item(s) to batch</a> |
|||
<a class="button" href="/cgi-bin/koha/labels/label-manager.pl?batch_id=">Return to batch summary</a> |
|||
<a class="button" style="border:2px solid #634;" href="/cgi-bin/koha/labels/label-manager.pl?op=delete_batch&batch_id=<!-- TMPL_VAR NAME="batch_id" -->">Delete current batch (<!-- TMPL_VAR NAME="batch_id" -->)</a> |
|||
<a class="button" href="/cgi-bin/koha/labels/label-print-pdf.pl?batch_id=<!-- TMPL_VAR NAME="batch_id" -->">Generate PDF for Batch: <!-- TMPL_VAR NAME="batch_id" --></a> |
|||
</div> |
|||
|
|||
<h2>Items to be Printed for Batch <!-- TMPL_VAR NAME="batch_id" --> (<!-- TMPL_VAR NAME="batch_count" --> items)</h2> |
|||
|
|||
<table> |
|||
<tr> |
|||
<th>Label Number</th> |
|||
<th>Summary</th> |
|||
<th>Item Type</th> |
|||
<th>Barcode</th> |
|||
<th>Delete</th> |
|||
</tr> |
|||
<!-- TMPL_LOOP NAME="resultsloop" --> |
|||
<tr> |
|||
<td> |
|||
<!-- TMPL_VAR NAME="labelno" --> |
|||
</td> |
|||
<td> |
|||
<b> <a href="/cgi-bin/koha/detail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" -->"> <!-- TMPL_VAR NAME="title" -->:</a></b> <!-- TMPL_VAR NAME="author" -->: |
|||
<!-- TMPL_VAR NAME="isbn" --> </td> |
|||
<td> <!-- TMPL_VAR NAME="itemtype" --> </td> |
|||
<td> <!-- TMPL_VAR NAME="barcode" --> </td> |
|||
<td> |
|||
<a href="/cgi-bin/koha/labels/label-manager.pl?op=delete&itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->&batch_id=<!-- TMPL_VAR NAME="batch_id" -->">Delete</a> |
|||
</td> |
|||
</tr> |
|||
<!-- /TMPL_LOOP --> |
|||
</table> |
|||
|
|||
|
|||
<!-- /TMPL_UNLESS --> |
|||
|
|||
|
|||
|
|||
</div> |
|||
|
|||
|
|||
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" --> |
|||
|
|||
|
|||
|
|||
<script type="text/javascript"> |
|||
function Plugin(batch_id) { |
|||
window.open("label-item-search.pl?batch_id="+batch_id+"",'FindABibIndex','width=600,height=460,toolbar=no,scrollbars=yes'); |
|||
} |
|||
</script> |
|||
|
|||
|
@ -0,0 +1,57 @@ |
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><title>Koha › Labels</title> |
|||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="menus.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="menu-labels.inc" --> |
|||
|
|||
<div id="main"> |
|||
<!-- TMPL_INCLUDE NAME="label-status.inc" --> |
|||
|
|||
<!-- TMPL_IF NAME="resultsloop" --> |
|||
<h2>Templates</h2> |
|||
<form name="input" action="/cgi-bin/koha/labels/label-templates.pl" method="get"> |
|||
<table> |
|||
<tr> |
|||
<th>Template Code</th> |
|||
<th>Description</th> |
|||
<th>Edit</th> |
|||
<th>Delete</th> |
|||
<th>Active</th> |
|||
</tr> |
|||
<!-- TMPL_LOOP NAME="resultsloop" --> |
|||
<tr> |
|||
<td> |
|||
<!-- TMPL_VAR NAME="tmpl_code" --> |
|||
</td> |
|||
<td> |
|||
<!-- TMPL_VAR NAME="tmpl_desc" --> |
|||
</td> |
|||
<td> |
|||
<a href="/cgi-bin/koha/labels/label-edit-template.pl?tmpl_id=<!-- TMPL_VAR NAME="tmpl_id" -->">Edit</a> |
|||
</td> |
|||
<td> |
|||
<a href="/cgi-bin/koha/labels/label-templates.pl?op=delete&tmpl_id=<!-- TMPL_VAR NAME="tmpl_id" -->">Delete</a> |
|||
</td> |
|||
<td> |
|||
<input type="radio" name="tmpl_id" value="<!-- TMPL_VAR NAME="tmpl_id" -->" |
|||
<!-- TMPL_IF NAME="active" --> |
|||
checked |
|||
<!-- /TMPL_IF --> |
|||
> |
|||
|
|||
</td> |
|||
</tr> |
|||
<!-- /TMPL_LOOP --> |
|||
<tr><td colspan="5" align="right"> |
|||
<input class="button" type="submit" value="Set Active Template"> |
|||
<input type="hidden" name=op value="set_active_template"> |
|||
</td></tr> |
|||
</table> |
|||
|
|||
</form> |
|||
<!-- /TMPL_IF --> |
|||
|
|||
<br/> |
|||
<a href="/cgi-bin/koha/labels/label-create-template.pl?op=blank">Create New Label Template</a> |
|||
</div> |
|||
|
|||
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" --> |
@ -0,0 +1,128 @@ |
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><title>Koha › Labels</title> |
|||
<!-- TMPL_INCLUDE NAME="calendar.inc" --> |
|||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> |
|||
|
|||
<div id="main-compact"> |
|||
|
|||
<h1>Catalog item search |
|||
|
|||
<!-- TMPL_IF name="batch_id" --> |
|||
for batch <!-- TMPL_VAR NAME="batch_id" --> |
|||
<!-- /TMPL_IF --> |
|||
</h1> |
|||
|
|||
<form name="f" method="post"> |
|||
<input type="hidden" name="op" value="do_search" /> |
|||
<input type="hidden" name="batch_id" value="<!-- TMPL_VAR NAME="batch_id" -->" /> |
|||
<div> |
|||
<select name="idx"> |
|||
<option value="kw" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Keyword</option> |
|||
<option value="au" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Author</option> |
|||
<option value="yr" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Publication Date</option> |
|||
<option value="sn" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Standard Number</option> |
|||
<option value="nb" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>ISBN</option> |
|||
<option value="ns" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>ISSN</option> |
|||
<option value="lcn" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Call Number</option> |
|||
<option value="su" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Subject</option> |
|||
<option value="ti" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Title</option> |
|||
<option value="ti,phr" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Title Phrase</option> |
|||
<option value="se" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Series Title</option> |
|||
<option value="bc" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Barcode</option> |
|||
<option value="acqdate" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Acquisition Date</option> |
|||
</select> |
|||
<input type="text" size="30" name="marclist" title="Enter search terms" value=""/> |
|||
</div><div> |
|||
<select name="idx"> |
|||
<option value="kw" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Keyword</option> |
|||
<option value="au" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Author</option> |
|||
<option value="yr" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Publication Date</option> |
|||
<option value="sn" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Standard Number</option> |
|||
<option value="nb" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>ISBN</option> |
|||
<option value="ns" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>ISSN</option> |
|||
<option value="lcn" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Call Number</option> |
|||
<option value="su" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Subject</option> |
|||
<option value="ti" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Title</option> |
|||
<option value="ti,phr" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Title Phrase</option> |
|||
<option value="se" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Series Title</option> |
|||
<option value="bc" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Barcode</option> |
|||
<option value="acqdate" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Acquisition Date</option> |
|||
</select> |
|||
<input type="text" size="30" name="q" title="Enter search terms" value=""/> |
|||
</div> |
|||
|
|||
<!-- TMPL_IF NAME="sort_by_loop" --> |
|||
<fieldset><legend>Sort by: </legend> |
|||
<p><select id="sort_by" name="sort_by"> |
|||
<option value="">Field-weighted, Relevance Ranked</option> |
|||
<!-- TMPL_LOOP NAME="sort_by_loop" --> |
|||
<option value="<!-- TMPL_VAR NAME="value" -->" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->><!-- TMPL_VAR NAME="label" --></option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
</p> |
|||
</fieldset> |
|||
<!-- /TMPL_IF --> |
|||
|
|||
<table> |
|||
<!-- |
|||
<tr><th scope="row"> |
|||
<label for="datefrom">Added on or after date</label> |
|||
</th> |
|||
<td> |
|||
<input type="hidden" name="marclist" value="items.dateaccessioned" /> |
|||
<input type="hidden" name="and_or" value="and" /> |
|||
<input type="hidden" name="excluding" value="" /> |
|||
<input type="hidden" name="operator" value=">=" /> |
|||
<input type="text" size="10" id="datefrom" name="value" value="" /> |
|||
<img src="<!-- TMPL_VAR Name="themelang" -->/includes/calendar/cal.gif" border="0" id="openCalendarFrom" style="cursor: pointer;" valign="top" /> |
|||
|
|||
<script type="text/javascript"> |
|||
Calendar.setup({ |
|||
inputField : "datefrom", |
|||
ifFormat : "%Y-%m-%d", |
|||
button : "openCalendarFrom", |
|||
align : "Tl", |
|||
singleClick : false |
|||
}); |
|||
</script> |
|||
|
|||
|
|||
</td> |
|||
</tr> |
|||
<tr><th scope="row"> |
|||
<label for="dateto">Added on or before date</label> |
|||
</th> |
|||
<td> |
|||
<input type="hidden" name="marclist" value="items.dateaccessioned" /> |
|||
<input type="hidden" name="and_or" value="and" /> |
|||
<input type="hidden" name="excluding" value="" /> |
|||
<input type="hidden" name="operator" value="<=" /> |
|||
<input type="text" size="10" id="dateto" name="value" value="" /> |
|||
<img src="<!-- TMPL_VAR Name="themelang" -->/includes/calendar/cal.gif" border="0" id="openCalendarTo" style="cursor: pointer;" valign="top" /> |
|||
|
|||
<script type="text/javascript"> |
|||
Calendar.setup({ |
|||
inputField : "dateto", |
|||
ifFormat : "%Y-%m-%d", |
|||
button : "openCalendarTo", |
|||
align : "Tl", |
|||
}); |
|||
</script> |
|||
--> |
|||
<tr><th scope="row">Document Type</th> |
|||
<td colspan="2"> |
|||
<select name="Filter"> |
|||
<option value="">All Item Types</option> |
|||
<!-- TMPL_LOOP name="itemtypeloop" --> |
|||
<option value="<!-- TMPL_VAR name="value" -->" |
|||
<!-- TMPL_IF name="selected" --> selected="selected" |
|||
<!-- /TMPL_IF -->><!-- TMPL_VAR name="description" --></option> |
|||
<!-- /TMPL_LOOP --> |
|||
</select> |
|||
</td> |
|||
</tr> |
|||
|
|||
</table> |
|||
<p> <input type="submit" value="Start search" class="submit" /></p> |
|||
</form> |
|||
</div> |
|||
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" --> |
@ -0,0 +1,84 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
use strict; |
|||
use CGI; |
|||
use C4::Auth; |
|||
use C4::Output; |
|||
use C4::Labels; |
|||
use C4::Context; |
|||
use HTML::Template; |
|||
|
|||
#use Data::Dumper; |
|||
#use Smart::Comments; |
|||
|
|||
my $query = new CGI; |
|||
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
|||
{ |
|||
template_name => "labels/label-create-layout.tmpl", |
|||
query => $query, |
|||
type => "intranet", |
|||
authnotrequired => 0, |
|||
flagsrequired => { catalogue => 1 }, |
|||
debug => 1, |
|||
} |
|||
); |
|||
|
|||
my $data = get_label_options(); |
|||
my $op = $query->param('op'); |
|||
|
|||
my $active_template = GetActiveLabelTemplate(); |
|||
my @label_templates = GetAllLabelTemplates(); |
|||
my @printingtypes = get_printingtypes(); |
|||
my @layouts = get_layouts(); |
|||
my @barcode_types = get_barcode_types(); |
|||
my @batches = get_batches(); |
|||
|
|||
if ($op = 'add_layout') { |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
### $data |
|||
|
|||
$template->param( guidebox => 1 ) if ( $data->{'guidebox'} ); |
|||
$template->param( "papertype_$data->{'papertype'}" => 1 ); |
|||
$template->param( "$data->{'barcodetype'}_checked" => 1 ); |
|||
$template->param( "startrow" . $data->{'startrow'} . "_checked" => 1 ); |
|||
|
|||
$template->param( |
|||
|
|||
op => $op, |
|||
active_template => $data->{'active_template'}, |
|||
label_templates => \@label_templates, |
|||
barcode_types => \@barcode_types, |
|||
printingtypes => \@printingtypes, |
|||
layout_loop => \@layouts, |
|||
|
|||
batches => \@batches, |
|||
id => $data->{'id'}, |
|||
barcodetype => $data->{'barcodetype'}, |
|||
papertype => $data->{'papertype'}, |
|||
|
|||
tx_author => $data->{'author'}, |
|||
tx_barcode => $data->{'barcode'}, |
|||
tx_title => $data->{'title'}, |
|||
tx_subtitle => $data->{'subtitle'}, |
|||
tx_isbn => $data->{'isbn'}, |
|||
tx_issn => $data->{'issn'}, |
|||
tx_itemtype => $data->{'itemtype'}, |
|||
tx_dewey => $data->{'dewey'}, |
|||
tx_class => $data->{'class'}, |
|||
tx_subclass => $data->{'subclass'}, |
|||
tx_itemcallnumber => $data->{'itemcallnumber'}, |
|||
|
|||
startlabel => $data->{'startlabel'}, |
|||
fontsize => $active_template->{'fontsize'}, |
|||
|
|||
intranetcolorstylesheet => |
|||
C4::Context->preference("intranetcolorstylesheet"), |
|||
intranetstylesheet => C4::Context->preference("intranetstylesheet"), |
|||
IntranetNav => C4::Context->preference("IntranetNav"), |
|||
); |
|||
|
|||
output_html_with_http_headers $query, $cookie, $template->output; |
@ -0,0 +1,85 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
use strict; |
|||
use CGI; |
|||
use C4::Auth; |
|||
use C4::Context; |
|||
use C4::Output; |
|||
use C4::Labels; |
|||
use HTML::Template; |
|||
use POSIX; |
|||
|
|||
#use Data::Dumper; |
|||
use Smart::Comments; |
|||
|
|||
my $dbh = C4::Context->dbh; |
|||
my $query = new CGI; |
|||
### $query |
|||
|
|||
my $tmpl_code = $query->param('tmpl_code'); |
|||
my $tmpl_desc = $query->param('tmpl_desc'); |
|||
my $page_height = $query->param('page_height'); |
|||
my $page_width = $query->param('page_width'); |
|||
my $label_height = $query->param('label_height'); |
|||
my $label_width = $query->param('label_width'); |
|||
my $topmargin = $query->param('topmargin'); |
|||
my $leftmargin = $query->param('leftmargin'); |
|||
my $cols = $query->param('cols'); |
|||
my $rows = $query->param('rows'); |
|||
my $colgap = $query->param('colgap'); |
|||
my $rowgap = $query->param('rowgap'); |
|||
my $units = $query->param('units'); |
|||
my $fontsize = $query->param('fontsize'); |
|||
|
|||
my $batch_id = $query->param('batch_id'); |
|||
|
|||
|
|||
my $op = $query->param('op'); |
|||
my @resultsloop; |
|||
|
|||
my ( $template, $loggedinuser, $cookie ); |
|||
|
|||
if ( $op eq 'blank' ) { |
|||
|
|||
my @units = ( |
|||
{ unit => 'INCH', desc => 'Inches' }, |
|||
{ unit => 'CM', desc => 'Centimeters' }, |
|||
{ unit => 'MM', desc => 'Millimeters' }, |
|||
{ unit => 'POINT', desc => 'Postscript Points' }, |
|||
); |
|||
|
|||
( $template, $loggedinuser, $cookie ) = get_template_and_user( |
|||
{ |
|||
template_name => "labels/label-create-template.tmpl", |
|||
query => $query, |
|||
type => "intranet", |
|||
authnotrequired => 1, |
|||
flagsrequired => { catalogue => 1 }, |
|||
debug => 1, |
|||
} |
|||
); |
|||
|
|||
$template->param( |
|||
units => \@units, |
|||
intranetcolorstylesheet => |
|||
C4::Context->preference("intranetcolorstylesheet"), |
|||
intranetstylesheet => C4::Context->preference("intranetstylesheet"), |
|||
IntranetNav => C4::Context->preference("IntranetNav"), |
|||
); |
|||
|
|||
} |
|||
|
|||
elsif ( $op eq 'create' ) { |
|||
CreateTemplate( |
|||
|
|||
$tmpl_code, $tmpl_desc, $page_width, |
|||
$page_height, $label_width, $label_height, $topmargin, |
|||
$leftmargin, $cols, $rows, $colgap, |
|||
$rowgap, $fontsize, $units ); |
|||
|
|||
print $query->redirect("./label-templates.pl"); |
|||
exit; |
|||
|
|||
} |
|||
|
|||
output_html_with_http_headers $query, $cookie, $template->output; |
@ -0,0 +1,87 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
use strict; |
|||
use CGI; |
|||
use C4::Auth; |
|||
use C4::Context; |
|||
use C4::Output; |
|||
use C4::Labels; |
|||
use C4::Interface::CGI::Output; |
|||
use HTML::Template; |
|||
use POSIX; |
|||
|
|||
#use Data::Dumper; |
|||
#use Smart::Comments; |
|||
|
|||
my $dbh = C4::Context->dbh; |
|||
my $query = new CGI; |
|||
my $layout_id = $query->param('layout_id'); |
|||
|
|||
### $query; |
|||
|
|||
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
|||
{ |
|||
template_name => "barcodes/label-edit-layout.tmpl", |
|||
query => $query, |
|||
type => "intranet", |
|||
authnotrequired => 1, |
|||
flagsrequired => { catalogue => 1 }, |
|||
debug => 1, |
|||
} |
|||
); |
|||
|
|||
my $layout = get_layout($layout_id); |
|||
my @barcode_types = get_barcode_types($layout_id); |
|||
my @printingtypes = get_printingtypes($layout_id); |
|||
### @printingtypes |
|||
### $layout |
|||
|
|||
my $layoutname = $layout->{'layoutname'}; |
|||
my $layout_id = $layout->{'id'}; |
|||
my $guidebox = $layout->{'guidebox'}; |
|||
my $startlabel = $layout->{'startlabel'}; |
|||
|
|||
my @title = build_text_dropbox( $layout->{'title'} ); |
|||
my @subtitle = build_text_dropbox( $layout->{'subtitle'} ); |
|||
my @author = build_text_dropbox( $layout->{'author'} ); |
|||
my @barcode = build_text_dropbox( $layout->{'barcode'} ); |
|||
my @isbn = build_text_dropbox( $layout->{'isbn'} ); |
|||
my @issn = build_text_dropbox( $layout->{'issn'} ); |
|||
my @itemtype = build_text_dropbox( $layout->{'itemtype'} ); |
|||
my @dewey = build_text_dropbox( $layout->{'dewey'} ); |
|||
my @class = build_text_dropbox( $layout->{'class'} ); |
|||
my @subclass = build_text_dropbox( $layout->{'subclass'} ); |
|||
my @itemcallnumber = build_text_dropbox( $layout->{'itemcallnumber'} ); |
|||
|
|||
|
|||
### @subclass |
|||
|
|||
$template->param( |
|||
barcode_types => \@barcode_types, |
|||
printingtypes => \@printingtypes, |
|||
|
|||
layoutname => $layoutname, |
|||
layout_id => $layout_id, |
|||
|
|||
guidebox => $guidebox, |
|||
startlabel => $startlabel, |
|||
|
|||
tx_title => \@title, |
|||
tx_subtitle => \@subtitle, |
|||
tx_author => \@author, |
|||
tx_isbn => \@isbn, |
|||
tx_issn => \@issn, |
|||
tx_itemtype => \@itemtype, |
|||
tx_dewey => \@dewey, |
|||
tx_barcode => \@barcode, |
|||
tx_classif => \@class, |
|||
tx_subclass => \@subclass, |
|||
tx_itemcallnumber => \@itemcallnumber, |
|||
|
|||
intranetcolorstylesheet => |
|||
C4::Context->preference("intranetcolorstylesheet"), |
|||
intranetstylesheet => C4::Context->preference("intranetstylesheet"), |
|||
IntranetNav => C4::Context->preference("IntranetNav"), |
|||
); |
|||
|
|||
output_html_with_http_headers $query, $cookie, $template->output; |
@ -0,0 +1,80 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
use strict; |
|||
use CGI; |
|||
use C4::Auth; |
|||
use C4::Context; |
|||
use C4::Output; |
|||
use C4::Labels; |
|||
use HTML::Template; |
|||
use POSIX; |
|||
|
|||
# use Data::Dumper; |
|||
|
|||
my $dbh = C4::Context->dbh; |
|||
my $query = new CGI; |
|||
|
|||
my $tmpl_id = $query->param('tmpl_id'); |
|||
|
|||
my $width = $query->param('width'); |
|||
my $height = $query->param('height'); |
|||
my $topmargin = $query->param('topmargin'); |
|||
my $leftmargin = $query->param('leftmargin'); |
|||
my $columns = $query->param('columns'); |
|||
my $rows = $query->param('rows'); |
|||
my $colgap = $query->param('colgap'); |
|||
my $rowgap = $query->param('rowgap'); |
|||
|
|||
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
|||
{ |
|||
template_name => "labels/label-edit-template.tmpl", |
|||
query => $query, |
|||
type => "intranet", |
|||
authnotrequired => 1, |
|||
flagsrequired => { catalogue => 1 }, |
|||
debug => 1, |
|||
} |
|||
); |
|||
|
|||
my $tmpl = GetSingleLabelTemplate($tmpl_id); |
|||
|
|||
my @units = ( |
|||
{ unit => 'INCH', desc => 'Inches' }, |
|||
{ unit => 'CM', desc => 'Centimeters' }, |
|||
{ unit => 'MM', desc => 'Millimeters' }, |
|||
{ unit => 'POINT', desc => 'Postscript Points' }, |
|||
); |
|||
|
|||
foreach my $unit (@units) { |
|||
if ( $unit->{'unit'} eq $tmpl->{'units'} ) { |
|||
$unit->{'selected'} = 1; |
|||
} |
|||
} |
|||
|
|||
$template->param( |
|||
|
|||
units => \@units, |
|||
|
|||
tmpl_id => $tmpl->{'tmpl_id'}, |
|||
tmpl_code => $tmpl->{'tmpl_code'}, |
|||
tmpl_desc => $tmpl->{'tmpl_desc'}, |
|||
page_width => $tmpl->{'page_width'}, |
|||
page_height => $tmpl->{'page_height'}, |
|||
label_width => $tmpl->{'label_width'}, |
|||
label_height => $tmpl->{'label_height'}, |
|||
topmargin => $tmpl->{'topmargin'}, |
|||
leftmargin => $tmpl->{'leftmargin'}, |
|||
cols => $tmpl->{'cols'}, |
|||
rows => $tmpl->{'rows'}, |
|||
colgap => $tmpl->{'colgap'}, |
|||
rowgap => $tmpl->{'rowgap'}, |
|||
fontsize => $tmpl->{'fontsize'}, |
|||
active => $tmpl->{'active'}, |
|||
|
|||
intranetcolorstylesheet => |
|||
C4::Context->preference("intranetcolorstylesheet"), |
|||
intranetstylesheet => C4::Context->preference("intranetstylesheet"), |
|||
IntranetNav => C4::Context->preference("IntranetNav"), |
|||
); |
|||
|
|||
output_html_with_http_headers $query, $cookie, $template->output; |
@ -0,0 +1,95 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
use strict; |
|||
use CGI; |
|||
use C4::Auth; |
|||
use C4::Output; |
|||
use C4::Labels; |
|||
use C4::Output; |
|||
use C4::Context; |
|||
use HTML::Template; |
|||
|
|||
use Smart::Comments; |
|||
|
|||
my $query = new CGI; |
|||
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
|||
{ |
|||
template_name => "labels/label-home.tmpl", |
|||
query => $query, |
|||
type => "intranet", |
|||
authnotrequired => 0, |
|||
flagsrequired => { catalogue => 1 }, |
|||
debug => 1, |
|||
} |
|||
); |
|||
|
|||
# little block for displaying active layout/template/batch in templates |
|||
# ---------- |
|||
my $batch_id = $query->param('batch_id'); |
|||
my $active_layout = get_active_layout(); |
|||
my $active_template = GetActiveLabelTemplate(); |
|||
my $active_layout_name = $active_layout->{'layoutname'}; |
|||
my $active_template_name = $active_template->{'tmpl_code'}; |
|||
# ---------- |
|||
|
|||
|
|||
my $data = get_label_options(); |
|||
my $op = $query->param('op'); |
|||
my $layout_id = $query->param('layout_id'); |
|||
|
|||
my @label_templates = GetAllLabelTemplates(); |
|||
my @printingtypes = get_printingtypes(); |
|||
my @layouts = get_layouts(); |
|||
my @barcode_types = get_barcode_types(); |
|||
my @batches = get_batches(); |
|||
|
|||
if ($op = 'delete_layout') { |
|||
delete_layout($layout_id); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
### $data |
|||
|
|||
$template->param( guidebox => 1 ) if ( $data->{'guidebox'} ); |
|||
$template->param( "papertype_$data->{'papertype'}" => 1 ); |
|||
$template->param( "$data->{'barcodetype'}_checked" => 1 ); |
|||
$template->param( "startrow" . $data->{'startrow'} . "_checked" => 1 ); |
|||
|
|||
$template->param( |
|||
op => $op, |
|||
active_layout_name => $active_layout_name, |
|||
active_template_name => $active_template_name, |
|||
|
|||
label_templates => \@label_templates, |
|||
barcode_types => \@barcode_types, |
|||
printingtypes => \@printingtypes, |
|||
layout_loop => \@layouts, |
|||
|
|||
batches => \@batches, |
|||
id => $data->{'id'}, |
|||
barcodetype => $data->{'barcodetype'}, |
|||
papertype => $data->{'papertype'}, |
|||
|
|||
tx_author => $data->{'author'}, |
|||
tx_barcode => $data->{'barcode'}, |
|||
tx_title => $data->{'title'}, |
|||
tx_isbn => $data->{'isbn'}, |
|||
tx_issn => $data->{'issn'}, |
|||
tx_itemtype => $data->{'itemtype'}, |
|||
tx_dewey => $data->{'dewey'}, |
|||
tx_class => $data->{'class'}, |
|||
tx_subclass => $data->{'subclass'}, |
|||
tx_itemcallnumber => $data->{'itemcallnumber'}, |
|||
|
|||
startlabel => $data->{'startlabel'}, |
|||
fontsize => $active_template->{'fontsize'}, |
|||
|
|||
intranetcolorstylesheet => |
|||
C4::Context->preference("intranetcolorstylesheet"), |
|||
intranetstylesheet => C4::Context->preference("intranetstylesheet"), |
|||
IntranetNav => C4::Context->preference("IntranetNav"), |
|||
); |
|||
|
|||
output_html_with_http_headers $query, $cookie, $template->output; |
@ -0,0 +1,195 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
use strict; |
|||
use CGI; |
|||
use C4::Auth; |
|||
use C4::Labels; |
|||
use C4::Output; |
|||
use HTML::Template; |
|||
use POSIX; |
|||
|
|||
#use Data::Dumper; |
|||
#use Smart::Comments; |
|||
|
|||
my $dbh = C4::Context->dbh; |
|||
my $query = new CGI; |
|||
my $op = $query->param('op'); |
|||
my $layout_id = $query->param('layout_id'); |
|||
my $layoutname = $query->param('layoutname'); |
|||
my $barcodetype = $query->param('barcodetype'); |
|||
|
|||
|
|||
my $bcn = $query->param('tx_barcode'); |
|||
my $author = $query->param('tx_author'); |
|||
|
|||
my $title = $query->param('tx_title'); |
|||
my $subtitle = $query->param('tx_subtitle'); |
|||
my $isbn = $query->param('tx_isbn'); |
|||
my $issn = $query->param('tx_issn'); |
|||
my $itemtype = $query->param('tx_itemtype'); |
|||
my $dcn = $query->param('tx_dewey'); |
|||
my $classif = $query->param('tx_classif'); |
|||
my $itemcallnumber = $query->param('tx_itemcallnumber'); |
|||
my $subclass = $query->param('tx_subclass'); |
|||
my $author = $query->param('tx_author'); |
|||
my $tmpl_id = $query->param('tmpl_id'); |
|||
my $summary = $query->param('summary'); |
|||
my $startlabel = $query->param('startlabel'); |
|||
my $printingtype = $query->param('printingtype'); |
|||
my $guidebox = $query->param('guidebox'); |
|||
my $fontsize = $query->param('fontsize'); |
|||
my @itemnumber = $query->param('itemnumber'); |
|||
|
|||
|
|||
# little block for displaying active layout/template/batch in templates |
|||
# ---------- |
|||
my $batch_id = $query->param('batch_id'); |
|||
my $active_layout = get_active_layout(); |
|||
my $active_template = GetActiveLabelTemplate(); |
|||
my $active_layout_name = $active_layout->{'layoutname'}; |
|||
my $active_template_name = $active_template->{'tmpl_code'}; |
|||
# ---------- |
|||
|
|||
#if (!$batch_id ) { |
|||
# $batch_id = get_highest_batch(); |
|||
#} |
|||
|
|||
my ($itemnumber) = @itemnumber if (scalar(@itemnumber) == 1); |
|||
|
|||
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
|||
{ |
|||
template_name => "labels/label-manager.tmpl", |
|||
query => $query, |
|||
type => "intranet", |
|||
authnotrequired => 1, |
|||
flagsrequired => { catalogue => 1 }, |
|||
debug => 1, |
|||
} |
|||
); |
|||
|
|||
if ( $op eq 'save_conf' ) { # this early sub is depreciated, use save_layout() |
|||
|
|||
SaveConf( |
|||
$barcodetype, $title, $isbn, |
|||
$issn, $itemtype, $bcn, $dcn, |
|||
$classif, $subclass, $itemcallnumber, $author, |
|||
$tmpl_id, $printingtype, $guidebox, $startlabel, $layoutname |
|||
); |
|||
print $query->redirect("label-home.pl"); |
|||
exit; |
|||
} |
|||
|
|||
|
|||
elsif ( $op eq 'save_layout' ) { |
|||
save_layout( |
|||
$barcodetype, $title, $subtitle, $isbn, |
|||
$issn, $itemtype, $bcn, $dcn, |
|||
$classif, $subclass, $itemcallnumber, $author, |
|||
$tmpl_id, $printingtype, $guidebox, $startlabel, $layoutname, |
|||
$layout_id |
|||
); |
|||
|
|||
### $layoutname |
|||
|
|||
print $query->redirect("label-home.pl"); |
|||
exit; |
|||
} |
|||
elsif ( $op eq 'add_layout' ) { |
|||
add_layout( |
|||
$barcodetype, $title, $subtitle, $isbn, |
|||
$issn, $itemtype, $bcn, $dcn, |
|||
$classif, $subclass, $itemcallnumber, $author, |
|||
$tmpl_id, $printingtype, $guidebox, $startlabel, $layoutname, |
|||
$layout_id |
|||
); |
|||
|
|||
### $layoutname |
|||
|
|||
print $query->redirect("label-home.pl"); |
|||
exit; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
elsif ( $op eq 'add' ) { # add item |
|||
my $query2 = "INSERT INTO labels ( itemnumber, batch_id ) values ( ?,? )"; |
|||
my $sth2 = $dbh->prepare($query2); |
|||
for my $inum (@itemnumber) { |
|||
$sth2->execute($inum, $batch_id); |
|||
} |
|||
$sth2->finish; |
|||
} |
|||
elsif ( $op eq 'deleteall' ) { |
|||
my $query2 = "DELETE FROM labels"; |
|||
my $sth2 = $dbh->prepare($query2); |
|||
$sth2->execute(); |
|||
$sth2->finish; |
|||
} |
|||
elsif ( $op eq 'delete' ) { |
|||
my $query2 = "DELETE FROM labels where itemnumber = ?"; |
|||
my $sth2 = $dbh->prepare($query2); |
|||
$sth2->execute($itemnumber); |
|||
$sth2->finish; |
|||
} |
|||
|
|||
|
|||
elsif ( $op eq 'delete_batch' ) { |
|||
delete_batch($batch_id); |
|||
print $query->redirect("label-manager.pl?batch_id="); |
|||
exit; |
|||
} |
|||
|
|||
elsif ( $op eq 'add_batch' ) { |
|||
$batch_id= add_batch(); |
|||
|
|||
} |
|||
|
|||
elsif ( $op eq 'set_active_layout' ) { |
|||
set_active_layout($layout_id); |
|||
print $query->redirect("label-home.pl"); |
|||
exit; |
|||
} |
|||
|
|||
|
|||
# first lets do a read of the labels table , to get the a list of the |
|||
# currently entered items to be prinited |
|||
#use Data::Dumper; |
|||
my @batches = get_batches(); |
|||
my @resultsloop = get_label_items($batch_id); |
|||
#warn $batches[0]; |
|||
#warn $batch_id; |
|||
#warn Dumper(@resultsloop); |
|||
|
|||
my $tmpl =GetActiveLabelTemplate(); |
|||
### $tmpl |
|||
#calc-ing number of sheets |
|||
#my $number_of_results = scalar @resultsloop; |
|||
#my $sheets_needed = ( ( --$number_of_results + $startrow ) / 8 ); |
|||
#$sheets_needed = ceil($sheets_needed); # rounding up int's |
|||
|
|||
#my $tot_labels = ( $sheets_needed * 8 ); |
|||
#my $start_results = ( $number_of_results + $startrow ); |
|||
#my $labels_remaining = ( $tot_labels - $start_results ); |
|||
|
|||
$template->param( |
|||
batch_id => $batch_id, |
|||
batch_count => scalar @resultsloop, |
|||
active_layout_name => $active_layout_name, |
|||
active_template_name => $active_template_name, |
|||
|
|||
resultsloop => \@resultsloop, |
|||
batches => \@batches, |
|||
tmpl_desc => $tmpl->{'tmpl_desc'}, |
|||
|
|||
# startrow => $startrow, |
|||
# sheets => $sheets_needed, |
|||
# labels_remaining => $labels_remaining, |
|||
|
|||
intranetcolorstylesheet => |
|||
C4::Context->preference("intranetcolorstylesheet"), |
|||
intranetstylesheet => C4::Context->preference("intranetstylesheet"), |
|||
IntranetNav => C4::Context->preference("IntranetNav"), |
|||
); |
|||
output_html_with_http_headers $query, $cookie, $template->output; |
@ -0,0 +1,50 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
use strict; |
|||
use CGI; |
|||
use C4::Auth; |
|||
use C4::Context; |
|||
use C4::Output; |
|||
use C4::Labels; |
|||
use C4::Interface::CGI::Output; |
|||
use HTML::Template; |
|||
use POSIX; |
|||
|
|||
#use Data::Dumper; |
|||
#use Smart::Comments; |
|||
|
|||
|
|||
my $dbh = C4::Context->dbh; |
|||
my $query = new CGI; |
|||
|
|||
my $tmpl_id = $query->param('tmpl_id'); |
|||
my $tmpl_code = $query->param('tmpl_code'); |
|||
my $tmpl_desc = $query->param('tmpl_desc'); |
|||
my $page_height = $query->param('page_height'); |
|||
my $page_width = $query->param('page_width'); |
|||
my $label_height = $query->param('label_height'); |
|||
my $label_width = $query->param('label_width'); |
|||
my $topmargin = $query->param('topmargin'); |
|||
my $leftmargin = $query->param('leftmargin'); |
|||
my $cols = $query->param('cols'); |
|||
my $rows = $query->param('rows'); |
|||
my $colgap = $query->param('colgap'); |
|||
my $rowgap = $query->param('rowgap'); |
|||
my $fontsize = $query->param('fontsize'); |
|||
my $units = $query->param('units'); |
|||
my $active = $query->param('active'); |
|||
|
|||
|
|||
SaveTemplate( |
|||
|
|||
$tmpl_id, $tmpl_code, $tmpl_desc, $page_width, |
|||
$page_height, $label_width, $label_height, $topmargin, |
|||
$leftmargin, $cols, $rows, $colgap, |
|||
$rowgap, $fontsize, $units |
|||
|
|||
); |
|||
|
|||
|
|||
print $query->redirect("./label-templates.pl"); |
|||
|
|||
|
@ -0,0 +1,32 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
use lib '/usr/local/opus-dev/intranet/modules'; |
|||
use C4::Context("/etc/koha-opus-dev.conf"); |
|||
|
|||
use strict; |
|||
use CGI; |
|||
use C4::Labels; |
|||
use C4::Auth; |
|||
use C4::Output; |
|||
use C4::Interface::CGI::Output; |
|||
use C4::Context; |
|||
use HTML::Template; |
|||
|
|||
use Data::Dumper; |
|||
|
|||
# get the printing settings |
|||
my $conf_data = get_label_options(); |
|||
my $cgi = new CGI; |
|||
|
|||
my $papertype = $conf_data->{'papertype'}; |
|||
warn $papertype; |
|||
|
|||
if ( $papertype eq "Gaylord8511" ) { |
|||
warn "GAY"; |
|||
print $cgi->redirect("/cgi-bin/koha/barcodes/label-print-pdf.pl"); |
|||
} |
|||
elsif ( $papertype eq "OPUS-Dot Matrix" ) { |
|||
warn "OPUS labes"; |
|||
print $cgi->redirect("/cgi-bin/koha/barcodes/label-print-opus-pdf.pl"); |
|||
} |
|||
|
@ -0,0 +1,82 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
use strict; |
|||
use CGI; |
|||
use C4::Auth; |
|||
use C4::Context; |
|||
use C4::Output; |
|||
use C4::Labels; |
|||
use HTML::Template; |
|||
use POSIX; |
|||
|
|||
#use Data::Dumper; |
|||
|
|||
my $dbh = C4::Context->dbh; |
|||
my $query = new CGI; |
|||
my $op = $query->param('op'); |
|||
my $tmpl_code = $query->param('tmpl_code'); |
|||
my $tmpl_id = $query->param('tmpl_id'); |
|||
|
|||
|
|||
my $width = $query->param('width'); |
|||
my $height = $query->param('height'); |
|||
my $topmargin = $query->param('topmargin'); |
|||
my $leftmargin = $query->param('leftmargin'); |
|||
my $columns = $query->param('columns'); |
|||
my $rows = $query->param('rows'); |
|||
my $colgap = $query->param('colgap'); |
|||
my $rowgap = $query->param('rowgap'); |
|||
|
|||
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
|||
{ |
|||
template_name => "labels/label-templates.tmpl", |
|||
query => $query, |
|||
type => "intranet", |
|||
authnotrequired => 1, |
|||
flagsrequired => { catalogue => 1 }, |
|||
debug => 1, |
|||
} |
|||
); |
|||
|
|||
|
|||
my @resultsloop; |
|||
|
|||
|
|||
if ( $op eq 'set_active_template' ) { |
|||
SetActiveTemplate($tmpl_id); |
|||
} |
|||
|
|||
elsif ( $op eq 'delete' ) { |
|||
DeleteTemplate($tmpl_id); |
|||
} |
|||
|
|||
elsif ( $op eq 'save' ) { |
|||
SaveTemplate($tmpl_code); |
|||
} |
|||
|
|||
@resultsloop = GetAllLabelTemplates(); |
|||
|
|||
# little block for displaying active layout/template/batch in templates |
|||
# ---------- |
|||
my $batch_id = $query->param('batch_id'); |
|||
my $active_layout = get_active_layout(); |
|||
my $active_template = GetActiveLabelTemplate(); |
|||
my $active_layout_name = $active_layout->{'layoutname'}; |
|||
my $active_template_name = $active_template->{'tmpl_code'}; |
|||
# ---------- |
|||
|
|||
$template->param( |
|||
|
|||
batch_id => $batch_id, |
|||
active_layout_name => $active_layout_name, |
|||
active_template_name => $active_template_name, |
|||
|
|||
resultsloop => \@resultsloop, |
|||
|
|||
intranetcolorstylesheet => |
|||
C4::Context->preference("intranetcolorstylesheet"), |
|||
intranetstylesheet => C4::Context->preference("intranetstylesheet"), |
|||
IntranetNav => C4::Context->preference("IntranetNav"), |
|||
); |
|||
|
|||
output_html_with_http_headers $query, $cookie, $template->output; |
Loading…
Reference in new issue