1 package C4::Interface::FlagsCDK; #asummes C4/Interface/FlagsCDK
4 # Copyright 2000-2002 Katipo Communications
6 # This file is part of Koha.
8 # Koha is free software; you can redistribute it and/or modify it under the
9 # terms of the GNU General Public License as published by the Free Software
10 # Foundation; either version 2 of the License, or (at your option) any later
13 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
14 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License along with
18 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
19 # Suite 330, Boston, MA 02111-1307 USA
27 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
29 # set the version for version checking
33 @EXPORT = qw(&trapscreen &trapsnotes &reservesdisplay);
34 %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
36 # your exported package globals go here,
37 # as well as any optionally exported functions
39 @EXPORT_OK = qw($Var1 %Hashit);
40 # non-exported package globals go here
41 use vars qw(@more $stuff);
43 # initalize package globals, first exported ones
48 # then the others (which are still accessible as $Some::Module::stuff)
52 # all file-scoped lexicals must be created before
53 # the functions below that use them.
55 # file-private lexicals go here
59 # here's a file-private function as a closure,
60 # callable as &$priv_func; it cannot be prototyped.
65 # make all your functions, whether exported or not;
70 my ($env,$bornum,$borrower,$amount,$traps_set)=@_;
71 my $titlepanel = C4::InterfaceCDK::titlepanel($env,$env->{'sysarea'},"Borrower Flags");
73 #debug_msg($env,"owwing = $amount");
74 my $borpanel = C4::InterfaceCDK::borrowerbox($env,$borrower,$amount);
76 my $hght = @$traps_set+4;
77 my $flagsset = new Cdk::Scroll ('Title'=>"Act On Flag",
78 'List'=>\@$traps_set,'Height'=>$hght,'Width'=>15,
80 my $act =$flagsset->activate();
85 $action = @$traps_set[$act];
94 my ($env,$bornum,$borrower,$amount) = @_;
95 my $titlepanel = C4::InterfaceCDK::titlepanel($env,$env->{'sysarea'},"Borrower Notes");
96 my $borpanel = C4::InterfaceCDK::borrowerbox($env,$borrower,$amount);
98 my $notesbox = new Cdk::Mentry ('Label'=>"Notes: ",
99 'Width'=>40,'Prows'=>10,'Lrows'=>30,
100 'Lpos'=>"Top",'Xpos'=>"RIGHT",'Ypos'=>10);
101 my $ln = length($borrower->{'borrowernotes'});
104 my $y = substr($borrower->{'borrowernotes'},$x,1);
105 $notesbox->inject('Input'=>$y);
108 my $notes = $notesbox->activate();
109 if (!defined $notes) {
110 $notes = $borrower->{'borrowernotes'};
112 while (substr($notes,0,1) eq " ") {
114 if (length($notes) == 1) {
117 $temp = substr($notes,1,length($notes)-1);
128 sub reservesdisplay {
129 my ($env,$borrower,$amount,$odues,$items) = @_;
130 my $titlepanel = C4::InterfaceCDK::titlepanel($env,$env->{'sysarea'},"Reserves Waiting");
131 my $borpanel = C4::InterfaceCDK::borrowerbox($env,$borrower,$amount);
135 while (@$items[$x] ne "") {
136 my $itemdata = @$items[$x];
137 my $itemrow = fmtstr($env,$itemdata->{'holdingbranch'},"L6");
138 $itemrow = $itemrow.$itemdata->{'title'}.": ".$itemdata->{'author'};
139 $itemrow = fmtstr($env,$itemrow,"L68").$itemdata->{'itemtype'};
140 @itemslist[$x] = $itemrow;
143 my $reslist = new Cdk::Scroll('Title'=>"",'List'=>\@itemslist,
144 'Height'=>10,'Width'=>76,'Xpos'=>1,'Ypos'=>10);
145 $reslist->activate();
151 END { } # module clean-up code here (global destructor)