From ffd3a011192e776642b2132a2b448c5412c7922c Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Tue, 8 Jan 2008 19:41:25 -0600 Subject: [PATCH] More replace statements, this time admin/printers.pl Bug 1546 Signed-off-by: Joshua Ferraro --- admin/printers.pl | 13 ++++++++++--- .../prog/en/modules/admin/printers.tmpl | 5 +++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/admin/printers.pl b/admin/printers.pl index 3e3071d89f..273c1eeac9 100755 --- a/admin/printers.pl +++ b/admin/printers.pl @@ -113,9 +113,16 @@ if ($op eq 'add_form') { } elsif ($op eq 'add_validate') { $template->param(add_validate => 1); my $dbh = C4::Context->dbh; - my $sth=$dbh->prepare("REPLACE printers (printername,printqueue,printtype) values (?,?,?)"); - $sth->execute($input->param('printername'),$input->param('printqueue'),$input->param('printtype')); - $sth->finish; + if ($input->param('add')){ + my $sth=$dbh->prepare("INSERT INTO printers (printername,printqueue,printtype) VALUES (?,?,?)"); + $sth->execute($input->param('printername'),$input->param('printqueue'),$input->param('printtype')); + $sth->finish; + } + else { + my $sth=$dbh->prepare("UPDATE printers SET printqueue=?,printtype=? WHERE printername=?"); + $sth->execute($input->param('printqueue'),$input->param('printtype'),$input->param('printername')); + $sth->finish; + } # END $OP eq ADD_VALIDATE ################## DELETE_CONFIRM ################################## # called by default form, used to confirm deletion of data in DB diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tmpl index e388daa3a6..b88fc99fa1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tmpl @@ -91,6 +91,11 @@
" name="Aform" method="post"> + + + + +
  1. -- 2.20.1