Bug 24201: (QA follow-up) IndependentBranches

This patch updates the IndependentBranches template display logic such
that the 'Select desk' and 'Select library and desk' options appear
correctly when IndependentBranches is enabled.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Martin Renvoize 2020-08-07 13:37:30 +01:00 committed by Jonathan Druart
parent 6a525c1cf7
commit 9d2b53c1b8
3 changed files with 11 additions and 16 deletions

View file

@ -15,13 +15,15 @@
[% IF !Koha.Preference('IndependentBranchesTransfers') || CAN_user_superlibrarian %] [% IF !Koha.Preference('IndependentBranchesTransfers') || CAN_user_superlibrarian %]
<li><a href="/cgi-bin/koha/circ/branchtransfers.pl">Transfer</a></li> <li><a href="/cgi-bin/koha/circ/branchtransfers.pl">Transfer</a></li>
[% END %] [% END %]
[% IF ( AutoLocation ) %][% ELSE %][% IF ( IndependentBranches ) %][% ELSE %] [% IF !( Koha.Preference('IndependentBranches') && !CAN_user_superlibrarian && !CAN_user_editcatalogue_edit_catalogue ) %]
[% IF Koha.Preference('UseCirculationDesks') %] [% IF Koha.Preference('UseCirculationDesks') %]
<li><a href="/cgi-bin/koha/circ/set-library.pl">Set library and desk</a></li> <li><a href="/cgi-bin/koha/circ/set-library.pl">Set library and desk</a></li>
[% ELSE %] [% ELSE %]
<li><a href="/cgi-bin/koha/circ/set-library.pl">Set library</a></li> <li><a href="/cgi-bin/koha/circ/set-library.pl">Set library</a></li>
[% END %] [% END %]
[% END %][% END %] [% ELSIF Koha.Preference('UseCirculationDesks') %]
<li><a href="/cgi-bin/koha/circ/set-library.pl">Set desk</a></li>
[% END %]
[% IF ( fast_cataloging ) %][% IF ( CAN_user_editcatalogue_fast_cataloging ) %] [% IF ( fast_cataloging ) %][% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
<li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA">Fast cataloging</a></li> <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA">Fast cataloging</a></li>
[% END %][% END %] [% END %][% END %]

View file

@ -130,9 +130,8 @@
</li> </li>
[% END %] [% END %]
[% IF !( Koha.Preference('IndependentBranches') && !CAN_user_superlibrarian && !CAN_user_editcatalogue_edit_catalogue ) %]
<li role="separator" class="loggedin-menu-label divider"></li> <li role="separator" class="loggedin-menu-label divider"></li>
[% IF ( IndependentBranches ) %]
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
<li> <li>
[% IF Koha.Preference('UseCirculationDesks') %] [% IF Koha.Preference('UseCirculationDesks') %]
<a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set library and desk</a> <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set library and desk</a>
@ -140,14 +139,10 @@
<a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set library</a> <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set library</a>
[% END %] [% END %]
</li> </li>
[% END %] [% ELSIF Koha.Preference('UseCirculationDesks') %]
[% ELSE %] <li role="separator" class="loggedin-menu-label divider"></li>
<li> <li>
[% IF Koha.Preference('UseCirculationDesks') %] <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set desk</a>
<a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set library and desk</a>
[% ELSE %]
<a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set library</a>
[% END %]
</li> </li>
[% END %] [% END %]
[% IF EnableSearchHistory %] [% IF EnableSearchHistory %]

View file

@ -64,20 +64,18 @@ Updated:<ul>
[% ELSE %] [% ELSE %]
<form method="post" action="set-library.pl"> <form method="post" action="set-library.pl">
[% IF !( Koha.Preference('IndependentBranches') && !CAN_user_superlibrarian && !CAN_user_editcatalogue_edit_catalogue ) %]
<fieldset class="rows"> <fieldset class="rows">
<legend>Set library</legend> <legend>Set library</legend>
<ol> <ol>
[% IF ( singleBranchMode && !CAN_user_superlibrarian ) %]
<li>SingleBranchMode is ON.</li>
[% ELSE %]
<li><label for="branch">Choose library:</label> <li><label for="branch">Choose library:</label>
<select name="branch" id="branch"> <select name="branch" id="branch">
[% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %] [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
</select></li> </select></li>
[% END %]
</ol> </ol>
</fieldset> </fieldset>
[% IF Desks.all %] [% END %]
[% IF Koha.Preference('UseCirculationDesks') && Desks.all %]
<fieldset class="rows"> <fieldset class="rows">
<legend>Set desk</legend> <legend>Set desk</legend>
<ol> <ol>