[Bps-public-commit] rt-extension-automaticassignment branch, master, updated. 87a2b8f487f806cce79dfb042dbd86ab9cc49062

? sunnavy sunnavy at bestpractical.com
Tue Jul 28 17:05:31 EDT 2020


The branch, master has been updated
       via  87a2b8f487f806cce79dfb042dbd86ab9cc49062 (commit)
       via  813f8af92af29761963a5cf8390676fde239d8c4 (commit)
       via  ec30df70546712d55465b8adcf715349fccee481 (commit)
       via  0cb4c7282bbf08cf75ddbc481bb9dc36f7d23316 (commit)
       via  5e10186abbe31e0f3f9f002ff1a97384b2902c72 (commit)
       via  32f20554e9848f98e7cad0c93871e2a360213b56 (commit)
      from  cb616a965a5d0261809f14cc23fb5405d7fda7e5 (commit)

Summary of changes:
 Changes                                         |  3 +++
 MANIFEST                                        |  4 +++
 META.yml                                        |  4 +--
 Makefile.PL                                     |  4 +--
 README                                          |  2 +-
 inc/Module/Install/RTx.pm                       | 36 ++++++++++++++++++-------
 lib/RT/Extension/AutomaticAssignment.pm         |  4 +--
 lib/RT/Extension/AutomaticAssignment/Test.pm.in |  2 +-
 8 files changed, 41 insertions(+), 18 deletions(-)

- Log -----------------------------------------------------------------
commit 32f20554e9848f98e7cad0c93871e2a360213b56
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Jul 28 21:38:15 2020 +0800

    Update M:I:RTx

diff --git a/META.yml b/META.yml
index 3d6977b..52ae464 100644
--- a/META.yml
+++ b/META.yml
@@ -27,6 +27,6 @@ requires:
 resources:
   license: http://opensource.org/licenses/gpl-license.php
 version: '0.03'
-x_module_install_rtx_version: '0.40'
+x_module_install_rtx_version: '0.42'
 x_requires_rt: '4.2'
 x_rt_too_new: '4.6'
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index 7cad529..2dd9489 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -6,9 +6,10 @@ use strict;
 use warnings;
 no warnings 'once';
 
+use Term::ANSIColor qw(:constants);
 use Module::Install::Base;
 use base 'Module::Install::Base';
-our $VERSION = '0.40';
+our $VERSION = '0.42';
 
 use FindBin;
 use File::Glob     ();
@@ -53,7 +54,7 @@ sub RTx {
         my @look = @INC;
         unshift @look, grep {defined and -d $_} @try;
         push @look, grep {defined and -d $_}
-            map { ( "$_/rt4/lib", "$_/lib/rt4", "$_/lib" ) } @prefixes;
+            map { ( "$_/rt5/lib", "$_/lib/rt5", "$_/rt4/lib", "$_/lib/rt4", "$_/lib" ) } @prefixes;
         last if eval {local @INC = @look; require RT; $RT::LocalLibPath};
 
         warn
@@ -76,6 +77,22 @@ sub RTx {
         $self->requires_rt('4.0.0');
     }
 
+    my $package = $name;
+    $package =~ s/-/::/g;
+    if ( $RT::CORED_PLUGINS{$package} ) {
+        my ($base_version) = $RT::VERSION =~ /(\d+\.\d+\.\d+)/;
+        die RED, <<"EOT";
+
+**** Error: Your installed version of RT ($RT::VERSION) already
+            contains this extension in core, so you don't need to
+            install it.
+
+            Check https://docs.bestpractical.com/rt/$base_version/RT_Config.html
+            to configure it.
+
+EOT
+    }
+
     # Installation locations
     my %path;
     my $plugin_path;
@@ -223,7 +240,7 @@ sub requires_rt {
     my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
 
     if ($sorted[-1] eq $version) {
-        die <<"EOT";
+        die RED, <<"EOT";
 
 **** Error: This extension requires RT $version. Your installed version
             of RT ($RT::VERSION) is too old.
@@ -249,12 +266,12 @@ sub requires_rt_plugin {
         unshift @INC, $path;
     } else {
         my $name = $self->name;
-        warn <<"EOT";
+        my $msg = <<"EOT";
 
 **** Warning: $name requires that the $plugin plugin be installed and
               enabled; it does not appear to be installed.
-
 EOT
+        warn RED, $msg, RESET, "\n";
     }
     $self->requires(@_);
 }
@@ -264,9 +281,8 @@ sub rt_too_new {
     my $name = $self->name;
     $msg ||= <<EOT;
 
-**** Error: Your installed version of RT (%s) is too new; this extension
-            only works with versions older than %s.
-
+**** Warning: Your installed version of RT (%s) is too new; this extension
+              has not been tested on your version of RT and may not work as expected.
 EOT
     $self->add_metadata("x_rt_too_new", $version) if $self->is_admin;
 
@@ -274,7 +290,7 @@ EOT
     my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
 
     if ($sorted[0] eq $version) {
-        die sprintf($msg,$RT::VERSION,$version);
+        warn RED, sprintf($msg,$RT::VERSION), RESET, "\n";
     }
 }
 
@@ -297,4 +313,4 @@ sub _load_rt_handle {
 
 __END__
 
-#line 468
+#line 484

commit 5e10186abbe31e0f3f9f002ff1a97384b2902c72
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Jul 28 21:38:25 2020 +0800

    Add "." to @INC for perl 5.26+

diff --git a/Makefile.PL b/Makefile.PL
index 6c03aa5..c35943e 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,3 +1,4 @@
+use lib '.';
 use inc::Module::Install;
 
 RTx 'RT-Extension-AutomaticAssignment';

commit 0cb4c7282bbf08cf75ddbc481bb9dc36f7d23316
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Jul 28 21:39:53 2020 +0800

    Update copyright year to 2020

diff --git a/README b/README
index 23bbd7d..a74d0ef 100644
--- a/README
+++ b/README
@@ -92,7 +92,7 @@ BUGS
         L<rt.cpan.org|http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-AutomaticAssignment>.
 
 COPYRIGHT
-    This extension is Copyright (C) 2016 Best Practical Solutions, LLC.
+    This extension is Copyright (C) 2016-2020 Best Practical Solutions, LLC.
 
     This is free software, licensed under:
 
diff --git a/lib/RT/Extension/AutomaticAssignment.pm b/lib/RT/Extension/AutomaticAssignment.pm
index 17fd5e2..f56e3a9 100644
--- a/lib/RT/Extension/AutomaticAssignment.pm
+++ b/lib/RT/Extension/AutomaticAssignment.pm
@@ -322,7 +322,7 @@ or via the web at
 
 =head1 COPYRIGHT
 
-This extension is Copyright (C) 2016 Best Practical Solutions, LLC.
+This extension is Copyright (C) 2016-2020 Best Practical Solutions, LLC.
 
 This is free software, licensed under:
 

commit ec30df70546712d55465b8adcf715349fccee481
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Jul 29 04:50:23 2020 +0800

    Fix signature process
    
    "sign" needs to be before "WriteAll"

diff --git a/Makefile.PL b/Makefile.PL
index c35943e..7f4e902 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -28,6 +28,5 @@ substitute(
     'lib/RT/Extension/AutomaticAssignment/Test.pm',
 );
 
-WriteAll;
 sign;
-
+WriteAll;

commit 813f8af92af29761963a5cf8390676fde239d8c4
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Jul 29 03:59:11 2020 +0800

    Fix test warnings of "Sunday should be specified as day 0"

diff --git a/lib/RT/Extension/AutomaticAssignment/Test.pm.in b/lib/RT/Extension/AutomaticAssignment/Test.pm.in
index 6c4759d..365e4a8 100644
--- a/lib/RT/Extension/AutomaticAssignment/Test.pm.in
+++ b/lib/RT/Extension/AutomaticAssignment/Test.pm.in
@@ -57,7 +57,7 @@ Set(%ServiceBusinessHours, (
     },
     'Weekend' => {
         6 => { Name => 'Saturday',  Start => '08:00', End => '18:00' },
-        7 => { Name => 'Sunday',    Start => '08:00', End => '18:00' },
+        0 => { Name => 'Sunday',    Start => '08:00', End => '18:00' },
         holidays => \@Holidays,
     },
 ));

commit 87a2b8f487f806cce79dfb042dbd86ab9cc49062
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Jul 29 04:59:22 2020 +0800

    Prep 0.04

diff --git a/Changes b/Changes
index c6636dd..465fcd1 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+0.04  2020-07-27
+    - Add user-defined choosers and filters
+
 0.03  2016-09-09
     - remove "from initial collection" debug log
 
diff --git a/MANIFEST b/MANIFEST
index dd10da7..b213aaf 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -6,9 +6,11 @@ html/Admin/Queues/Elements/Chooser/ActiveTickets
 html/Admin/Queues/Elements/Chooser/Random
 html/Admin/Queues/Elements/Chooser/RoundRobin
 html/Admin/Queues/Elements/Chooser/TimeLeft
+html/Admin/Queues/Elements/Chooser/UserDefined
 html/Admin/Queues/Elements/Filter/ExcludedDates
 html/Admin/Queues/Elements/Filter/MemberOfGroup
 html/Admin/Queues/Elements/Filter/MemberOfRole
+html/Admin/Queues/Elements/Filter/UserDefined
 html/Admin/Queues/Elements/Filter/WorkSchedule
 html/Admin/Queues/Elements/SortableBox
 html/Callbacks/AutomaticAssignment/Elements/Tabs/PrivilegedQueue
@@ -37,10 +39,12 @@ lib/RT/Extension/AutomaticAssignment/Chooser/ActiveTickets.pm
 lib/RT/Extension/AutomaticAssignment/Chooser/Random.pm
 lib/RT/Extension/AutomaticAssignment/Chooser/RoundRobin.pm
 lib/RT/Extension/AutomaticAssignment/Chooser/TimeLeft.pm
+lib/RT/Extension/AutomaticAssignment/Chooser/UserDefined.pm
 lib/RT/Extension/AutomaticAssignment/Filter.pm
 lib/RT/Extension/AutomaticAssignment/Filter/ExcludedDates.pm
 lib/RT/Extension/AutomaticAssignment/Filter/MemberOfGroup.pm
 lib/RT/Extension/AutomaticAssignment/Filter/MemberOfRole.pm
+lib/RT/Extension/AutomaticAssignment/Filter/UserDefined.pm
 lib/RT/Extension/AutomaticAssignment/Filter/WorkSchedule.pm
 lib/RT/Extension/AutomaticAssignment/Test.pm
 lib/RT/Extension/AutomaticAssignment/Test.pm.in
diff --git a/META.yml b/META.yml
index 52ae464..d3a4095 100644
--- a/META.yml
+++ b/META.yml
@@ -26,7 +26,7 @@ requires:
   perl: 5.8.3
 resources:
   license: http://opensource.org/licenses/gpl-license.php
-version: '0.03'
+version: '0.04'
 x_module_install_rtx_version: '0.42'
 x_requires_rt: '4.2'
 x_rt_too_new: '4.6'
diff --git a/lib/RT/Extension/AutomaticAssignment.pm b/lib/RT/Extension/AutomaticAssignment.pm
index f56e3a9..ae01bb5 100644
--- a/lib/RT/Extension/AutomaticAssignment.pm
+++ b/lib/RT/Extension/AutomaticAssignment.pm
@@ -2,7 +2,7 @@ package RT::Extension::AutomaticAssignment;
 use strict;
 use warnings;
 
-our $VERSION = '0.03';
+our $VERSION = '0.04';
 
 RT->AddJavaScript('jquery.ui.sortable.js');
 

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


More information about the Bps-public-commit mailing list