From a5db6479fdbdfe2720879be0e500db5dc949af1a Mon Sep 17 00:00:00 2001 From: tipaul Date: Tue, 17 Jan 2006 16:36:41 +0000 Subject: [PATCH] removing unused script --- fixBranches.pl | 73 ------------------------------------------------- tidyaccounts.pl | 52 ----------------------------------- 2 files changed, 125 deletions(-) delete mode 100755 fixBranches.pl delete mode 100755 tidyaccounts.pl diff --git a/fixBranches.pl b/fixBranches.pl deleted file mode 100755 index 82b484894f..0000000000 --- a/fixBranches.pl +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/perl - -# script to fix all the branch settings in the items table of the koha database. - -use strict; -use DBI; -use C4::Context; - -# This script makes the following substitutions. -# on homebranch field: -my $home_default = 'C'; -my %home = ( 'F' => 'FP' , - 'FM' => 'FP' , - 'M' => 'C' , - 'P' => 'C' , - 'S' => 'SP' , - 'T' => 'C' , - 'TR' => 'C' , - 'I' => 'C' , - 'D' => 'C' , - 'L' => 'LP' , - 'FP' => 'FP' , - 'SP' => 'SP' , - 'LP' => 'LP' , - 'C' => 'C' ); - -# on holdingbranch field: -my $hold_default = 'L'; -my %hold = ( 'F' => 'F' , - 'FM' => 'FM' , - 'M' => 'M' , - 'P' => 'P' , - 'S' => 'S' , - 'T' => 'T' , - 'TR' => 'TR' , - 'I' => 'I' , - 'D' => 'D' , - 'L' => 'L' , - 'FP' => 'F' , - 'C' => 'L' , - 'SP' => 'S' , - 'LP' => 'L' ); - - -# do the substitutions..... -my $dbh = C4::Context->dbh; - -my $sth = $dbh->prepare("SELECT barcode, holdingbranch, homebranch FROM items"); -$sth->execute(); - -my $today = localtime(time()); -print "Output from fixBranches.pl $today \n\n"; - -while (my $item = $sth->fetchrow_hashref) { - my $oldhold = $item->{'holdingbranch'}; - my $newhold = $hold{$oldhold} ? $hold{$oldhold} : $hold_default ; - if ($oldhold ne $newhold) { - my $uth = $dbh->prepare("UPDATE items SET holdingbranch = ? WHERE barcode = ?"); - $uth->execute($newhold, $item->{'barcode'}); - print "$item->{'barcode'} : Holding branch setting changed from $oldhold -> $newhold \n"; - $uth->finish; - } - my $oldhome = $item->{'homebranch'}; - my $newhome = $home{$oldhome} ? $home{$oldhome} : $home_default ; - if ($oldhome ne $newhome) { - my $uth = $dbh->prepare("UPDATE items SET homebranch = ? WHERE barcode = ?"); - $uth->execute($newhome, $item->{'barcode'}); - print "$item->{'barcode'} : Home branch setting changed from $oldhome -> $newhome \n"; - $uth->finish; - } -} - -print "\nFinished output from fixbranches.pl\n"; diff --git a/tidyaccounts.pl b/tidyaccounts.pl deleted file mode 100755 index bebc1d05c3..0000000000 --- a/tidyaccounts.pl +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/perl - -# $Id$ - -# -# written 31/5/00 by chris@katipo.co.nz to make a way to fix account mistakes -# - - -# Copyright 2000-2002 Katipo Communications -# -# 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 CGI; -use C4::Accounts2; - -my $input=new CGI; - -#print $input->header(); -#print $input->dump; - -my $bornum=$input->param('bornum'); - -my @name=$input->param; - -foreach my $key (@name){ - if ($key ne 'bornum'){ - my $temp=$input->param($key); - -# print $temp,$key; - if ($temp ne ''){ - fixaccounts($bornum,$key,$temp); - - } - } -} - -print $input->redirect("boraccount.pl?bornum=$bornum");