From 8d51042a2929accd079233f3544355a8bb876a74 Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Sun, 6 Apr 2008 22:09:24 -0500 Subject: [PATCH] Add Logging module 'SYSTEMPREFERENCE', log adds, mods & deletes. Signed-off-by: Joshua Ferraro --- admin/systempreferences.pl | 14 ++++++++++++-- .../prog/en/modules/admin/systempreferences.tmpl | 8 ++++++-- .../prog/en/modules/tools/viewlog.tmpl | 6 ++++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index 6a1ed4d781..37a30cf219 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -47,6 +47,7 @@ use C4::Context; use C4::Koha; use C4::Languages qw(getTranslatedLanguages); use C4::ClassSource; +use C4::Log; use C4::Output; use C4::Context; @@ -333,8 +334,9 @@ sub StringSearch { } my $input = new CGI; -my $searchfield=$input->param('searchfield'); -my $offset=$input->param('offset'); +my $searchfield = $input->param('searchfield'); +my $Tvalue = $input->param('Tvalue'); +my $offset = $input->param('offset'); my $script_name="/cgi-bin/koha/admin/systempreferences.pl"; my ($template, $borrowernumber, $cookie) @@ -400,12 +402,16 @@ if ($op eq 'update_and_reedit') { my $sth=$dbh->prepare("update systempreferences set value=?,explanation=?,type=?,options=? where variable=?"); $sth->execute($value, $input->param('explanation'), $input->param('variable'), $input->param('preftype'), $input->param('prefoptions')); $sth->finish; + warn "logaction !! mod "; + logaction('SYSTEMPREFERENCE','MODIFY',undef, $input->param('variable') . " | " . $value ); } } else { unless (C4::Context->config('demo') eq 1) { my $sth=$dbh->prepare("insert into systempreferences (variable,value,explanation) values (?,?,?,?,?)"); $sth->execute($input->param('variable'), $input->param('value'), $input->param('explanation'), $input->param('preftype'), $input->param('prefoptions')); $sth->finish; + warn "logaction !! add "; + logaction('SYSTEMPREFERENCE','ADD',undef, $input->param('variable') . " | " . $input->param('value') ); } } $sth->finish; @@ -538,12 +544,14 @@ if ($op eq 'add_form') { my $sth=$dbh->prepare("update systempreferences set value=?,explanation=?,type=?,options=? where variable=?"); $sth->execute($value, $input->param('explanation'), $input->param('preftype'), $input->param('prefoptions'), $input->param('variable')); $sth->finish; + logaction('SYSTEMPREFERENCE','MODIFY',undef, $input->param('variable') . " | " . $value ); } } else { unless (C4::Context->config('demo') eq 1) { my $sth=$dbh->prepare("insert into systempreferences (variable,value,explanation,type,options) values (?,?,?,?,?)"); $sth->execute($input->param('variable'), $value, $input->param('explanation'), $input->param('preftype'), $input->param('prefoptions')); $sth->finish; + logaction('SYSTEMPREFERENCE','ADD',undef, $input->param('variable') . " | " . $value ); } } $sth->finish; @@ -568,6 +576,8 @@ if ($op eq 'add_form') { my $dbh = C4::Context->dbh; my $sth=$dbh->prepare("delete from systempreferences where variable=?"); $sth->execute($searchfield); + my $logstring = $searchfield . " | " . $Tvalue ; + logaction('SYSTEMPREFERENCE','DELETE',undef,$logstring); $sth->finish; # END $OP eq DELETE_CONFIRMED diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tmpl index a2150befb6..6279c97e63 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tmpl @@ -194,8 +194,12 @@ Value: -
" method="post">" /> -
" method="post">
+
" method="post"> + + " /> + " /> +
+
" method="post">
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl index 06ac6669af..c6e23250f9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl @@ -20,10 +20,11 @@
" /> - " /> +" /> " /> " /> - " /> +--> " />
Additional parameters

@@ -121,6 +122,7 @@ + -- 2.39.2