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