Date defaults in pendingreserves.pl (holds to pull report)
The pendingreserves.pl script is defaulting to a date range of 10 years ago to yesterday. However, the last bit of the below part of the script -- the if !defined($startdate) piece -- seems to be implying that other start and end dates could be provided. I'm not finding any place where other dates can be set by the user before the report is run. After it runs (first entry into screen), the user can change dates in the Refine Results section. Is there a syspref I'm missing, or somewhere else, that the user can specify different dates as a default? Thanks. my $todaysdate = sprintf("%-04.4d-%-02.2d-%02.2d", $year, $month, $day); my $yesterdaysdate = sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day, 0, 0, -1)); # Find 10 years ago for the default shelf pull start and end dates # A default of the prior day's holds is a reasonable way to pull holds my $pastdate = sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day, -10, 0, 0)); # Predefine the start and end dates if they are not already defined $startdate =~ s/^\s+//; $startdate =~ s/\s+$//; $enddate =~ s/^\s+//; $enddate =~ s/\s+$//; # Check if null, should string match, if so set start and end date to yesterday if (!defined($startdate) or $startdate eq "") { $startdate = format_date($pastdate); } if (!defined($enddate) or $enddate eq "") { $enddate = format_date($yesterdaysdate); } Jane Wagner Library Systems Analyst PTFS Inc. Content Management and Library Solutions 6400 Goldsboro Road, Suite 200 Bethesda, MD 20817 (301) 654-8088 x 151 jwagner@ptfs.com
However, the last bit of the below part of the script -- the if !defined($startdate) piece -- seems to be implying that other start and end dates could be provided.
Of course: if the user can change dates in the Refine Results section then the script is set up to accept custom dates. At my library I suggest that librarians bookmark their Holds Queue report with their branch parameter prefilled to save clicks. You could do the same with pendingreserves.pl: /cgi-bin/koha/circ/pendingreserves.pl?from=01/18/2009&to=01/19/2009 -- Owen -- Web Developer Athens County Public Libraries http://www.myacpl.org
2009/3/21 Owen Leonard <oleonard@myacpl.org>:
However, the last bit of the below part of the script -- the if !defined($startdate) piece -- seems to be implying that other start and end dates could be provided.
Of course: if the user can change dates in the Refine Results section then the script is set up to accept custom dates. At my library I suggest that librarians bookmark their Holds Queue report with their branch parameter prefilled to save clicks. You could do the same with pendingreserves.pl:
/cgi-bin/koha/circ/pendingreserves.pl?from=01/18/2009&to=01/19/2009
And for future reference, these lines in the script tell you want variable names the script is expecting my $startdate=$input->param('from'); my $enddate=$input->param('to'); Chris
That approach hadn't occurred to me, thanks. However, is it possible to pass a sliding date? Something like $yesterday and $today? As a test I modified the script itself to use $yesterdaysdate in place of $pastdate, which worked fine. However, I'd like to give the user more options. Jane Wagner Library Systems Analyst PTFS Inc. Content Management and Library Solutions 6400 Goldsboro Road, Suite 200 Bethesda, MD 20817 (301) 654-8088 x 151 jwagner@ptfs.com -----Original Message----- From: Owen Leonard [mailto:oleonard@myacpl.org] Sent: Friday, March 20, 2009 2:57 PM To: Wagner, Jane Cc: koha-devel@lists.koha.org Subject: Re: [Koha-devel] Date defaults in pendingreserves.pl (holds to pull report)
However, the last bit of the below part of the script -- the if !defined($startdate) piece -- seems to be implying that other start and end dates could be provided.
Of course: if the user can change dates in the Refine Results section then the script is set up to accept custom dates. At my library I suggest that librarians bookmark their Holds Queue report with their branch parameter prefilled to save clicks. You could do the same with pendingreserves.pl: /cgi-bin/koha/circ/pendingreserves.pl?from=01/18/2009&to=01/19/2009 -- Owen -- Web Developer Athens County Public Libraries http://www.myacpl.org
2009/3/21 Wagner, Jane <jwagner@ptfs.com>:
That approach hadn't occurred to me, thanks. However, is it possible to pass a sliding date? Something like $yesterday and $today? As a test I modified the script itself to use $yesterdaysdate in place of $pastdate, which worked fine. However, I'd like to give the user more options
Well you could just pass in yesterday and todays date :) So you could edit the template that creates the link to the script so that it has the prefilled, so the user could just click on it and it would do todays. Or you could make it a form, with 2 input fields that the user could type into. Short answer is yes, the form accepts inputs, you just have to pass them to it. Chris
OK, thanks to both of you. Some things to consider.... Jane Wagner Library Systems Analyst PTFS Inc. Content Management and Library Solutions 6400 Goldsboro Road, Suite 200 Bethesda, MD 20817 (301) 654-8088 x 151 jwagner@ptfs.com -----Original Message----- From: Chris Cormack [mailto:chris@bigballofwax.co.nz] Sent: Friday, March 20, 2009 3:15 PM To: Wagner, Jane Cc: Owen Leonard; koha-devel Subject: Re: [Koha-devel] Date defaults in pendingreserves.pl (holds to pull report) 2009/3/21 Wagner, Jane <jwagner@ptfs.com>:
That approach hadn't occurred to me, thanks. However, is it possible to pass a sliding date? Something like $yesterday and $today? As a test I modified the script itself to use $yesterdaysdate in place of $pastdate, which worked fine. However, I'd like to give the user more options
Well you could just pass in yesterday and todays date :) So you could edit the template that creates the link to the script so that it has the prefilled, so the user could just click on it and it would do todays. Or you could make it a form, with 2 input fields that the user could type into. Short answer is yes, the form accepts inputs, you just have to pass them to it. Chris
participants (3)
-
Chris Cormack -
Owen Leonard -
Wagner, Jane