X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=tools%2Fletter.pl;h=7582e6616e4d479f4daf8fb1710b5b49fcdefb85;hb=3c7edd1cbef811de89d6ee0b54cd690dd36d6ff4;hp=eb9d6a631260044e8ac02f30096a13ff2fdd0920;hpb=0ef6b0d5c618c2bd4d0ec942e870a6f989632ca0;p=koha_fer diff --git a/tools/letter.pl b/tools/letter.pl index eb9d6a6312..7582e6616e 100755 --- a/tools/letter.pl +++ b/tools/letter.pl @@ -85,17 +85,17 @@ sub protected_letters { return { map { $_->[0] => 1 } @{$codes} }; } -my $input = new CGI; +our $input = new CGI; my $searchfield = $input->param('searchfield'); my $script_name = '/cgi-bin/koha/tools/letter.pl'; -my $branchcode = $input->param('branchcode'); +our $branchcode = $input->param('branchcode'); my $code = $input->param('code'); my $module = $input->param('module'); my $content = $input->param('content'); my $op = $input->param('op') || ''; my $dbh = C4::Context->dbh; -my ( $template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user( +our ( $template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user( { template_name => 'tools/letter.tmpl', query => $input, @@ -106,7 +106,7 @@ my ( $template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user( } ); -my $my_branch = C4::Context->preference("IndependantBranches") && !$staffflags->{'superlibrarian'} +our $my_branch = C4::Context->preference("IndependentBranches") && !$staffflags->{'superlibrarian'} ? C4::Context->userenv()->{'branch'} : undef; # we show only the TMPL_VAR names $op @@ -115,6 +115,7 @@ $template->param( independant_branch => $my_branch, script_name => $script_name, searchfield => $searchfield, + branchcode => $branchcode, action => $script_name ); @@ -194,11 +195,19 @@ sub add_form { } else { push @{$field_selection}, add_fields('biblio','biblioitems'), - {value => q{}, text => '---ITEMS---' }, + add_fields('items'), {value => 'items.content', text => 'items.content'}, - add_fields('issues','borrowers'); + {value => 'items.fine', text => 'items.fine'}, + add_fields('borrowers'); if ($module eq 'circulation') { push @{$field_selection}, add_fields('opac_news'); + + } + + if ( $module eq 'circulation' && $code eq "CHECKIN" ) { + push @{$field_selection}, add_fields('old_issues'); + } else { + push @{$field_selection}, add_fields('issues'); } }