[Bps-public-commit] rt-extension-excelfeed branch master updated. 0.06-5-g2fc9c1c

BPS Git Server git at git.bestpractical.com
Tue Apr 5 16:08:47 UTC 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt-extension-excelfeed".

The branch, master has been updated
       via  2fc9c1c122a68b1618072d7868cc351a70606459 (commit)
       via  ddd11f7bcda20fcb34a941b7d5dc9de4b50a1a9e (commit)
       via  37f2450d08779dd764d970fb508a9c315a03a792 (commit)
       via  40d10aa4d66181203bb67442bfd941a277527fd1 (commit)
       via  9e19923a7f2d1327438cf44a399f82f3cda2701b (commit)
      from  21c7262afea2b5a3705c0570ee89dca7728e039f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2fc9c1c122a68b1618072d7868cc351a70606459
Merge: 21c7262 ddd11f7
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Apr 5 23:54:49 2022 +0800

    Merge branch 'user-context-cfs'


commit ddd11f7bcda20fcb34a941b7d5dc9de4b50a1a9e
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Sep 6 16:59:59 2019 -0400

    Prep 0.07

diff --git a/Changes b/Changes
index e92e7df..533c349 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,8 @@
+
+0.07 2022-04-04
+ - Update Dashboard Mailer method with changes from RT
+ - Update MSExcel checkbox on dashboard subscription page for RT 5
+
 0.06 2020-07-17
  - Make it work for RT 5.0
  - Fix "Current Search" menu
diff --git a/MANIFEST b/MANIFEST
index 85126d4..1f80376 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,7 +1,4 @@
 Changes
-etc/chart_callback.patch
-etc/subscription_callbacks.patch
-etc/tabs_privileged_callback.patch
 html/Callbacks/RT-Extension-ExcelFeed/Dashboards/Subscription.html/MassageSubscriptionFields
 html/Callbacks/RT-Extension-ExcelFeed/Dashboards/Subscription.html/SubscriptionFields
 html/Callbacks/RT-Extension-ExcelFeed/Dashboards/Subscription.html/SubscriptionFormEnd
diff --git a/META.yml b/META.yml
index 41e58ba..6fafd10 100644
--- a/META.yml
+++ b/META.yml
@@ -16,7 +16,6 @@ meta-spec:
 name: RT-Extension-ExcelFeed
 no_index:
   directory:
-    - etc
     - html
     - inc
 requires:
@@ -24,7 +23,7 @@ requires:
   perl: 5.10.1
 resources:
   license: http://opensource.org/licenses/gpl-license.php
-version: '0.06'
+version: '0.07'
 x_module_install_rtx_version: '0.43'
-x_requires_rt: 4.2.10
+x_requires_rt: 4.4.5
 x_rt_too_new: 5.2.0
diff --git a/Makefile.PL b/Makefile.PL
index 41c1ea5..9b82aa4 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -7,7 +7,7 @@ readme_from 'lib/RT/Extension/ExcelFeed.pm';
 license  'gplv2';
 
 requires 'Excel::Writer::XLSX';
-requires_rt '4.2.10';
+requires_rt '4.4.5';
 rt_too_new '5.2.0';
 
 sign;
diff --git a/README b/README
index 71bdec1..de75911 100644
--- a/README
+++ b/README
@@ -10,7 +10,10 @@ DESCRIPTION
     files rather than inline HTML reports.
 
 RT VERSION
-    Works with RT 4.2.10+, 4.4, 5.0
+    Works with RT 4.4.5, 5.0.2
+
+    Updates are made in version 0.07 for compatibility with RT 4.4.5 and
+    5.0.2. To run with earlier versions of RT, use version 0.06.
 
 INSTALLATION
     "perl Makefile.PL"
@@ -18,25 +21,6 @@ INSTALLATION
     "make install"
         May need root permissions
 
-    patch RT
-        The following patches are also needed for RT prior to 4.4.2. Note
-        the versions and only apply the patches needed for your version.
-
-        Only run these the first time you install this module. If upgrading,
-        install any patches that were not previously applied.
-
-        Apply for both 4.2 and 4.4.0. Not needed for 4.4.1:
-
-            patch -p1 -d /path/to/rt < etc/subscription_callbacks.patch
-
-        Apply for 4.2 and 4.4.0. Not needed for 4.2.13 or later, or 4.4.1.
-
-            patch -p1 -d /path/to/rt < etc/chart_callback.patch
-
-        Apply for 4.2, 4.4.0 and 4.4.1:
-
-            patch -p1 -d /path/to/rt < etc/tabs_privileged_callback.patch
-
     Add this line to /opt/rt5/etc/RT_SiteConfig.pm
             Plugin('RT::Extension::ExcelFeed');
 
diff --git a/etc/chart_callback.patch b/etc/chart_callback.patch
deleted file mode 100644
index a8c2817..0000000
--- a/etc/chart_callback.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/share/html/Search/Elements/Chart b/share/html/Search/Elements/Chart
-index 6285fac..eb46cf8 100644
---- a/share/html/Search/Elements/Chart
-+++ b/share/html/Search/Elements/Chart
-@@ -84,6 +84,8 @@ my $query_string = $m->comp('/Elements/QueryString', %ARGS, GroupBy => \@GroupBy
- <& ChartTable, %ARGS, Table => { $report->FormatTable( %columns ) } &>
- % }
- 
-+% $m->callback( CallbackName => 'AfterChartTable', ARGSRef => \%ARGS );
-+
- % if ( ($ChartStyle || '') =~ /\bsql\b/ ) {
- <div class="query"><span class="label"><% loc('Query') %>:</span><span class="value"><% $Query %></span></div>
- % }
diff --git a/etc/subscription_callbacks.patch b/etc/subscription_callbacks.patch
deleted file mode 100644
index cf17c8e..0000000
--- a/etc/subscription_callbacks.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-diff --git a/share/html/Dashboards/Subscription.html b/share/html/Dashboards/Subscription.html
-index 3bf39d0..f31cd90 100644
---- a/share/html/Dashboards/Subscription.html
-+++ b/share/html/Dashboards/Subscription.html
-@@ -176,6 +176,8 @@
- <input name="Recipient" id="Recipient" size="30" value="<%$fields{Recipient} ? $fields{Recipient} : ''%>" />
- <div class="hints"><% loc("Leave blank to send to your current email address ([_1])", $session{'CurrentUser'}->EmailAddress) %></div>
- </td></tr>
-+% $m->callback( %ARGS, CallbackName => 'SubscriptionFormEnd', FieldsRef => \%fields,
-+%     SubscriptionObj => $SubscriptionObj, DashboardObj => $Dashboard );
- </table>
- </&>
- </td>
-@@ -216,6 +218,9 @@ my %fields = (
-     Counter     => 0,
- );
- 
-+$m->callback( %ARGS, CallbackName => 'SubscriptionFields', FieldsRef => \%fields,
-+     SubscriptionObj => $SubscriptionObj, DashboardObj => $Dashboard);
-+
- # update any fields with the values from the subscription object
- if ($SubscriptionObj) {
-     for my $field (keys %fields) {
-@@ -230,6 +235,8 @@ for my $field (keys %fields) {
-         if defined($ARGS{$field});
- }
- 
-+$m->callback( %ARGS, CallbackName => 'MassageSubscriptionFields', FieldsRef => \%fields,
-+     SubscriptionObj => $SubscriptionObj, DashboardObj => $Dashboard);
- 
- # this'll be defined on submit
- if (defined $ARGS{Save}) {
diff --git a/etc/tabs_privileged_callback.patch b/etc/tabs_privileged_callback.patch
deleted file mode 100644
index 493c0f8..0000000
--- a/etc/tabs_privileged_callback.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
-index c6c6505..d4b2e59 100644
---- a/share/html/Elements/Tabs
-+++ b/share/html/Elements/Tabs
-@@ -757,6 +757,9 @@ my $build_main_nav = sub {
-         }
-     }
- 
-+    # Scope here so we can share in the Privileged callback
-+    my $args      = '';
-+    my $has_query = '';
-     if (
-         (
-                $request_path =~ m{^/(?:Ticket|Search)/}
-@@ -767,8 +770,6 @@ my $build_main_nav = sub {
-       )
-     {
-         my $search = Menu()->child('search')->child('tickets');
--        my $args      = '';
--        my $has_query = '';
-         my $current_search = $session{"CurrentSearchHash"} || {};
-         my $search_id = $DECODED_ARGS->{'SavedSearchLoad'} || $DECODED_ARGS->{'SavedSearchId'} || $current_search->{'SearchId'} || '';
-         my $chart_id = $DECODED_ARGS->{'SavedChartSearchId'} || $current_search->{SavedChartSearchId};
-@@ -936,7 +937,7 @@ my $build_main_nav = sub {
-         PageMenu()->child( edit => title => loc('Edit'), path => '/Prefs/MyRT.html' );
-     }
- 
--    $m->callback( CallbackName => 'Privileged', Path => $request_path );
-+    $m->callback( CallbackName => 'Privileged', Path => $request_path, Search_Args => $args, Has_Query => $has_query );
- };
- 
- my $build_selfservice_nav = sub {
diff --git a/lib/RT/Extension/ExcelFeed.pm b/lib/RT/Extension/ExcelFeed.pm
index 3370686..7c56a7a 100644
--- a/lib/RT/Extension/ExcelFeed.pm
+++ b/lib/RT/Extension/ExcelFeed.pm
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 package RT::Extension::ExcelFeed;
 
-our $VERSION = '0.06';
+our $VERSION = '0.07';
 
 =head1 NAME
 
@@ -19,7 +19,10 @@ inline HTML reports.
 
 =head1 RT VERSION
 
-Works with RT 4.2.10+, 4.4, 5.0
+Works with RT 4.4.5, 5.0.2
+
+Updates are made in version 0.07 for compatibility with RT 4.4.5 and 5.0.2.
+To run with earlier versions of RT, use version 0.06.
 
 =head1 INSTALLATION
 
@@ -33,26 +36,6 @@ Works with RT 4.2.10+, 4.4, 5.0
 
 May need root permissions
 
-=item patch RT
-
-The following patches are also needed for RT prior to 4.4.2. Note the
-versions and only apply the patches needed for your version.
-
-Only run these the first time you install this module. If upgrading, install
-any patches that were not previously applied.
-
-Apply for both 4.2 and 4.4.0. Not needed for 4.4.1:
-
-    patch -p1 -d /path/to/rt < etc/subscription_callbacks.patch
-
-Apply for 4.2 and 4.4.0. Not needed for 4.2.13 or later, or 4.4.1.
-
-    patch -p1 -d /path/to/rt < etc/chart_callback.patch
-
-Apply for 4.2, 4.4.0 and 4.4.1:
-
-    patch -p1 -d /path/to/rt < etc/tabs_privileged_callback.patch
-
 =item Add this line to F</opt/rt5/etc/RT_SiteConfig.pm>
 
     Plugin('RT::Extension::ExcelFeed');

commit 37f2450d08779dd764d970fb508a9c315a03a792
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Apr 5 23:52:56 2022 +0800

    Update M:I:RTx

diff --git a/META.yml b/META.yml
index 79c4fdc..41e58ba 100644
--- a/META.yml
+++ b/META.yml
@@ -25,6 +25,6 @@ requires:
 resources:
   license: http://opensource.org/licenses/gpl-license.php
 version: '0.06'
-x_module_install_rtx_version: '0.42'
+x_module_install_rtx_version: '0.43'
 x_requires_rt: 4.2.10
 x_rt_too_new: 5.2.0
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index 2dd9489..2889ece 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -9,7 +9,7 @@ no warnings 'once';
 use Term::ANSIColor qw(:constants);
 use Module::Install::Base;
 use base 'Module::Install::Base';
-our $VERSION = '0.42';
+our $VERSION = '0.43';
 
 use FindBin;
 use File::Glob     ();
@@ -134,7 +134,7 @@ lexicons ::
     if( $extra_args->{'remove_files'} ){
         $self->include('Module::Install::RTx::Remove');
         our @remove_files;
-        eval { require "etc/upgrade/remove_files" }
+        eval { require "./etc/upgrade/remove_files" }
           or print "No remove file located, no files to remove\n";
         $remove_files = join ",", map {"q(\$(DESTDIR)$plugin_path/$name/$_)"} @remove_files;
     }

commit 40d10aa4d66181203bb67442bfd941a277527fd1
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Apr 5 22:37:12 2022 +0800

    Update MSExcel checkbox on dashboard subscription page for RT 5

diff --git a/html/Callbacks/RT-Extension-ExcelFeed/Dashboards/Subscription.html/SubscriptionFormEnd b/html/Callbacks/RT-Extension-ExcelFeed/Dashboards/Subscription.html/SubscriptionFormEnd
index f4a87ea..adf7349 100644
--- a/html/Callbacks/RT-Extension-ExcelFeed/Dashboards/Subscription.html/SubscriptionFormEnd
+++ b/html/Callbacks/RT-Extension-ExcelFeed/Dashboards/Subscription.html/SubscriptionFormEnd
@@ -1,9 +1,21 @@
+% if ( RT::Handle::cmp_version($RT::VERSION, '5.0.0') < 0 ) {
 <tr><td class="label">
 <&|/l&>Microsoft Excel Attachment</&>:
 </td><td class="value">
 <input type="checkbox" id="MSExcel" name="MSExcel" value="selected" <% $FieldsRef->{'MSExcel'} eq 'selected' ? 'checked="checked"' : "" |n %>></input>
 <label for="MSExcel"><&|/l&>Send reports as attached Microsoft Excel (.xlsx) files</&></label>
 </td></tr>
+% } else {
+<div class="form-row">
+  <div class="col-3 label"></div>
+  <div class="col-9 value">
+    <div class="custom-control custom-checkbox">
+      <input type="checkbox" id="MSExcel" name="MSExcel" class="custom-control-input" value="selected" <% $FieldsRef->{'MSExcel'} ? 'checked="checked"' : "" |n %>>
+      <label class="custom-control-label" for="MSExcel"><&|/l&>Send reports as attached Microsoft Excel (.xlsx) files</&></label>
+    </div>
+  </div>
+</div>
+% }
 <%ARGS>
 $FieldsRef
 $SubscriptionObj

commit 9e19923a7f2d1327438cf44a399f82f3cda2701b
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Tue Sep 3 17:18:51 2019 -0400

    Update dashboard mailer with user context changes

diff --git a/lib/RT/Dashboard/Mailer_Vendor.pm b/lib/RT/Dashboard/Mailer_Vendor.pm
index 09a8875..d0fe02c 100644
--- a/lib/RT/Dashboard/Mailer_Vendor.pm
+++ b/lib/RT/Dashboard/Mailer_Vendor.pm
@@ -57,6 +57,7 @@ sub SendDashboard {
     my $self = shift;
     my %args = (
         CurrentUser  => undef,
+        ContextUser  => undef,
         Email        => undef,
         Subscription => undef,
         DryRun       => 0,
@@ -64,8 +65,8 @@ sub SendDashboard {
     );
 
     my $currentuser  = $args{CurrentUser};
+    my $context_user = $args{ContextUser} || $currentuser;
     my $subscription = $args{Subscription};
-
     my $rows = $subscription->SubValue('Rows');
 
     my $DashboardId = $subscription->SubValue('DashboardId');
@@ -82,17 +83,19 @@ sub SendDashboard {
         );
     }
 
-    $RT::Logger->debug('Generating dashboard "'.$dashboard->Name.'" for user "'.$currentuser->Name.'":');
+    $RT::Logger->debug('Generating dashboard "'.$dashboard->Name.'" for user "'.$context_user->Name.'":');
 
     if ($args{DryRun}) {
         print << "SUMMARY";
     Dashboard: @{[ $dashboard->Name ]}
-    User:   @{[ $currentuser->Name ]} <$args{Email}>
+    Subscription Owner: @{[ $currentuser->Name ]}
+    Recipient: <$args{Email}>
 SUMMARY
         return;
     }
 
     local $HTML::Mason::Commands::session{CurrentUser} = $currentuser;
+    local $HTML::Mason::Commands::session{ContextUser} = $context_user;
     local $HTML::Mason::Commands::r = RT::Dashboard::FakeRequest->new;
 
     my $HasResults = undef;
@@ -125,7 +128,7 @@ SUMMARY
         . $dashboard->Name . "</p>";
 
         my @searches = $dashboard->Searches();
-
+        local $HTML::Mason::Commands::session{CurrentUser} = $context_user;
         # Run each search and push the resulting file into the @attachments array
         foreach my $search (@searches){
             my $search_content = $search->{'Attribute'}->Content;

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

Summary of changes:
 Changes                                            |  5 ++++
 MANIFEST                                           |  3 --
 META.yml                                           |  7 ++---
 Makefile.PL                                        |  2 +-
 README                                             | 24 +++-------------
 etc/chart_callback.patch                           | 13 ---------
 etc/subscription_callbacks.patch                   | 32 ----------------------
 etc/tabs_privileged_callback.patch                 | 32 ----------------------
 .../Subscription.html/SubscriptionFormEnd          | 12 ++++++++
 inc/Module/Install/RTx.pm                          |  4 +--
 lib/RT/Dashboard/Mailer_Vendor.pm                  | 11 +++++---
 lib/RT/Extension/ExcelFeed.pm                      | 27 ++++--------------
 12 files changed, 39 insertions(+), 133 deletions(-)
 delete mode 100644 etc/chart_callback.patch
 delete mode 100644 etc/subscription_callbacks.patch
 delete mode 100644 etc/tabs_privileged_callback.patch


hooks/post-receive
-- 
rt-extension-excelfeed


More information about the Bps-public-commit mailing list