From 694ad5d6fb007bc21960c4a7fe6730fc7fe27f06 Mon Sep 17 00:00:00 2001 From: tipaul Date: Tue, 4 May 2004 16:17:19 +0000 Subject: [PATCH] removing unused subs --- C4/Interface/AccountsCDK.pm | 122 ------------------ C4/Interface/BorrowerCDK.pm | 82 ------------ C4/Interface/FlagsCDK.pm | 120 ----------------- C4/Interface/RenewalsCDK.pm | 57 --------- C4/Interface/ReserveentCDK.pm | 233 ---------------------------------- 5 files changed, 614 deletions(-) delete mode 100755 C4/Interface/AccountsCDK.pm delete mode 100755 C4/Interface/BorrowerCDK.pm delete mode 100755 C4/Interface/FlagsCDK.pm delete mode 100755 C4/Interface/RenewalsCDK.pm delete mode 100755 C4/Interface/ReserveentCDK.pm diff --git a/C4/Interface/AccountsCDK.pm b/C4/Interface/AccountsCDK.pm deleted file mode 100755 index 38d0b6afd4..0000000000 --- a/C4/Interface/AccountsCDK.pm +++ /dev/null @@ -1,122 +0,0 @@ -package C4::Interface::AccountsCDK; #asummes C4/Interface/AccountsCDK - -#uses Newt - -# 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 - -# FIXME - I'm pretty sure that this, along with the rest of the -# CDK-based stuff, is obsolete. - -use C4::InterfaceCDK; -use C4::Accounts2; -use strict; - -require Exporter; -use DBI; -use vars qw($VERSION @ISA @EXPORT); - -# set the version for version checking -$VERSION = 0.01; -@ISA = qw(Exporter); -@EXPORT = qw(&accountsdialog); - -sub accountsdialog { - my ($env,$title,$borrower,$accountlines,$amountowing)=@_; - my $titlepanel = titlepanel($env,$env->{'sysarea'},"Money Owing"); - my @borinfo; - my $reason; - #$borinfo[0] = "$borrower->{'cardnumber'}"; - #$borinfo[1] = "$borrower->{'surname'}, $borrower->{'title'} $borrower->{'firstname'} "; - #$borinfo[2] = "$borrower->{'streetaddress'}, $borrower->{'city'}"; - #$borinfo[3] = "Total Due: ".fmtdec($env,$amountowing,"52"); - #my $borpanel = - # new Cdk::Label ('Message' =>\@borinfo, 'Ypos'=>4, 'Xpos'=>"RIGHT"); - my $borpanel = borrowerbox($env,$borrower,$amountowing); - $borpanel->draw(); - my @sel = ("N ","Y "); - my $acctlist = new Cdk::Selection ('Title'=>"Outstanding Items", - 'List'=>\@$accountlines,'Choices'=>\@sel,'Height'=>12,'Width'=>80, - 'Xpos'=>1,'Ypos'=>10); - my @amounts=$acctlist->activate(); - my $accountno; - my $amount2; - my $count=@amounts; - my $amount; - my $check=0; - for (my $i=0;$i<$count;$i++){ - if ($amounts[$i] == 1){ - $check=1; - if ($accountlines->[$i]=~ /(^[0-9]+)/){ - $accountno=$1; - } - if ($accountlines->[$i]=~/([0-9]+\.[0-9]+)/){ - $amount2=$1; - } - my $borrowerno=$borrower->{'borrowernumber'}; - makepayment($borrowerno,$accountno,$amount2); - $amount+=$amount2; - } - } - my $amountentry = new Cdk::Entry('Label'=>"Amount: ", - 'Max'=>"10",'Width'=>"10", - 'Xpos'=>"1",'Ypos'=>"3", - 'Type'=>"INT"); - $amountentry->preProcess ('Function' => sub{preamt(@_,$env,$acctlist);}); - # - - if ($amount eq ''){ - $amount =$amountentry->activate(); - } else { - $amountentry->set('Value'=>$amount); - $amount=$amountentry->activate(); - } -# debug_msg($env,"accounts $amount barcode=$accountno"); - if (!defined $amount) { - #debug_msg($env,"escaped"); - #$reason="Finished user"; - } - $borpanel->erase(); - $acctlist->erase(); - $amountentry->erase(); - undef $acctlist; - undef $borpanel; - undef $borpanel; - undef $titlepanel; - if ($check == 1){ - $amount=0; - } - return($amount,$reason); -} - -sub preamt { - my ($input,$env,$acctlist)= @_; - my $key_tab = chr(9); - if ($input eq $key_tab) { - actlist ($env,$acctlist); - return 0; - } - return 1; -} - -sub actlist { - my ($env,$acctlist) = @_; - $acctlist->activate(); -} - - -END { } # module clean-up code here (global destructor) diff --git a/C4/Interface/BorrowerCDK.pm b/C4/Interface/BorrowerCDK.pm deleted file mode 100755 index ddd545e13d..0000000000 --- a/C4/Interface/BorrowerCDK.pm +++ /dev/null @@ -1,82 +0,0 @@ -package C4::Interface::BorrowerCDK; #asummes C4/Interface/BorrowerCDK - -#uses Newt - -# 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 - -# FIXME - I'm pretty sure that this, along with the rest of the -# CDK-based stuff, is obsolete. - -use C4::InterfaceCDK; -use strict; -use Cdk; - -require Exporter; -use DBI; -use vars qw($VERSION @ISA @EXPORT); -# set the version for version checking -$VERSION = 0.01; - -@ISA = qw(Exporter); -@EXPORT = qw(&BorrowerAddress); - -sub BorrowerAddress { - my ($env,$bornum,$borrower)=@_; - my $titlepanel = titlepanel($env,$env{'sysarea'},"Update Borrower"); - $titlepanel->draw(); - my BorrAdd = BorrAddpame - -sub BorrAddpanel { - my ($env,$bornum,$borrower)=@_; - my $titlepanel = titlepanel($env,$env{'sysarea'},"Update Borrower"); - my @rowtitl = ("Card Number","Surname","First Name","Other Names","Initials", - "Address","Area","Town","Telephone","Email","Fax Number","Alt Address", - "Alt Area","Alt Town","Alt Phone","Contact Name"); - my @coltitles = (""); - my @coltypes = ("UMIXED"); - my @colwidths = (40); - my $entrymatrix = new Cdk::Matrix ( - 'ColTitles'=> \@coltitles, - 'RowTitles'=> \@rowtitles, - 'ColWidths'=> \@colwidths, - 'ColTypes'=> \@coltypes, - 'Vrows'=> 16, - 'Vcols'=> 1, - 'RowSpace'=> 0); - my @data; - $data[0] = $borrower{'cardnumber'}; - $data[1] = $borrower{'surname'}; - $data[2] = $borrower{'firstname'}; - $data[3] = $borrower{' - $entrymatrix->inject('Input'=>"KEY_DOWN"); - my $reason; - my ($rows,$cols,$info) = $entrymatrix->activate(); - my @responses; - if (!defined $rows) { - $reason = "Circ"; - } else { - my $i = 0; - while ($i < $numflds) { - $responses[$i] =$info->[$i][0]; - $i++; - } - } - return($reason,@responses); -} - -END { } # module clean-up code here (global destructor) diff --git a/C4/Interface/FlagsCDK.pm b/C4/Interface/FlagsCDK.pm deleted file mode 100755 index c28bb63888..0000000000 --- a/C4/Interface/FlagsCDK.pm +++ /dev/null @@ -1,120 +0,0 @@ -package C4::Interface::FlagsCDK; #asummes C4/Interface/FlagsCDK - - -# 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 - -# FIXME - I'm pretty sure that this, along with the rest of the -# CDK-based stuff, is obsolete. - -use C4::Format; -use C4::InterfaceCDK; -use strict; - -require Exporter; -use DBI; -use vars qw($VERSION @ISA @EXPORT); - -# set the version for version checking -$VERSION = 0.01; - -@ISA = qw(Exporter); -@EXPORT = qw(&trapscreen &trapsnotes &reservesdisplay); - -sub trapscreen { - my ($env,$bornum,$borrower,$amount,$traps_set)=@_; - my $titlepanel = C4::InterfaceCDK::titlepanel($env,$env->{'sysarea'},"Borrower Flags"); - my @borinfo; - #debug_msg($env,"owwing = $amount"); - my $borpanel = C4::InterfaceCDK::borrowerbox($env,$borrower,$amount); - $borpanel->draw(); - my $hght = @$traps_set+4; - my $flagsset = new Cdk::Scroll ('Title'=>"Act On Flag", - 'List'=>\@$traps_set,'Height'=>$hght,'Width'=>15, - 'Xpos'=>4,'Ypos'=>3); - my $act =$flagsset->activate(); - my $action; - if (!defined $act) { - $action = "NONE"; - } else { - $action = @$traps_set[$act]; - } - undef $titlepanel; - undef $flagsset; - undef $borpanel; - return($action); -} - -sub trapsnotes { - my ($env,$bornum,$borrower,$amount) = @_; - my $titlepanel = C4::InterfaceCDK::titlepanel($env,$env->{'sysarea'},"Borrower Notes"); - my $borpanel = C4::InterfaceCDK::borrowerbox($env,$borrower,$amount); - $borpanel->draw(); - my $notesbox = new Cdk::Mentry ('Label'=>"Notes: ", - 'Width'=>40,'Prows'=>10,'Lrows'=>30, - 'Lpos'=>"Top",'Xpos'=>"RIGHT",'Ypos'=>10); - my $ln = length($borrower->{'borrowernotes'}); - my $x = 0; - while ($x < $ln) { - my $y = substr($borrower->{'borrowernotes'},$x,1); - $notesbox->inject('Input'=>$y); - $x++; - } - my $notes = $notesbox->activate(); - if (!defined $notes) { - $notes = $borrower->{'borrowernotes'}; - } else { - while (substr($notes,0,1) eq " ") { - my $temp; - if (length($notes) == 1) { - $temp = ""; - } else { - $temp = substr($notes,1,length($notes)-1); - } - $notes = $temp; - } - } - undef $notesbox; - undef $borpanel; - undef $titlepanel; - return $notes; -} - -sub reservesdisplay { - my ($env,$borrower,$amount,$odues,$items) = @_; - my $titlepanel = C4::InterfaceCDK::titlepanel($env,$env->{'sysarea'},"Reserves Waiting"); - my $borpanel = C4::InterfaceCDK::borrowerbox($env,$borrower,$amount); - $borpanel->draw(); - my $x = 0; - my @itemslist; - while (@$items[$x] ne "") { - my $itemdata = @$items[$x]; - my $itemrow = fmtstr($env,$itemdata->{'holdingbranch'},"L6"); - $itemrow = $itemrow.$itemdata->{'title'}.": ".$itemdata->{'author'}; - $itemrow = fmtstr($env,$itemrow,"L68").$itemdata->{'itemtype'}; - @itemslist[$x] = $itemrow; - $x++; - } - my $reslist = new Cdk::Scroll('Title'=>"",'List'=>\@itemslist, - 'Height'=>10,'Width'=>76,'Xpos'=>1,'Ypos'=>10); - $reslist->activate(); - undef $reslist; - undef $borpanel; - undef $titlepanel; -} - -END { } # module clean-up code here (global destructor) diff --git a/C4/Interface/RenewalsCDK.pm b/C4/Interface/RenewalsCDK.pm deleted file mode 100755 index c4c31e3850..0000000000 --- a/C4/Interface/RenewalsCDK.pm +++ /dev/null @@ -1,57 +0,0 @@ -package C4::Interface::RenewalsCDK; #assumes C4/Interface/RenewalsCDK - -#uses Newt - -# 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 - -# FIXME - I'm pretty sure that this, along with the rest of the -# CDK-based stuff, is obsolete. - -use strict; -use Cdk; -use C4::InterfaceCDK; -use Date::Manip; -#use C4::Circulation; - -require Exporter; -use DBI; -use vars qw($VERSION @ISA @EXPORT); - -# set the version for version checking -$VERSION = 0.01; - -@ISA = qw(Exporter); -@EXPORT = qw(renew_window); - -sub renew_window { - my ($env,$issueditems,$borrower,$amountowing,$odues)=@_; - my $titlepanel = C4::InterfaceCDK::titlepanel($env,$env->{'sysarea'},"Renewals"); - my @sel = ("N ","Y "); - my $issuelist = new Cdk::Selection ('Title'=>"Renew items", - 'List'=>\@$issueditems,'Choices'=>\@sel, - 'Height'=> 14,'Width'=>78,'Ypos'=>8); - my $x = 0; - my $borrbox = C4::InterfaceCDK::borrowerbox($env,$borrower,$amountowing); - $borrbox->draw(); - my @renews = $issuelist->activate(); - $issuelist->erase(); - undef $titlepanel; - undef $issuelist; - undef $borrbox; - return \@renews; -} diff --git a/C4/Interface/ReserveentCDK.pm b/C4/Interface/ReserveentCDK.pm deleted file mode 100755 index 4ee416abce..0000000000 --- a/C4/Interface/ReserveentCDK.pm +++ /dev/null @@ -1,233 +0,0 @@ -package C4::Interface::ReserveentCDK; #asummes C4/Interface/ReserveCDK - -#uses Newt - -# 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 - -# FIXME - I'm pretty sure that this, along with the rest of the -# CDK-based stuff, is obsolete. - -use C4::Format; -use C4::InterfaceCDK; -use strict; -use Cdk; - -require Exporter; -use DBI; -use vars qw($VERSION @ISA @EXPORT); - -# set the version for version checking -$VERSION = 0.01; - -@ISA = qw(Exporter); -@EXPORT = qw(&FindBiblioScreen &SelectBiblio &MakeReserveScreen); - -sub FindBiblioScreen { - my ($env,$title,$numflds,$flds,$fldlns)=@_; - my $titlepanel = titlepanel($env,"Reserves","Find a title"); - #my @coltitles=("a","b"); - my @rowtitles; - my $nflds =@$flds; - my $ow = 0; - while ($ow < $nflds) { - @rowtitles[$ow]=@$flds[$ow]; - $ow++; - } - my @coltitles = (""); - my @coltypes = ("UMIXED"); - my @colwidths = (40); - my $entrymatrix = new Cdk::Matrix ( - 'ColTitles'=> \@coltitles, - 'RowTitles'=> \@rowtitles, - 'ColWidths'=> \@colwidths, - 'ColTypes'=> \@coltypes, - 'Vrows'=> 7, - 'Vcols'=> 1, - 'RowSpace'=> 0); - #$entrymatrix->set('BoxCell'=>"FALSE"); - #$entrymatrix->draw(); - $entrymatrix->inject('Input'=>"KEY_DOWN"); - my $reason; - my ($rows,$cols,$info) = $entrymatrix->activate(); - my @responses; - if (!defined $rows) { - $reason = "Circ"; - } else { - my $i = 0; - while ($i < $numflds) { - $responses[$i] =$info->[$i][0]; - $i++; - } - } - return($reason,@responses); -} - -sub SelectBiblio { - my ($env,$count,$entries) = @_; - my $titlepanel = titlepanel($env,"Reserves","Select title"); - my $biblist = new Cdk::Alphalist('Title'=>"Select a Title", - 'List'=>\@$entries,'Height' => 22,'Width' => 76, - 'Ypos'=>1); - my $selection = $biblist->activate(); - my $reason; - my $result; - if (!defined $selection) { - $reason="Circ"; - } else { - $result=$selection; - } - return($reason,$result); -} - -sub MakeReserveScreen { - my ($env,$bibliorec,$bitems,$branches) = @_; - my $titlepanel = titlepanel($env,"Reserves","Create Reservation"); - my $line = fmtstr($env,$bibliorec->{'title'},"L72"); - my $authlen = length($bibliorec->{'author'}); - my $testlen = length($bibliorec->{'title'}) + $authlen; - if ($testlen < 72) { - $line = substr($line,0,71-$authlen)." ".$bibliorec->{'author'}; - $line = fmtstr($env,$line,"L72"); - } else { - my $split = int(($testlen-72)*0.7); - $line = substr($line,0,72+$split-$authlen)." ".$bibliorec->{'author'}; - $line = fmtstr($env,$line,"L72"); - } - my @book = ($line); - my $bookpanel = new Cdk::Label ('Message' =>\@book, - 'Ypos'=>"2"); - $bookpanel->draw(); - my $branchlist = new Cdk::Radio('Title'=>"Collection Branch", - 'List'=>\@$branches, - 'Xpos'=>"20",'Ypos'=>"5",'Width'=>"18",'Height'=>"6"); - $branchlist->draw(); - my $i = 0; - my $brcnt = @$branches; - my $brdef = 0; - while (($brdef == 0) && ($i < $brcnt)) { - my $brcode = substr(@$branches[$i],0,2); - my $brtest = fmtstr($env,$env->{'branchcode'},"L2"); - if ($brcode eq $brtest) { - $brdef = 1 - } else { - $branchlist->inject('Input'=>"KEY_DOWN"); - $i++; - } - } - $branchlist->inject('Input'=>" "); - my @constraintlist = ("Any item","Only Selected","Except Selected"); - my $constrainttype = new Cdk::Radio('Title'=>"Reserve Constraints", - 'List'=>\@constraintlist, - 'Xpos'=>"54",'Ypos'=>"5",'Width'=>"17",'Height'=>"6"); - $constrainttype->draw(); - my $numbit = @$bitems; - my @itemarr; - my $i; - while ($i < $numbit) { - my $bitline = @$bitems[$i]; - my @blarr = split("\t",$bitline); - my $line = @blarr[1]." ".@blarr[2]; - if (@blarr[3] > 0) { - my $line = $line.@blarr[3]; - } - my $line = $line.@blarr[4]." ".@blarr[5]; - $line = fmtstr($env,$line,"L40"); - #$bitx{$line} = @blarr[0]; - $itemarr[$i]=$line; - $i++; - } - my @sel = ("Y ","N "); - my $itemlist = new Cdk::Selection('Title'=>"Items Held", - 'List'=>\@itemarr,'Choices'=>\@sel, - 'Xpos'=>"1",'Ypos'=>"12",'Width'=>"70",'Height'=>"8"); - $itemlist->draw(); - my $borrowerentry = new Cdk::Entry('Label'=>"",'Title'=>"Borrower", - 'Max'=>"11",'Width'=>"11", - 'Xpos'=>"2",'Ypos'=>"5", - 'Type'=>"UMIXED"); - borrbind($env,$borrowerentry); - # $borrowentry->bind('Key'=>"KEY_TAB",'Function'=>sub {$x = act($scroll1);}); - my $complete = 0; - my $reason = ""; - my @answers; - while ($complete == 0) { - my $borrowercode = $borrowerentry->activate(); - if (!defined $borrowercode) { - $reason="Circ"; - $complete = 1; - @answers[0] = "" - } else { - @answers[0] = $borrowercode; - if ($borrowercode ne "") { $complete = 1; }; - while ($complete == 1) { - my $x = $branchlist->activate(); - if (!defined $x) { - $complete = 0; - @answers[1] = ""; - } else { - my @brline = split(" ",@$branches[$x]); - @answers[1] = @brline[0]; - $complete = 2; - $answers[2] = "a"; - $answers[3] = ""; - while ($complete == 2) { - if ($numbit > 1) { - my @constarr = ("a", "o", "e"); - my $constans = $constrainttype->activate(); - if (!defined $constans) { - $complete = 1; # go back a step - } else { - @answers[2] = $constarr[$constans]; - $complete = 3; - if ($answers[2] ne "a") { - while ($complete == 3) { - my @itemans = $itemlist->activate(); - if (!defined @itemans) { - $complete = 2; # go back a step - } else { - $complete = 4; - my $no_ans = @itemans; - my @items; - my $cnt = @itemans; - my $i = 0; - my $j = 0; - while ($i < $cnt) { - if ($itemans[$i] == 0) { - my $bitline = @$bitems[$i]; - my @blarr = split("\t",$bitline); - @items[$j] = @blarr[0]; - $j++; - } - $i++; - } - @answers[3] = \@items; - } - } - } - } - } else { - $complete = 3; - } - } - } - } - } - } - return ($reason,@answers); -} -END { } # module clean-up code here (global destructor) -- 2.39.5