summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorivan <ivan>2009-11-24 07:23:58 +0000
committerivan <ivan>2009-11-24 07:23:58 +0000
commit1c478456e58dc554ff08e06a8d419f32c82c6529 (patch)
treeaf5150324b7f3420788a09043608e4bac219dddc /httemplate/search
parente670183bbb184527df5da958acb7a4b5d41ee6ec (diff)
add date constratint on time worked search
Diffstat (limited to 'httemplate/search')
-rw-r--r--httemplate/search/report_timeworked.html28
-rw-r--r--httemplate/search/timeworked.html7
2 files changed, 35 insertions, 0 deletions
diff --git a/httemplate/search/report_timeworked.html b/httemplate/search/report_timeworked.html
new file mode 100644
index 000000000..a672ec082
--- /dev/null
+++ b/httemplate/search/report_timeworked.html
@@ -0,0 +1,28 @@
+<% include( '/elements/header.html', 'Time Worked' ) %>
+
+<FORM ACTION="timeworked.html" METHOD="GET">
+
+<TABLE BGCOLOR="#cccccc" CELLSPACING=0>
+
+ <TR>
+ <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left">
+ <FONT SIZE="+1">Search options</FONT>
+ </TH>
+ </TR>
+
+ <% include ('/elements/tr-input-beginning_ending.html') %>
+
+</TABLE>
+
+<BR>
+<INPUT TYPE="submit" VALUE="Get Report">
+
+</FORM>
+
+<% include('/elements/footer.html') %>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Time queue');
+
+</%init>
diff --git a/httemplate/search/timeworked.html b/httemplate/search/timeworked.html
index b72dd0ea9..29f9b2546 100644
--- a/httemplate/search/timeworked.html
+++ b/httemplate/search/timeworked.html
@@ -96,6 +96,13 @@ my $where = "
";
#AND $wheretimeleft
+my $str2time_sql = str2time_sql;
+my $closing = str2time_sql_closing;
+
+my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
+$where .= " AND $str2time_sql Transactions.Created $closing >= $beginning ".
+ " AND $str2time_sql Transactions.Created $closing <= $ending";
+
my $query = "
SELECT Tickets.id, Tickets.Subject,
TO_CHAR(Transactions.Created, 'Dy Mon DD HH24:MI:SS YYYY'),