summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2009-11-24 07:42:29 +0000
committerivan <ivan>2009-11-24 07:42:29 +0000
commitfd76ba41f6e7279f6cfa6a65f675898ba08f05bb (patch)
tree1428fbf171036b5b89b169703f33affc5d368ea3 /httemplate
parent7dc06e75274b96460e69477bef3b21866e6ec974 (diff)
timeworked report: carry the date range through to the success redirect
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/misc/process/timeworked.html4
-rwxr-xr-xhttemplate/misc/timeworked.html3
-rw-r--r--httemplate/search/timeworked.html39
3 files changed, 32 insertions, 14 deletions
diff --git a/httemplate/misc/process/timeworked.html b/httemplate/misc/process/timeworked.html
index 860118e0c..200a7511d 100644
--- a/httemplate/misc/process/timeworked.html
+++ b/httemplate/misc/process/timeworked.html
@@ -1,13 +1,15 @@
% if ($error) {
<% $cgi->redirect(popurl(2). "timeworked.html?". $cgi->query_string) %>
% } else {
-<% $cgi->redirect(popurl(3). "search/timeworked.html") %>
+<% $cgi->redirect(popurl(3). "search/timeworked.html?begin=$begin;end=$end") %>
% }
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Time queue');
+my($begin, $end) = FS::UI::Web::parse_beginning_ending($cgi);
+
my @acct_rt_transaction;
foreach my $transaction (
map { /^transactionid(\d+)$/; $1; } grep /^transactionid\d+$/, $cgi->param
diff --git a/httemplate/misc/timeworked.html b/httemplate/misc/timeworked.html
index db4b64ce7..46063e829 100755
--- a/httemplate/misc/timeworked.html
+++ b/httemplate/misc/timeworked.html
@@ -92,6 +92,9 @@
<BR>
+<INPUT TYPE="hidden" NAME="begin" VALUE="<% $cgi->param('begin') |h %>">
+<INPUT TYPE="hidden" NAME="end" VALUE="<% $cgi->param('end') |h %>">
+
<INPUT TYPE="submit" NAME="submit" VALUE="<% $title %>">
</FORM>
diff --git a/httemplate/search/timeworked.html b/httemplate/search/timeworked.html
index b72dd0ea9..1d877e6ef 100644
--- a/httemplate/search/timeworked.html
+++ b/httemplate/search/timeworked.html
@@ -32,19 +32,7 @@
'',
'',
],
- 'html_foot' => sub {
- '<BR><INPUT TYPE="button" VALUE="select all" onClick="setAll(true)">'.
- '<INPUT TYPE="button" VALUE="unselect all" onClick="setAll(false)">'.
- '<BR><INPUT TYPE="submit" NAME="action" VALUE="Assign to accounts"><BR>'.
- '<SCRIPT TYPE="text/javascript">'.
- ' function setAll(setTo) { '.
- ' theForm = document.timeForm;'.
- ' for (i=0,n=theForm.elements.length;i<n;i++)'.
- ' if (theForm.elements[i].name.indexOf("transactionid") != -1)'.
- ' theForm.elements[i].checked = setTo;'.
- ' }'.
- '</SCRIPT>';
- },
+ 'html_foot' => $html_foot,
)
%>
@@ -96,6 +84,13 @@ my $where = "
";
#AND $wheretimeleft
+my $str2time_sql = str2time_sql;
+my $closing = str2time_sql_closing;
+
+my($begin, $end) = FS::UI::Web::parse_beginning_ending($cgi);
+$where .= " AND $str2time_sql Transactions.Created $closing >= $begin ".
+ " AND $str2time_sql Transactions.Created $closing <= $end ";
+
my $query = "
SELECT Tickets.id, Tickets.Subject,
TO_CHAR(Transactions.Created, 'Dy Mon DD HH24:MI:SS YYYY'),
@@ -114,4 +109,22 @@ my $count_query = "SELECT COUNT(*) FROM Transactions $where";
my $link = [ "${p}rt/Ticket/Display.html?id=", sub { shift->[0]; } ];
+my $html_foot = qq'
+ <INPUT TYPE="hidden" NAME="begin" VALUE="$begin">
+ <INPUT TYPE="hidden" NAME="end" VALUE="$end">
+ <BR>
+ <INPUT TYPE="button" VALUE="select all" onClick="setAll(true)">
+ <INPUT TYPE="button" VALUE="unselect all" onClick="setAll(false)">
+ <BR>
+ <INPUT TYPE="submit" NAME="action" VALUE="Assign to accounts"><BR>
+ <SCRIPT TYPE="text/javascript">
+ function setAll(setTo) {
+ theForm = document.timeForm;
+ for (i=0,n=theForm.elements.length;i<n;i++)
+ if (theForm.elements[i].name.indexOf("transactionid") != -1)
+ theForm.elements[i].checked = setTo;
+ }
+ </SCRIPT>
+';
+
</%init>