Bug 22464: Pass forward parameters
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-illrequests.tt
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE KohaDates %]
4 [% USE Branches %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo;   Your interlibrary loan requests</title>[% INCLUDE 'doc-head-close.inc' %]
7 [% BLOCK cssinclude %][% END %]
8 </head>
9 [% INCLUDE 'bodytag.inc' bodyid='opac-illrequests' bodyclass='scrollto' %]
10 [% BLOCK messages %]
11     [% IF message == "1" %]
12         <div class="alert alert-success" role="alert">Request updated</div>
13     [% ELSIF message == "2" %]
14         <div class="alert alert-success" role="alert">Request placed</div>
15     [% END %]
16 [% END %]
17 [% INCLUDE 'masthead.inc' %]
18 <div class="main">
19     <ul class="breadcrumb noprint">
20         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
21         [% IF ( logged_in_user ) %]
22             <li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">&rsaquo;</span></li>
23         [% END %]
24
25         [% IF method != 'list' %]
26             <li><a href="/cgi-bin/koha/opac-illrequests.pl">Interlibrary loan requests</a> <span class="divider">&rsaquo;</span></li>
27             [% IF method == 'create' %]
28                 <li>New interlibrary loan request</li>
29             [% ELSIF method == 'view' %]
30                 <li>View interlibrary loan request</li>
31             [% END %]
32         [% ELSE %]
33             <li>Interlibrary loan requests</li>
34         [% END %]
35
36     </ul> <!-- / .breadcrumb -->
37
38 <div class="container-fluid">
39     <div class="row-fluid">
40         [% IF ( OpacNav||loggedinusername ) && !print %]
41             <div class="span2">
42                 <div id="navigation">
43                     [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
44                 </div>
45             </div>
46         [% END %]
47
48         [% IF ( OpacNav||loggedinusername ) %]
49             <div class="span10">
50         [% ELSE %]
51             <div class="span12">
52         [% END %]
53           [% IF !backends_available %]
54             <div class="alert">ILL module configuration problem. Contact your administrator.</div>
55           [% ELSE %]
56             <div id="illrequests" class="maincontent">
57                 [% IF method == 'create' %]
58                     <h2>New interlibrary loan request</h2>
59                     [% IF stage == 'copyrightclearance' %]
60                         [% INCLUDE messages %]
61                         <div>
62                             <p>
63                                 [% Koha.Preference('ILLModuleCopyrightClearance') | $raw %]
64                             </p>
65                             [% USE link_url = url('/cgi-bin/koha/opac-illrequests.pl', whole.value.other) %]
66                             <a href="[% link_url _ '&amp;stage=copyrightclearance' | $raw %]"
67                                class="btn btn-sm btn-default"><i class="fa fa-check"></i> Yes</a>
68                             <a href="/cgi-bin/koha/opac-illrequests.pl"
69                                class="btn btn-sm btn-default"><i class="fa fa-times"></i> No</a>
70                         </div>
71                     [% ELSE %]
72                         [% INCLUDE messages %]
73                         [% IF backends %]
74                             <form method="post" id="illrequestcreate-form" novalidate="novalidate">
75                                 <fieldset class="rows">
76                                     <label for="backend">Provider:</label>
77                                     <select name="backend">
78                                         [% FOREACH backend IN backends %]
79                                             <option value="[% backend | html %]">[% backend | html %]</option>
80                                         [% END %]
81                                     </select>
82                                 </fieldset>
83                                 <fieldset class="action">
84                                     <input type="hidden" name="method" value="create" />
85                                     <input type="submit" name="create_select_backend" value="Next" />
86                                 </fieldset>
87                             </form>
88                         [% ELSE %]
89                             [% PROCESS $whole.opac_template %]
90                         [% END %]
91                     [% END %]
92                 [% ELSIF method == 'list' %]
93                     <h2>Interlibrary loan requests</h2>
94                     [% INCLUDE messages %]
95
96                     <div id="illrequests-create-button" class="dropdown btn-group">
97                         [% IF backends.size > 1 %]
98                                 <button class="btn btn-default dropdown-toggle" type="button" id="ill-backend-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
99                                     <i class="fa fa-plus"></i> Create a new request <span class="caret"></span>
100                                 </button>
101                                 <ul id="backend-dropdown-options" class="dropdown-menu nojs" aria-labelledby="ill-backend-dropdown">
102                                     [% FOREACH backend IN backends %]
103                                         <li><a href="/cgi-bin/koha/opac-illrequests.pl?method=create&amp;backend=[% backend | uri %]">[% backend | html %]</a></li>
104                                     [% END %]
105                                 </ul>
106                         [% ELSE %]
107                             <a id="ill-new" class="btn btn-default" href="/cgi-bin/koha/opac-illrequests.pl?method=create&amp;backend=[% backends.0 | html %]">
108                                 <i class="fa fa-plus"></i> Create a new request
109                             </a>
110                         [% END %]
111                     </div>
112
113                     <table id="illrequestlist" class="table table-bordered table-striped">
114                         <thead>
115                             <tr>
116                                 <th>Request ID</th>
117                                 <th>Author</th>
118                                 <th>Title</th>
119                                 <th>Requested from</th>
120                                 <th>Request type</th>
121                                 <th>Status</th>
122                                 <th class="title-string">Request placed</th>
123                                 <th class="title-string">Last updated</th>
124                                 <th></th>
125                             </tr>
126                         </thead>
127                         <tbody>
128                             [% FOREACH request IN requests %]
129                                 [% status = request.status | html %]
130                                 [% type = request.get_type %]
131                                 <tr>
132                                     <td>[% request.id | html %]</td>
133                                     <td>
134                                         [% IF request.metadata.Author %][% request.metadata.Author | html %][% ELSE %]<span>N/A</span>[% END %]
135                                     </td>
136                                     <td>
137                                         [% IF request.metadata.Title %][% request.metadata.Title | html %][% ELSE %]<span>N/A</span>[% END %]
138                                     </td>
139                                     <td>[% request.backend | html %]</td>
140                                     <td>
141                                         [% IF type %][% type | html %][% ELSE %]<span>N/A</span>[% END %]
142                                     </td>
143                                     <td>[% request.status_alias ? request.statusalias.lib_opac : request.capabilities.$status.name | html %]</td>
144                                     <td><span title="[% request.placed | html %]">[% request.placed | $KohaDates %]</span></td>
145                                     <td><span title="[% request.updated | html %]">[% request.updated | $KohaDates %]</span></td>
146                                     <td>
147                                         <a href="/cgi-bin/koha/opac-illrequests.pl?method=view&amp;illrequest_id=[% request.id | uri %]" class="btn btn-default btn-small pull-right">View</a>
148                                     </td>
149                                 </tr>
150                             [% END %]
151                         </tbody>
152                     </table>
153                 [% ELSIF method == 'view' %]
154                     <h2>View interlibrary loan request</h2>
155                     [% INCLUDE messages %]
156                     [% status = request.status %]
157                     <form method="post" action="?method=update" id="illrequestupdate-form" novalidate="novalidate">
158                             <fieldset class="rows">
159                                 <legend id="library_legend">Details from library</legend>
160                                 <ol>
161                                     [% type = request.get_type %]
162                                     <li>
163                                         <label for="request_id">Request ID:</label>
164                                         [% request.id | html %]
165                                     </li>
166                                     <li>
167                                         <label for="backend">Requested from:</label>
168                                         [% request.backend | html %]
169                                     </li>
170                                     [% IF request.biblio_id %]
171                                         <li>
172                                             <label for="biblio">Requested item:</label>
173                                             <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% request.biblio_id | uri %]">Click here to view</a>
174                                         </li>
175                                     [% END %]
176                                     <li>
177                                         <label for="branchcode">Collection library:</label>
178                                         [% Branches.GetName(request.branchcode) | html %]
179                                     </li>
180                                     <li>
181                                         <label for="status">Status:</label>
182                                         [% request.status_alias ? request.statusalias.lib_opac : request.capabilities.$status.name | html %]
183                                     </li>
184                                     <li>
185                                         <label for="medium">Request type:</label>
186                                         [% IF type %][% type | html %][% ELSE %]<span>N/A</span>[% END %]
187                                     </li>
188                                     <li>
189                                         <label for="placed">Request placed:</label>
190                                         [% request.placed | $KohaDates %]
191                                     </li>
192                                     <li>
193                                         <label for="updated">Last updated:</label>
194                                         [% request.updated | $KohaDates %]
195                                     </li>
196                                     <li>
197                                         <label for="notesopac">Notes:</label>
198                                         [% IF !request.completed %]
199                                             <textarea name="notesopac" rows="5" cols="50">[% request.notesopac | html %]</textarea>
200                                         [% ELSE %]
201                                             [% request.notesopac | html %]
202                                         [% END %]
203                                     </li>
204                                 </ol>
205                             </fieldset>
206                             <div class="rows">
207                                 <legend id="backend_legend">Details from [% request.backend | html %]</legend>
208                                 [% FOREACH meta IN request.metadata %]
209                                     <div class="requestattr-[% meta.key | html %]">
210                                         <span class="label">[% meta.key | html %]:</span>
211                                         [% IF meta.value %][% meta.value | html %][% ELSE %]<span>N/A</span>[% END %]
212                                     </div>
213                                 [% END %]
214                             </div>
215                             <fieldset class="action illrequest-actions">
216                                 <input type="hidden" name="illrequest_id" value="[% request.illrequest_id | html %]" />
217                                 <input type="hidden" name="method" value="update" />
218                                 [% IF !request.completed %]
219                                     [% IF request.status == "NEW" %]
220                                         <a class="cancel-illrequest btn btn-danger" href="/cgi-bin/koha/opac-illrequests.pl?method=cancreq&amp;illrequest_id=[% request.illrequest_id | html %]">Request cancellation</a>
221                                     [% END %]
222                                     <input type="submit" class="update-illrequest btn btn-default" value="Submit modifications" />
223                                 [% END %]
224                                 <span class="cancel"><a href="/cgi-bin/koha/opac-illrequests.pl">Cancel</a></span>
225                             </fieldset>
226                         </form>
227                     [% END %]
228                 </div> <!-- / .maincontent -->
229           [% END %]
230             </div> <!-- / .span10/12 -->
231         </div> <!-- / .row-fluid -->
232     </div> <!-- / .container-fluid -->
233 </div> <!-- / .main -->
234
235 [% INCLUDE 'opac-bottom.inc' %]
236
237 [% BLOCK jsinclude %]
238 [% INCLUDE 'datatables.inc' %]
239 <script>
240     //<![CDATA[
241         $("#illrequestlist").dataTable($.extend(true, {}, dataTablesDefaults, {
242             "columnDefs": [
243                 { "targets": [ -1 ], "sortable": false, "searchable": false },
244                 { "type": "title-string", "targets" : [ "title-string" ] }
245             ],
246             "order": [[ 3, "desc" ]],
247             "deferRender": true
248         }));
249         $("#backend-dropdown-options").removeClass("nojs");
250     //]]>
251 </script>
252 [% TRY %]
253 [% PROCESS backend_jsinclude %]
254 [% CATCH %]
255 [% END %]
256 [% END %]