X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=circ%2Fbranchoverdues.pl;h=c81547ed4328c588055394ebedfe60b01017ff7e;hb=9c5e40e4923179bf0b2b630d3e09797dc4c1fdb0;hp=905af943968cc91d89e084d2f14f7b843a2d5199;hpb=1e2faa91192302bde210e149963b42e8cfa8f97b;p=koha.git diff --git a/circ/branchoverdues.pl b/circ/branchoverdues.pl index 905af94396..c81547ed43 100755 --- a/circ/branchoverdues.pl +++ b/circ/branchoverdues.pl @@ -22,11 +22,13 @@ use C4::Context; use CGI; use C4::Output; use C4::Auth; -use C4::Dates qw/format_date/; use C4::Overdues; # AddNotifyLine use C4::Biblio; use C4::Koha; use C4::Debug; +use C4::Branch; +use Koha::DateUtils; +use Data::Dumper; =head1 branchoverdues.pl @@ -96,28 +98,34 @@ elsif ( $input->param('action') eq 'remove' ) { my @overduesloop; my @getoverdues = GetOverduesForBranch( $default, $location ); -use Data::Dumper; $debug and warn "HERE : $default / $location" . Dumper(@getoverdues); # search for location authorised value my ($tag,$subfield) = GetMarcFromKohaField('items.location',''); my $tagslib = &GetMarcStructure(1,''); if ($tagslib->{$tag}->{$subfield}->{authorised_value}) { my $values= GetAuthorisedValues($tagslib->{$tag}->{$subfield}->{authorised_value}); + for (@$values) { $_->{selected} = 1 if $location eq $_->{authorised_value} } $template->param(locationsloop => $values); } # now display infos foreach my $num (@getoverdues) { - my %overdueforbranch; - $overdueforbranch{'date_due'} = format_date( $num->{'date_due'} ); + my $record = GetMarcBiblio($num->{biblionumber}); + if ($record){ + $overdueforbranch{'subtitle'} = GetRecordValue('subtitle',$record,'')->[0]->{subfield}; + } + my $dt = dt_from_string($num->{date_due}, 'sql'); + $overdueforbranch{'date_due'} = output_pref($dt); $overdueforbranch{'title'} = $num->{'title'}; $overdueforbranch{'description'} = $num->{'description'}; $overdueforbranch{'barcode'} = $num->{'barcode'}; $overdueforbranch{'biblionumber'} = $num->{'biblionumber'}; + $overdueforbranch{'author'} = $num->{'author'}; $overdueforbranch{'borrowersurname'} = $num->{'surname'}; $overdueforbranch{'borrowerfirstname'} = $num->{'firstname'}; $overdueforbranch{'borrowerphone'} = $num->{'phone'}; $overdueforbranch{'borroweremail'} = $num->{'email'}; + $overdueforbranch{'homebranch'} = GetBranchName($num->{'homebranch'}); $overdueforbranch{'itemcallnumber'} = $num->{'itemcallnumber'}; $overdueforbranch{'borrowernumber'} = $num->{'borrowernumber'}; $overdueforbranch{'itemnumber'} = $num->{'itemnumber'}; @@ -144,7 +152,6 @@ foreach my $num (@getoverdues) { # initiate the templates for the overdueloop $template->param( overduesloop => \@overduesloop, - show_date => format_date(C4::Dates->today('iso')), location => $location, );