X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=circ%2Foverdue.pl;h=4343592e5af8c600ceca43c59d701dd36849b863;hb=08382876306cfda839637c5f72a107b304458a8e;hp=56e0941081af3be160549fc0356d6283783a0502;hpb=068e5be6395088793aeab66d67c36c2b9da2c5d9;p=koha.git diff --git a/circ/overdue.pl b/circ/overdue.pl index 56e0941081..4343592e5a 100755 --- a/circ/overdue.pl +++ b/circ/overdue.pl @@ -40,6 +40,8 @@ my $borcatfilter = $input->param('borcat') || ''; my $itemtypefilter = $input->param('itemtype') || ''; my $borflagsfilter = $input->param('borflag') || ''; my $branchfilter = $input->param('branch') || ''; +my $homebranchfilter = $input->param('homebranch') || ''; +my $holdingbranchfilter = $input->param('holdingbranch') || ''; my $op = $input->param('op') || ''; my $dateduefrom = format_date_in_iso($input->param( 'dateduefrom' )) || ''; my $datedueto = format_date_in_iso($input->param( 'datedueto' )) || ''; @@ -60,7 +62,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => { reports => 1, circulate => "circulate_remaining_permissions" }, + flagsrequired => { circulate => "overdues_report" }, debug => 1, } ); @@ -89,7 +91,7 @@ while (my ($itemtype, $description) =$req->fetchrow) { itemtypename => $description, }; } -my $onlymine=C4::Context->preference('IndependantBranches') && +my $onlymine=C4::Context->preference('IndependentBranches') && C4::Context->userenv && C4::Context->userenv->{flags} % 2 !=1 && C4::Context->userenv->{branch}; @@ -214,14 +216,17 @@ if (@patron_attr_filter_loop) { $template->param( patron_attr_header_loop => [ map { { header => $_->{description} } } grep { ! $_->{isclone} } @patron_attr_filter_loop ], branchloop => GetBranchesLoop($branchfilter, $onlymine), + homebranchloop => GetBranchesLoop( $homebranchfilter, $onlymine ), + holdingbranchloop => GetBranchesLoop( $holdingbranchfilter, $onlymine ), branchfilter => $branchfilter, + homebranchfilter => $homebranchfilter, + holdingbranchfilter => $homebranchfilter, borcatloop=> \@borcatloop, itemtypeloop => \@itemtypeloop, patron_attr_filter_loop => \@patron_attr_filter_loop, borname => $bornamefilter, order => $order, showall => $showall, - DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), dateduefrom => $input->param( 'dateduefrom' ) || '', datedueto => $input->param( 'datedueto' ) || '', ); @@ -239,7 +244,7 @@ if ($noreport) { my $today_dt = DateTime->now(time_zone => C4::Context->tz); - $today_dt->truncate(to => 'minutes'); + $today_dt->truncate(to => 'minute'); my $todaysdate = $today_dt->strftime('%Y-%m-%d %H:%M'); $bornamefilter =~s/\*/\%/g; @@ -261,6 +266,8 @@ if ($noreport) { issues.itemnumber, issues.issuedate, items.barcode, + items.homebranch, + items.holdingbranch, biblio.title, biblio.author, borrowers.borrowernumber, @@ -296,6 +303,8 @@ if ($noreport) { $strsth .= " AND borrowers.lost <> 0"; } $strsth.=" AND borrowers.branchcode = '" . $branchfilter . "' " if $branchfilter; + $strsth.=" AND items.homebranch = '" . $homebranchfilter . "' " if $homebranchfilter; + $strsth.=" AND items.holdingbranch = '" . $holdingbranchfilter . "' " if $holdingbranchfilter; $strsth.=" AND date_due < '" . $datedueto . "' " if $datedueto; $strsth.=" AND date_due > '" . $dateduefrom . "' " if $dateduefrom; # restrict patrons (borrowers) to those matching the patron attribute filter(s), if any @@ -353,6 +362,8 @@ if ($noreport) { title => $data->{title}, author => $data->{author}, branchcode => $data->{branchcode}, + homebranchcode => $data->{homebranchcode}, + holdingbranchcode => $data->{holdingbranchcode}, itemcallnumber => $data->{itemcallnumber}, replacementprice => $data->{replacementprice}, enumchron => $data->{enumchron},