From ac6fb12c9aff29a652ee10c960ab10309d22adee Mon Sep 17 00:00:00 2001 From: David Cook Date: Mon, 6 Jan 2014 14:32:31 +1100 Subject: [PATCH] Bug 11473 - Fix log viewer template conditions This patch adds the 'loopro' key to the 'module' value, so that conditions are actually triggered in the template logic. (Note: loopro.CIRCULATION is valid, but I changed it for the sake of consistency across the different conditions.) This patch also adds substr checks to the 'info' column when using the cataloguing module. This will check for 'item' and 'biblio', so that the appropriate label qualifer can be shown in the log viewer. If either term is absent, the unqualified number will be shown instead (this will be the majority of action logs at this point). _TEST PLAN_ Before applying: 1) Access log viewer from Tools (or wherever really) 2) Look up logs for circulation, patrons, cataloguing, serial, authorities, etc. 3) Note that the "Object" will always just be a number without qualification. After applying the patch: 1) Look at those same logs 2) Note that the object number for borrowers will usually be prefaced by 'member' (notwithstanding FINES which aren't taken into account in this template yet); new bibs and new items should say 'Item X' or 'Biblio X'. Serials should have a link. Authorities should have a link and an 'auth' preface. Signed-off-by: Chris Cormack Works as advertised Signed-off-by: Jonathan Druart Signed-off-by: Galen Charlton --- .../prog/en/modules/tools/viewlog.tt | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt index a1d6e89fe4..ccd7cb64de 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt @@ -127,7 +127,7 @@ [% loopro.timestamp %] - [% IF ( module == 'CIRCULATION' ) %] + [% IF ( loopro.module == 'CIRCULATION' ) %] [% loopro.user %] [% ELSE %] [% loopro.user %] @@ -136,27 +136,29 @@ [% loopro.module %] [% loopro.action %] - [% IF ( module == 'MEMBERS' ) %] + [% IF ( loopro.module == 'MEMBERS' ) %] member [% loopro.object %] [% ELSE %] - [% IF ( module == 'CIRCULATION' ) %] + [% IF ( loopro.module == 'CIRCULATION' ) %] [% IF ( loopro.object ) %] member [% loopro.object %] [% END %] [% ELSE %] - [% IF ( module == 'CATALOGUING' ) %] - [% IF ( info == 'item' ) %] + [% IF ( loopro.module == 'CATALOGUING' ) %] + [% IF ( loopro.info.substr(0, 4) == 'item' ) %] Item [% loopro.object %] - [% ELSE %] + [% ELSIF ( loopro.info.substr(0, 6) == 'biblio' ) %] biblio [% loopro.object %] + [% ELSE %] + [% loopro.object %] [% END %] [% ELSE %] - [% IF ( module == 'SERIAL' ) %] + [% IF ( loopro.module == 'SERIAL' ) %] [% loopro.object %] [% ELSE %] - [% IF ( module == 'AUTHORITIES' ) %] + [% IF ( loopro.module == 'AUTHORITIES' ) %] auth [% loopro.object %] [% ELSE %] [% loopro.object %] @@ -167,7 +169,7 @@ [% END %] - [% IF ( loopro.CIRCULATION ) %] + [% IF ( loopro.module == 'CIRCULATION' ) %] Item [% loopro.barcode |html %] [% ELSE %] [% loopro.info |html %] -- 2.39.5