From 40851ea4cc34c0599fb8595cd330feb66cd3d975 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Tue, 8 Jan 2008 19:01:37 -0600 Subject: [PATCH] Removing replace sql from admin/letter.pl as per bug 1546 Signed-off-by: Joshua Ferraro --- admin/letter.pl | 15 ++++++++++++--- .../prog/en/modules/tools/letter.tmpl | 5 +++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/admin/letter.pl b/admin/letter.pl index 5c44d5b725..e0deea5c74 100755 --- a/admin/letter.pl +++ b/admin/letter.pl @@ -148,9 +148,18 @@ if ($op eq 'add_form') { # called by add_form, used to insert/modify data in DB } elsif ($op eq 'add_validate') { my $dbh = C4::Context->dbh; - my $sth=$dbh->prepare("replace letter (module,code,name,title,content) values (?,?,?,?,?)"); - $sth->execute(map {$input->param('module')} qw(code name title content)); - $sth->finish; + if ($query->param('add')){ + # need to do an insert + my $sth=$dbh->prepare("INSERT INTO letter (module,code,name,title,content) VALUES (?,?,?,?,?)"); + $sth->execute(map {$input->param('module')} qw(code name title content)); + $sth->finish; + } + else { + # do an update + my $sth=$dbh->prepare("UPDATE letter SET module=?,name=?,title=?,content=? WHERE code=?"); + $sth->execute(map {$input->param('module')} qw(name title content code)); + $sth->finish; + } print $input->redirect("letter.pl"); exit; ################## DELETE_CONFIRM ################################## diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tmpl index 9ad4483fc7..88ec3698bb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tmpl @@ -159,6 +159,11 @@
+ + + + +
Modify noticeAdd notice
    -- 2.39.5