[Rt-commit] r4310 - in RT-Extension-ActivityReports: .
html/Callbacks/ActivityReports/Elements
html/Callbacks/ActivityReports/Elements/Tabs
html/Callbacks/ActivityReports/Search
html/Callbacks/ActivityReports/Search/Results.html
html/Reports/Activity html/Reports/Activity/Elements
alexmv at bestpractical.com
alexmv at bestpractical.com
Wed Dec 14 03:31:59 EST 2005
Author: alexmv
Date: Wed Dec 14 03:31:58 2005
New Revision: 4310
Added:
RT-Extension-ActivityReports/html/Callbacks/ActivityReports/Elements/
RT-Extension-ActivityReports/html/Callbacks/ActivityReports/Elements/Tabs/
RT-Extension-ActivityReports/html/Callbacks/ActivityReports/Elements/Tabs/Default
RT-Extension-ActivityReports/html/Callbacks/ActivityReports/Search/
RT-Extension-ActivityReports/html/Callbacks/ActivityReports/Search/Results.html/
RT-Extension-ActivityReports/html/Callbacks/ActivityReports/Search/Results.html/SearchActions
RT-Extension-ActivityReports/html/Reports/Activity/Elements/LimitReport
RT-Extension-ActivityReports/html/Reports/Activity/index.html
Modified:
RT-Extension-ActivityReports/ (props changed)
RT-Extension-ActivityReports/MANIFEST
RT-Extension-ActivityReports/html/Reports/Activity/ActivityDetail.html
RT-Extension-ActivityReports/html/Reports/Activity/ActivitySummary.html
RT-Extension-ActivityReports/html/Reports/Activity/Elements/ScreenFooter
RT-Extension-ActivityReports/html/Reports/Activity/Elements/ScreenHeader
RT-Extension-ActivityReports/html/Reports/Activity/Elements/Tabs
RT-Extension-ActivityReports/html/Reports/Activity/ResolutionComments.html
RT-Extension-ActivityReports/html/Reports/Activity/ResolutionStatistics.html
Log:
r7720 at zoq-fot-pik: chmrr | 2005-12-14 03:31:26 -0500
* Tabs stuff. Works, but probably not 100% correctly. I want Jifty.
* Callbacks frobs
Modified: RT-Extension-ActivityReports/MANIFEST
==============================================================================
--- RT-Extension-ActivityReports/MANIFEST (original)
+++ RT-Extension-ActivityReports/MANIFEST Wed Dec 14 03:31:58 2005
@@ -1,8 +1,19 @@
+html/Callbacks/ActivityReports/Elements/Tabs/Default
html/Callbacks/ActivityReports/NoAuth/webrt.css/Default
-html/Tools/ActivityDetail.html
-html/Tools/ActivitySummary.html
-html/Tools/Elements/MiniPlot
-html/Tools/ResolutionStatistics.html
+html/Callbacks/ActivityReports/Search/Results.html/SearchActions
+html/Reports/Activity/ActivityDetail.html
+html/Reports/Activity/ActivitySummary.html
+html/Reports/Activity/Elements/LimitReport
+html/Reports/Activity/Elements/MiniPlot
+html/Reports/Activity/Elements/PrintFooter
+html/Reports/Activity/Elements/PrintHeader
+html/Reports/Activity/Elements/ScreenFooter
+html/Reports/Activity/Elements/ScreenHeader
+html/Reports/Activity/Elements/Tabs
+html/Reports/Activity/Elements/Wrapper
+html/Reports/Activity/index.html
+html/Reports/Activity/ResolutionComments.html
+html/Reports/Activity/ResolutionStatistics.html
inc/Module/Install.pm
inc/Module/Install/Base.pm
inc/Module/Install/Can.pm
Added: RT-Extension-ActivityReports/html/Callbacks/ActivityReports/Elements/Tabs/Default
==============================================================================
--- (empty file)
+++ RT-Extension-ActivityReports/html/Callbacks/ActivityReports/Elements/Tabs/Default Wed Dec 14 03:31:58 2005
@@ -0,0 +1,7 @@
+<%init>
+if ($ARGS{current_toptab} eq "Tools/Offline.html") {
+ $ARGS{tabs}{r} ||= { path => 'Reports/Activity/index.html',
+ title => 'Reports',
+ };
+}
+</%init>
\ No newline at end of file
Added: RT-Extension-ActivityReports/html/Callbacks/ActivityReports/Search/Results.html/SearchActions
==============================================================================
--- (empty file)
+++ RT-Extension-ActivityReports/html/Callbacks/ActivityReports/Search/Results.html/SearchActions Wed Dec 14 03:31:58 2005
@@ -0,0 +1,7 @@
+<a href="<% $RT::WebPath %>/Reports/Activity/index.html?<% $QueryString %>">Generate reports</a>
+<%init>
+use YAML;
+my %args = $m->caller_args(2);
+
+my $QueryString = $m->comp('/Elements/QueryString', query => $args{Query});
+</%init>
\ No newline at end of file
Modified: RT-Extension-ActivityReports/html/Reports/Activity/ActivityDetail.html
==============================================================================
--- RT-Extension-ActivityReports/html/Reports/Activity/ActivityDetail.html (original)
+++ RT-Extension-ActivityReports/html/Reports/Activity/ActivityDetail.html Wed Dec 14 03:31:58 2005
@@ -1,6 +1,5 @@
<&|Elements/Wrapper, %ARGS, title => loc("Activity detail"),
path => "Reports/Activity/ActivityDetail.html",
- query => $query
&>
<& Elements/MiniPlot, data => \%counts &>
@@ -25,14 +24,14 @@
</&>
<%args>
$query => 'id > 0'
-$start => "'2005/01/01'"
-$end => "'2006/01/01'"
+$start => "2005/01/01"
+$end => "2006/01/01"
</%args>
<%init>
my $summary_tickets = RT::Tickets->new($session{'CurrentUser'});
-$summary_tickets->FromSQL($query . " AND ( Updated >= $start AND Updated <= $end)");
+$summary_tickets->FromSQL($query . " AND ( Updated >= '$start' AND Updated <= '$end')");
my %counts;
while (my $ticket = $summary_tickets->Next) {
my $txns = $ticket->Transactions;
Modified: RT-Extension-ActivityReports/html/Reports/Activity/ActivitySummary.html
==============================================================================
--- RT-Extension-ActivityReports/html/Reports/Activity/ActivitySummary.html (original)
+++ RT-Extension-ActivityReports/html/Reports/Activity/ActivitySummary.html Wed Dec 14 03:31:58 2005
@@ -1,8 +1,5 @@
-<&|Elements/Wrapper,
- %ARGS,
+<&|Elements/Wrapper, %ARGS, title => loc("Activity summary"),
path => "Reports/Activity/ActivitySummary.html",
- title=> loc("Activity summary"),
- query => $query
&>
<& Elements/MiniPlot, data => \%queues &>
@@ -33,13 +30,13 @@
</&>
<%args>
$query => 'id > 0'
-$start => "'2005/01/01'"
-$end => "'2006/01/01'"
+$start => "2005/01/01"
+$end => "2006/01/01"
</%args>
<%init>
my $tickets = RT::Tickets->new($session{'CurrentUser'});
-$tickets->FromSQL($query . " AND ( Updated >= $start AND Updated <= $end)");
+$tickets->FromSQL($query . " AND ( Updated >= '$start' AND Updated <= '$end')");
my %queues;
my %status;
Added: RT-Extension-ActivityReports/html/Reports/Activity/Elements/LimitReport
==============================================================================
--- (empty file)
+++ RT-Extension-ActivityReports/html/Reports/Activity/Elements/LimitReport Wed Dec 14 03:31:58 2005
@@ -0,0 +1,23 @@
+<form action="index.html" method="POST" enctype="multipart/form-data">
+Query:
+<textarea name="query"><% $query %></textarea><br />
+
+Report type: <select name="type">
+<option value="ActivityDetail" <% $ARGS{path} =~ /ActivityDetail/ ? 'selected' : '' %>>Activity detail</option>
+<option value="ActivitySummary" <% $ARGS{path} =~ /ActivitySummary/ ? 'selected' : '' %>>Activity summary</option>
+<option value="ResolutionComments" <% $ARGS{path} =~ /ResolutionComments/ ? 'selected' : '' %>>Resolution comments</option>
+<option value="ResolutionStatistics" <% $ARGS{path} =~ /ResolutionStatistics/ ? 'selected' : '' %>>Resolution statistics</option>
+</select><br />
+
+Start date: <input type="text" name="start" value="<% $start %>" /><br />
+End date: <input type="text" name="end" value="<% $end %>" /><br />
+<& /Elements/Submit, Label => loc('Report') &>
+</form>
+<%args>
+$type => undef
+$start => undef
+$end => undef
+$query => undef
+</%args>
+<%init>
+</%init>
\ No newline at end of file
Modified: RT-Extension-ActivityReports/html/Reports/Activity/Elements/ScreenFooter
==============================================================================
--- RT-Extension-ActivityReports/html/Reports/Activity/Elements/ScreenFooter (original)
+++ RT-Extension-ActivityReports/html/Reports/Activity/Elements/ScreenFooter Wed Dec 14 03:31:58 2005
@@ -1,3 +1,4 @@
+<& LimitReport, %ARGS &>
<div align="right">
% my %printable_args = %ARGS;
% delete $printable_args{$_} for (qw/path title mode/);
Modified: RT-Extension-ActivityReports/html/Reports/Activity/Elements/ScreenHeader
==============================================================================
--- RT-Extension-ActivityReports/html/Reports/Activity/Elements/ScreenHeader (original)
+++ RT-Extension-ActivityReports/html/Reports/Activity/Elements/ScreenHeader Wed Dec 14 03:31:58 2005
@@ -4,6 +4,5 @@
</%args>
<& /Elements/Header, Title => $title &>
<& Tabs,
- current_tab => $path,
+ current_subtab => $path,
Title => $title &>
-
Modified: RT-Extension-ActivityReports/html/Reports/Activity/Elements/Tabs
==============================================================================
--- RT-Extension-ActivityReports/html/Reports/Activity/Elements/Tabs (original)
+++ RT-Extension-ActivityReports/html/Reports/Activity/Elements/Tabs Wed Dec 14 03:31:58 2005
@@ -1 +1,52 @@
-% $m->comp('/Elements/Tabs', %ARGS);
+<& /Elements/Tabs,
+ tabs => $tabs,
+ subtabs => $subtabs,
+ current_toptab => 'Tools/Offline.html',
+ current_tab => 'Reports/Activity/index.html'.$args,
+ Title => $Title &>
+
+<%INIT>
+my $subtabs = {};
+
+my $top = $m->caller_args(-1);
+my $args = "?" . $m->comp( '/Elements/QueryString',
+ query => $top->{query},
+ start => $top->{start},
+ end => $top->{end});
+if ($m->caller_args(-1)->{'query'}) {
+ $current_subtab .= $args;
+ $subtabs = {
+ a => { title => 'Activity detail',
+ path => 'Reports/Activity/ActivityDetail.html'.$args,
+ },
+ b => { title => 'Activity summary',
+ path => 'Reports/Activity/ActivitySummary.html'.$args,
+ },
+ c => { title => 'Resolution comments',
+ path => 'Reports/Activity/ResolutionComments.html'.$args,
+ },
+ d => { title => 'Resolution statistics',
+ path => 'Reports/Activity/ResolutionStatistics.html'.$args,
+ },
+ };
+}
+
+my $tabs = {
+ a => { title => loc('Offline'),
+ path => 'Tools/Offline.html',
+ },
+ r => { title => loc('Reports'),
+ path => 'Reports/Activity/index.html'.$args,
+ subtabs => $subtabs,
+ current_subtab => $current_subtab,
+ }
+ };
+
+</%INIT>
+
+
+<%ARGS>
+$current_tab => undef
+$current_subtab => undef
+$Title => undef
+</%ARGS>
Modified: RT-Extension-ActivityReports/html/Reports/Activity/ResolutionComments.html
==============================================================================
--- RT-Extension-ActivityReports/html/Reports/Activity/ResolutionComments.html (original)
+++ RT-Extension-ActivityReports/html/Reports/Activity/ResolutionComments.html Wed Dec 14 03:31:58 2005
@@ -1,6 +1,5 @@
-<&|Elements/PageWrapper, %ARGS, title => loc("Resolution Comments"),
+<&|Elements/Wrapper, %ARGS, title => loc("Resolution Comments"),
path => "Reports/Activity/ResolutionComments.html",
- query => $query
&>
<table style="width: 100%">
@@ -27,8 +26,8 @@
<%args>
$query => 'id > 0'
-$start => "'2005/01/01'"
-$end => "'2006/01/01'"
+$start => "2005/01/01"
+$end => "2006/01/01"
</%args>
<%init>
@@ -36,7 +35,7 @@
my $summary_tickets = RT::Tickets->new( $session{'CurrentUser'} );
$summary_tickets->FromSQL(
- $query . " AND (Status = 'resolved')" );
+ $query . " AND (Status = 'resolved') AND ( Updated >= '$start' AND Updated <= '$end')" );
my @items;
while ( my $ticket = $summary_tickets->Next ) {
Modified: RT-Extension-ActivityReports/html/Reports/Activity/ResolutionStatistics.html
==============================================================================
--- RT-Extension-ActivityReports/html/Reports/Activity/ResolutionStatistics.html (original)
+++ RT-Extension-ActivityReports/html/Reports/Activity/ResolutionStatistics.html Wed Dec 14 03:31:58 2005
@@ -1,7 +1,7 @@
<&|Elements/Wrapper, %ARGS, title => loc("Resolution statistics"),
path => "Reports/Activity/ResolutionStatistics.html",
- query => $query,
-&>
+ &>
+
<& Elements/MiniPlot,
data => \%plot,
major => ['Date range','Last 30 days','Last 60 days','Last 90 days','Ever'],
@@ -39,8 +39,8 @@
</&>
<%args>
$query => 'id > 0'
-$start => "'2005/01/01'"
-$end => "'2006/01/01'"
+$start => "2005/01/01"
+$end => "2006/01/01"
</%args>
<%init>
@@ -52,7 +52,7 @@
$in_90_days->Set(Format => 'Unix', Value => ( time - (86400*90)));
my %queries;
-$queries{'Date range'} = "(Resolved >= $start AND Resolved <= $end)";
+$queries{'Date range'} = "(Resolved >= '$start' AND Resolved <= '$end')";
$queries{'Last 30 days'} = "(Resolved >= '".$in_30_days->ISO."')";
$queries{'Last 60 days'} = "(Resolved >= '".$in_60_days->ISO."')";
$queries{'Last 90 days'} = "(Resolved >= '".$in_90_days->ISO."')";
Added: RT-Extension-ActivityReports/html/Reports/Activity/index.html
==============================================================================
--- (empty file)
+++ RT-Extension-ActivityReports/html/Reports/Activity/index.html Wed Dec 14 03:31:58 2005
@@ -0,0 +1,14 @@
+<&| Elements/Wrapper, %ARGS, Title => loc("Activity detail") &>
+</&>
+
+<%args>
+$type => undef
+$start => undef
+$end => undef
+$query => undef
+</%args>
+<%init>
+if ($type) {
+ $m->redirect($type . ".html?" . $m->comp('/Elements/QueryString', query => $query, start => $start, end => $end));
+}
+</%init>
More information about the Rt-commit
mailing list