Browse Source

Working on display lists of issues

master
chris 25 years ago
parent
commit
65f34786dc
  1. 26
      C4/Circulation.pm
  2. 24
      C4/Interface.pm

26
C4/Circulation.pm

@ -146,14 +146,36 @@ sub Issue {
}
}
sub pastitems{
#Get list of all items borrower has currently on issue
my ($bornum,$dbh)=@_;
my $sth=$dbh->prepare("Select * from issues,item,biblio,biblioitems
where borrowernumber=$bornum and issues.itemnumber=item.itemnumber
and item.biblionumber=biblioitems.biblioitemnumber
and biblioitems.biblionumber=biblio.biblionumber");
$sth->execute;
my $i=0;
my @items;
while (my $data->fetchrow_hashref){
$items[$i]="$data->{'title'} $data->{'author'};
$i++;
}
return(\@items);
}
sub processitems {
#process a uses items
# clearscreen();
output(1,1,"Processing Items");
helptext("F11 Ends processing for current borrower F10 ends issues");
my ($bornum)=@_;
my ($itemnum,$reason)=&scanbook();
my $dbh=&C4Connect;
my $items=pastitems($bornum,$dbh);
issueswindow('Issues',$items,$items);
pause();
my $query="Select * from items,biblio where barcode = '$itemnum' and items.biblionumber=biblio.biblionumber";
my $sth=$dbh->prepare($query);
$sth->execute;
@ -224,8 +246,8 @@ sub checkoverdues{
#checks whether a borrower has overdue items
my ($bornum,$dbh)=@_;
my $sth=$dbh->prepare("Select * from issues,items,biblio where
borrowernumber=$bornum and issues.itemnumber=items.itemnumber and
items.biblionumber=biblio.biblionumber");
borrowernumber=$bornum and issues.itemnumber=items.itemnumber and
items.biblionumber=biblio.biblionumber");
$sth->execute;
my $row=1;
my $col=40;

24
C4/Interface.pm

@ -17,7 +17,7 @@ $VERSION = 0.01;
@ISA = qw(Exporter);
@EXPORT = qw(&dialog &startint &endint &output &clearscreen &pause &helptext
&textbox &menu);
&textbox &menu &issuewindow);
%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
# your exported package globals go here,
@ -123,6 +123,28 @@ sub list {
return($reason,$data);
}
sub issuewindow {
my ($title,$items1,$items2)=@_;
my $panel = Newt::Panel(4, 4, $title);
my $li = Newt::Listbox($numitems,NEWT_FLAG_RETURNEXIT | NEWT_FLAG_MULTIPLE);
my $li2 = Newt::Listbox($numitems,NEWT_FLAG_RETURNEXIT | NEWT_FLAG_MULTIPLE);
$li->Add($items->@);
$li2->Add($items2->@);
$panel->Add(0,0,$li,NEWT_ANCHOR_LEFT);
$panel->Add(0,1,$li2,NEWT_ANCHOR_LEFT);
$panel->AddHotKey(NEWT_KEY_F11);
my ($reason,$data)=$panel->Run();
if ($reason eq NEWT_EXIT_HOTKEY) {
if ($data eq NEWT_KEY_F11) {
$reason="Quit";
}
}
my @stuff=$li->Get();
$data=$stuff[0];
return($reason,$data);
}
sub dialog {
my ($name)=@_;
my $entry=Newt::Entry(20,NEWT_FLAG_SCROLL | NEWT_FLAG_RETURNEXIT);

Loading…
Cancel
Save