64a057dd0ee02e6d0d364f36c5dd3c547303d31e
[koha-equinox.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                             <a href="?method=create&stage=copyrightclearance&backend=[% whole.value.backend | uri %]"
66                                class="btn btn-sm btn-default"><i class="fa fa-check"></i> Yes</a>
67                             <a href="/cgi-bin/koha/opac-illrequests.pl"
68                                class="btn btn-sm btn-default"><i class="fa fa-times"></i> No</a>
69                         </div>
70                     [% ELSE %]
71                         [% INCLUDE messages %]
72                         [% IF backends %]
73                             <form method="post" id="illrequestcreate-form" novalidate="novalidate">
74                                 <fieldset class="rows">
75                                     <label for="backend">Provider:</label>
76                                     <select name="backend">
77                                         [% FOREACH backend IN backends %]
78                                             <option value="[% backend | html %]">[% backend | html %]</option>
79                                         [% END %]
80                                     </select>
81                                 </fieldset>
82                                 <fieldset class="action">
83                                     <input type="hidden" name="method" value="create" />
84                                     <input type="submit" name="create_select_backend" value="Next" />
85                                 </fieldset>
86                             </form>
87                         [% ELSE %]
88                             [% PROCESS $whole.opac_template %]
89                         [% END %]
90                     [% END %]
91                 [% ELSIF method == 'list' %]
92                     <h2>Interlibrary loan requests</h2>
93                     [% INCLUDE messages %]
94
95                     <div id="illrequests-create-button" class="dropdown btn-group">
96                         [% IF backends.size > 1 %]
97                                 <button class="btn btn-default dropdown-toggle" type="button" id="ill-backend-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
98                                     <i class="fa fa-plus"></i> Create a new request <span class="caret"></span>
99                                 </button>
100                                 <ul id="backend-dropdown-options" class="dropdown-menu nojs" aria-labelledby="ill-backend-dropdown">
101                                     [% FOREACH backend IN backends %]
102                                         <li><a href="/cgi-bin/koha/opac-illrequests.pl?method=create&amp;backend=[% backend | uri %]">[% backend | html %]</a></li>
103                                     [% END %]
104                                 </ul>
105                         [% ELSE %]
106                             <a id="ill-new" class="btn btn-default" href="/cgi-bin/koha/opac-illrequests.pl?method=create&amp;backend=[% backends.0 | html %]">
107                                 <i class="fa fa-plus"></i> Create a new request
108                             </a>
109                         [% END %]
110                     </div>
111
112                     <table id="illrequestlist" class="table table-bordered table-striped">
113                         <thead>
114                             <tr>
115                                 <th>Request ID</th>
116                                 <th>Author</th>
117                                 <th>Title</th>
118                                 <th>Requested from</th>
119                                 <th>Request type</th>
120                                 <th>Status</th>
121                                 <th class="title-string">Request placed</th>
122                                 <th class="title-string">Last updated</th>
123                                 <th></th>
124                             </tr>
125                         </thead>
126                         <tbody>
127                             [% FOREACH request IN requests %]
128                                 [% status = request.status | html %]
129                                 [% type = request.get_type %]
130                                 <tr>
131                                     <td>[% request.id | html %]</td>
132                                     <td>
133                                         [% IF request.metadata.Author %][% request.metadata.Author | html %][% ELSE %]<span>N/A</span>[% END %]
134                                     </td>
135                                     <td>
136                                         [% IF request.metadata.Title %][% request.metadata.Title | html %][% ELSE %]<span>N/A</span>[% END %]
137                                     </td>
138                                     <td>[% request.backend | html %]</td>
139                                     <td>
140                                         [% IF type %][% type | html %][% ELSE %]<span>N/A</span>[% END %]
141                                     </td>
142                                     <td>[% request.status_alias ? request.statusalias.lib_opac : request.capabilities.$status.name | html %]</td>
143                                     <td><span title="[% request.placed | html %]">[% request.placed | $KohaDates %]</span></td>
144                                     <td><span title="[% request.updated | html %]">[% request.updated | $KohaDates %]</span></td>
145                                     <td>
146                                         <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>
147                                     </td>
148                                 </tr>
149                             [% END %]
150                         </tbody>
151                     </table>
152                 [% ELSIF method == 'view' %]
153                     <h2>View interlibrary loan request</h2>
154                     [% INCLUDE messages %]
155                     [% status = request.status %]
156                     <form method="post" action="?method=update" id="illrequestupdate-form" novalidate="novalidate">
157                             <fieldset class="rows">
158                                 <legend id="library_legend">Details from library</legend>
159                                 <ol>
160                                     [% type = request.get_type %]
161                                     <li>
162                                         <label for="request_id">Request ID:</label>
163                                         [% request.id | html %]
164                                     </li>
165                                     <li>
166                                         <label for="backend">Requested from:</label>
167                                         [% request.backend | html %]
168                                     </li>
169                                     [% IF request.biblio_id %]
170                                         <li>
171                                             <label for="biblio">Requested item:</label>
172                                             <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% request.biblio_id | uri %]">Click here to view</a>
173                                         </li>
174                                     [% END %]
175                                     <li>
176                                         <label for="branchcode">Collection library:</label>
177                                         [% Branches.GetName(request.branchcode) | html %]
178                                     </li>
179                                     <li>
180                                         <label for="status">Status:</label>
181                                         [% request.status_alias ? request.statusalias.lib_opac : request.capabilities.$status.name | html %]
182                                     </li>
183                                     <li>
184                                         <label for="medium">Request type:</label>
185                                         [% IF type %][% type | html %][% ELSE %]<span>N/A</span>[% END %]
186                                     </li>
187                                     <li>
188                                         <label for="placed">Request placed:</label>
189                                         [% request.placed | $KohaDates %]
190                                     </li>
191                                     <li>
192                                         <label for="updated">Last updated:</label>
193                                         [% request.updated | $KohaDates %]
194                                     </li>
195                                     <li>
196                                         <label for="notesopac">Notes:</label>
197                                         [% IF !request.completed %]
198                                             <textarea name="notesopac" rows="5" cols="50">[% request.notesopac | html %]</textarea>
199                                         [% ELSE %]
200                                             [% request.notesopac | html %]
201                                         [% END %]
202                                     </li>
203                                 </ol>
204                             </fieldset>
205                             <div class="rows">
206                                 <legend id="backend_legend">Details from [% request.backend | html %]</legend>
207                                 [% FOREACH meta IN request.metadata %]
208                                     <div class="requestattr-[% meta.key | html %]">
209                                         <span class="label">[% meta.key | html %]:</span>
210                                         [% IF meta.value %][% meta.value | html %][% ELSE %]<span>N/A</span>[% END %]
211                                     </div>
212                                 [% END %]
213                             </div>
214                             <fieldset class="action illrequest-actions">
215                                 <input type="hidden" name="illrequest_id" value="[% request.illrequest_id | html %]" />
216                                 <input type="hidden" name="method" value="update" />
217                                 [% IF !request.completed %]
218                                     [% IF request.status == "NEW" %]
219                                         <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>
220                                     [% END %]
221                                     <input type="submit" class="update-illrequest btn btn-default" value="Submit modifications" />
222                                 [% END %]
223                                 <span class="cancel"><a href="/cgi-bin/koha/opac-illrequests.pl">Cancel</a></span>
224                             </fieldset>
225                         </form>
226                     [% END %]
227                 </div> <!-- / .maincontent -->
228           [% END %]
229             </div> <!-- / .span10/12 -->
230         </div> <!-- / .row-fluid -->
231     </div> <!-- / .container-fluid -->
232 </div> <!-- / .main -->
233
234 [% INCLUDE 'opac-bottom.inc' %]
235
236 [% BLOCK jsinclude %]
237 [% INCLUDE 'datatables.inc' %]
238 <script>
239     //<![CDATA[
240         $("#illrequestlist").dataTable($.extend(true, {}, dataTablesDefaults, {
241             "columnDefs": [
242                 { "targets": [ -1 ], "sortable": false, "searchable": false },
243                 { "type": "title-string", "targets" : [ "title-string" ] }
244             ],
245             "order": [[ 3, "desc" ]],
246             "deferRender": true
247         }));
248         $("#backend-dropdown-options").removeClass("nojs");
249     //]]>
250 </script>
251 [% TRY %]
252 [% PROCESS backend_jsinclude %]
253 [% CATCH %]
254 [% END %]
255 [% END %]