summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--httemplate/elements/menu.html2
-rw-r--r--httemplate/search/report_timeworked.html28
-rw-r--r--httemplate/search/timeworked.html7
3 files changed, 36 insertions, 1 deletions
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index ccee9c3a7..b039e78e8 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -320,7 +320,7 @@ $tools_menu{'Job Queue'} = [ $fsurl.'search/queue.html', 'View pending job queu
if $curuser->access_right('Job queue');
$tools_menu{'Ticketing'} = [ \%tools_ticketing, 'Ticketing tools' ]
if $conf->config('ticket_system');
-$tools_menu{'Time Queue'} = [ $fsurl.'search/timeworked.html', 'View pending support time' ]
+$tools_menu{'Time Queue'} = [ $fsurl.'search/report_timeworked.html', 'View pending support time' ]
if $curuser->access_right('Time queue');
$tools_menu{'Attachments'} = [ $fsurl.'browse/cust_attachment.html', 'View customer attachments' ]
if !$conf->config('disable_cust_attachment');
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'),