Koha/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt
Nicolas Legrand 4163f24014 Bug 24201: (follow-up) add desk choice with library choice
You should be able to add desk choice when you are logging in or
changing library.

Test plan:

1. apply patch
2. have at least three libraries, one without desk, one with one and
one with a few.
3. At login, when choosing a library, it should enable all desks it
has. Pick one.
4. the desk id and name should be set in your session and appear in
the top right, next to the library name.
5. change library and desks from intranet (at the set-library.pl page)
6. you should have the same behaviours
7. if you have a library without a desk, it should prompt you a '---'
option and no desks will be attached to the session.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-08-07 16:54:40 +02:00

115 lines
3.7 KiB
Text

[% USE Branches %]
[% USE Desks %]
[% USE Koha %]
[% IF Desks.all %]
[% SET setdesk = 1 %]
[% END %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Circulation &rsaquo; Set library</title>
[% INCLUDE 'doc-head-close.inc' %]
<style>
.noshow {display: none;}
</style>
</head>
<body id="circ_set-library" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<div id="breadcrumbs">
<a href="/cgi-bin/koha/mainpage.pl">Home</a>
&rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
&rsaquo; <a href="/cgi-bin/koha/circ/set-library.pl">Set library</a>
</div>
<div class="main container-fluid">
<div class="row">
<div class="col-sm-12">
<main>
<div class="row">
[% IF Koha.Preference('CircSidebar') %]
<div class="col-sm-10 col-sm-push-2">
[% ELSE %]
<div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
[% END %]
[% IF ( updated ) %]
<h2>Update succeeded</h2>
Updated:<ul>
[% FOREACH update IN updated %]
[% IF ( update.updated_branch ) %]
<li>Library: [% update.old_branch or "?" | html %] &rArr; [% update.new_branch or "?" | html %]</li>
[% ELSIF (update.updated_desk) %]
<li>Desk: [% update.old_desk or "?" | html %] &rArr; [% LoginDeskname or "?" | html %]</li>
[% ELSE %]
<li>ERROR - unknown</li>
[% END %]
[% END %]
</ul>
<form method="post" action="[% referer or "/cgi-bin/koha/circ/circulation.pl" %]">
<div class="noshow">
[% FOREACH recycle_loo IN recycle_loop %]
<input type="text" name="[% recycle_loo.param | html %]" value="[% recycle_loo.value | html %]" />
[% END %]
</div>
<button type="submit">Continue</button>
</form>
[% ELSE %]
<form method="post" action="set-library.pl">
<fieldset class="rows">
<legend>Set library</legend>
<ol>
[% IF ( singleBranchMode && !CAN_user_superlibrarian ) %]
<li>SingleBranchMode is ON.</li>
[% ELSE %]
<li><label for="branch">Choose library:</label>
<select name="branch" id="branch">
[% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
</select></li>
[% END %]
</ol>
</fieldset>
[% IF Desks.all %]
<fieldset class="rows">
<legend>Set Desk</legend>
<ol>
<li><label for="desk">Choose Desk:</label>
<select name="desk_id" id="desk_id">
[% PROCESS options_for_desks desks => Desks.all( selected => desk_id ) %]
</select></li>
</ol>
</fieldset>
[% END %]
<fieldset class="action">
<input type="submit" value="Submit" />
<a class="cancel" id="cancel_set_library" href="[% referer or '/cgi-bin/koha/circ/circulation.pl' %]">Cancel</a>
</fieldset>
<div class="noshow">
[% FOREACH recycle_loo IN recycle_loop %]
<input type="text" name="[% recycle_loo.param | html %]" value="[% recycle_loo.value | html %]" />
[% END %]
<input type="hidden" name="oldreferer" value="[% referer or "/cgi-bin/koha/circ/circulation.pl" %]" />
</div>
</form>
<!-- /updated -->
[% END %]
[% IF Koha.Preference('CircSidebar') %]
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% INCLUDE 'circ-nav.inc' %]
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
[% END %]
</main>
</div> <!-- /.col-sm-12 -->
</div> <!-- /.row -->
[% INCLUDE 'intranet-bottom.inc' %]