From: Chris Cormack Date: Wed, 9 Jan 2008 01:41:25 +0000 (-0600) Subject: More replace statements, this time admin/printers.pl X-Git-Tag: v3.00.00-beta~640 X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=ffd3a011192e776642b2132a2b448c5412c7922c;p=koha.git More replace statements, this time admin/printers.pl Bug 1546 Signed-off-by: Joshua Ferraro --- 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"> + + + + +