From 1c478456e58dc554ff08e06a8d419f32c82c6529 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 24 Nov 2009 07:23:58 +0000 Subject: [PATCH] add date constratint on time worked search --- httemplate/elements/menu.html | 2 +- httemplate/search/report_timeworked.html | 28 ++++++++++++++++++++++++++++ httemplate/search/timeworked.html | 7 +++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 httemplate/search/report_timeworked.html 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' ) %> + +
+ + + + + + + + <% include ('/elements/tr-input-beginning_ending.html') %> + +
+ Search options +
+ +
+ + +
+ +<% include('/elements/footer.html') %> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Time queue'); + + 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'), -- 2.11.0