[Bps-public-commit] rt-extension-timetracking branch, master, updated. 0.09-19-g3a3308b
? sunnavy
sunnavy at bestpractical.com
Fri Jul 24 17:27:11 EDT 2020
The branch, master has been updated
via 3a3308b8ebca413ed9e60be6912065a2a1cf67ad (commit)
via 87b6ee19550ac0edd5ca6bc6108ab4accbf50502 (commit)
via 96b54a14093c86fb444f0aca20f4e6d6b4a0d391 (commit)
via fff09a979816254668f01c2276387f90ed3fce34 (commit)
via 4e57205026992274752dfef2ddb047360ded6deb (commit)
via ec2abad4cfed02810718490e3cebf7c56fd2a7ef (commit)
from ce34742346c170d749f25d8ec0a0b8949dd7fded (commit)
Summary of changes:
Changes | 3 +
MANIFEST | 1 -
META.yml | 6 +-
Makefile.PL | 3 +-
README | 13 ++---
...cfs-on-ticket-creation-and-updates-with-U.patch | 68 ----------------------
inc/Module/Install/RTx.pm | 36 ++++++++----
lib/RT/Extension/TimeTracking.pm | 16 ++---
lib/RT/Extension/TimeTracking/Test.pm.in | 2 +-
9 files changed, 44 insertions(+), 104 deletions(-)
delete mode 100644 etc/0001-handle-txn-cfs-on-ticket-creation-and-updates-with-U.patch
- Log -----------------------------------------------------------------
commit ec2abad4cfed02810718490e3cebf7c56fd2a7ef
Author: sunnavy <sunnavy at bestpractical.com>
Date: Sat Jul 25 05:00:55 2020 +0800
Update M:I:RTx
diff --git a/META.yml b/META.yml
index 34c2f5b..a28f8e3 100644
--- a/META.yml
+++ b/META.yml
@@ -27,5 +27,5 @@ resources:
license: http://opensource.org/licenses/gpl-license.php
repository: https://github.com/bestpractical/rt-extension-timetracking
version: '0.11'
-x_module_install_rtx_version: '0.40'
+x_module_install_rtx_version: '0.42'
x_requires_rt: 4.2.0
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 4e57205026992274752dfef2ddb047360ded6deb
Author: sunnavy <sunnavy at bestpractical.com>
Date: Sat Jul 25 05:01:09 2020 +0800
Add "." to @INC for perl 5.26+
diff --git a/Makefile.PL b/Makefile.PL
index a6051fc..fb781b0 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,3 +1,4 @@
+use lib '.';
use inc::Module::Install;
RTx 'RT-Extension-TimeTracking';
commit fff09a979816254668f01c2276387f90ed3fce34
Author: sunnavy <sunnavy at bestpractical.com>
Date: Sat Jul 25 05:08:16 2020 +0800
Require RT 5 and update docs accordingly
diff --git a/META.yml b/META.yml
index a28f8e3..09370ed 100644
--- a/META.yml
+++ b/META.yml
@@ -28,4 +28,4 @@ resources:
repository: https://github.com/bestpractical/rt-extension-timetracking
version: '0.11'
x_module_install_rtx_version: '0.42'
-x_requires_rt: 4.2.0
+x_requires_rt: 5.0.0
diff --git a/Makefile.PL b/Makefile.PL
index fb781b0..64655f0 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -3,7 +3,7 @@ use inc::Module::Install;
RTx 'RT-Extension-TimeTracking';
repository('https://github.com/bestpractical/rt-extension-timetracking');
-requires_rt '4.2.0';
+requires_rt '5.0.0';
my ($lp) = ($INC{'RT.pm'} =~ /^(.*)[\\\/]/);
my $lib_path = join( ' ', "$RT::LocalPath/lib", $lp );
diff --git a/README b/README
index 06f2b7b..b7269ed 100644
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ NAME
RT-Extension-TimeTracking - Time Tracking Extension
RT VERSION
- Works with RT 4.2, 4.4
+ Works with RT 5.0.
INSTALLATION
perl Makefile.PL
@@ -19,18 +19,13 @@ INSTALLATION
If you are upgrading this module, check for upgrading instructions
in case changes need to be made to your database.
- patch RT
- Only run this the first time you install this module.
-
- patch -p1 -d /path/to/rt < etc/0001-handle-txn-cfs-on-ticket-creation-and-updates-with-U.patch
-
- Edit your /opt/rt4/etc/RT_SiteConfig.pm
+ Edit your /opt/rt5/etc/RT_SiteConfig.pm
Add this line:
Plugin('RT::Extension::TimeTracking');
Clear your mason cache
- rm -rf /opt/rt4/var/mason_data/obj
+ rm -rf /opt/rt5/var/mason_data/obj
Restart your webserver
diff --git a/lib/RT/Extension/TimeTracking.pm b/lib/RT/Extension/TimeTracking.pm
index 89b06ab..740fbb6 100644
--- a/lib/RT/Extension/TimeTracking.pm
+++ b/lib/RT/Extension/TimeTracking.pm
@@ -36,7 +36,7 @@ RT-Extension-TimeTracking - Time Tracking Extension
=head1 RT VERSION
-Works with RT 4.2, 4.4
+Works with RT 5.0.
=head1 INSTALLATION
@@ -60,13 +60,7 @@ in your database.
If you are upgrading this module, check for upgrading instructions
in case changes need to be made to your database.
-=item patch RT
-
-Only run this the first time you install this module.
-
- patch -p1 -d /path/to/rt < etc/0001-handle-txn-cfs-on-ticket-creation-and-updates-with-U.patch
-
-=item Edit your F</opt/rt4/etc/RT_SiteConfig.pm>
+=item Edit your F</opt/rt5/etc/RT_SiteConfig.pm>
Add this line:
@@ -74,7 +68,7 @@ Add this line:
=item Clear your mason cache
- rm -rf /opt/rt4/var/mason_data/obj
+ rm -rf /opt/rt5/var/mason_data/obj
=item Restart your webserver
diff --git a/lib/RT/Extension/TimeTracking/Test.pm.in b/lib/RT/Extension/TimeTracking/Test.pm.in
index 713f586..5af1ae7 100644
--- a/lib/RT/Extension/TimeTracking/Test.pm.in
+++ b/lib/RT/Extension/TimeTracking/Test.pm.in
@@ -2,7 +2,7 @@ use strict;
use warnings;
### after: use lib qw(@RT_LIB_PATH@);
-use lib qw(/opt/rt4/local/lib /opt/rt4/lib);
+use lib qw(/opt/rt5/local/lib /opt/rt5/lib);
package RT::Extension::TimeTracking::Test;
commit 96b54a14093c86fb444f0aca20f4e6d6b4a0d391
Author: sunnavy <sunnavy at bestpractical.com>
Date: Sat Jul 25 05:08:57 2020 +0800
Drop patch for RT 4
diff --git a/MANIFEST b/MANIFEST
index 3c12b2e..a08ccc4 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -2,7 +2,6 @@ Changes
doc/images/timetracking_basics.png
doc/images/timetracking_my_week.png
doc/images/timetracking_my_week_admin.png
-etc/0001-handle-txn-cfs-on-ticket-creation-and-updates-with-U.patch
etc/initialdata
html/Callbacks/RT-Extension-TimeTracking/Elements/ShowCustomFields/MassageCustomFields
html/Callbacks/RT-Extension-TimeTracking/Elements/ShowCustomFields/ShowComponentName
diff --git a/etc/0001-handle-txn-cfs-on-ticket-creation-and-updates-with-U.patch b/etc/0001-handle-txn-cfs-on-ticket-creation-and-updates-with-U.patch
deleted file mode 100644
index 0cc0cd8..0000000
--- a/etc/0001-handle-txn-cfs-on-ticket-creation-and-updates-with-U.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From 30935bb85e63a168b31559d7d2e225134a694a15 Mon Sep 17 00:00:00 2001
-From: sunnavy <sunnavy at bestpractical.com>
-Date: Tue, 12 Nov 2013 21:49:46 +0800
-Subject: [PATCH] handle txn cfs on ticket creation and updates(with
- UpdateTimeWorked but no content)
-
----
- lib/RT/Interface/Web.pm | 16 ++++++++++++++--
- lib/RT/Ticket.pm | 2 +-
- 2 files changed, 15 insertions(+), 3 deletions(-)
-
-diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
-index 2dd0fd1..4a73d3b 100644
---- a/lib/RT/Interface/Web.pm
-+++ b/lib/RT/Interface/Web.pm
-@@ -2760,7 +2760,6 @@ sub ProcessTicketBasics {
- FinalPriority
- Priority
- TimeEstimated
-- TimeWorked
- TimeLeft
- Type
- Status
-@@ -2789,6 +2788,12 @@ sub ProcessTicketBasics {
- ARGSRef => $ARGSRef,
- );
-
-+ if ( $ARGSRef->{'TimeWorked'} ) {
-+ my ( $val, $msg, $txn ) = $TicketObj->SetTimeWorked( $ARGSRef->{'TimeWorked'} );
-+ push( @results, $msg );
-+ $txn->UpdateCustomFields( %$ARGSRef) if $txn;
-+ }
-+
- # We special case owner changing, so we can use ForceOwnerChange
- if ( $ARGSRef->{'Owner'}
- && $ARGSRef->{'Owner'} !~ /\D/
-@@ -3169,7 +3174,14 @@ sub ProcessObjectCustomFieldUpdatesForCreate {
- );
- }
-
-- $parsed{"CustomField-$cfid"} = \@values if @values;
-+ if (@values) {
-+ if ( $class eq 'RT::Transaction' ) {
-+ $parsed{"Object-RT::Transaction--CustomField-$cfid"} = \@values;
-+ }
-+ else {
-+ $parsed{"CustomField-$cfid"} = \@values if @values;
-+ }
-+ }
- }
- }
-
-diff --git a/lib/RT/Ticket.pm b/lib/RT/Ticket.pm
-index 80af7f5..d4e2055 100644
---- a/lib/RT/Ticket.pm
-+++ b/lib/RT/Ticket.pm
-@@ -2671,7 +2671,7 @@ sub _Set {
- # just made the ticket unreadable to us
- $trans->{ _object_is_readable } = 1;
-
-- return ( $ret, scalar $trans->BriefDescription );
-+ return ( $ret, scalar $trans->BriefDescription, $trans );
- }
-
-
---
-1.8.4.1
-
commit 87b6ee19550ac0edd5ca6bc6108ab4accbf50502
Author: sunnavy <sunnavy at bestpractical.com>
Date: Sat Jul 25 05:09:18 2020 +0800
Update copyright year to 2020
diff --git a/README b/README
index b7269ed..4d1ae14 100644
--- a/README
+++ b/README
@@ -159,7 +159,7 @@ BUGS
ing>.
COPYRIGHT
- This extension is Copyright (C) 2013-2018 Best Practical Solutions, LLC.
+ This extension is Copyright (C) 2013-2020 Best Practical Solutions, LLC.
This is free software, licensed under:
diff --git a/lib/RT/Extension/TimeTracking.pm b/lib/RT/Extension/TimeTracking.pm
index 740fbb6..9cfcf83 100644
--- a/lib/RT/Extension/TimeTracking.pm
+++ b/lib/RT/Extension/TimeTracking.pm
@@ -278,7 +278,7 @@ Or via the web at: L<rt.cpan.org|http://rt.cpan.org/Public/Dist/Display.html?Nam
=head1 COPYRIGHT
-This extension is Copyright (C) 2013-2018 Best Practical Solutions, LLC.
+This extension is Copyright (C) 2013-2020 Best Practical Solutions, LLC.
This is free software, licensed under:
commit 3a3308b8ebca413ed9e60be6912065a2a1cf67ad
Author: sunnavy <sunnavy at bestpractical.com>
Date: Sat Jul 25 05:11:05 2020 +0800
Prep 0.20
diff --git a/Changes b/Changes
index 48e1451..bc5fede 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
Revision history for RT-Extension-TimeTracking
+0.20 2020-07-24
+ - Add RT 5 support and drop RT 4 support
+
0.11 2018-03-14
- Adjust previous/next week dates for DST
diff --git a/META.yml b/META.yml
index 09370ed..1c1841d 100644
--- a/META.yml
+++ b/META.yml
@@ -26,6 +26,6 @@ requires:
resources:
license: http://opensource.org/licenses/gpl-license.php
repository: https://github.com/bestpractical/rt-extension-timetracking
-version: '0.11'
+version: '0.20'
x_module_install_rtx_version: '0.42'
x_requires_rt: 5.0.0
diff --git a/README b/README
index 4d1ae14..8e71144 100644
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ NAME
RT-Extension-TimeTracking - Time Tracking Extension
RT VERSION
- Works with RT 5.0.
+ Works with RT 5.0. Check 0.1* versions if you are using RT 4.
INSTALLATION
perl Makefile.PL
diff --git a/lib/RT/Extension/TimeTracking.pm b/lib/RT/Extension/TimeTracking.pm
index 9cfcf83..830c8fb 100644
--- a/lib/RT/Extension/TimeTracking.pm
+++ b/lib/RT/Extension/TimeTracking.pm
@@ -2,7 +2,7 @@ use strict;
use warnings;
package RT::Extension::TimeTracking;
-our $VERSION = '0.11';
+our $VERSION = '0.20';
RT->AddStyleSheets("time_tracking.css");
RT->AddJavaScript("time_tracking.js");
@@ -36,7 +36,7 @@ RT-Extension-TimeTracking - Time Tracking Extension
=head1 RT VERSION
-Works with RT 5.0.
+Works with RT 5.0. Check 0.1* versions if you are using RT 4.
=head1 INSTALLATION
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list