From dd50153f00f0ed950ca3eb412cd0a46be4d1048f Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Sun, 30 Dec 2007 11:27:55 -0500 Subject: [PATCH] moving some files and deleting cataloguing/updateitem.pl, the _real_ updateitem.pl is in catalogue/ Signed-off-by: Joshua Ferraro --- cataloguing/updateitem.pl | 91 ----------------------------- check_sysprefs.pl => misc/check_sysprefs.pl | 0 misc/{ => cronjobs}/fines-sanop.pl | 0 misc/{ => cronjobs}/fines2.pl | 0 4 files changed, 91 deletions(-) delete mode 100755 cataloguing/updateitem.pl rename check_sysprefs.pl => misc/check_sysprefs.pl (100%) rename misc/{ => cronjobs}/fines-sanop.pl (100%) rename misc/{ => cronjobs}/fines2.pl (100%) diff --git a/cataloguing/updateitem.pl b/cataloguing/updateitem.pl deleted file mode 100755 index 9ffd9c9679..0000000000 --- a/cataloguing/updateitem.pl +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/perl - -# $Id: updateitem.pl,v 1.9.2.1.2.4 2006/10/05 18:36:50 kados Exp $ -# Copyright 2006 LibLime -# -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA -use strict; use warnings; -use C4::Context; -use C4::Biblio; -use C4::Output; -use C4::Circulation; -use C4::Accounts; -use C4::Reserves; - -my $cgi= new CGI; - -my $biblionumber=$cgi->param('biblionumber'); -my $itemnumber=$cgi->param('itemnumber'); -my $biblioitemnumber=$cgi->param('biblioitemnumber'); -my $itemlost=$cgi->param('itemlost'); -my $wthdrawn=$cgi->param('wthdrawn'); -my $binding=$cgi->param('binding'); - -my $confirm=$cgi->param('confirm'); -my $dbh = C4::Context->dbh; -# get the rest of this item's information -my $item_data_sth = $dbh->prepare("SELECT * FROM items WHERE itemnumber=?"); -$item_data_sth->execute($itemnumber); -my $item_data_hashref = $item_data_sth->fetchrow_hashref(); - -# superimpose the new on the old -$item_data_hashref->{'itemlost'} = $itemlost if $itemlost; -$item_data_hashref->{'wthdrawn'} = $wthdrawn if $wthdrawn; -$item_data_hashref->{'binding'} = $binding if $binding; - -# check reservations -my ($status, $reserve) = CheckReserves($itemnumber, $item_data_hashref->{'barcode'}); -if ($reserve){ - #print $cgi->header; - warn "Reservation found on item $itemnumber"; - #exit; -} -# check issues -my $sth=$dbh->prepare("SELECT * FROM issues WHERE (itemnumber=? AND returndate IS NULL)"); -$sth->execute($itemnumber); -my $issues=$sth->fetchrow_hashref(); - -# if a borrower lost the item, add a replacement cost to the their record -if ( ($issues->{borrowernumber}) && ($itemlost==1) ){ - - # first make sure the borrower hasn't already been charged for this item - my $sth1=$dbh->prepare("SELECT * from accountlines - WHERE borrowernumber=? AND itemnumber=?"); - $sth1->execute($issues->{'borrowernumber'},$itemnumber); - my $existing_charge_hashref=$sth1->fetchrow_hashref(); - - # OK, they haven't - unless ($existing_charge_hashref) { - # This item is on issue ... add replacement cost to the borrower's record and mark it returned - my $accountno = getnextacctno('',$issues->{'borrowernumber'},$dbh); - my $sth2=$dbh->prepare("INSERT INTO accountlines - (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,itemnumber) - VALUES - (?,?,now(),?,?,'L',?,?)"); - $sth2->execute($issues->{'borrowernumber'},$accountno,$item_data_hashref->{'replacementprice'}, - "Lost Item $item_data_hashref->{'title'} $item_data_hashref->{'barcode'}", - $item_data_hashref->{'replacementprice'},$itemnumber); - $sth2->finish; - } -} -$sth->finish; - -# FIXME: eventually we'll use Biblio.pm, but it's currently too buggy -#ModItem( $dbh,'',$biblionumber,$itemnumber,'',$item_hashref ); -$sth = $dbh->prepare("UPDATE items SET wthdrawn=?,itemlost=?,binding=? WHERE itemnumber=?"); -$sth->execute($wthdrawn,$itemlost,$binding,$itemnumber); - -print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber"); diff --git a/check_sysprefs.pl b/misc/check_sysprefs.pl similarity index 100% rename from check_sysprefs.pl rename to misc/check_sysprefs.pl diff --git a/misc/fines-sanop.pl b/misc/cronjobs/fines-sanop.pl similarity index 100% rename from misc/fines-sanop.pl rename to misc/cronjobs/fines-sanop.pl diff --git a/misc/fines2.pl b/misc/cronjobs/fines2.pl similarity index 100% rename from misc/fines2.pl rename to misc/cronjobs/fines2.pl -- 2.11.0