Bug 11473 - add 'biblio' and 'item' to cataloguing logging info
authorDavid Cook <dcook@prosentient.com.au>
Mon, 6 Jan 2014 04:01:10 +0000 (15:01 +1100)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 17 Jan 2014 05:42:44 +0000 (05:42 +0000)
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>

C4/AuthoritiesMarc.pm
C4/Biblio.pm
C4/Items.pm
tools/upload-cover-image.pl

index a22190b..f7eb122 100644 (file)
@@ -739,7 +739,7 @@ sub ModAuthority {
        "VALUES (?,?)";
       $dbh->do($sqlinsert,undef,($authid,0));
   }
-  logaction( "AUTHORITIES", "MODIFY", $authid, "BEFORE=>" . $oldrecord->as_formatted ) if C4::Context->preference("AuthoritiesLog");
+  logaction( "AUTHORITIES", "MODIFY", $authid, "authority BEFORE=>" . $oldrecord->as_formatted ) if C4::Context->preference("AuthoritiesLog");
   return $authid;
 }
 
index 71e9366..dc40d68 100644 (file)
@@ -316,7 +316,7 @@ sub ModBiblio {
 
     if ( C4::Context->preference("CataloguingLog") ) {
         my $newrecord = GetMarcBiblio($biblionumber);
-        logaction( "CATALOGUING", "MODIFY", $biblionumber, "BEFORE=>" . $newrecord->as_formatted );
+        logaction( "CATALOGUING", "MODIFY", $biblionumber, "biblio BEFORE=>" . $newrecord->as_formatted );
     }
 
     # Cleaning up invalid fields must be done early or SetUTF8Flag is liable to
@@ -470,7 +470,7 @@ sub DelBiblio {
     # from being generated by _koha_delete_biblioitems
     $error = _koha_delete_biblio( $dbh, $biblionumber );
 
-    logaction( "CATALOGUING", "DELETE", $biblionumber, "" ) if C4::Context->preference("CataloguingLog");
+    logaction( "CATALOGUING", "DELETE", $biblionumber, "biblio" ) if C4::Context->preference("CataloguingLog");
 
     return;
 }
index 2b83ffc..5680db7 100644 (file)
@@ -583,7 +583,7 @@ sub ModItem {
     # item status is possible
     ModZebra( $biblionumber, "specialUpdate", "biblioserver" );
 
-    logaction("CATALOGUING", "MODIFY", $itemnumber, Dumper($item)) if C4::Context->preference("CataloguingLog");
+    logaction("CATALOGUING", "MODIFY", $itemnumber, "item ".Dumper($item)) if C4::Context->preference("CataloguingLog");
 }
 
 =head2 ModItemTransfer
index b85a81a..8ca419c 100755 (executable)
@@ -151,7 +151,7 @@ if ($fileID) {
                             $filename =~ s/^\s+//;
                             $filename =~ s/\s+$//;
                             if (C4::Context->preference("CataloguingLog")) {
-                                logaction('CATALOGUING', 'MODIFY', $biblionumber, "cover image: $filename");
+                                logaction('CATALOGUING', 'MODIFY', $biblionumber, "biblio cover image: $filename");
                             }
                             my $srcimage = GD::Image->new("$dir/$filename");
                             if ( defined $srcimage ) {