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