Bug 26844: Add warning to disabled logs on log viewer
[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 'Run'    %]Run
119 [%        CASE %][% action | html %]
120 [%    END %]
121 [% END %]
122
123 [% BLOCK translate_log_interface %]
124 [%    SWITCH log_interface.upper %]
125 [%        CASE 'INTRANET'    %]Intranet
126 [%        CASE 'OPAC'        %]OPAC
127 [%        CASE 'SIP'         %]SIP
128 [%        CASE 'COMMANDLINE' %]Command-line
129 [%        CASE 'API'         %]REST API
130 [%        CASE 'CRON'        %]Cron job
131 [%        CASE %][% log_interface | html %]
132 [%    END %]
133 [% END %]
134
135 <div id="breadcrumbs">
136         <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
137         [% IF ( do_it ) %]
138                 <a href="/cgi-bin/koha/tools/viewlog.pl">Logs</a> &rsaquo; Results
139         [% ELSE %]
140                 Logs
141         [% END %]
142 </div>
143
144 <div class="main container-fluid">
145     <div class="row">
146         <div class="col-sm-10 col-sm-push-2">
147             <main>
148
149                                 <h1>Browse system logs</h1>
150                                 <form method="post" action="/cgi-bin/koha/tools/viewlog.pl">
151                                         [% IF ( do_it ) %]
152                                                 <input type="hidden" name="do_it" value="[% do_it | html %]" />
153                                         [% END %]
154                     <input type="hidden" name="src" value="[% src | html %]" />
155                                         <fieldset class="rows">
156                                                 <ol>
157                                                         <li>
158                                                                 <label for="user">Librarian:</label>
159                                 <input type="text" name="user" id="user" value="[% user | html %]" />
160                                                         </li>
161                             [% UNLESS src == "circ" %]
162                                 <li>
163                                     <label for="modules">Modules:</label>
164                                     <div class="log_modules">
165                                         [% IF modules.size == 0 %]
166                                             <label for="moduleALL" class="viewlog"><input type="checkbox" id="moduleALL" name="modules" value="" checked="checked"> All</label>
167                                         [% ELSE %]
168                                             <label for="moduleALL" class="viewlog"><input type="checkbox" id="moduleALL" name="modules" value=""> All</label>
169                                         [% END %]
170                                         [% FOREACH modx IN [ 'AUTH' 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'LETTER' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS' ] %]
171                                             [% IF modules.grep(modx).size %]
172                                                 <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>
173                                             [% ELSE %]
174                                                 <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>
175                                             [% END %]
176                                         [% END %]
177                                     </div>
178                                 </li>
179                             [% ELSE %]
180                                 <input type="hidden" name="modules" value="MEMBERS" />
181                                 <input type="hidden" name="modules" value="CIRCULATION" />
182                             [% END %]
183                             <li>
184                                 <label for="actions">Actions:</label>
185                                 <div class="log_modules">
186                                     [% IF actions.length == 0 %]
187                                         <label for="actionALL" class="viewlog"><input type="checkbox" id="actionALL" name="actions" value="" checked="checked"> All</label>
188                                     [% ELSE %]
189                                         <label for="actionALL" class="viewlog"><input type="checkbox" id="actionALL" name="actions" value=""> All</label>
190                                     [% END %]
191
192                                     [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'CANCEL' 'SUSPEND' 'RESUME' 'ADDCIRCMESSAGE' 'DELCIRCMESSAGE' 'STATUS_CHANGE' 'CHANGE PASS' 'Run' ] %]
193                                         [% IF actions.grep(actx).size %]
194                                             <label for="action[% actx | html %]" class="viewlog"><input type="checkbox" id="action[% actx | html %]" name="actions" value="[% actx | html %]" checked="checked"> [% PROCESS translate_log_action action=actx %]</label>
195                                         [% ELSE %]
196                                             <label for="action[% actx | html %]" class="viewlog"><input type="checkbox" id="action[% actx | html %]" name="actions" value="[% actx | html %]"> [% PROCESS translate_log_action action=actx %]</label>
197                                         [% END %]
198                                     [% END %]
199                                 </div>
200                             </li>
201                             <li>
202                                 [% IF src == 'circ' %]
203                                     <label for="object">Borrowernumber: </label>
204                                     <input type="text" id="object" name="object" value="[% object | html %]" readonly="readonly" title="This field cannot be modified from the circulation module." />
205                                 [% ELSE %]
206                                     <label for="object">Object: </label>
207                                     <input type="text" id="object" name="object" value="[% object | html %]" />
208                                 [% END %]
209                             </li>
210                                                         <li>
211                                                                 <label for="info">Info:</label>
212                                 <input type="text" id="info" name="info" value="[% info | html %]" />
213                                                         </li>
214                             <li>
215                                 <label for="interfaces">Interface:</label>
216                                 [% IF interfaces.size == 0 %]
217                                     <label for="interfaceALL" class="viewlog"><input type="checkbox" id="interfaceALL" name="interfaces" value="" checked="checked"> All</label>
218                                 [% ELSE %]
219                                     <label for="interfaceALL" class="viewlog"><input type="checkbox" id="interfaceALL" name="interfaces" value=""> All</label>
220                                 [% END %]
221
222                                 [% FOREACH interf IN [ 'INTRANET' 'OPAC' 'SIP' 'COMMANDLINE' 'API' 'CRON' ] %]
223                                     [% IF interfaces.grep(interf).size %]
224                                         <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>
225                                     [% ELSE %]
226                                         <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>
227                                     [% END %]
228                                 [% END %]
229                             </li>
230                                                         <li>
231                                 <label for="from"> Display from: </label> <input type="text" size="10" id="from" name="from" value="[% datefrom | html %]" class="datepickerfrom" />
232                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
233                                                         </li>
234                                                         <li>
235                                 <label for="to">Display to: </label> <input size="10" id="to" name="to" type="text" value="[% dateto | html %]" class="datepickerto" />
236                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
237                                                         </li>
238                                                 </ol>
239                                         </fieldset>
240                                         <fieldset class="rows">
241                                                 <legend>Output</legend>
242                                                 <ol>
243                                                         <li>
244                                                                 <label for="screen" >To screen in the browser:</label> <input id="screen" type="radio" checked="checked" name="output" value="screen" />
245                                                         </li>
246                                                         <li>
247                                                                 <label for="file">To a file:</label>
248                                                                 <input id="file" type="radio" name="output" value="file" />
249                                                                 <label class="inline" for="basename">Named:</label>
250                                                                 <input type="text" name="basename" id="basename" value="Export" />
251                                                                 <!--
252                                                                         <label for="MIME" class="inline">Into an application:</label>
253                                                                         [% CGIextChoice | html %]
254                                                                         [% CGIsepChoice | html %]
255                                                                 -->
256                                                                 <input type="hidden" name="report_name" value="[% report_name | html %]" />
257                                                         </li>
258                                                 </ol>
259                                         </fieldset>
260                                         <fieldset class="action">
261                                                 <input type="submit" value="Submit" />
262                                                 <input type="hidden" name="do_it" value="1" />
263                                         </fieldset>
264                         </form>
265                 [% IF ( do_it ) %]
266                     [% IF ( total ) %]
267                         <h3>Log entries</h3>
268                         <div id="toolbar" class="btn-toolbar">
269                             <a href="#" id="select_none" class="btn btn-link disabled"><i class="fa fa-remove"></i> Check none</a>
270                             <button class="btn btn-link disabled compare_link"><i class="fa fa-columns"></i> Compare selected</button>
271                         </div>
272                         <table id="logst">
273                             <thead>
274                                 <tr>
275                                     <th>Date</th>
276                                     <th>Librarian</th>
277                                     <th>Module</th>
278                                     <th>Action</th>
279                                     <th>Object</th>
280                                     <th>Info</th>
281                                     <th>Interface</th>
282                                 </tr>
283                             </thead>
284                             <tbody>
285                             [% FOREACH loopro IN looprow %]
286                                 <tr>
287                                     <td data-order="[% loopro.timestamp | html %]">[% loopro.timestamp | $KohaDates with_hours=1 %]</td>
288                                     <td>
289                                         [% IF loopro.librarian %]
290                                             <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>
291                                         [% ELSE %]
292                                             [% loopro.user | html %]
293                                         [% END %]
294                                     </td>
295                                     <td>[% PROCESS translate_log_module module=loopro.module %]</td>
296                                     <td>[% PROCESS translate_log_action action=loopro.action %]</td>
297                                     <td>
298                                         [% IF ( loopro.module == 'MEMBERS' ) || ( loopro.module == 'CIRCULATION' ) || ( loopro.module == 'FINES' ) %]
299                                             [% IF loopro.patron %]
300                                                 <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>
301                                             [% ELSE %]
302                                                 [% loopro.object | html %]
303                                             [% END %]
304                                         [% ELSE %]
305                                                 [% IF ( loopro.module == 'CATALOGUING' ) %]
306                                                     [% IF ( loopro.info.substr(0, 4) == 'item' ) %]
307                                                         <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
308                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.biblionumber | uri %]" title="Display detail for this biblio">Biblio [% loopro.biblionumber | html %]</a>
309                                                     [% ELSIF ( loopro.info.substr(0, 6) == 'biblio' ) %]
310                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object | uri %]" title="Display detail for this biblio">Biblio [% loopro.object | html %]</a>
311                                                     [% ELSE %]
312                                                         [% loopro.object | html %]
313                                                     [% END %]
314                                                 [% ELSE %]
315                                                     [% IF ( loopro.module == 'SERIAL' ) %]
316                                                         <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% loopro.object | uri %]">Subscription [% loopro.object | html %] </a>
317                                                     [% ELSE %]
318                                                         [% IF ( loopro.module == 'AUTHORITIES' ) %]
319                                                             <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% loopro.object | uri %]" title="Display detail for this authority">Authority [% loopro.object | html %]</a>
320                                                         [% ELSE %]
321                                                             [% loopro.object | html %]
322                                                         [% END %]
323                                                     [% END %]
324                                                 [% END %]
325                                         [% END %]
326                                     </td>
327                                     <td>
328                                         [% IF ( loopro.module == 'CIRCULATION' ) %]
329                                             <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>
330                                         [% ELSE %]
331                                             [% IF loopro.module == "SYSTEMPREFERENCE" %]
332                                                 <div class="loginfo" id="loginfo[% loopro.action_id | html %]">[% loopro.info | trim | html %]</div>
333                                                 <div class="compare_info" id="compare_info[% loopro.action_id | html %]">
334                                                     <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>
335                                                 </div>
336                                             [% ELSE %]
337                                                 <div class="loginfo" id="loginfo[% loopro.action_id | html %]">
338                                                     [% loopro.info | html %]
339                                                 </div>
340                                             [% END %]
341                                         [% END %]
342                                     </td>
343                                     <td>[% PROCESS translate_log_interface log_interface=loopro.interface %]</td>
344                                 </tr>
345                             [% END %]
346                             </tbody>
347                         </table>
348                     [% ELSE %]
349                         <div class="dialog alert">
350                             No log found
351                             [% IF ( CATALOGUING ) %]
352                                 for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% object | url %]">Bibliographic record [% object | html %]</a>
353                             [% END %]
354                             [% IF ( MEMBERS ) %]
355                                 for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% object | url %]">[% INCLUDE 'patron-title.inc' %]</a>
356                             [% END %]
357                             .
358                         </div>
359                     [% END %]
360                 [% END %]
361
362
363             </main>
364         </div> <!-- /.col-sm-10.col-sm-push-2 -->
365
366         <div class="col-sm-2 col-sm-pull-10">
367             <aside>
368                 [% IF ( circulation ) %]
369                     [% INCLUDE 'circ-menu.inc' %]
370                 [% ELSE %]
371                     [% IF ( CATALOGUING ) %]
372                         [% INCLUDE 'biblio-view-menu.inc' %]
373                     [% ELSE %]
374                         [% INCLUDE 'tools-menu.inc' %]
375                     [% END %]
376                 [% END %]
377             </aside>
378         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
379      </div> <!-- /.row -->
380
381 <div class="modal" id="compareInfo" tabindex="-1" role="dialog" aria-labelledby="compareInfoLabel">
382     <div class="modal-dialog modal-lg" role="document">
383         <div class="modal-content">
384             <div class="modal-header">
385                 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
386                 <h4 class="modal-title" id="compareInfoLabel">Compare preference values</h4>
387             </div>
388             <div class="modal-body">
389                 <div class="row">
390                     <div class="compare_pane col-sm-6" id="col1">
391                         <h5>Older version</h5>
392                         <pre></pre>
393                     </div>
394                     <div class="compare_pane col-sm-6" id="col2">
395                         <h5>Newer version</h5>
396                         <pre></pre>
397                     </div>
398                 </div>
399             </div> <!-- /.modal-body -->
400             <div class="modal-footer">
401                 <button type="button" class="btn btn-default deny" data-dismiss="modal">Close</button>
402             </div>
403         </div> <!-- /.modal-content -->
404     </div> <!-- /.modal-dialog -->
405 </div> <!-- /#compareInfo -->
406
407 [% MACRO jsinclude BLOCK %]
408     [% INCLUDE 'calendar.inc' %]
409     [% INCLUDE 'datatables.inc' %]
410     [% INCLUDE 'columns_settings.inc' %]
411     [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
412     [% Asset.js("js/tools-menu.js") | $raw %]
413     [% Asset.js("lib/hc-sticky.js") | $raw %]
414     [% IF ( circulation ) %]
415         [% INCLUDE 'str/members-menu.inc' %]
416         [% Asset.js("js/members-menu.js") | $raw %]
417     [% END %]
418     [% Asset.js("lib/jsdiff/jsdiff.min.js") | $raw %]
419     <script>
420         var columns_settings = [% TablesSettings.GetColumns('tools', 'logviewer', 'logst', 'json') | $raw %];
421     </script>
422     [% Asset.js("js/viewlog.js") | $raw %]
423 [% END %]
424
425 [% INCLUDE 'intranet-bottom.inc' %]