1) Malformed conditionals Currently, the majority of "viewlog.tt" is ignored, because we haven't formed the conditionals correctly. (e.g. Using 'module' when we should be using 'loopro.module' [or 'loopro.MODULENAME' like 'loopro.CIRCULATION'], 'info' instead of 'loopro.info', etc.) This means that we always get the raw "loopro.object", which is either a borrowernumber, biblionumber, itemnumber, subscriptionid, or authid, with absolutely no qualifier at all. *SOLUTION* Alas, the solution requires a few systematic changes. Detecting an object as a 'borrowernumber' is easy, since MEMBERS, CIRCULATION, and FINES always use it as its object. Same goes for 'subscriptionid' for SERIALS and 'authid' for AUTHORITIES. For these cases, we just need to fix the variables called in the conditions. However, unfortunately, CATALOGUING sometimes uses biblionumber and sometimes uses itemnumber as its object. This causes the following problem... 2) Conditions in viewlog.pl and viewlog.tt do not correctly differentiate items and biblios. There are conditions that check to see if the 'info' column says 'item'. However, this has erratic results, because 'item' is only logged for item adds and deletions - not modifications. (Authorities also only track 'authority' for additions and deletions - not modifications.) 'biblio' is only tracked for biblio additions. Deletions have no info, while modifications include the record content. In viewlog.tt, logs without an 'info' of 'item' will be labelled and linked as 'biblio'. That means that all item modifications will be treated as biblios and not items. *SOLUTION* Change logaction to prepend the info column with "biblio" for all biblio transactions and "item" for all item transactions. Then, check for the applicable substring in viewlog.pl and viewlog.tt to determine how to link and label the number. For legacy data, have a third option that doesn't label/link the object. Just have the raw number (as we currently do).
Created attachment 23915 [details] [review] 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.
Created attachment 23916 [details] [review] Bug 11473 - Remove boilerplate in log viewer template This patch eliminates unnecessary conditions and boilerplate. _TEST PLAN_ Apply the patch. 1) Try viewing logs for circulation, patrons, fines, cataloguines, serials, authorities, etc. 2) Note that everything should look exactly the same as before, with one exception: FINES 3) Fines will now show "member X" for the user associated with the fine.
Created attachment 23917 [details] [review] Bug 11473 - Improve wording in log viewer template This patch capitalizes 'member' and 'biblio' as object labels in the log viewer. It also adds a "Subscription" label, and changes "auth" to "Authority". _TEST PLAN_ Before applying patch: 1) View logs for patrons, new biblio, serials, and authorities. Apply the patch: 1) Notice the capitalization and new/modified labels.
Created attachment 23918 [details] [review] Bug 11473 - add 'biblio' and 'item' to cataloguing logging info This patch adds the words 'biblio' and 'item' to the 'info' of the cataloguing logs which were missing them (such as biblio delete, biblio mod, item mod, upload cover image). This patch also adds 'authority' for authority mod. _TEST PLAN_ Before applying: 1) Create/view mods for items, biblios, and authorities. 2) Create/view biblio deletion 3) Create/view upload cover image log 4) Note that none of these contain the words 'biblio','item',or 'authority' in their "Info" columns. Apply patch. 5) Repeat steps 1-3 6) Note that the new logs contain 'biblio','item', and 'authority' in their "Info" column, while the past ones don't. 7) Note also that 'biblio' and 'item' will have 'Biblio' and 'Item' appear in their "Object" column for the new logs
Created attachment 23922 [details] [review] 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 <chris@bigballofwax.co.nz> Works as advertised
Created attachment 23923 [details] [review] Bug 11473 - Remove boilerplate in log viewer template This patch eliminates unnecessary conditions and boilerplate. _TEST PLAN_ Apply the patch. 1) Try viewing logs for circulation, patrons, fines, cataloguines, serials, authorities, etc. 2) Note that everything should look exactly the same as before, with one exception: FINES 3) Fines will now show "member X" for the user associated with the fine. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 23924 [details] [review] Bug 11473 - Improve wording in log viewer template This patch capitalizes 'member' and 'biblio' as object labels in the log viewer. It also adds a "Subscription" label, and changes "auth" to "Authority". _TEST PLAN_ Before applying patch: 1) View logs for patrons, new biblio, serials, and authorities. Apply the patch: 1) Notice the capitalization and new/modified labels. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 23925 [details] [review] Bug 11473 - add 'biblio' and 'item' to cataloguing logging info This patch adds the words 'biblio' and 'item' to the 'info' of the cataloguing logs which were missing them (such as biblio delete, biblio mod, item mod, upload cover image). This patch also adds 'authority' for authority mod. _TEST PLAN_ Before applying: 1) Create/view mods for items, biblios, and authorities. 2) Create/view biblio deletion 3) Create/view upload cover image log 4) Note that none of these contain the words 'biblio','item',or 'authority' in their "Info" columns. Apply patch. 5) Repeat steps 1-3 6) Note that the new logs contain 'biblio','item', and 'authority' in their "Info" column, while the past ones don't. 7) Note also that 'biblio' and 'item' will have 'Biblio' and 'Item' appear in their "Object" column for the new logs Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
QA comment: It is not perfect but it is far better than it is currently. 2 first patches could be squashed for more visibility. Marked as Passed QA.
Created attachment 24152 [details] [review] 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 <chris@bigballofwax.co.nz> Works as advertised Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 24153 [details] [review] Bug 11473 - Remove boilerplate in log viewer template This patch eliminates unnecessary conditions and boilerplate. _TEST PLAN_ Apply the patch. 1) Try viewing logs for circulation, patrons, fines, cataloguines, serials, authorities, etc. 2) Note that everything should look exactly the same as before, with one exception: FINES 3) Fines will now show "member X" for the user associated with the fine. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 24154 [details] [review] Bug 11473 - Improve wording in log viewer template This patch capitalizes 'member' and 'biblio' as object labels in the log viewer. It also adds a "Subscription" label, and changes "auth" to "Authority". _TEST PLAN_ Before applying patch: 1) View logs for patrons, new biblio, serials, and authorities. Apply the patch: 1) Notice the capitalization and new/modified labels. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 24155 [details] [review] Bug 11473 - add 'biblio' and 'item' to cataloguing logging info This patch adds the words 'biblio' and 'item' to the 'info' of the cataloguing logs which were missing them (such as biblio delete, biblio mod, item mod, upload cover image). This patch also adds 'authority' for authority mod. _TEST PLAN_ Before applying: 1) Create/view mods for items, biblios, and authorities. 2) Create/view biblio deletion 3) Create/view upload cover image log 4) Note that none of these contain the words 'biblio','item',or 'authority' in their "Info" columns. Apply patch. 5) Repeat steps 1-3 6) Note that the new logs contain 'biblio','item', and 'authority' in their "Info" column, while the past ones don't. 7) Note also that 'biblio' and 'item' will have 'Biblio' and 'Item' appear in their "Object" column for the new logs Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Pushed to master, along with a follow-up that repairs links to the item from item modification log entries. Thanks, David!
Patches pushed to 3.14.x, will be in 3.14.5