add date constratint on time worked search
authorivan <ivan>
Tue, 24 Nov 2009 07:23:58 +0000 (07:23 +0000)
committerivan <ivan>
Tue, 24 Nov 2009 07:23:58 +0000 (07:23 +0000)
httemplate/elements/menu.html
httemplate/search/report_timeworked.html [new file with mode: 0644]
httemplate/search/timeworked.html

index ccee9c3..b039e78 100644 (file)
@@ -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 (file)
index 0000000..a672ec0
--- /dev/null
@@ -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>
index b72dd0e..29f9b25 100644 (file)
@@ -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'),