Bugzilla – Attachment 3312 Details for
Bug 5874
Overdue report : Limit by date & add a new permission to restrict who can run the report
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed Patch
0001-Bug-5874-circ-overdue.pl-modified-permission-limit-o.patch (text/plain), 5.93 KB, created by
Chris Cormack
on 2011-03-16 01:16:04 UTC
(
hide
)
Description:
Proposed Patch
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2011-03-16 01:16:04 UTC
Size:
5.93 KB
patch
obsolete
>From a6f0521724f70cdef2e8a68837de7057d8f065c5 Mon Sep 17 00:00:00 2001 >From: Paul Poulain <paul.poulain@biblibre.com> >Date: Wed, 15 Dec 2010 13:31:44 +0100 >Subject: [PATCH] Bug 5874 : circ/overdue.pl modified : permission & limit on date > >- the Overdues.pl now is now available to ppl with reports->execute_reports permission >- there is a filter on date (to display only "old" or "new" overdues, for example) > >(the permission is created in another patch) >--- > circ/overdue.pl | 12 ++++++- > .../prog/en/modules/circ/overdue.tmpl | 33 +++++++++++++++++++- > 2 files changed, 42 insertions(+), 3 deletions(-) > >diff --git a/circ/overdue.pl b/circ/overdue.pl >index cad8e6d..21a5254 100755 >--- a/circ/overdue.pl >+++ b/circ/overdue.pl >@@ -26,7 +26,7 @@ use CGI qw(-oldstyle_urls); > use C4::Auth; > use C4::Branch; > use C4::Debug; >-use C4::Dates qw/format_date/; >+use C4::Dates qw/format_date format_date_in_iso/; > use Date::Calc qw/Today/; > use Text::CSV_XS; > >@@ -39,6 +39,8 @@ my $itemtypefilter = $input->param('itemtype') || ''; > my $borflagsfilter = $input->param('borflag') || ''; > my $branchfilter = $input->param('branch') || ''; > my $op = $input->param('op') || ''; >+my $dateduefrom = format_date_in_iso($input->param( 'dateduefrom' )) || ''; >+my $datedueto = format_date_in_iso($input->param( 'datedueto' )) || ''; > my $isfiltered = $op =~ /apply/i && $op =~ /filter/i; > my $noreport = C4::Context->preference('FilterBeforeOverdueReport') && ! $isfiltered && $op ne "csv"; > >@@ -48,7 +50,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > query => $input, > type => "intranet", > authnotrequired => 0, >- flagsrequired => { reports => 1, circulate => "circulate_remaining_permissions" }, >+ flagsrequired => { reports => 'execute_reports', circulate => "circulate_remaining_permissions" }, > debug => 1, > } > ); >@@ -206,6 +208,9 @@ $template->param( > borcatloop=> \@borcatloop, > itemtypeloop => \@itemtypeloop, > patron_attr_filter_loop => \@patron_attr_filter_loop, >+ dateduefrom => $input->param( 'dateduefrom' ) || '', >+ datedueto => $input->param( 'datedueto' ) || '', >+ DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), > borname => $bornamefilter, > order => $order, > showall => $showall); >@@ -253,6 +258,8 @@ if ($noreport) { > $strsth.=" AND biblioitems.itemtype = '" . $itemtypefilter . "' " if $itemtypefilter; > $strsth.=" AND borrowers.flags = '" . $borflagsfilter . "' " if $borflagsfilter; > $strsth.=" AND borrowers.branchcode = '" . $branchfilter . "' " if $branchfilter; >+ $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 > my $bnlist = $have_pattr_filter_data ? join(',',keys %borrowernumber_to_attributes) : ''; > $strsth =~ s/WHERE 1=1/WHERE 1=1 AND borrowers.borrowernumber IN ($bnlist)/ if $bnlist; >@@ -284,6 +291,7 @@ if ($noreport) { > push @patron_attr_value_loop, { value => join(', ', sort { lc $a cmp lc $b } @displayvalues) }; > } > >+ $data->{email}=C4::Members::GetFirstValidEmailAddress($data->{borrowernumber}); > push @overduedata, { > duedate => format_date($data->{date_due}), > borrowernumber => $data->{borrowernumber}, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tmpl >index 9682fb1..a37fdca 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tmpl >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tmpl >@@ -69,6 +69,7 @@ > <style type="text/css"> > .sql {display:none;} > </style> >+<!-- TMPL_INCLUDE NAME="calendar.inc" --> > </head> > <body> > <!-- TMPL_INCLUDE NAME="header.inc" --> >@@ -137,6 +138,35 @@ > <fieldset class="brief"> > <h4>Filter On:</h4> > <ol> >+ <li style="border: dashed; border-width:1px;">Date due: >+ <label for="dateduefrom">From: >+ <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="dateduefrom_button" alt="Show Calendar" /> >+ </label> >+ <input type="text" id="dateduefrom" name="dateduefrom" size="20" value="<!-- TMPL_VAR NAME="dateduefrom" -->" /> >+ <script language="JavaScript" type="text/javascript"> >+ Calendar.setup( >+ { >+ inputField : "dateduefrom", >+ ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->", >+ button : "dateduefrom_button" >+ } >+ ); >+ </script> >+ >+ <label for="datedueto">To: >+ <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="datedueto_button" alt="Show Calendar" /> >+ </label> >+ <input type="text" id="datedueto" name="datedueto" size="20" value="<!-- TMPL_VAR NAME="datedueto" -->" /> >+ <script language="JavaScript" type="text/javascript"> >+ Calendar.setup( >+ { >+ inputField : "datedueto", >+ ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->", >+ button : "datedueto_button" >+ } >+ ); >+ </script> >+ </li> > <li><label>Name or cardnumber:</label><input type="text" name="borname" value="<!--TMPL_VAR Name="borname" escape="html" -->" /></li> > <li><label>Patron category:</label><select name="borcat" id="borcat"><option value="">Any</option> > <!-- TMPL_LOOP name="borcatloop" --> >@@ -233,7 +263,8 @@ > </li> > </ol> > <fieldset class="action"> >- <input type="submit" name="op" value="Apply Filter" class="submit" /> >+ <input type="hidden" name="op" value="Apply Filter" /> >+ <input type="submit" name="sub" value="Apply Filter" class="submit" /> > </fieldset> > </fieldset> > </form> >-- >1.7.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5874
: 3312 |
3324