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