koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] CVS: koha/admin itemtypes.pl,1.4,1.4.2.1


From: Andrew Arensburger
Subject: [Koha-cvs] CVS: koha/admin itemtypes.pl,1.4,1.4.2.1
Date: Thu, 03 Oct 2002 19:34:49 -0700

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

Modified Files:
      Tag: arensb-context
        itemtypes.pl 
Log Message:
Use C4::Connect instead of C4::Database, C4::Connect->dbh instead
C4Connect.


Index: itemtypes.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/itemtypes.pl,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -C2 -r1.4 -r1.4.2.1
*** itemtypes.pl        14 Aug 2002 18:12:53 -0000      1.4
--- itemtypes.pl        4 Oct 2002 02:34:47 -0000       1.4.2.1
***************
*** 39,50 ****
  
  use strict;
- use C4::Output;
  use CGI;
  use C4::Search;
- use C4::Database;
  
  sub StringSearch  {
        my ($env,$searchstring,$type)address@hidden;
!       my $dbh = &C4Connect;
        $searchstring=~ s/\'/\\\'/g;
        my @data=split(' ',$searchstring);
--- 39,50 ----
  
  use strict;
  use CGI;
+ use C4::Context;
+ use C4::Output;
  use C4::Search;
  
  sub StringSearch  {
        my ($env,$searchstring,$type)address@hidden;
!       my $dbh = C4::Context->dbh;
        $searchstring=~ s/\'/\\\'/g;
        my @data=split(' ',$searchstring);
***************
*** 61,65 ****
        #  $sth->execute;
        $sth->finish;
-       $dbh->disconnect;
        return ($cnt,address@hidden);
  }
--- 61,64 ----
***************
*** 85,89 ****
        my $data;
        if ($itemtype) {
!               my $dbh = &C4Connect;
                my $sth=$dbh->prepare("select 
itemtype,description,loanlength,renewalsallowed,rentalcharge from itemtypes 
where itemtype='$itemtype'");
                $sth->execute;
--- 84,88 ----
        my $data;
        if ($itemtype) {
!               my $dbh = C4::Context->dbh;
                my $sth=$dbh->prepare("select 
itemtype,description,loanlength,renewalsallowed,rentalcharge from itemtypes 
where itemtype='$itemtype'");
                $sth->execute;
***************
*** 184,188 ****
  # called by add_form, used to insert/modify data in DB
  } elsif ($op eq 'add_validate') {
!       my $dbh=C4Connect;
        my $query = "replace itemtypes 
(itemtype,description,loanlength,renewalsallowed,rentalcharge) values (";
        $query.= $dbh->quote($input->param('itemtype')).",";
--- 183,187 ----
  # called by add_form, used to insert/modify data in DB
  } elsif ($op eq 'add_validate') {
!       my $dbh = C4::Context->dbh;
        my $query = "replace itemtypes 
(itemtype,description,loanlength,renewalsallowed,rentalcharge) values (";
        $query.= $dbh->quote($input->param('itemtype')).",";
***************
*** 206,210 ****
  # called by default form, used to confirm deletion of data in DB
  } elsif ($op eq 'delete_confirm') {
!       my $dbh = &C4Connect;
        my $sth=$dbh->prepare("select count(*) as total from categoryitem where 
itemtype='$itemtype'");
        $sth->execute;
--- 205,209 ----
  # called by default form, used to confirm deletion of data in DB
  } elsif ($op eq 'delete_confirm') {
!       my $dbh = C4::Context->dbh;
        my $sth=$dbh->prepare("select count(*) as total from categoryitem where 
itemtype='$itemtype'");
        $sth->execute;
***************
*** 233,237 ****
  # called by delete_confirm, used to effectively confirm deletion of data in DB
  } elsif ($op eq 'delete_confirmed') {
!       my $dbh=C4Connect;
        my $itemtype=uc($input->param('itemtype'));
        my $query = "delete from itemtypes where itemtype='$itemtype'";
--- 232,236 ----
  # called by delete_confirm, used to effectively confirm deletion of data in DB
  } elsif ($op eq 'delete_confirmed') {
!       my $dbh = C4::Context->dbh;
        my $itemtype=uc($input->param('itemtype'));
        my $query = "delete from itemtypes where itemtype='$itemtype'";




reply via email to

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