Bug 8781: hiding of transfer page when it's useless
authorAdrien Saurat <adrien.saurat@biblibre.com>
Tue, 18 Sep 2012 08:27:39 +0000 (10:27 +0200)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Sun, 2 Dec 2012 14:27:20 +0000 (09:27 -0500)
The transfer page is only useful when the system
preference "IndependantBranches" is Off of when the user
is a superlibrarian. Otherwise it can be hidden.

Signed-off-by: Melia Meggs <melia@test.bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and perlcritic pass.

TEST PLAN :
It's about testing the display of the "Transfer" link on "circulation-home.pl".
The link needs to appear if IndependantBranches is off or if the user is a superlibrarian.

1) IndependantBranches = Off, user is superlibrarian : link appears
2) IndependantBranches = Off, user is not superlibrarian : link appears
3) IndependantBranches = On, user is superlibrarian : link appears
4) IndependantBranches = On, user is not superlibrarian : link does not appear
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

circ/circulation-home.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt

index 842f8d9..5eee81b 100755 (executable)
@@ -25,7 +25,7 @@ use C4::Context;
 use C4::Koha;
 
 my $query = new CGI;
-my ($template, $loggedinuser, $cookie)
+my ($template, $loggedinuser, $cookie, $flags)
 = get_template_and_user({template_name => "circ/circulation-home.tmpl",
                                query => $query,
                                type => "intranet",
@@ -37,5 +37,8 @@ my ($template, $loggedinuser, $cookie)
 my $fa = getframeworkinfo('FA');
 $template->param( fast_cataloging => 1 ) if (defined $fa);
 
+# Checking if the transfer page needs to be displayed
+$template->param( display_transfer => 1 ) if ( ($flags->{'superlibrarian'} == 1) || (C4::Context->preference("IndependantBranches") == 0) );
+
 
 output_html_with_http_headers $query, $cookie, $template->output;
index 8b4ad57..631158f 100644 (file)
@@ -19,7 +19,9 @@
        <ul>
         <li><a href="/cgi-bin/koha/circ/circulation.pl">Check out</a></li>
         <li><a href="/cgi-bin/koha/circ/returns.pl">Check in</a></li>
+    [% IF ( display_transfer ) %]
                <li><a href="/cgi-bin/koha/circ/branchtransfers.pl">Transfer</a></li>
+    [% END %]
        [% IF ( AutoLocation ) %][% ELSE %][% IF ( IndependantBranches ) %][% ELSE %]<li><a href="/cgi-bin/koha/circ/selectbranchprinter.pl">Set library</a></li>[% END %][% END %]
        [% IF ( fast_cataloging ) %]
            [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]