[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha C4/Biblio.pm C4/Log.pm C4/Members.pm C4/Se... [rel_3_0]
From: |
Antoine Farnault |
Subject: |
[Koha-cvs] koha C4/Biblio.pm C4/Log.pm C4/Members.pm C4/Se... [rel_3_0] |
Date: |
Wed, 10 Jan 2007 16:31:16 +0000 |
CVSROOT: /sources/koha
Module name: koha
Branch: rel_3_0
Changes by: Antoine Farnault <toins> 07/01/10 16:31:16
Modified files:
C4 : Biblio.pm Log.pm Members.pm Serials.pm
C4/Circulation : Circ2.pm
admin : systempreferences.pl
koha-tmpl/intranet-tmpl/prog/en/admin: systempreferences.tmpl
members : memberentry.pl
updater : updatedatabase
Log message:
new systems preferences :
- CataloguingLog (log the update/creation/deletion of a notice if set
to 1)
- BorrowersLog ( idem for borrowers )
- IssueLog (log all issue if set to 1)
- ReturnLog (log all return if set to 1)
- SusbcriptionLog (log all creation/deletion/update of a subcription)
All of theses are in a new tab called 'LOGFeatures' in
systempreferences.pl
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Biblio.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.178.2.45&r2=1.178.2.46
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Log.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.5.2.1&r2=1.5.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Members.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.32.2.26&r2=1.32.2.27
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Serials.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.5.2.19&r2=1.5.2.20
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Circulation/Circ2.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.114.2.29&r2=1.114.2.30
http://cvs.savannah.gnu.org/viewcvs/koha/admin/systempreferences.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.34.2.13&r2=1.34.2.14
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/admin/systempreferences.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.3&r2=1.1.2.4
http://cvs.savannah.gnu.org/viewcvs/koha/members/memberentry.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.38.2.22&r2=1.38.2.23
http://cvs.savannah.gnu.org/viewcvs/koha/updater/updatedatabase?cvsroot=koha&only_with_tag=rel_3_0&r1=1.157.2.43&r2=1.157.2.44
Patches:
Index: C4/Biblio.pm
===================================================================
RCS file: /sources/koha/koha/C4/Biblio.pm,v
retrieving revision 1.178.2.45
retrieving revision 1.178.2.46
diff -u -b -r1.178.2.45 -r1.178.2.46
--- C4/Biblio.pm 9 Jan 2007 10:31:09 -0000 1.178.2.45
+++ C4/Biblio.pm 10 Jan 2007 16:31:15 -0000 1.178.2.46
@@ -31,7 +31,7 @@
use vars qw($VERSION @ISA @EXPORT);
# set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.178.2.45 $' =~ /\d+/g;
shift(@v).".".join( "_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = do { my @v = '$Revision: 1.178.2.46 $' =~ /\d+/g;
shift(@v).".".join( "_", map { sprintf "%03d", $_ } @v ); };
@ISA = qw( Exporter );
@@ -272,6 +272,10 @@
# now add the record
my $biblionumber =
MARCaddbiblio( $record, $oldbibnum, $frameworkcode );
+
+
&logaction(C4::Context->userenv->{'number'},"CATALOGUING","ADD",$biblionumber,"biblio")
+ if C4::Context->preference("CataloguingLog");
+
return ( $biblionumber, $oldbibnum, $oldbibitemnum );
}
@@ -348,6 +352,10 @@
# add the item
&MARCadditem( $record, $item->{'biblionumber'},$frameworkcode );
+
+
&logaction(C4::Context->userenv->{'number'},"CATALOGUING","ADD",$itemnumber,"item")
+ if C4::Context->preference("CataloguingLog");
+
return ($item->{biblionumber}, $item->{biblioitemnumber},$itemnumber);
}
@@ -375,6 +383,9 @@
my $oldbiblionumber = _koha_modify_biblio( $dbh, $oldbiblio );
_koha_modify_biblioitem( $dbh, $oldbiblio );
+
&logaction(C4::Context->userenv->{'number'},"CATALOGUING","MODIFY",$biblionumber,"biblio")
+ if C4::Context->preference("CataloguingLog");
+
return 1;
}
@@ -406,6 +417,10 @@
elsif ($new_item_hashref) {
_koha_modify_item( $dbh, $new_item_hashref );
}
+
+
&logaction(C4::Context->userenv->{'number'},"CATALOGUING","MODIFY",$itemnumber,"item")
+ if C4::Context->preference("CataloguingLog");
+
}
=head2 ModBiblioframework
@@ -513,6 +528,10 @@
return $error if $error;
}
}
+
+
&logaction(C4::Context->userenv->{'number'},"CATALOGUING","DELETE",$biblionumber,"")
+ if C4::Context->preference("CataloguingLog");
+
return undef;
}
@@ -530,6 +549,8 @@
&_koha_delete_item( $dbh, $itemnumber );
my $newrec = &MARCdelitem( $biblionumber, $itemnumber );
&MARCaddbiblio( $newrec, $biblionumber, );
+
&logaction(C4::Context->userenv->{'number'},"CATALOGUING","DELETE",$itemnumber,"item")
+ if C4::Context->preference("CataloguingLog");
}
=head2 GetBiblioData
@@ -3646,8 +3667,18 @@
=cut
-# $Id: Biblio.pm,v 1.178.2.45 2007/01/09 10:31:09 toins Exp $
+# $Id: Biblio.pm,v 1.178.2.46 2007/01/10 16:31:15 toins Exp $
# $Log: Biblio.pm,v $
+# Revision 1.178.2.46 2007/01/10 16:31:15 toins
+# new systems preferences :
+# - CataloguingLog (log the update/creation/deletion of a notice if set to 1)
+# - BorrowersLog ( idem for borrowers )
+# - IssueLog (log all issue if set to 1)
+# - ReturnLog (log all return if set to 1)
+# - SusbcriptionLog (log all creation/deletion/update of a subcription)
+#
+# All of theses are in a new tab called 'LOGFeatures' in systempreferences.pl
+#
# Revision 1.178.2.45 2007/01/09 10:31:09 toins
# sync with dev_week. ( new function : GetMarcSeries )
#
Index: C4/Log.pm
===================================================================
RCS file: /sources/koha/koha/C4/Log.pm,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -u -b -r1.5.2.1 -r1.5.2.2
--- C4/Log.pm 5 Dec 2006 11:35:30 -0000 1.5.2.1
+++ C4/Log.pm 10 Jan 2007 16:31:15 -0000 1.5.2.2
@@ -29,7 +29,7 @@
use vars qw($VERSION @ISA @EXPORT);
# set the version for version checking
-$VERSION = 0.01;
+$VERSION = do { my @v = '$Revision: 1.5.2.2 $' =~ /\d+/g; shift(@v) . "." .
join( "_", map { sprintf "%03d", $_ } @v ); };
=head1 NAME
@@ -59,8 +59,9 @@
Adds a record into action_logs table to report the different changes upon the
database
=cut
+
#'
-sub logaction{
+sub logaction {
my ($usernumber,$modulename, $actionname, $objectnumber,
$infos)address@hidden;
$usernumber='' unless $usernumber;
my $dbh = C4::Context->dbh;
@@ -75,7 +76,9 @@
returns True If Activate_Log variable is equal to On
Activate_Log is a system preference Variable
+
=cut
+
#'
sub logstatus{
return C4::Context->preference("Activate_Log");
@@ -92,6 +95,7 @@
returns a table of hash containing who did what on which object at what time
=cut
+
#'
sub displaylog{
my ($modulename, @filters)address@hidden;
Index: C4/Members.pm
===================================================================
RCS file: /sources/koha/koha/C4/Members.pm,v
retrieving revision 1.32.2.26
retrieving revision 1.32.2.27
diff -u -b -r1.32.2.26 -r1.32.2.27
--- C4/Members.pm 6 Dec 2006 14:05:34 -0000 1.32.2.26
+++ C4/Members.pm 10 Jan 2007 16:31:15 -0000 1.32.2.27
@@ -17,7 +17,7 @@
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
-# $Id: Members.pm,v 1.32.2.26 2006/12/06 14:05:34 btoumi Exp $
+# $Id: Members.pm,v 1.32.2.27 2007/01/10 16:31:15 toins Exp $
use strict;
require Exporter;
@@ -26,10 +26,11 @@
use C4::Date;
use Digest::MD5 qw(md5_base64);
use Date::Calc qw/Today/;
+use C4::Log; # logaction
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
-$VERSION = do { my @v = '$Revision: 1.32.2.26 $' =~ /\d+/g; shift(@v) . "." .
join( "_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = do { my @v = '$Revision: 1.32.2.27 $' =~ /\d+/g; shift(@v) . "." .
join( "_", map { sprintf "%03d", $_ } @v ); };
=head1 NAME
@@ -62,7 +63,7 @@
&getboracctrecord
&GetborCatFromCatType &getborrowercategory
&fixEthnicity
- ðnicitycategories get_institutions add_member_orgs
+ ðnicitycategories &get_institutions add_member_orgs
&get_age &GetBorrowersFromSurname &GetBranchCodeFromBorrowers
&GetFlagsAndBranchFromBorrower
&GetCities &GetRoadTypes &GetRoadTypeDetails &GetBorNotifyAcctRecord
@@ -441,7 +442,8 @@
updateguarantees(%data);
}
-
+
&logaction(C4::Context->userenv->{'number'},"MEMBERS","MODIFY",$data{'borrowernumber'},"")
+ if C4::Context->preference("BorrowersLog");
}
sub newmember {
@@ -552,6 +554,10 @@
$sth->execute;
$sth->finish;
$data{'borrowernumber'} = $dbh->{'mysql_insertid'};
+
+
&logaction(C4::Context->userenv->{'number'},"MEMBERS","CREATE",$data{'borrowernumber'},"")
+ if C4::Context->preference("BorrowersLog");
+
return $data{'borrowernumber'};
}
@@ -577,6 +583,9 @@
$sth->execute( $uid, $digest, $member );
return 1;
}
+
+ &logaction(C4::Context->userenv->{'number'},"MEMBERS","CHANGE
PASS",$member,"")
+ if C4::Context->preference("BorrowersLog");
}
sub getmemberfromuserid {
@@ -1539,6 +1548,10 @@
$sth = $dbh->prepare($query);
$sth->execute($member);
$sth->finish;
+
+ # logging to action_log
+ &logaction(C4::Context->userenv->{'number'},"MEMBERS","DELETE",$member,"")
+ if C4::Context->preference("BorrowersLog");
}
=head2 DelBorrowerCompletly
Index: C4/Serials.pm
===================================================================
RCS file: /sources/koha/koha/C4/Serials.pm,v
retrieving revision 1.5.2.19
retrieving revision 1.5.2.20
diff -u -b -r1.5.2.19 -r1.5.2.20
--- C4/Serials.pm 22 Dec 2006 14:38:59 -0000 1.5.2.19
+++ C4/Serials.pm 10 Jan 2007 16:31:15 -0000 1.5.2.20
@@ -17,7 +17,7 @@
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
-# $Id: Serials.pm,v 1.5.2.19 2006/12/22 14:38:59 toins Exp $
+# $Id: Serials.pm,v 1.5.2.20 2007/01/10 16:31:15 toins Exp $
use strict;
use C4::Date;
@@ -33,7 +33,7 @@
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
# set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.5.2.19 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.5.2.20 $' =~ /\d+/g;
shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v );
};
@@ -1143,6 +1143,9 @@
$subscriptionid
);
$sth->finish;
+
+
&logaction(C4::Context->userenv->{'number'},"SUBSCRIPTION","MODIFY",$subscriptionid,"")
+ if C4::Context->preference("SubscriptionLog");
}
=head2 NewSubscription
@@ -1251,6 +1254,10 @@
format_date_in_iso($startdate),
format_date_in_iso($startdate)
);
+
+
&logaction(C4::Context->userenv->{'number'},"SUBSCRIPTION","ADD",$subscriptionid,"")
+ if C4::Context->preference("SubscriptionLog");
+
return $subscriptionid;
}
@@ -1299,6 +1306,9 @@
$sth = $dbh->prepare($query);
$sth->execute( format_date_in_iso($startdate),
$numberlength, $weeklength, $monthlength, $subscriptionid );
+
+
&logaction(C4::Context->userenv->{'number'},"SUBSCRIPTION","RENEW",$subscriptionid,"")
+ if C4::Context->preference("SubscriptionLog");
}
=head2 NewIssue
@@ -1657,6 +1667,9 @@
$dbh->do(
"DELETE FROM subscriptionhistory WHERE
subscriptionid=$subscriptionid");
$dbh->do("DELETE FROM serial WHERE subscriptionid=$subscriptionid");
+
+
&logaction(C4::Context->userenv->{'number'},"SUBSCRIPTION","DELETE",$subscriptionid,"")
+ if C4::Context->preference("SubscriptionLog");
}
=head2 DelIssue
Index: C4/Circulation/Circ2.pm
===================================================================
RCS file: /sources/koha/koha/C4/Circulation/Circ2.pm,v
retrieving revision 1.114.2.29
retrieving revision 1.114.2.30
diff -u -b -r1.114.2.29 -r1.114.2.30
--- C4/Circulation/Circ2.pm 8 Jan 2007 16:49:04 -0000 1.114.2.29
+++ C4/Circulation/Circ2.pm 10 Jan 2007 16:31:15 -0000 1.114.2.30
@@ -17,7 +17,7 @@
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
-# $Id: Circ2.pm,v 1.114.2.29 2007/01/08 16:49:04 alaurin Exp $
+# $Id: Circ2.pm,v 1.114.2.30 2007/01/10 16:31:15 toins Exp $
use strict;
require Exporter;
@@ -40,7 +40,7 @@
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
# set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.114.2.29 $' =~ /\d+/g;
shift(@v).".".join( "_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = do { my @v = '$Revision: 1.114.2.30 $' =~ /\d+/g;
shift(@v).".".join( "_", map { sprintf "%03d", $_ } @v ); };
=head1 NAME
@@ -1374,6 +1374,10 @@
$iteminformation->{'itemtype'}, $borrower->{'borrowernumber'}
);
}
+
+
&logaction(C4::Context->userenv->{'number'},"CIRCULATION","ISSUE","barcode=".$barcode,"borrower=".$borrower)
+ if C4::Context->preference("IssueLog");
+
}
=head2 getLoanLength
@@ -1646,6 +1650,10 @@
$iteminformation->{'itemtype'},
$borrower->{'borrowernumber'}
);
+
+
&logaction(C4::Context->userenv->{'number'},"CIRCULATION","RETURN","barcode=".$barcode."
borrower=".$borrower,$messages)
+ if C4::Context->preference("ReturnLog");
+
return ( $doreturn, $messages, $iteminformation, $borrower );
}
Index: admin/systempreferences.pl
===================================================================
RCS file: /sources/koha/koha/admin/systempreferences.pl,v
retrieving revision 1.34.2.13
retrieving revision 1.34.2.14
diff -u -b -r1.34.2.13 -r1.34.2.14
--- admin/systempreferences.pl 10 Jan 2007 09:09:51 -0000 1.34.2.13
+++ admin/systempreferences.pl 10 Jan 2007 16:31:15 -0000 1.34.2.14
@@ -47,11 +47,10 @@
use C4::Koha;
use C4::Output;
use C4::Interface::CGI::Output;
-
use C4::Context;
-# Fix me, shouldnt we store this stuff in the systempreferences table?
+# FIXME, shouldnt we store this stuff in the systempreferences table?
my %tabsysprefs;
# Acquisitions
@@ -142,6 +141,7 @@
$tabsysprefs{opacuserjs}="OPAC";
$tabsysprefs{SubscriptionHistory}="OPAC";
$tabsysprefs{opacheader}="OPAC";
+
# OPACFeatures
$tabsysprefs{Disable_Dictionary}="OPACFeatures";
$tabsysprefs{hidelostitems}="OPACFeatures";
@@ -160,6 +160,13 @@
$tabsysprefs{suggestion}="OPACFeatures";
$tabsysprefs{OpacTopissue}="OPACFeatures";
+# LOGFeatures
+ $tabsysprefs{CataloguingLog} = "LOGFeatures";
+ $tabsysprefs{BorrowersLog} = "LOGFeatures";
+ $tabsysprefs{SubscriptionLog} = "LOGFeatures";
+ $tabsysprefs{IssueLog} = "LOGFeatures";
+ $tabsysprefs{ReturnLog} = "LOGFeatures";
+
sub StringSearch {
my ($env,$searchstring,$type)address@hidden;
my $dbh = C4::Context->dbh;
Index: koha-tmpl/intranet-tmpl/prog/en/admin/systempreferences.tmpl
===================================================================
RCS file:
/sources/koha/koha/koha-tmpl/intranet-tmpl/prog/en/admin/systempreferences.tmpl,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -b -r1.1.2.3 -r1.1.2.4
--- koha-tmpl/intranet-tmpl/prog/en/admin/systempreferences.tmpl 22 Dec
2006 17:11:33 -0000 1.1.2.3
+++ koha-tmpl/intranet-tmpl/prog/en/admin/systempreferences.tmpl 10 Jan
2007 16:31:15 -0000 1.1.2.4
@@ -143,6 +143,7 @@
<h1>System preferences admin</h1>
<div id="action">
<a href="/cgi-bin/koha/admin/systempreferences.pl?tab=Admin">Admin</a>
+ <a href="/cgi-bin/koha/admin/systempreferences.pl?tab=LOGFeatures">Log
Features</a>
<a
href="/cgi-bin/koha/admin/systempreferences.pl?tab=Acquisitions">Acquisitions</a>
<a
href="/cgi-bin/koha/admin/systempreferences.pl?tab=Authorities">Authorities</a>
<a
href="/cgi-bin/koha/admin/systempreferences.pl?tab=Catalogue">Catalogue</a>
Index: members/memberentry.pl
===================================================================
RCS file: /sources/koha/koha/members/memberentry.pl,v
retrieving revision 1.38.2.22
retrieving revision 1.38.2.23
diff -u -b -r1.38.2.22 -r1.38.2.23
--- members/memberentry.pl 3 Jan 2007 16:18:47 -0000 1.38.2.22
+++ members/memberentry.pl 10 Jan 2007 16:31:15 -0000 1.38.2.23
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# $Id: memberentry.pl,v 1.38.2.22 2007/01/03 16:18:47 btoumi Exp $
+# $Id: memberentry.pl,v 1.38.2.23 2007/01/10 16:31:15 toins Exp $
# Copyright 2006 SAN OUEST PROVENCE et Paul POULAIN
#
@@ -197,7 +197,6 @@
# test to know if another user have the same password
and same login
if ($loginexist eq 0) {
&modmember(%data);
- logaction($loggedinuser,"MEMBERS","modify
member", $borrowernumber, "");
}
else {
push @errors, "ERROR_login_exist";
@@ -215,7 +214,6 @@
my @orgs=split(/\|/,$data{'organisations'});
add_member_orgs($borrowernumber,address@hidden);
}
- logaction($loggedinuser,"MEMBERS","add member",
$borrowernumber, "");
}
}
Index: updater/updatedatabase
===================================================================
RCS file: /sources/koha/koha/updater/updatedatabase,v
retrieving revision 1.157.2.43
retrieving revision 1.157.2.44
diff -u -b -r1.157.2.43 -r1.157.2.44
--- updater/updatedatabase 10 Jan 2007 14:13:17 -0000 1.157.2.43
+++ updater/updatedatabase 10 Jan 2007 16:31:15 -0000 1.157.2.44
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Id: updatedatabase,v 1.157.2.43 2007/01/10 14:13:17 toins Exp $
+# $Id: updatedatabase,v 1.157.2.44 2007/01/10 16:31:15 toins Exp $
# Database Updater
# This script checks for required updates to the database.
@@ -447,6 +447,46 @@
explanation => 'Enable / Disable the search authority link
on OPAC',
type => 'YesNo',
},
+ {
+ uniquefieldrequired => 'variable',
+ variable => 'CataloguingLog',
+ value => '1',
+ forceupdate => {'explanation' => 1, 'type' => 1},
+ explanation => 'Active this if you want to log cataloguing
action.',
+ type => 'YesNo',
+ },
+ {
+ uniquefieldrequired => 'variable',
+ variable => 'BorrowersLog',
+ value => '1',
+ forceupdate => {'explanation' => 1, 'type' => 1},
+ explanation => 'Active this if you want to log borrowers
edition/creation/deletion...',
+ type => 'YesNo',
+ },
+ {
+ uniquefieldrequired => 'variable',
+ variable => 'SubscriptionLog',
+ value => '1',
+ forceupdate => {'explanation' => 1, 'type' => 1},
+ explanation => 'Active this if you want to log
Subscription action',
+ type => 'YesNo',
+ },
+ {
+ uniquefieldrequired => 'variable',
+ variable => 'IssueLog',
+ value => '1',
+ forceupdate => {'explanation' => 1, 'type' => 1},
+ explanation => 'Active this if you want to log issue.',
+ type => 'YesNo',
+ },
+ {
+ uniquefieldrequired => 'variable',
+ variable => 'ReturnLog',
+ value => '1',
+ forceupdate => {'explanation' => 1, 'type' => 1},
+ explanation => 'Active this if you want to log the
circulation return',
+ type => 'YesNo',
+ },
],
userflags => [
{
@@ -2093,6 +2133,16 @@
exit;
# $Log: updatedatabase,v $
+# Revision 1.157.2.44 2007/01/10 16:31:15 toins
+# new systems preferences :
+# - CataloguingLog (log the update/creation/deletion of a notice if set to 1)
+# - BorrowersLog ( idem for borrowers )
+# - IssueLog (log all issue if set to 1)
+# - ReturnLog (log all return if set to 1)
+# - SusbcriptionLog (log all creation/deletion/update of a subcription)
+#
+# All of theses are in a new tab called 'LOGFeatures' in systempreferences.pl
+#
# Revision 1.157.2.43 2007/01/10 14:13:17 toins
# opac_news.displayed is replaced by opac_news.number.
# This field say how are ordered the news on the template.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] koha C4/Biblio.pm C4/Log.pm C4/Members.pm C4/Se... [rel_3_0],
Antoine Farnault <=