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