Bug 25537: Page reload at branchtransfers.pl loses destination branch
[koha-equinox.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / branchtransfers.tt
1 [% USE Koha %]
2 [% USE Branches %]
3 [% USE ItemTypes %]
4 [% USE AuthorisedValues %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Circulation &rsaquo; Transfers</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 </head>
9 <body id="circ_branchtransfers" class="circ">
10 [% INCLUDE 'header.inc' %]
11 [% INCLUDE 'circ-search.inc' %]
12
13 <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; Transfers</div>
14
15 <div class="main container-fluid">
16     <div class="row">
17         [% IF Koha.Preference('CircSidebar') %]
18             <div class="col-sm-10 col-sm-push-2">
19         [% ELSE %]
20             <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
21         [% END %]
22             <main>
23
24 [% IF ( found ) %]
25     <h3>Reserve found</h3>
26     <table>
27         <caption>
28             [% IF ( reserved ) %]
29                 Reserve found for [% name | html %] (<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | uri %]">[% borrowernumber | html %]</a>).
30             [% END %]
31             [% IF ( waiting ) %]
32                 Item is marked waiting at [% branchname | html %] for [% name | html %] (<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | uri %]">[% borrowernumber | html %]</a>).
33             [% END %]
34         </caption>
35         <tr>
36             <th>
37                 [% IF ( reserved ) %]Set reserve to waiting and transfer book to [% branchname | html %]: [% END %]
38                 [% IF ( waiting ) %]Cancel reservation and then attempt transfer: [% END %]
39             </th>
40             <td>
41                 <form method="post" name="mainform" id="mainform" action="branchtransfers.pl">
42                     [% FOREACH trsfitemloo IN trsfitemloop %]
43                         <input type="hidden" name="bc-[% trsfitemloo.counter | html %]" value="[% trsfitemloo.barcode | html %]" />
44                         <input type="hidden" name="fb-[% trsfitemloo.counter | html %]" value="[% trsfitemloo.frombrcd | html %]" />
45                         <input type="hidden" name="tb-[% trsfitemloo.counter | html %]" value="[% trsfitemloo.tobrcd | html %]" />
46                     [% END %]
47                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
48                     <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
49                     <input type="hidden" name="tobranchcd" value="[% tobranchcd | html %]" />
50                     [% IF ( waiting ) %]
51                         <input type="hidden" name="barcode" value="[% barcode | html %]" />
52                         <input type="hidden" name="request" value="KillWaiting" />
53                         <input type="submit" value="Cancel" />
54                     [% END %]
55                     [% IF ( reserved ) %]
56                         <input type="hidden" name="request" value="SetWaiting" />
57                         <input type="submit" value="Waiting" />
58                     [% END %]
59                 </form>
60             </td>
61         </tr>
62             [% IF ( reserved ) %]
63                 <tr>
64                     <th>Cancel reservation and then attempt transfer:</th>
65                     <td>
66                         <form method="post" name="mainform" id="mainform" action="branchtransfers.pl">
67                             [% FOREACH trsfitemloo IN trsfitemloop %]
68                                 <input type="hidden" name="bc-[% trsfitemloo.counter | html %]" value="[% trsfitemloo.barcode | html %]" />
69                                 <input type="hidden" name="fb-[% trsfitemloo.counter | html %]" value="[% trsfitemloo.frombrcd | html %]" />
70                                 <input type="hidden" name="tb-[% trsfitemloo.counter | html %]" value="[% trsfitemloo.tobrcd | html %]" />
71                             [% END %]
72                             <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
73                             <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
74                             <input type="hidden" name="tobranchcd" value="[% tobranchcd | html %]" />
75                             <input type="hidden" name="barcode" value="[% barcode | html %]" />
76                             <input type="hidden" name="request" value="KillReserved" />
77                             <input type="submit" value="Cancel" />
78                         </form>
79                     </td>
80                 </tr>
81             [% END %]
82                 <tr>
83                     <th>Ignore and return to transfers: </th>
84                         <td>
85                             <form method="post" name="mainform" id="mainform" action="branchtransfers.pl" />
86                                 <input type="hidden" name="tobranchcd" value="[% tobranchcd | html %]" />
87                                 <input type="hidden" name="barcode" />
88                                 [% FOREACH trsfitemloo IN trsfitemloop %]
89                                     <input type="hidden" name="bc-[% trsfitemloo.counter | html %]" value="[% trsfitemloo.barcode | html %]" />
90                                     <input type="hidden" name="fb-[% trsfitemloo.counter | html %]" value="[% trsfitemloo.frombrcd | html %]" />
91                                     <input type="hidden" name="tb-[% trsfitemloo.counter | html %]" value="[% trsfitemloo.tobrcd | html %]" />
92                                 [% END %]
93                                 <input type="submit" value="Ignore" />
94                             </form>
95                         </td>
96                 </tr>
97     </table>
98
99 [% ELSE %]
100                     [% IF ( reqmessage ) %]
101                      <div class="dialog message">
102                         <ul>
103                          [% IF ( cancelled ) %]
104                              <li>Reserve cancelled</li>
105                          [% END %]
106                          [% IF ( setwaiting ) %]
107                              <li>Item should now be waiting at library: [% reqbrchname | html %]</li>
108                          [% END %]
109                          </ul>
110                     </div>
111                      [% END %]
112
113                      [% IF ( errmsgloop ) %]
114                         <div class="dialog message">
115                             <ul>
116                              [% FOREACH errmsgloo IN errmsgloop %]
117                               [% IF ( errmsgloo.errbadcode ) %]
118                                   <li>No Item with barcode: [% errmsgloo.msg | html %]</li>
119                               [% END %]
120                               [% IF ( errmsgloo.errispermanent ) %]
121                                   <li>Please return item to home library: [% Branches.GetName( errmsgloo.msg ) | html %]</li>
122                               [% END %]
123                               [% IF ( errmsgloo.errnotallowed ) %]
124                                   <li>Transfer is not allowed for:
125                                       <ol>
126                                           [% IF ( Koha.Preference('BranchTransferLimitsType') == 'itemtype' ) %]
127                                               <li>Item type: <b>[% ItemTypes.GetDescription( errmsgloo.code ) | html %]</b></li>
128                                           [% ELSE %]
129                                               <li>Collection: <b>[% AuthorisedValues.GetByCode( 'CCODE', errmsgloo.code ) | html %]</b></li>
130                                           [% END %]
131                                           <li>Destination library: <b>[% Branches.GetName( errmsgloo.tbr ) | html %]</b></li>
132                                       </ol>
133                                   </li>
134                               [% END %]
135                               [% IF ( errmsgloo.errdesteqholding ) %]
136                                   <li>Item is already at destination library.</li>
137                               [% END %]
138                               [% IF ( errmsgloo.errwasreturned ) %]
139                                   <li>Item was on loan to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% errmsgloo.patron.borrowernumber | uri %]">
140                                   [% errmsgloo.patron.firstname | html %] [% errmsgloo.patron.surname | html %]
141                                   ([% errmsgloo.patron.cardnumber | html %])</a> and has been returned.</li>
142                               [% END %]
143                           [% END %]
144                           </ul>
145                             </div>
146                         [% END %]
147
148 <div id="branchtransfers">
149     <form method="post" name="mainform" id="mainform" action="/cgi-bin/koha/circ/branchtransfers.pl">
150         <fieldset class="brief">
151             <legend>Transfer</legend>
152             <ol>
153                         <li>
154                 <label for="tobranchcd">Destination library: </label>
155                     <select name="tobranchcd" id="tobranchcd">
156                         [% PROCESS options_for_libraries libraries => Branches.all( selected => tobranchcd, unfiltered => 1) %]
157                     </select>
158             </li>
159             <li>
160                 <label for="barcode">Enter barcode: </label>
161                 <input name="barcode" id="barcode" size="15" class="focus" type="text" /> <input type="submit" value="Submit" />
162             </li>
163                         </ol>
164         </fieldset>
165         <input type="hidden" name="tobranchcd" value="[% tobrancd | html %]" />
166         [% FOREACH trsfitemloo IN trsfitemloop %]
167             <input type="hidden" name="bc-[% trsfitemloo.counter | html %]" value="[% trsfitemloo.barcode | html %]" />
168             <input type="hidden" name="fb-[% trsfitemloo.counter | html %]" value="[% trsfitemloo.frombrcd | html %]" />
169             <input type="hidden" name="tb-[% trsfitemloo.counter | html %]" value="[% trsfitemloo.tobrcd | html %]" />
170         [% END %]
171     </form>
172 </div>
173
174     [% IF ( trsfitemloop ) %]
175                 <table>
176             <caption>Transferred items</caption>
177             <tr>
178                 <th class="tf-title">Title</th>
179                 <th class="tf-author">Author</th>
180                 <th class="tf-barcode">Barcode</th>
181                 <th class="tf-location">Shelving location</th>
182                 <th class="tf-itemcallnumber">Call number</th>
183                 <th class="tf-itemtype">Item type</th>
184                 <th class="tf-ccode">Collection</th>
185                 <th class="tf-destination">Destination</th>
186             </tr>
187             [% FOREACH trsfitemloo IN trsfitemloop %]
188                 <tr>
189                     <td class="tf-title"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% trsfitemloo.biblionumber | uri %]">[% trsfitemloo.title | html %]</a></td>
190                     <td class="tf-author">[% trsfitemloo.author | html %]</td>
191                     <td class="tf-barcode"><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% trsfitemloo.biblionumber | uri %]&amp;itemnumber=[% trsfitemloo.itemnumber | uri %]#item[% trsfitemloo.itemnumber | uri %]">[% trsfitemloo.barcode | html %]</a></td>
192                     <td class="tf-location"><span class="shelvingloc">[% trsfitemloo.location | html %]</span></td>
193                     <td class="tf-itemcallnumber">[% trsfitemloo.itemcallnumber | html %]</td>
194                     <td class="tf-itemtype">[% ItemTypes.GetDescription( trsfitemloo.itemtype ) | html %]</td>
195                     <td class="tf-ccode">[% AuthorisedValues.GetByCode( 'CCODE', trsfitemloo.ccode ) | html %]</td>
196                     <td class="tf-destination">[% Branches.GetName( trsfitemloo.tobrcd ) | html %]</td>
197                 </tr>
198             [% END %]
199         </table>
200     [% END %]
201         
202         
203 [% END %]
204
205     </main>
206         </div> <!-- /.col-sm-10.col-sm-push-2 -->
207         [% IF Koha.Preference('CircSidebar') %]
208             <div class="col-sm-2 col-sm-pull-10">
209                 <aside>
210                     [% INCLUDE 'circ-nav.inc' %]
211                 </aside>
212             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
213         [% END %]
214     </div> <!-- /.row -->
215
216 [% INCLUDE 'intranet-bottom.inc' %]