1 package C4::Interface::FlagsCDK; #asummes C4/Interface/FlagsCDK
9 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
11 # set the version for version checking
15 @EXPORT = qw(&trapscreen &trapsnotes &reservesdisplay);
16 %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
18 # your exported package globals go here,
19 # as well as any optionally exported functions
21 @EXPORT_OK = qw($Var1 %Hashit);
22 # non-exported package globals go here
23 use vars qw(@more $stuff);
25 # initalize package globals, first exported ones
30 # then the others (which are still accessible as $Some::Module::stuff)
34 # all file-scoped lexicals must be created before
35 # the functions below that use them.
37 # file-private lexicals go here
41 # here's a file-private function as a closure,
42 # callable as &$priv_func; it cannot be prototyped.
47 # make all your functions, whether exported or not;
52 my ($env,$bornum,$borrower,$amount,$traps_set)=@_;
53 my $titlepanel = C4::InterfaceCDK::titlepanel($env,$env->{'sysarea'},"Borrower Flags");
55 #debug_msg($env,"owwing = $amount");
56 my $borpanel = C4::InterfaceCDK::borrowerbox($env,$borrower,$amount);
58 my $hght = @$traps_set+4;
59 my $flagsset = new Cdk::Scroll ('Title'=>"Act On Flag",
60 'List'=>\@$traps_set,'Height'=>$hght,'Width'=>15,
62 my $act =$flagsset->activate();
67 $action = @$traps_set[$act];
76 my ($env,$bornum,$borrower,$amount) = @_;
77 my $titlepanel = C4::InterfaceCDK::titlepanel($env,$env->{'sysarea'},"Borrower Notes");
78 my $borpanel = C4::InterfaceCDK::borrowerbox($env,$borrower,$amount);
80 my $notesbox = new Cdk::Mentry ('Label'=>"Notes: ",
81 'Width'=>40,'Prows'=>10,'Lrows'=>30,
82 'Lpos'=>"Top",'Xpos'=>"RIGHT",'Ypos'=>10);
83 my $ln = length($borrower->{'borrowernotes'});
86 my $y = substr($borrower->{'borrowernotes'},$x,1);
87 $notesbox->inject('Input'=>$y);
90 my $notes = $notesbox->activate();
91 if (!defined $notes) {
92 $notes = $borrower->{'borrowernotes'};
94 while (substr($notes,0,1) eq " ") {
96 if (length($notes) == 1) {
99 $temp = substr($notes,1,length($notes)-1);
110 sub reservesdisplay {
111 my ($env,$borrower,$amount,$odues,$items) = @_;
112 my $titlepanel = C4::InterfaceCDK::titlepanel($env,$env->{'sysarea'},"Reserves Waiting");
113 my $borpanel = C4::InterfaceCDK::borrowerbox($env,$borrower,$amount);
117 while (@$items[$x] ne "") {
118 my $itemdata = @$items[$x];
119 my $itemrow = fmtstr($env,$itemdata->{'holdingbranch'},"L6");
120 $itemrow = $itemrow.$itemdata->{'title'}.": ".$itemdata->{'author'};
121 $itemrow = fmtstr($env,$itemrow,"L68").$itemdata->{'itemtype'};
122 @itemslist[$x] = $itemrow;
125 my $reslist = new Cdk::Scroll('Title'=>"",'List'=>\@itemslist,
126 'Height'=>10,'Width'=>76,'Xpos'=>1,'Ypos'=>10);
127 $reslist->activate();
133 END { } # module clean-up code here (global destructor)