Bug 23019: (follow-up) Fix usability issues
[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 [% USE TablesSettings %]
8 [% SET footerjs = 1 %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>
11         Koha &rsaquo; Tools &rsaquo;
12         [% IF ( do_it ) %]
13                 Logs &rsaquo; Results
14         [% ELSE %]
15                 Logs
16         [% END %]
17 </title>
18 [% INCLUDE 'doc-head-close.inc' %]
19 [% Asset.css("css/humanmsg.css") | $raw %]
20 [% FILTER collapse %]
21     <style>
22         fieldset.rows label.viewlog {
23             float: none;
24             font-weight: normal;
25             margin: 0;
26             min-width: 9em;
27             padding: .5em;
28             text-align: left;
29             white-space: nowrap;
30             width: auto;
31         }
32         .log_modules {
33             display: flex;
34             flex-wrap: wrap;
35         }
36         .compare_info {
37             background-color: #E6F0F2;
38             margin: .5em -.5em -.5em -.5em;
39             padding: .5em;
40             text-align: right;
41         }
42         .modal-dialog {
43             width : 90%;
44         }
45         /* jsdiff styles */
46         ins {
47             background-color: #e6ffe6;
48         }
49         del {
50             background-color: #ffe6e6;
51         }
52         #col1 ins,
53         #col2 del {
54             display: none;
55         }
56         pre {
57             overflow: scroll;
58             padding: 10px;
59         }
60     </style>
61 [% END %]
62 </head>
63
64 <body id="tools_viewlog" class="tools">
65 [% INCLUDE 'header.inc' %]
66 [% INCLUDE 'cat-search.inc' %]
67
68 [% BLOCK translate_log_module %]
69 [%    SWITCH module %]
70 [%        CASE 'AUTH'         %]Authentication[% UNLESS Koha.Preference('AuthFailureLog') || Koha.Preference('AuthScuccessLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
71 [%        CASE 'CATALOGUING'  %]Catalog[% UNLESS Koha.Preference('CataloguingLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
72
73 [%        CASE 'AUTHORITIES'  %]Authorities[% UNLESS Koha.Preference('AuthoritiesLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
74
75 [%        CASE 'MEMBERS'      %]Patrons[% UNLESS Koha.Preference('BorrowersLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
76
77 [%        CASE 'ACQUISITIONS' %]Acquisitions <i class="fa fa-warning" title="Log not enabled"></i>
78
79 [%        CASE 'SERIAL'       %]Serials[% UNLESS Koha.Preference('SubscriptionLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
80
81 [%        CASE 'HOLDS'        %]Holds[% UNLESS Koha.Preference('HoldsLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
82
83 [%        CASE 'ILL'          %]Interlibrary loans[% UNLESS Koha.Preference('IllLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
84
85 [%        CASE 'CIRCULATION'  %]Circulation[% UNLESS Koha.Preference('IssueLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
86
87 [%        CASE 'LETTER'       %]Letter[% UNLESS Koha.Preference('LetterLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
88
89 [%        CASE 'FINES'        %]Fines[% UNLESS Koha.Preference('FinesLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
90
91 [%        CASE 'SYSTEMPREFERENCE' %]System prefs
92
93 [%        CASE 'CRONJOBS' %]Cron jobs[% UNLESS Koha.Preference('CronjobLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
94
95 [%        CASE 'REPORTS'      %]Reports[% UNLESS Koha.Preference('ReportsLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
96
97 [%        CASE %][% module | html %]
98 [%    END %]
99 [% END %]
100
101 [% BLOCK translate_log_action %]
102 [%    SWITCH action %]
103 [%        CASE 'ADD'    %]Add
104 [%        CASE 'DELETE' %]Delete
105 [%        CASE 'MODIFY' %]Modify
106 [%        CASE 'ISSUE'  %]Checkout
107 [%        CASE 'RETURN' %]Return
108 [%        CASE 'CREATE' %]Create
109 [%        CASE 'CANCEL' %]Cancel
110 [%        CASE 'RESUME' %]Resume
111 [%        CASE 'SUSPEND' %]Suspend
112 [%        CASE 'RENEW'  %]Renew
113 [%        CASE 'RENEWAL' %]Renew
114 [%        CASE 'CHANGE PASS' %]Change password
115 [%        CASE 'ADDCIRCMESSAGE' %]Add circulation message
116 [%        CASE 'DELCIRCMESSAGE' %]Delete circulation message
117 [%        CASE 'STATUS_CHANGE'  %]Change ILL request status
118 [%        CASE 'PATRON_NOTICE'  %]Send a notice to a patron
119 [%        CASE 'Run'    %]Run
120 [%        CASE %][% action | html %]
121 [%    END %]
122 [% END %]
123
124 [% BLOCK translate_log_interface %]
125 [%    SWITCH log_interface.upper %]
126 [%        CASE 'INTRANET'    %]Intranet
127 [%        CASE 'OPAC'        %]OPAC
128 [%        CASE 'SIP'         %]SIP
129 [%        CASE 'COMMANDLINE' %]Command-line
130 [%        CASE 'API'         %]REST API
131 [%        CASE 'CRON'        %]Cron job
132 [%        CASE %][% log_interface | html %]
133 [%    END %]
134 [% END %]
135
136 <div id="breadcrumbs">
137         <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
138         [% IF ( do_it ) %]
139                 <a href="/cgi-bin/koha/tools/viewlog.pl">Logs</a> &rsaquo; Results
140         [% ELSE %]
141                 Logs
142         [% END %]
143 </div>
144
145 <div class="main container-fluid">
146     <div class="row">
147         <div class="col-sm-10 col-sm-push-2">
148             <main>
149
150                                 <h1>Browse system logs</h1>
151                                 <form method="post" action="/cgi-bin/koha/tools/viewlog.pl">
152                                         [% IF ( do_it ) %]
153                                                 <input type="hidden" name="do_it" value="[% do_it | html %]" />
154                                         [% END %]
155                     <input type="hidden" name="src" value="[% src | html %]" />
156                                         <fieldset class="rows">
157                                                 <ol>
158                                                         <li>
159                                                                 <label for="user">Librarian:</label>
160                                 <input type="text" name="user" id="user" value="[% user | html %]" />
161                                                         </li>
162                             [% UNLESS src == "circ" %]
163                                 <li>
164                                     <label>Modules:</label>
165                                     <div class="log_modules">
166                                         [% IF modules.size == 0 %]
167                                             <label for="moduleALL" class="viewlog"><input type="checkbox" id="moduleALL" name="modules" value="" checked="checked"> All</label>
168                                         [% ELSE %]
169                                             <label for="moduleALL" class="viewlog"><input type="checkbox" id="moduleALL" name="modules" value=""> All</label>
170                                         [% END %]
171                                         [% FOREACH modx IN [ 'AUTH' 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'LETTER' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS' ] %]
172                                             [% IF modules.grep(modx).size %]
173                                                 <label for="module[% modx | html %]" class="viewlog"><input type="checkbox" id="module[% modx | html %]" name="modules" value="[% modx | html %]" checked="checked"> [% PROCESS translate_log_module module=modx %]</label>
174                                             [% ELSE %]
175                                                 <label for="module[% modx | html %]" class="viewlog"><input type="checkbox" id="module[% modx | html %]" name="modules" value="[% modx | html %]"> [% PROCESS translate_log_module module=modx %]</label>
176                                             [% END %]
177                                         [% END %]
178                                     </div>
179                                 </li>
180                             [% ELSE %]
181                                 <input type="hidden" name="modules" value="MEMBERS" />
182                                 <input type="hidden" name="modules" value="CIRCULATION" />
183                             [% END %]
184                             <li>
185                                 <label>Actions:</label>
186                                 <div class="log_modules">
187                                     [% IF actions.length == 0 %]
188                                         <label for="actionALL" class="viewlog"><input type="checkbox" id="actionALL" name="actions" value="" checked="checked"> All</label>
189                                     [% ELSE %]
190                                         <label for="actionALL" class="viewlog"><input type="checkbox" id="actionALL" name="actions" value=""> All</label>
191                                     [% END %]
192
193                                     [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'CANCEL' 'SUSPEND' 'RESUME' 'ADDCIRCMESSAGE' 'DELCIRCMESSAGE' 'STATUS_CHANGE' 'PATRON_NOTICE' 'CHANGE PASS' 'Run' ] %]
194                                         [% IF actions.grep(actx).size %]
195                                             <label for="action[% actx| replace('\s+', '_') | html %]" class="viewlog"><input type="checkbox" id="action[% actx | replace('\s+', '_') | html %]" name="actions" value="[% actx | html %]" checked="checked"> [% PROCESS translate_log_action action=actx %]</label>
196                                         [% ELSE %]
197                                             <label for="action[% actx| replace('\s+', '_') | html %]" class="viewlog"><input type="checkbox" id="action[% actx | replace('\s+', '_') | html %]" name="actions" value="[% actx | html %]"> [% PROCESS translate_log_action action=actx %]</label>
198                                         [% END %]
199                                     [% END %]
200                                 </div>
201                             </li>
202                             <li>
203                                 [% IF src == 'circ' %]
204                                     <label for="object">Borrowernumber: </label>
205                                     <input type="text" id="object" name="object" value="[% object | html %]" readonly="readonly" title="This field cannot be modified from the circulation module." />
206                                 [% ELSE %]
207                                     <label for="object">Object: </label>
208                                     <input type="text" id="object" name="object" value="[% object | html %]" />
209                                 [% END %]
210                             </li>
211                                                         <li>
212                                                                 <label for="info">Info:</label>
213                                 <input type="text" id="info" name="info" value="[% info | html %]" />
214                                                         </li>
215                             <li>
216                                 <label>Interface:</label>
217                                 [% IF interfaces.size == 0 %]
218                                     <label for="interfaceALL" class="viewlog"><input type="checkbox" id="interfaceALL" name="interfaces" value="" checked="checked"> All</label>
219                                 [% ELSE %]
220                                     <label for="interfaceALL" class="viewlog"><input type="checkbox" id="interfaceALL" name="interfaces" value=""> All</label>
221                                 [% END %]
222
223                                 [% FOREACH interf IN [ 'INTRANET' 'OPAC' 'SIP' 'COMMANDLINE' 'API' 'CRON' ] %]
224                                     [% IF interfaces.grep(interf).size %]
225                                         <label for="interface[% interf | html %]" class="viewlog"><input type="checkbox" id="interface[% interf | html %]" name="interfaces" value="[% interf | html %]" checked="checked"> [% PROCESS translate_log_interface log_interface=interf %]</label>
226                                     [% ELSE %]
227                                         <label for="interface[% interf | html %]" class="viewlog"><input type="checkbox" id="interface[% interf | html %]" name="interfaces" value="[% interf | html %]"> [% PROCESS translate_log_interface log_interface=interf %]</label>
228                                     [% END %]
229                                 [% END %]
230                             </li>
231                                                         <li>
232                                 <label for="from"> Display from: </label> <input type="text" size="10" id="from" name="from" value="[% datefrom | html %]" class="datepickerfrom" />
233                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
234                                                         </li>
235                                                         <li>
236                                 <label for="to">Display to: </label> <input size="10" id="to" name="to" type="text" value="[% dateto | html %]" class="datepickerto" />
237                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
238                                                         </li>
239                                                 </ol>
240                                         </fieldset>
241                                         <fieldset class="rows">
242                                                 <legend>Output</legend>
243                                                 <ol>
244                                                         <li>
245                                                                 <label for="screen" >To screen in the browser:</label> <input id="screen" type="radio" checked="checked" name="output" value="screen" />
246                                                         </li>
247                                                         <li>
248                                                                 <label for="file">To a file:</label>
249                                                                 <input id="file" type="radio" name="output" value="file" />
250                                                                 <label class="inline" for="basename">Named:</label>
251                                                                 <input type="text" name="basename" id="basename" value="Export" />
252                                                                 <!--
253                                                                         <label for="MIME" class="inline">Into an application:</label>
254                                                                         [% CGIextChoice | html %]
255                                                                         [% CGIsepChoice | html %]
256                                                                 -->
257                                                                 <input type="hidden" name="report_name" value="[% report_name | html %]" />
258                                                         </li>
259                                                 </ol>
260                                         </fieldset>
261                                         <fieldset class="action">
262                                                 <input type="submit" value="Submit" />
263                                                 <input type="hidden" name="do_it" value="1" />
264                                         </fieldset>
265                         </form>
266                 [% IF ( do_it ) %]
267                     [% IF ( total ) %]
268                         <h3>Log entries</h3>
269                         <div id="toolbar" class="btn-toolbar">
270                             <a href="#" id="select_none" class="btn btn-link disabled"><i class="fa fa-remove"></i> Check none</a>
271                             <button class="btn btn-link disabled compare_link"><i class="fa fa-columns"></i> Compare selected</button>
272                         </div>
273                         <table id="logst">
274                             <thead>
275                                 <tr>
276                                     <th>Date</th>
277                                     <th>Librarian</th>
278                                     <th>Module</th>
279                                     <th>Action</th>
280                                     <th>Object</th>
281                                     <th>Info</th>
282                                     <th>Interface</th>
283                                 </tr>
284                             </thead>
285                             <tbody>
286                             [% FOREACH loopro IN looprow %]
287                                 <tr>
288                                     <td data-order="[% loopro.timestamp | html %]">[% loopro.timestamp | $KohaDates with_hours=1 %]</td>
289                                     <td>
290                                         [% IF loopro.librarian %]
291                                             <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>
292                                         [% ELSE %]
293                                             [% loopro.user | html %]
294                                         [% END %]
295                                     </td>
296                                     <td>[% PROCESS translate_log_module module=loopro.module %]</td>
297                                     <td>[% PROCESS translate_log_action action=loopro.action %]</td>
298                                     <td>
299                                         [% IF ( loopro.module == 'MEMBERS' ) || ( loopro.module == 'CIRCULATION' ) || ( loopro.module == 'FINES' ) %]
300                                             [% IF loopro.patron %]
301                                                 <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>
302                                             [% ELSE %]
303                                                 [% loopro.object | html %]
304                                             [% END %]
305                                         [% ELSE %]
306                                                 [% IF ( loopro.module == 'CATALOGUING' ) %]
307                                                     [% IF ( loopro.info.substr(0, 4) == 'item' ) %]
308                                                         <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
309                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.biblionumber | uri %]" title="Display detail for this biblio">Biblio [% loopro.biblionumber | html %]</a>
310                                                     [% ELSIF ( loopro.info.substr(0, 6) == 'biblio' ) %]
311                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object | uri %]" title="Display detail for this biblio">Biblio [% loopro.object | html %]</a>
312                                                     [% ELSE %]
313                                                         [% loopro.object | html %]
314                                                     [% END %]
315                                                 [% ELSE %]
316                                                     [% IF ( loopro.module == 'SERIAL' ) %]
317                                                         <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% loopro.object | uri %]">Subscription [% loopro.object | html %] </a>
318                                                     [% ELSE %]
319                                                         [% IF ( loopro.module == 'AUTHORITIES' ) %]
320                                                             <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% loopro.object | uri %]" title="Display detail for this authority">Authority [% loopro.object | html %]</a>
321                                                         [% ELSE %]
322                                                             [% loopro.object | html %]
323                                                         [% END %]
324                                                     [% END %]
325                                                 [% END %]
326                                         [% END %]
327                                     </td>
328                                     <td>
329                                         [% IF ( loopro.module == 'CIRCULATION' ) %]
330                                             <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>
331                                         [% ELSE %]
332                                             [% IF loopro.module == "SYSTEMPREFERENCE" || loopro.module == "REPORTS" %]
333                                                 <div class="loginfo" id="loginfo[% loopro.action_id | html %]">[% loopro.info | trim | html %]</div>
334                                                 <div class="compare_info" id="compare_info[% loopro.action_id | html %]">
335                                                     <label><input type="checkbox" name="diff" id="action_id[% loopro.action_id | html %]" data-actionid="[% loopro.action_id | html %]" data-filter="[% FOREACH info IN loopro.info.split(' \| ') %][% IF loop.first %][% info | html %][% END %][% END %]" class="compare" /> Compare</label>
336                                                 </div>
337                                             [% ELSE %]
338                                                 <div class="loginfo" id="loginfo[% loopro.action_id | html %]">
339                                                     [% loopro.info | html %]
340                                                 </div>
341                                             [% END %]
342                                         [% END %]
343                                     </td>
344                                     <td>[% PROCESS translate_log_interface log_interface=loopro.interface %]</td>
345                                 </tr>
346                             [% END %]
347                             </tbody>
348                         </table>
349                     [% ELSE %]
350                         <div class="dialog alert">
351                             No log found
352                             [% IF ( CATALOGUING ) %]
353                                 for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% object | url %]">Bibliographic record [% object | html %]</a>
354                             [% END %]
355                             [% IF ( MEMBERS ) %]
356                                 for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% object | url %]">[% INCLUDE 'patron-title.inc' %]</a>
357                             [% END %]
358                             .
359                         </div>
360                     [% END %]
361                 [% END %]
362
363
364             </main>
365         </div> <!-- /.col-sm-10.col-sm-push-2 -->
366
367         <div class="col-sm-2 col-sm-pull-10">
368             <aside>
369                 [% IF ( circulation ) %]
370                     [% INCLUDE 'circ-menu.inc' %]
371                 [% ELSE %]
372                     [% IF ( CATALOGUING ) %]
373                         [% INCLUDE 'biblio-view-menu.inc' %]
374                     [% ELSE %]
375                         [% INCLUDE 'tools-menu.inc' %]
376                     [% END %]
377                 [% END %]
378             </aside>
379         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
380      </div> <!-- /.row -->
381
382 <div class="modal" id="compareInfo" tabindex="-1" role="dialog" aria-labelledby="compareInfoLabel">
383     <div class="modal-dialog modal-lg" role="document">
384         <div class="modal-content">
385             <div class="modal-header">
386                 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
387                 <h4 class="modal-title" id="compareInfoLabel">Compare preference values</h4>
388             </div>
389             <div class="modal-body">
390                 <div class="row">
391                     <div class="compare_pane col-sm-6" id="col1">
392                         <h5>Older version</h5>
393                         <pre></pre>
394                     </div>
395                     <div class="compare_pane col-sm-6" id="col2">
396                         <h5>Newer version</h5>
397                         <pre></pre>
398                     </div>
399                 </div>
400             </div> <!-- /.modal-body -->
401             <div class="modal-footer">
402                 <button type="button" class="btn btn-default deny" data-dismiss="modal">Close</button>
403             </div>
404         </div> <!-- /.modal-content -->
405     </div> <!-- /.modal-dialog -->
406 </div> <!-- /#compareInfo -->
407
408 [% MACRO jsinclude BLOCK %]
409     [% INCLUDE 'calendar.inc' %]
410     [% INCLUDE 'datatables.inc' %]
411     [% INCLUDE 'columns_settings.inc' %]
412     [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
413     [% Asset.js("js/tools-menu.js") | $raw %]
414     [% Asset.js("lib/hc-sticky.js") | $raw %]
415     [% IF ( circulation ) %]
416         [% INCLUDE 'str/members-menu.inc' %]
417         [% Asset.js("js/members-menu.js") | $raw %]
418     [% END %]
419     [% Asset.js("lib/jsdiff/jsdiff.min.js") | $raw %]
420     <script>
421         var columns_settings = [% TablesSettings.GetColumns('tools', 'logviewer', 'logst', 'json') | $raw %];
422     </script>
423     [% Asset.js("js/viewlog.js") | $raw %]
424 [% END %]
425
426 [% INCLUDE 'intranet-bottom.inc' %]