Bug 25845: Add 'api' to the log viewer interface options
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 23 Jun 2020 14:06:55 +0000 (11:06 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 22 Jul 2020 08:17:53 +0000 (10:17 +0200)
This patch simply adds the API option to the log viewer.

To test:
1. Have BorrowersLog set
2. Update some patron using the API. For example
   curl --location --request PUT 'http://koha:koha@kohadev-intra.mydnsname.org:8081/api/v1/patrons/1' \
--header 'Content-Type: application/json' \
--data-raw '{
"firstname": "Tomasito",
"surname": "None",
"address": "Address",
"category_id": "ST",
"city": "Córdoba",
"library_id": "MPL"
}'
3. Open the log viewer
=> FAIL: There's no way to filter on interface, choosing API
4. Apply this patch
5. Reload the log viewer
=> SUCCESS: There are options to filter by 'API' interface
=> SUCCESS: Filtering by 'API' works
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt

index 259d36d..60bc277 100644 (file)
@@ -85,6 +85,7 @@ fieldset.rows label.viewlog {
 [%        CASE 'OPAC'        %]OPAC
 [%        CASE 'SIP'         %]SIP
 [%        CASE 'COMMANDLINE' %]Command-line
+[%        CASE 'API'         %]API
 [%        CASE %][% log_interface | html %]
 [%    END %]
 [% END %]
@@ -176,7 +177,7 @@ fieldset.rows label.viewlog {
                                     <label for="interfaceALL" class="viewlog"><input type="checkbox" id="interfaceALL" name="interfaces" value=""> All</label>
                                 [% END %]
 
-                                [% FOREACH interf IN [ 'INTRANET' 'OPAC' 'SIP' 'COMMANDLINE' ] %]
+                                [% FOREACH interf IN [ 'INTRANET' 'OPAC' 'SIP' 'COMMANDLINE' 'API' ] %]
                                     [% IF interfaces.grep(interf).size %]
                                         <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>
                                     [% ELSE %]