Bug 19791: Keep user in circ when viewing patron's logs
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / viewlog.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE AuthorisedValues %]
5 [% USE Branches %]
6 [% USE KohaDates %]
7 [% SET footerjs = 1 %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>
10         Koha &rsaquo; Tools &rsaquo;
11         [% IF ( do_it ) %]
12                 Logs &rsaquo; Results
13         [% ELSE %]
14                 Logs
15         [% END %]
16 </title>
17 [% INCLUDE 'doc-head-close.inc' %]
18 </head>
19
20 <body id="tools_viewlog" class="tools">
21 [% INCLUDE 'header.inc' %]
22 [% INCLUDE 'cat-search.inc' %]
23
24 [% BLOCK translate_log_module %]
25 [%    SWITCH module %]
26 [%        CASE 'CATALOGUING'  %]Catalog
27 [%        CASE 'AUTHORITIES'  %]Authorities
28 [%        CASE 'MEMBERS'      %]Patrons
29 [%        CASE 'ACQUISITIONS' %]Acquisitions
30 [%        CASE 'SERIAL'       %]Serials
31 [%        CASE 'HOLDS'        %]Holds
32 [%        CASE 'ILL'          %]Interlibrary loans
33 [%        CASE 'CIRCULATION'  %]Circulation
34 [%        CASE 'LETTER'       %]Letter
35 [%        CASE 'FINES'        %]Fines
36 [%        CASE 'SYSTEMPREFERENCE' %]System prefs
37 [%        CASE 'CRONJOBS' %]Cron jobs
38 [%        CASE 'REPORTS'      %]Reports
39 [%        CASE %][% module | html %]
40 [%    END %]
41 [% END %]
42
43 [% BLOCK translate_log_action %]
44 [%    SWITCH action %]
45 [%        CASE 'ADD'    %]Add
46 [%        CASE 'DELETE' %]Delete
47 [%        CASE 'MODIFY' %]Modify
48 [%        CASE 'ISSUE'  %]Checkout
49 [%        CASE 'RETURN' %]Return
50 [%        CASE 'CREATE' %]Create
51 [%        CASE 'CANCEL' %]Cancel
52 [%        CASE 'RESUME' %]Resume
53 [%        CASE 'SUSPEND' %]Suspend
54 [%        CASE 'RENEW'  %]Renew
55 [%        CASE 'RENEWAL' %]Renew
56 [%        CASE 'CHANGE PASS' %]Change password
57 [%        CASE 'ADDCIRCMESSAGE' %]Add circulation message
58 [%        CASE 'DELCIRCMESSAGE' %]Delete circulation message
59 [%        CASE 'STATUS_CHANGE'  %]Change ILL request status
60 [%        CASE 'Run'    %]Run
61 [%        CASE %][% action | html %]
62 [%    END %]
63 [% END %]
64
65 [% BLOCK translate_log_interface %]
66 [%    SWITCH log_interface %]
67 [%        CASE 'INTRANET'    %]Intranet
68 [%        CASE 'OPAC'        %]OPAC
69 [%        CASE 'SIP'         %]SIP
70 [%        CASE 'COMMANDLINE' %]Command-line
71 [%        CASE %][% log_interface | html %]
72 [%    END %]
73 [% END %]
74
75 <div id="breadcrumbs">
76         <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
77         [% IF ( do_it ) %]
78                 <a href="/cgi-bin/koha/tools/viewlog.pl">Logs</a> &rsaquo; Results
79         [% ELSE %]
80                 Logs
81         [% END %]
82 </div>
83
84 <div class="main container-fluid">
85     <div class="row">
86         <div class="col-sm-10 col-sm-push-2">
87             <main>
88
89                                 <h1>Browse system logs</h1>
90                                 <form method="post" action="/cgi-bin/koha/tools/viewlog.pl">
91                                         [% IF ( do_it ) %]
92                                                 <input type="hidden" name="do_it" value="[% do_it | html %]" />
93                                         [% END %]
94                     <input type="hidden" name="src" value="[% src | html %]" />
95                                         <fieldset class="rows">
96                                                 <ol>
97                                                         <li>
98                                                                 <label for="user">Librarian:</label>
99                                 <input type="text" name="user" id="user" value="[% user | html %]" />
100                                                         </li>
101                             [% UNLESS src == "circ" %]
102                                 <li>
103                                     <label for="modules">Modules:</label>
104                                     <select name="modules" id="modules" multiple="multiple">
105                                         [% UNLESS modules %]
106                                             <option value="" selected="selected">All</option>
107                                         [% ELSE %]
108                                             <option value="">All</option>
109                                         [% END %]
110                                         [% FOREACH modx IN [ 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'LETTER' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS' ] %]
111                                             [% IF modules.grep(modx).size %]
112                                                 <option value="[% modx | html %]" selected="selected">[% PROCESS translate_log_module module=modx %]</option>
113                                             [% ELSE %]
114                                                 <option value="[% modx | html %]">[% PROCESS translate_log_module module=modx %]</option>
115                                             [% END %]
116                                         [% END %]
117                                     </select>
118                                 </li>
119                             [% ELSE %]
120                                 <input type="hidden" name="modules" value="MEMBERS" />
121                             [% END %]
122                             <li>
123                                 <label for="actions">Actions:</label>
124                                 <select name="actions" id="actions" multiple="multiple">
125                                     [% UNLESS actions %]
126                                         <option value="" selected="selected">All</option>
127                                     [% ELSE %]
128                                         <option value="">All</option>
129                                     [% END %]
130
131                                     [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'CANCEL' 'SUSPEND' 'RESUME' 'ADDCIRCMESSAGE' 'DELCIRCMESSAGE' 'STATUS_CHANGE' 'CHANGE PASS' 'Run' ] %]
132                                         [% IF actions.grep(actx).size %]
133                                             <option value="[% actx | html %]" selected="selected">[% PROCESS translate_log_action action=actx %]</option>
134                                         [% ELSE %]
135                                                 <option value="[% actx | html %]">[% PROCESS translate_log_action action=actx %]</option>
136                                         [% END %]
137                                     [% END %]
138                                 </select>
139                             </li>
140                             <li>
141                                 [% IF src == 'circ' %]
142                                     <label for="object">Borrowernumber: </label>
143                                     <input type="text" id="object" name="object" value="[% object | html %]" readonly="readonly" title="This field cannot be modified from the circulation module." />
144                                 [% ELSE %]
145                                     <label for="object">Object: </label>
146                                     <input type="text" id="object" name="object" value="[% object | html %]" />
147                                 [% END %]
148                             </li>
149                                                         <li>
150                                                                 <label for="info">Info:</label>
151                                 <input type="text" id="info" name="info" value="[% info | html %]" />
152                                                         </li>
153                             <li>
154                                 <label for="interfaces">Interface:</label>
155                                 <select name="interfaces" id="interfaces" multiple="multiple">
156                                     [% UNLESS interfaces %]
157                                         <option value="" selected="selected">All</option>
158                                     [% ELSE %]
159                                         <option value="">All</option>
160                                     [% END %]
161
162                                     [% FOREACH interf IN [ 'INTRANET' 'OPAC' 'SIP' 'COMMANDLINE' ] %]
163                                         [% IF interfaces.grep(interf).size %]
164                                             <option value="[% interf | html %]" selected="selected">[% PROCESS translate_log_interface log_interface=interf %]</option>
165                                         [% ELSE %]
166                                             <option value="[% interf | html %]">[% PROCESS translate_log_interface log_interface=interf %]</option>
167                                         [% END %]
168                                     [% END %]
169                                 </select>
170                             </li>
171                                                         <li>
172                                 <label for="from"> Display from: </label> <input type="text" size="10" id="from" name="from" value="[% datefrom | html %]" class="datepickerfrom" />
173                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
174                                                         </li>
175                                                         <li>
176                                 <label for="to">Display to: </label> <input size="10" id="to" name="to" type="text" value="[% dateto | html %]" class="datepickerto" />
177                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
178                                                         </li>
179                                                 </ol>
180                                         </fieldset>
181                                         <fieldset class="rows">
182                                                 <legend>Output</legend>
183                                                 <ol>
184                                                         <li>
185                                                                 <label for="screen" >To screen in the browser:</label> <input id="screen" type="radio" checked="checked" name="output" value="screen" />
186                                                         </li>
187                                                         <li>
188                                                                 <label for="file">To a file:</label>
189                                                                 <input id="file" type="radio" name="output" value="file" />
190                                                                 <label class="inline" for="basename">Named:</label>
191                                                                 <input type="text" name="basename" id="basename" value="Export" />
192                                                                 <!--
193                                                                         <label for="MIME" class="inline">Into an application:</label>
194                                                                         [% CGIextChoice | html %]
195                                                                         [% CGIsepChoice | html %]
196                                                                 -->
197                                                                 <input type="hidden" name="report_name" value="[% report_name | html %]" />
198                                                         </li>
199                                                 </ol>
200                                         </fieldset>
201                                         <fieldset class="action">
202                                                 <input type="submit" value="Submit" />
203                                                 <input type="hidden" name="do_it" value="1" />
204                                         </fieldset>
205                         </form>
206                 [% IF ( do_it ) %]
207                     [% IF ( total ) %]
208                         <h4>[% total | html %] lines found.</h4>
209                         <table>
210                             <thead>
211                                 <tr>
212                                     <th>Date</th>
213                                     <th>Librarian</th>
214                                     <th>Module</th>
215                                     <th>Action</th>
216                                     <th>Object</th>
217                                     <th>Info</th>
218                                     <th>Interface</th>
219                                 </tr>
220                             </thead>
221                             <tbody>
222                             [% FOREACH loopro IN looprow %]
223                                 <tr>
224                                     <td>[% loopro.timestamp | $KohaDates with_hours=1 %]</td>
225                                     <td>
226                                         [% IF loopro.librarian %]
227                                             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.librarian.borrowernumber | uri %]" title="display detail for this librarian."> [% IF ( loopro.librarian.firstname ) || ( loopro.librarian.surname ) %][% loopro.librarian.firstname | html %] [% loopro.librarian.surname | html %] ([% loopro.librarian.borrowernumber | html %]) [% ELSE %][% loopro.librarian.borrowernumber | html %][% END %]</a>
228                                         [% ELSE %]
229                                             [% loopro.user | html %]
230                                         [% END %]
231                                     </td>
232                                     <td>[% PROCESS translate_log_module module=loopro.module %]</td>
233                                     <td>[% PROCESS translate_log_action action=loopro.action %]</td>
234                                     <td>
235                                         [% IF ( loopro.module == 'MEMBERS' ) || ( loopro.module == 'CIRCULATION' ) || ( loopro.module == 'FINES' ) %]
236                                             [% IF loopro.patron %]
237                                                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.object | uri %]" title="Display member details."> [% IF ( loopro.object ) %][% IF ( loopro.patron.firstname ) || ( loopro.patron.surname ) %][% loopro.patron.firstname | html %] [% loopro.patron.surname | html %] ([% loopro.object | html %]) [% ELSE %]Member [% loopro.object | html %][% END %][% END %] </a>
238                                             [% ELSE %]
239                                                 [% loopro.object | html %]
240                                             [% END %]
241                                         [% ELSE %]
242                                                 [% IF ( loopro.module == 'CATALOGUING' ) %]
243                                                     [% IF ( loopro.info.substr(0, 4) == 'item' ) %]
244                                                         <a href="/cgi-bin/koha/catalogue/moredetail.pl?item=[% loopro.object | uri %]&amp;biblionumber=[% loopro.biblionumber | uri %]&amp;bi=[% loopro.biblioitemnumber | uri %]#item[% loopro.object | uri %]">Item [% loopro.object | html %]</a> from
245                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.biblionumber | uri %]" title="Display detail for this biblio">Biblio [% loopro.biblionumber | html %]</a>
246                                                     [% ELSIF ( loopro.info.substr(0, 6) == 'biblio' ) %]
247                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object | uri %]" title="Display detail for this biblio">Biblio [% loopro.object | html %]</a>
248                                                     [% ELSE %]
249                                                         [% loopro.object | html %]
250                                                     [% END %]
251                                                 [% ELSE %]
252                                                     [% IF ( loopro.module == 'SERIAL' ) %]
253                                                         <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% loopro.object | uri %]">Subscription [% loopro.object | html %] </a>
254                                                     [% ELSE %]
255                                                         [% IF ( loopro.module == 'AUTHORITIES' ) %]
256                                                             <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% loopro.object | uri %]" title="Display detail for this authority">Authority [% loopro.object | html %]</a>
257                                                         [% ELSE %]
258                                                             [% loopro.object | html %]
259                                                         [% END %]
260                                                     [% END %]
261                                                 [% END %]
262                                         [% END %]
263                                     </td>
264                                     <td>
265                                         [% IF ( loopro.module == 'CIRCULATION' ) %]
266                                             <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% loopro.info | uri %]&amp;biblionumber=[% loopro.biblionumber | uri %]&amp;bi=[% loopro.biblioitemnumber | uri %]#item[% loopro.info | uri %]" title="Display detail for this item">Item [% loopro.barcode | html %]</a>
267                                         [% ELSE %]
268                                             [% loopro.info | html %]
269                                         [% END %]
270                                     </td>
271                                     <td>[% PROCESS translate_log_interface log_interface=loopro.interface %]</td>
272                                 </tr>
273                             [% END %]
274                             </tbody>
275                         </table>
276                     [% ELSE %]
277                         <div class="dialog alert">
278                             No log found
279                             [% IF ( CATALOGUING ) %]
280                                 for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% object | url %]">Bibliographic record [% object | html %]</a>
281                             [% END %]
282                             [% IF ( MEMBERS ) %]
283                                 for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% object | url %]">[% INCLUDE 'patron-title.inc' %]</a>
284                             [% END %]
285                             .
286                         </div>
287                     [% END %]
288                 [% END %]
289
290
291             </main>
292         </div> <!-- /.col-sm-10.col-sm-push-2 -->
293
294         <div class="col-sm-2 col-sm-pull-10">
295             <aside>
296                 [% IF ( circulation ) %]
297                     [% INCLUDE 'circ-menu.inc' %]
298                 [% ELSE %]
299                     [% IF ( CATALOGUING ) %]
300                         [% INCLUDE 'biblio-view-menu.inc' %]
301                     [% ELSE %]
302                         [% INCLUDE 'tools-menu.inc' %]
303                     [% END %]
304                 [% END %]
305             </aside>
306         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
307      </div> <!-- /.row -->
308
309 [% MACRO jsinclude BLOCK %]
310     [% INCLUDE 'calendar.inc' %]
311     [% Asset.js("js/tools-menu.js") | $raw %]
312     [% IF ( circulation ) %]
313         [% INCLUDE 'str/members-menu.inc' %]
314         [% Asset.js("js/members-menu.js") | $raw %]
315     [% END %]
316 [% END %]
317
318 [% INCLUDE 'intranet-bottom.inc' %]