koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha/admin printers.pl,1.1.2.4,1.1.2.5


From: Steve Tonnesen
Subject: [Koha-cvs] CVS: koha/admin printers.pl,1.1.2.4,1.1.2.5
Date: Tue, 17 Sep 2002 13:23:29 -0700

Update of /cvsroot/koha/koha/admin
In directory usw-pr-cvs1:/tmp/cvs-serv17088

Modified Files:
      Tag: rel-1-2
        printers.pl 
Log Message:
Fixed printers.pl so that printers can be edited (would previously just add a
new printer instead of editing an existing one).


Index: printers.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/printers.pl,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -r1.1.2.4 -r1.1.2.5
*** printers.pl 20 Aug 2002 09:28:26 -0000      1.1.2.4
--- printers.pl 17 Sep 2002 20:23:27 -0000      1.1.2.5
***************
*** 157,167 ****
  } elsif ($op eq 'add_validate') {
        my $dbh=C4Connect;
!       my $query = "replace printers (printername,printqueue,printtype) values 
(";
!       $query.= $dbh->quote($input->param('printername')).",";
!       $query.= $dbh->quote($input->param('printqueue')).",";
!       $query.= $dbh->quote($input->param('printtype')).")";
!       my $sth=$dbh->prepare($query);
!       $sth->execute;
!       $sth->finish;
        print "data recorded";
        print "<form action='$script_name' method=post>";
--- 157,171 ----
  } elsif ($op eq 'add_validate') {
        my $dbh=C4Connect;
!       my $sth=$dbh->prepare("select * from printers where printername=?");
!       $sth->execute($input->param('printername'));
!       if ($sth->rows) {
!           my $sti=$dbh->prepare("update printers set printqueue=?,printtype=? 
where printername=?");
!           $sti->execute($input->param('printqueue'), 
$input->param('printtype'), $input->param('printername'));
!           $sti->finish;
!       } else {
!           my $sti=$dbh->prepare("insert into printers 
(printqueue,printtype,printername) values (?,?,?)");
!           $sti->execute($input->param('printqueue'), 
$input->param('printtype'), $input->param('printername'));
!           $sti->finish;
!       }
        print "data recorded";
        print "<form action='$script_name' method=post>";




reply via email to

[Prev in Thread] Current Thread [Next in Thread]