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>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit ac6fb12c9aff29a652ee10c960ab10309d22adee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 5b3535899acfdcd309d722dba39a8bdcdbdc54e4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 8b386419c07413c810c56482cd4b505cdb5f43f2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 5885077fbbc97add0d077898c06726ef3106eee9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11473: (follow-up) ensure link to item is construct correctly

This patch adjusts the check on action_logs.info to better detect
if the event concerns an item.  This fixes a problem where the links
from log entries on item modifications would, if followed, result
in internal server errors.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 490e38069c0b9fcf71449d7812a0056b68318c64)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11329: Check for MARC record existence in opac-showmarc

Instead of just running as_formatted, check if GetMarcBiblio returned
a reference. If you e.g. did not pass an id, return 404 instead of 500.
Consistent with opac-export.pl

Test plan:
[1] Run opac-showmarc.pl with valid biblionumber in id parameter.
[2] Remove id parameter from URL. You should get a 404 now.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 80bcbd798991eaa57bcc7b5ac8906b276fbed5bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11329: Check for MARC record existence in catalogue/showmarc

Intranet counterpart patch. Same check as in opac/opac-showmarc.

Test plan:
[1] Run showmarc.pl with valid biblionumber in id parameter.
[2] Remove id parameter from URL. You should get a 404 now.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d92dc91f778f5db3360f3070d0bb5d44a0d75024)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>