[Bps-public-commit] rt-extension-debugtimers branch, master, updated. 38e7787c588f3e351745db22fe55f446183b64a9

Jim Brandt jbrandt at bestpractical.com
Wed Feb 13 14:56:03 EST 2019


The branch, master has been updated
       via  38e7787c588f3e351745db22fe55f446183b64a9 (commit)
       via  835aaf4cd3ffce52c1cc5212dfd04bd73049ced1 (commit)
       via  c26fc677b82fd869fc22b66690cbdb89dd7e0de4 (commit)
       via  7d476eae24ecebe851e692ba6d9e6d87d6f5fd1a (commit)
      from  aa1721774af45aab10ea1f8af2de5248e055e6da (commit)

Summary of changes:
 Changes                                      |   4 +-
 MANIFEST                                     |  21 +++
 META.yml                                     |   2 +-
 README                                       |  16 ++-
 html/Callbacks/DebugTimers/autohandler/Final |  16 +++
 html/Elements/QueueSummaryByLifecycle        | 188 ---------------------------
 html/Elements/QueueSummaryByStatus           | 167 ------------------------
 html/Elements/Quicksearch                    |  70 ----------
 html/autohandler                             |  52 --------
 html/index.html                              | 165 -----------------------
 lib/RT/.vstags                               |   7 -
 lib/RT/Extension/DebugTimers.pm              |  20 ++-
 lib/RT/Principal_Local.pm                    |  98 --------------
 13 files changed, 69 insertions(+), 757 deletions(-)
 create mode 100644 MANIFEST
 create mode 100644 html/Callbacks/DebugTimers/autohandler/Final
 delete mode 100644 html/Elements/QueueSummaryByLifecycle
 delete mode 100644 html/Elements/QueueSummaryByStatus
 delete mode 100644 html/Elements/Quicksearch
 delete mode 100644 html/autohandler
 delete mode 100644 html/index.html
 delete mode 100644 lib/RT/.vstags
 delete mode 100644 lib/RT/Principal_Local.pm

- Log -----------------------------------------------------------------
commit 7d476eae24ecebe851e692ba6d9e6d87d6f5fd1a
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Feb 13 14:42:13 2019 -0500

    Remove unneeded files

diff --git a/html/Elements/QueueSummaryByLifecycle b/html/Elements/QueueSummaryByLifecycle
deleted file mode 100644
index 562ed2f..0000000
--- a/html/Elements/QueueSummaryByLifecycle
+++ /dev/null
@@ -1,188 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
-%#                                          <sales at bestpractical.com>
-%#
-%# (Except where explicitly superseded by other copyright notices)
-%#
-%#
-%# LICENSE:
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%#
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-%#
-%#
-%# CONTRIBUTION SUBMISSION POLICY:
-%#
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%#
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%#
-%# END BPS TAGGED BLOCK }}}
-<%perl>
-    foreach my $lifecycle ( map $lifecycle{$_}, sort keys %lifecycle ) {
-    my @cur_statuses = grep $lifecycle->IsValid($_), @statuses;
-    next unless @cur_statuses;
-</%perl>
-
-<table border="0" cellspacing="0" cellpadding="1" width="100%" class="queue-summary">
-
-<tr>
-    <th class="collection-as-table"><&|/l&>Queue</&></th>
-% for my $status ( @cur_statuses ) {
-    <th class="collection-as-table"><% loc($status) %></th>
-% }
-</tr>
-
-<%PERL>
-my $i = 0;
-for my $queue (@queues) {
-    next if lc($queue->{Lifecycle} || '') ne lc $lifecycle->Name;
-
-    $i++;
-</%PERL>
-<tr class="<% $i%2 ? 'oddline' : 'evenline'%>" >
-
-<td>
-    <a href="<% $link_all->($queue, \@cur_statuses) %>" title="<% $queue->{Description} %>"><% $queue->{Name} %></a>
-</td>
-
-%   for my $status (@cur_statuses) {
-<td align="right">
-    <a href="<% $link_status->($queue, $status) %>"><% $data->{$queue->{id}}->{lc $status} || '-' %></a>
-</td>
-%   }
-</tr>
-% }
-</table>
-% }
-% RT::Logger->debug("Leaving " . $m->current_comp->name . " time is: " . Time::HiRes::tv_interval( $m->{'rt_base_time'} ));
-<%INIT>
-RT::Logger->debug("Entering " . $m->current_comp->name . " time is: " . Time::HiRes::tv_interval( $m->{'rt_base_time'} ));
-
-my $build_search_link = sub {
-    my ($queue_name, $extra_query) = @_;
-    $queue_name =~ s/(['\\])/\\$1/g; #'
-
-    return RT->Config->Get('WebPath')
-         . "/Search/Results.html?Query="
-         . $m->interp->apply_escapes("Queue = '$queue_name' AND $extra_query", 'u');
-};
-
-my $link_all = sub {
-    my ($queue, $all_statuses) = @_;
-    my @escaped = @{$all_statuses};
-    s{(['\\])}{\\$1}g for @escaped;
-    return $build_search_link->($queue->{Name}, "(".join(" OR ", map "Status = '$_'", @escaped).")");
-};
-
-my $link_status = sub {
-    my ($queue, $status) = @_;
-    $status =~ s{(['\\])}{\\$1}g;
-    return $build_search_link->($queue->{Name}, "Status = '$status'");
-};
-
-$m->callback(
-    CallbackName        => 'LinkBuilders',
-    build_search_link   => \$build_search_link,
-    link_all            => \$link_all,
-    link_status         => \$link_status,
-);
-
-my $Queues = RT::Queues->new( $session{'CurrentUser'} );
-$Queues->UnLimit();
-my $unwanted = $session{'CurrentUser'}->UserObj->Preferences('QuickSearch', {});
-foreach my $queue ( keys %{$unwanted} ){
-    $Queues->Limit( FIELD => 'Name', VALUE => $queue, OPERATOR => '!=', CASESENSITIVE => 1 );
-}
-$m->callback( CallbackName => 'SQLFilter', Queues => $Queues );
-
-RT::Logger->debug("Before queue filter in " . $m->current_comp->name . " time is: " . Time::HiRes::tv_interval( $m->{'rt_base_time'} ));
-
-my @queues = grep {1} @{ $Queues->ItemsArrayRef };
-#my @queues = grep $queue_filter->($_), @{ $Queues->ItemsArrayRef };
-$m->callback( CallbackName => 'Filter', Queues => \@queues );
-$m->abort;
-RT::Logger->debug("After queue filter in " . $m->current_comp->name . " time is: " . Time::HiRes::tv_interval( $m->{'rt_base_time'} ));
-
- at queues = map {
-    {  id          => $_->Id,
-       Name        => $_->Name,
-       Description => $_->Description || '',
-       Lifecycle   => $_->Lifecycle,
-    }
-} grep $_, @queues;
-
-my %lifecycle;
-
-for my $queue (@queues) {
-    my $cycle = RT::Lifecycle->Load( Name => $queue->{'Lifecycle'} );
-    $lifecycle{ lc $cycle->Name } = $cycle;
-}
-
-unless (@statuses) {
-    my %seen;
-    foreach my $set ( 'initial', 'active' ) {
-        foreach my $lifecycle ( map $lifecycle{$_}, sort keys %lifecycle ) {
-            push @statuses, grep !$seen{ lc $_ }++, $lifecycle->Valid($set);
-        }
-    }
-}
-
-my $data     = {};
-my $statuses = {};
-
-RT::Logger->debug("Before RT::Report::Tickets in " . $m->current_comp->name . " time is: " . Time::HiRes::tv_interval( $m->{'rt_base_time'} ));
-
-use RT::Report::Tickets;
-my $report = RT::Report::Tickets->new( RT->SystemUser );
-my @escaped = @statuses;
-s{(['\\])}{\\$1}g for @escaped;
-my $query =
-    "(".
-    join(" OR ", map {"Status = '$_'"} @escaped) #'
-    .") AND (".
-    join(' OR ', map "Queue = ".$_->{id}, @queues)
-    .")";
-$query = 'id < 0' unless @queues;
-$report->SetupGroupings( Query => $query, GroupBy => [qw(Status Queue)] );
-
-while ( my $entry = $report->Next ) {
-    $data->{ $entry->__Value("Queue") }->{ $entry->__Value("Status") }
-        = $entry->__Value('id');
-    $statuses->{ $entry->__Value("Status") } = 1;
-}
-
-RT::Logger->debug("After RT::Report::Tickets in " . $m->current_comp->name . " time is: " . Time::HiRes::tv_interval( $m->{'rt_base_time'} ));
-
-</%INIT>
-<%ARGS>
-$queue_filter => undef
- at statuses => ()
-</%ARGS>
diff --git a/html/Elements/QueueSummaryByStatus b/html/Elements/QueueSummaryByStatus
deleted file mode 100644
index 2eeeef1..0000000
--- a/html/Elements/QueueSummaryByStatus
+++ /dev/null
@@ -1,167 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
-%#                                          <sales at bestpractical.com>
-%#
-%# (Except where explicitly superseded by other copyright notices)
-%#
-%#
-%# LICENSE:
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%#
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-%#
-%#
-%# CONTRIBUTION SUBMISSION POLICY:
-%#
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%#
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%#
-%# END BPS TAGGED BLOCK }}}
-<table border="0" cellspacing="0" cellpadding="1" width="100%" class="queue-summary">
-
-<tr>
-    <th class="collection-as-table"><&|/l&>Queue</&></th>
-% for my $status ( @statuses ) {
-    <th class="collection-as-table"><% loc($status) %></th>
-% }
-</tr>
-
-<%PERL>
-my $i = 0;
-for my $queue (@queues) {
-    $i++;
-    my $lifecycle = $lifecycle{ lc $queue->{'Lifecycle'} };
-    my @queue_statuses = grep { $lifecycle->IsValid($_) } @statuses;
-</%PERL>
-<tr class="<% $i%2 ? 'oddline' : 'evenline'%>" >
-
-<td>
-    <a href="<% $link_all->($queue, \@queue_statuses) %>" title="<% $queue->{Description} %>"><% $queue->{Name} %></a>
-</td>
-
-<%perl>
-   for my $status (@statuses) {
-   if ( $lifecycle->IsValid( $status ) ) {
-</%perl>
-<td align="right">
-    <a href="<% $link_status->($queue, $status) %>"><% $data->{$queue->{id}}->{lc $status} || '-' %></a>
-</td>
-%   } else {
-<td align="right">-</td>
-%   }
-%   }
-</tr>
-% }
-</table>
-<%INIT>
-RT::Logger->debug("Entering " . $m->current_comp . " time is: " . Time::HiRes::tv_interval( $m->{'rt_base_time'} ));
-
-my $build_search_link = sub {
-    my ($queue_name, $extra_query) = @_;
-    $queue_name =~ s/(['\\])/\\$1/g; #'
-
-    return RT->Config->Get('WebPath')
-         . "/Search/Results.html?Query="
-         . $m->interp->apply_escapes("Queue = '$queue_name' AND $extra_query", 'u');
-};
-
-my $link_all = sub {
-    my ($queue, $all_statuses) = @_;
-    return $build_search_link->($queue->{Name}, "(".join(" OR ", map "Status = '$_'", @$all_statuses).")");
-};
-
-my $link_status = sub {
-    my ($queue, $status) = @_;
-    return $build_search_link->($queue->{Name}, "Status = '$status'");
-};
-
-$m->callback(
-    CallbackName        => 'LinkBuilders',
-    build_search_link   => \$build_search_link,
-    link_all            => \$link_all,
-    link_status         => \$link_status,
-);
-
-my $Queues = RT::Queues->new( $session{'CurrentUser'} );
-$Queues->UnLimit();
-$m->callback( CallbackName => 'SQLFilter', Queues => $Queues );
-
-my @queues = grep $queue_filter->($_), @{ $Queues->ItemsArrayRef };
-$m->callback( CallbackName => 'Filter', Queues => \@queues );
-
- at queues = map {
-    {  id          => $_->Id,
-       Name        => $_->Name,
-       Description => $_->Description || '',
-       Lifecycle   => $_->Lifecycle,
-    }
-} grep $_, @queues;
-
-my %lifecycle;
-
-for my $queue (@queues) {
-    my $cycle = RT::Lifecycle->Load( Name => $queue->{'Lifecycle'} );
-    $lifecycle{ lc $cycle->Name } = $cycle;
-}
-
-unless (@statuses) {
-    my %seen;
-    foreach my $set ( 'initial', 'active' ) {
-        foreach my $lifecycle ( map $lifecycle{$_}, sort keys %lifecycle ) {
-            push @statuses, grep !$seen{ lc $_ }++, $lifecycle->Valid($set);
-        }
-    }
-}
-
-my $data     = {};
-my $statuses = {};
-
-use RT::Report::Tickets;
-my $report = RT::Report::Tickets->new( RT->SystemUser );
-my $query =
-    "(".
-    join(" OR ", map {s{(['\\])}{\\$1}g; "Status = '$_'"} @statuses) #'
-    .") AND (".
-    join(' OR ', map "Queue = ".$_->{id}, @queues)
-    .")";
-$query = 'id < 0' unless @queues;
-$report->SetupGroupings( Query => $query, GroupBy => [qw(Status Queue)] );
-
-while ( my $entry = $report->Next ) {
-    $data->{ $entry->__Value("Queue") }->{ $entry->__Value("Status") }
-        = $entry->__Value('id');
-    $statuses->{ $entry->__Value("Status") } = 1;
-}
-</%INIT>
-<%ARGS>
-$queue_filter => undef
- at statuses => ()
-</%ARGS>
diff --git a/html/Elements/Quicksearch b/html/Elements/Quicksearch
deleted file mode 100644
index d9a6a42..0000000
--- a/html/Elements/Quicksearch
+++ /dev/null
@@ -1,70 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
-%#                                          <sales at bestpractical.com>
-%#
-%# (Except where explicitly superseded by other copyright notices)
-%#
-%#
-%# LICENSE:
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%#
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-%#
-%#
-%# CONTRIBUTION SUBMISSION POLICY:
-%#
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%#
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%#
-%# END BPS TAGGED BLOCK }}}
-<div class="ticket-overview">
-<&|/Widgets/TitleBox,
-    title => loc("Quick search"),
-    bodyclass => "",
-    titleright => loc("Edit"),
-    titleright_href => RT->Config->Get('WebPath').'/Prefs/Quicksearch.html',
-&>
-<& $comp,
-   queue_filter => sub {
-       RT::Logger->debug("In queue filter on " . $_->Name . " time is: " . Time::HiRes::tv_interval( $m->{'rt_base_time'} ));
-       return !exists $unwanted->{$_->Name}
-       && $_->CurrentUserHasRight('ShowTicket'); },
-&>
-</&>
-</div>
-<%INIT>
-my $unwanted = $session{'CurrentUser'}->UserObj->Preferences('QuickSearch', {});
-my $comp = $SplitByLifecycle? '/Elements/QueueSummaryByLifecycle' : '/Elements/QueueSummaryByStatus';
-RT::Logger->warn("Running custom quick search");
-</%INIT>
-<%ARGS>
-$SplitByLifecycle => 1
-</%ARGS>
diff --git a/html/autohandler b/html/autohandler
deleted file mode 100644
index b908533..0000000
--- a/html/autohandler
+++ /dev/null
@@ -1,52 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
-%#                                          <sales at bestpractical.com>
-%#
-%# (Except where explicitly superseded by other copyright notices)
-%#
-%#
-%# LICENSE:
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%#
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-%#
-%#
-%# CONTRIBUTION SUBMISSION POLICY:
-%#
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%#
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%#
-%# END BPS TAGGED BLOCK }}}
-<%INIT>
-$m->callback( ARGSRef => \%ARGS, CallbackName => 'Init', CallbackPage => '/autohandler' );
-
-RT::Interface::Web::HandleRequest(\%ARGS);
-</%INIT>
diff --git a/html/index.html b/html/index.html
deleted file mode 100644
index 67d22e2..0000000
--- a/html/index.html
+++ /dev/null
@@ -1,165 +0,0 @@
-<!DOCTYPE html>
-<!--
-% $m->out('--'.'>');
-% $m->comp('/Elements/Header', Title=>loc("RT at a glance"), Refresh => $session{'home_refresh_interval'}||RT->Config->Get('HomePageRefreshInterval', $session{'CurrentUser'}), SkipDoctype => 1 );
-% if (0) {
-%# -->
-<html><head>
-<meta http-equiv="refresh" content="30; url=http://bestpractical.com/rt/rt-broken-install.html">
-<title>Almost there!</title></head>
-<body>
-
-<img src="http://www.bestpractical.com/images/unconfigured-rtlogo.jpg" />
-<br /><br />
-<h1>You're almost there!</h1>
-You haven't yet configured your webserver to run RT.
-
-You appear to have installed RT's web interface correctly, but haven't yet configured your web
-server to "run" the RT server which powers the web interface.
-
-The next step is to edit your webserver's configuration file to instruct it to use
-RT's <strong>mod_perl</strong> or <strong>FastCGI</strong> handler.
-
-If you need commercial support, please contact us at sales at bestpractical.com.
-
-
-<!--
-% }
-
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
-%#                                          <sales at bestpractical.com>
-%#
-%# (Except where explicitly superseded by other copyright notices)
-%#
-%#
-%# LICENSE:
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%#
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-%#
-%#
-%# CONTRIBUTION SUBMISSION POLICY:
-%#
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%#
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%#
-%# END BPS TAGGED BLOCK }}}
-<& /Elements/Tabs &>
-<& /Elements/ListActions, actions => \@results &>    
-<& /Elements/MyRT &>
-% RT::Logger->debug("Leaving index, time is: " . Time::HiRes::tv_interval( $m->{'rt_base_time'} ));
-<%init>
-RT::Logger->debug("Entering index, time is: " . Time::HiRes::tv_interval( $m->{'rt_base_time'} ));
-if ( RT::Interface::Web->MobileClient()) {
-    RT::Interface::Web::Redirect(RT->Config->Get('WebURL') ."m/");
-    $m->abort();
-}
-
-my @results;
-my $skip_create = 0;
-
-$m->callback( ARGSRef => \%ARGS, results => \@results, CallbackName => 'Initial', 
-              skip_create => \$skip_create );
-
-if ( $ARGS{'QuickCreate'} ) {
-    my $QueueObj = RT::Queue->new($session{'CurrentUser'});
-    $QueueObj->Load($ARGS{Queue}) or Abort(loc("Queue could not be loaded."));
-    
-    my $CFs = $QueueObj->TicketCustomFields();
-    
-    my ($ValidCFs, @msg) = $m->comp(
-        '/Elements/ValidateCustomFields',
-        CustomFields        => $CFs,
-        ARGSRef             => \%ARGS,
-        ValidateUnsubmitted => 1,
-    );
-
-
-    my $created;
-    if ( $ValidCFs && !$skip_create ) {
-        my ($t, $msg) = CreateTicket( 
-                        Queue => $ARGS{'Queue'},
-                        Owner => $ARGS{'Owner'},
-                        Status => $ARGS{'Status'},
-                        # yes! it's Requestors, not Requestor
-                        Requestors => $ARGS{'Requestors'},
-                        Content => $ARGS{'Content'},
-                        Subject => $ARGS{'Subject'});
-        push @results, $msg;
-
-        if ( $t && $t->Id ) {
-            $created = 1;
-            if ( RT->Config->Get('DisplayTicketAfterQuickCreate', $session{'CurrentUser'}) ) {
-                MaybeRedirectForResults(
-                    Actions   => \@results,
-                    Path      => '/Ticket/Display.html',
-                    Arguments => { id => $t->Id },
-                );
-            }
-        }
-    }
-    elsif ( !$ValidCFs ) {
-        push @results, loc("Can't quickly create ticket in queue [_1] because custom fields are required.  Please finish by using the normal ticket creation page.", $QueueObj->Name);
-        push @results, @msg;
-
-        MaybeRedirectForResults(
-            Actions     => \@results,
-            Path        => "/Ticket/Create.html",
-            Arguments   => {
-                (map { $_ => $ARGS{$_} } qw(Queue Owner Status Content Subject)),
-                Requestors => $ARGS{Requestors},
-                # From is set above when CFs are OK, but not here since we're
-                # not calling CreateTicket() directly.  The proper place to set
-                # a default for From, if desired in the future, is in
-                # CreateTicket() itself, or at least /Ticket/Display.html
-                # (which processes /Ticket/Create.html).  From is rarely used
-                # overall.
-            },
-        );
-    }
-
-    $session{QuickCreate} = \%ARGS unless $created;
-
-    MaybeRedirectForResults(
-        Actions   => \@results,
-        Path      => '/',
-    );
-}
-
-
-if ( $ARGS{'q'} ) {
-    RT::Interface::Web::Redirect(RT->Config->Get('WebURL')."Search/Simple.html?q=".$m->interp->apply_escapes($ARGS{q}, 'u'));
-}
-
-</%init>
-
-%# --></body></html>
diff --git a/lib/RT/.vstags b/lib/RT/.vstags
deleted file mode 100644
index 7cbf21f..0000000
--- a/lib/RT/.vstags
+++ /dev/null
@@ -1,7 +0,0 @@
-!_TAG_FILE_FORMAT	2	/extended format; --format=1 will not append ;" to lines/
-!_TAG_FILE_SORTED	1	/0=unsorted, 1=sorted, 2=foldcase/
-!_TAG_PROGRAM_AUTHOR	Darren Hiebert	/dhiebert at users.sourceforge.net/
-!_TAG_PROGRAM_NAME	Exuberant Ctags	//
-!_TAG_PROGRAM_URL	http://ctags.sourceforge.net	/official site/
-!_TAG_PROGRAM_VERSION	5.8	//
-RT::Extension::DebugTimers	Extension/DebugTimers.pm	3;"	p
diff --git a/lib/RT/Principal_Local.pm b/lib/RT/Principal_Local.pm
deleted file mode 100644
index b408a43..0000000
--- a/lib/RT/Principal_Local.pm
+++ /dev/null
@@ -1,98 +0,0 @@
-package RT::Principal;
-
-use strict;
-use warnings;
-no warnings 'redefine';
-
-our $_ACL_CACHE;
-
-sub HasRight {
-
-    my $self = shift;
-    my %args = ( Right        => undef,
-                 Object       => undef,
-                 EquivObjects => undef,
-                 @_,
-               );
-
-    # RT's SystemUser always has all rights
-    if ( $self->id == RT->SystemUser->id ) {
-        return 1;
-    }
-
-    if ( my $right = RT::ACE->CanonicalizeRightName( $args{'Right'} ) ) {
-        $args{'Right'} = $right;
-    } else {
-        $RT::Logger->error(
-               "Invalid right. Couldn't canonicalize right '$args{'Right'}'");
-        return undef;
-    }
-
-    return undef if $args{'Right'} eq 'ExecuteCode'
-        and RT->Config->Get('DisallowExecuteCode');
-
-    $args{'EquivObjects'} = [ @{ $args{'EquivObjects'} } ]
-        if $args{'EquivObjects'};
-
-    if ( $self->__Value('Disabled') ) {
-        $RT::Logger->debug(   "Disabled User #"
-                            . $self->id
-                            . " failed access check for "
-                            . $args{'Right'} );
-        return (undef);
-    }
-
-    if ( eval { $args{'Object'}->id } ) {
-        push @{ $args{'EquivObjects'} }, $args{'Object'};
-    } else {
-        $RT::Logger->crit("HasRight called with no valid object");
-        return (undef);
-    }
-
-    {
-        my $cached = $_ACL_CACHE->{
-            $self->id .';:;'. ref($args{'Object'}) .'-'. $args{'Object'}->id
-        };
-        return $cached->{'SuperUser'} || $cached->{ $args{'Right'} }
-            if $cached;
-    }
-
-    unshift @{ $args{'EquivObjects'} },
-        $args{'Object'}->ACLEquivalenceObjects;
-    unshift @{ $args{'EquivObjects'} }, $RT::System;
-
-    # If we've cached a win or loss for this lookup say so
-
-# Construct a hashkeys to cache decisions:
-# 1) full_hashkey - key for any result and for full combination of uid, right and objects
-# 2) short_hashkey - one key for each object to store positive results only, it applies
-# only to direct group rights and partly to role rights
-    my $full_hashkey = join (";:;", $self->id, $args{'Right'});
-    foreach ( @{ $args{'EquivObjects'} } ) {
-        my $ref_id = $self->_ReferenceId($_);
-        $full_hashkey .= ";:;".$ref_id;
-
-        my $short_hashkey = join(";:;", $self->id, $args{'Right'}, $ref_id);
-        my $cached_answer = $_ACL_CACHE->{ $short_hashkey };
-        return $cached_answer > 0 if defined $cached_answer;
-    }
-
-    {
-        my $cached_answer = $_ACL_CACHE->{ $full_hashkey };
-        return $cached_answer > 0 if defined $cached_answer;
-    }
-
-    my ( $hitcount, $via_obj ) = $self->_HasRight(%args);
-
-    $_ACL_CACHE->{ $full_hashkey } = $hitcount ? 1 : -1;
-    $_ACL_CACHE->{ join ';:;',  $self->id, $args{'Right'}, $via_obj } = 1
-        if $via_obj && $hitcount;
-
-    return ($hitcount);
-}
-
-
-
-
-1;
-

commit c26fc677b82fd869fc22b66690cbdb89dd7e0de4
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Feb 13 14:52:14 2019 -0500

    Add callback to log time info

diff --git a/html/Callbacks/DebugTimers/autohandler/Final b/html/Callbacks/DebugTimers/autohandler/Final
new file mode 100644
index 0000000..daec900
--- /dev/null
+++ b/html/Callbacks/DebugTimers/autohandler/Final
@@ -0,0 +1,16 @@
+<%INIT>
+my $time = Time::HiRes::tv_interval( $HTML::Mason::Commands::m->{'rt_base_time'} );
+
+# Default is 40 seconds, current default for FcgidIOTimeout
+my $time_threshold = defined RT::Config->Get('LongRequestThreshold') ?
+    RT::Config->Get('LongRequestThreshold') : 40;
+
+use Data::Dumper;
+my $request_args = $HTML::Mason::Commands::m->request_args;
+
+RT::Logger->debug(
+    $HTML::Mason::Commands::session{'CurrentUser'}->Name . " made a request that took: " . $time . " seconds\n"
+    . "Request URL: " . $HTML::Mason::Commands::m->request_comp->path . " \n"
+    . "Query args: " . Dumper($request_args)
+) if $time >= $time_threshold;
+</%INIT>

commit 835aaf4cd3ffce52c1cc5212dfd04bd73049ced1
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Feb 13 14:52:32 2019 -0500

    Update docs

diff --git a/README b/README
index f969be2..f76e53d 100644
--- a/README
+++ b/README
@@ -2,8 +2,9 @@ NAME
     RT-Extension-DebugTimers - Add detailed timers to debug performance
 
 DESCRIPTION
-    This extension provides overlays with additional timers to easily see
-    where time is going during RT page loads.
+    This extension provides timing and user information in RT's logs to help
+    determine which requests by which users may be experiencing slow load
+    times. It also enables a page timer in the footer on all RT pages.
 
 RT VERSION
     Works with RT 4.4
@@ -15,7 +16,7 @@ INSTALLATION
         May need root permissions
 
     Edit your /opt/rt4/etc/RT_SiteConfig.pm
-        If you are using RT 4.2 or greater, add this line:
+        Add this line:
 
             Plugin('RT::Extension::DebugTimers');
 
@@ -24,6 +25,15 @@ INSTALLATION
 
     Restart your webserver
 
+CONFIGURATION
+  When to log time information
+    To log timing and request information for only requests that take over
+    some number of seconds, add:
+
+        Set($LongRequestThreshold, 3);
+
+    to RT_SiteConfig.pm. The default value is 40 seconds.
+
 AUTHOR
     Best Practical Solutions, LLC <modules at bestpractical.com>
 
diff --git a/lib/RT/Extension/DebugTimers.pm b/lib/RT/Extension/DebugTimers.pm
index 16a4dbf..b57daa1 100644
--- a/lib/RT/Extension/DebugTimers.pm
+++ b/lib/RT/Extension/DebugTimers.pm
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 package RT::Extension::DebugTimers;
 
-our $VERSION = '0.01';
+our $VERSION = '0.02';
 
 RT->AddStyleSheets('debug-timers.css');
 
@@ -12,8 +12,9 @@ RT-Extension-DebugTimers - Add detailed timers to debug performance
 
 =head1 DESCRIPTION
 
-This extension provides overlays with additional timers to easily see
-where time is going during RT page loads.
+This extension provides timing and user information in RT's logs
+to help determine which requests by which users may be experiencing slow
+load times. It also enables a page timer in the footer on all RT pages.
 
 =head1 RT VERSION
 
@@ -33,7 +34,7 @@ May need root permissions
 
 =item Edit your F</opt/rt4/etc/RT_SiteConfig.pm>
 
-If you are using RT 4.2 or greater, add this line:
+Add this line:
 
     Plugin('RT::Extension::DebugTimers');
 
@@ -45,6 +46,17 @@ If you are using RT 4.2 or greater, add this line:
 
 =back
 
+=head1 CONFIGURATION
+
+=head2 When to log time information
+
+To log timing and request information for only requests that take over
+some number of seconds, add:
+
+    Set($LongRequestThreshold, 3);
+
+to C<RT_SiteConfig.pm>. The default value is 40 seconds.
+
 =head1 AUTHOR
 
 Best Practical Solutions, LLC E<lt>modules at bestpractical.comE<gt>

commit 38e7787c588f3e351745db22fe55f446183b64a9
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Feb 13 14:54:06 2019 -0500

    Prep for version 0.02

diff --git a/Changes b/Changes
index 30192bd..086a2f8 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,4 @@
 Revision history for RT-Extension-DebugTimers
 
-0.01 [Release Date]
- - Initial version
+0.02 2019-02-13
+ - Initial version with user info
diff --git a/MANIFEST b/MANIFEST
new file mode 100644
index 0000000..0ff7d7e
--- /dev/null
+++ b/MANIFEST
@@ -0,0 +1,21 @@
+Changes
+html/Callbacks/DebugTimers/autohandler/Final
+inc/Module/Install.pm
+inc/Module/Install/Base.pm
+inc/Module/Install/Can.pm
+inc/Module/Install/Fetch.pm
+inc/Module/Install/Include.pm
+inc/Module/Install/Makefile.pm
+inc/Module/Install/Metadata.pm
+inc/Module/Install/ReadmeFromPod.pm
+inc/Module/Install/RTx.pm
+inc/Module/Install/RTx/Runtime.pm
+inc/Module/Install/Win32.pm
+inc/Module/Install/WriteAll.pm
+inc/YAML/Tiny.pm
+lib/RT/Extension/DebugTimers.pm
+Makefile.PL
+MANIFEST			This list of files
+META.yml
+README
+static/css/debug-timers.css
diff --git a/META.yml b/META.yml
index 1a0c5b2..8b2e43a 100644
--- a/META.yml
+++ b/META.yml
@@ -24,7 +24,7 @@ requires:
 resources:
   license: http://opensource.org/licenses/gpl-license.php
   repository: https://github.com/bestpractical/rt-extension-debugtimers
-version: '0.01'
+version: '0.02'
 x_module_install_rtx_version: '0.40'
 x_requires_rt: 4.2.0
 x_rt_too_new: 4.6.0

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list