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