From ffc12916c035d63e87b1fc0a06449a2d33dc5a4f Mon Sep 17 00:00:00 2001 From: chris Date: Sun, 14 Nov 1999 03:59:19 +0000 Subject: [PATCH] getting borrower enquiries working --- C4/Circulation.pm | 11 +++++++---- C4/Circulation/Borrower.pm | 12 ++++++++++-- C4/Interface.pm | 23 ++++++++++++++++++++++- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 3bad774..2cfeb3c 100755 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -9,6 +9,7 @@ use C4::Database; use C4::Circulation::Issues; use C4::Circulation::Returns; use C4::Circulation::Renewals; +use C4::Circulation::Borrower; use C4::Interface; use C4::Security; @@ -65,17 +66,19 @@ sub Start_circ{ ('Issues','Returns','Borrower Enquiries','Log In')); if ($data eq 'Issues') { - $donext=Issue($env); + $donext=Issue($env); #C4::Circulation::Issues } elsif ($data eq 'Returns') { - $donext=Returns($env); + $donext=Returns($env); #C4::Circulation::Returns } elsif ($data eq 'Log In') { - debug_msg("","New user"); + debug_msg("","New user"); #C4::Security &endint($env); &Login($env); &startint($env,'Circulation'); } elsif ($data eq 'Quit') { $donext = $data; - } + } elsif ($data eq 'Borrower Enquiries'){ + $donext=Borenq($env); #C4::Circulation::Borrower + } debug_msg($env,"donext - $donext"); } &endint($env) diff --git a/C4/Circulation/Borrower.pm b/C4/Circulation/Borrower.pm index 1f97bb2..7a74dea 100755 --- a/C4/Circulation/Borrower.pm +++ b/C4/Circulation/Borrower.pm @@ -19,7 +19,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = 0.01; @ISA = qw(Exporter); -@EXPORT = qw(&findborrower); +@EXPORT = qw(&findborrower &Borenq); %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ], # your exported package globals go here, @@ -164,6 +164,14 @@ sub checktraps { } return ($issuesallowed); } - + +sub Borenq { + my ($env)=@_; + my $dbh=C4Connect; + #get borrower guff + my ($bornum,$issuesallowed,$borrower,$reason) = &findborrower($env,$dbh); + my ($data,$reason)=&borrowerwindow($env,$borrower); +# debug_msg("",$borrower->{'surname'}); +} END { } # module clean-up code here (global destructor) diff --git a/C4/Interface.pm b/C4/Interface.pm index 79df2aa..ac66aa7 100755 --- a/C4/Interface.pm +++ b/C4/Interface.pm @@ -22,7 +22,7 @@ $VERSION = 0.01; @ISA = qw(Exporter); @EXPORT = qw(&dialog &startint &endint &output &clearscreen &pause &helptext &textbox &menu &issuewindow &msg_yn &borrower_dialog &debug_msg &error_msg -&selborrower &fmtstr &fmtdec &returnwindow &logondialog); +&selborrower &fmtstr &fmtdec &returnwindow &logondialog &borrowerwindow); %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ], # your exported package globals go here, @@ -232,7 +232,26 @@ sub returnwindow { my $stuff=$entry->Get(); return($reason,$stuff); } +sub borrowerwindow { + my ($env,$borrower)=@_; + my $entry=Newt::Entry(10,NEWT_FLAG_SCROLL | NEWT_FLAG_RETURNEXIT); + my $label=Newt::Label("Borrower"); + my $l1=Newt::Label("$borrower->{'firstname'} $borrower->{'surname'}"); + my $l2=Newt::Label("Street Address: $borrower->{'streetaddress'}"); + my $l3=Newt::Label("Suburb: $borrower->{'suburb'}"); + my $l4=Newt::Label("City: $borrower->{'city'}"); + my $l5=Newt::Label("Email: $borrower->{'email'}"); + my $panel=Newt::Panel(10,10,'Borrower'); + $panel->Add(0,0,$label); + $panel->Add(0,1,$l1); + $panel->Add(0,2,$l2); + $panel->Add(0,3,$l3); + $panel->Add(0,4,$l4); + $panel->Add(0,5,$l5); + $panel->Add(0,6,$entry); + my ($reason,$data)=$panel->Run(); +} sub issuewindow { my ($env,$title,$items1,$items2,$borrower,$amountowing)=@_; @@ -295,6 +314,8 @@ sub issuewindow { } + + sub dialog { my ($name)=@_; my $entry=Newt::Entry(20,NEWT_FLAG_SCROLL | NEWT_FLAG_RETURNEXIT);