From d3ece118f130847eb9715dd1fb8edf3f1725c8f7 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 2 Jul 2010 14:55:41 -0400 Subject: [PATCH] bug 4808: allow limited-permission circ operators to print receipts Staff users now only need circulation privileges to print checkout receipts and slips; the 'borrowers' permission, which allows editing patron records, is no longer required. Signed-off-by: Galen Charlton --- .../prog/en/includes/circ-toolbar.inc | 2 ++ members/moremember.pl | 23 +++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc index 47815d7f75..976de151d1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc @@ -52,7 +52,9 @@ function update_child() { function yuiToolbar() { var printmenu = [ + { text: _("Print Page"), onclick: {fn: function(){printx_window("page")}} }, + { text: _("Print Slip"), onclick: {fn: function(){printx_window("slip")}} }, { text: _("Quick Slip"), onclick: {fn: function(){printx_window("qslip")}} } ]; diff --git a/members/moremember.pl b/members/moremember.pl index 4d4d9bb406..34a3e09d9b 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -76,10 +76,23 @@ for my $failedret (@failedreturns) { $return_failed{$failedret} = 1; } my $template_name; my $quickslip = 0; -if ($print eq "page") { $template_name = "members/moremember-print.tmpl"; } -elsif ($print eq "slip") { $template_name = "members/moremember-receipt.tmpl"; } -elsif ($print eq "qslip") { $template_name = "members/moremember-receipt.tmpl"; $quickslip = 1; } -else { $template_name = "members/moremember.tmpl"; } +my $flagsrequired; +if ($print eq "page") { + $template_name = "members/moremember-print.tmpl"; + $flagsrequired = { borrowers => 1 }; +} elsif ($print eq "slip") { + $template_name = "members/moremember-receipt.tmpl"; + # circ staff who process checkouts but can't edit + # patrons still need to be able to print receipts + $flagsrequired = { circulate => "circulate_remaining_permissions" }; +} elsif ($print eq "qslip") { + $template_name = "members/moremember-receipt.tmpl"; + $quickslip = 1; + $flagsrequired = { circulate => "circulate_remaining_permissions" }; +} else { + $template_name = "members/moremember.tmpl"; + $flagsrequired = { borrowers => 1 }; +} my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { @@ -87,7 +100,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => { borrowers => 1 }, + flagsrequired => $flagsrequired, debug => 1, } ); -- 2.39.5