[Bps-public-commit] rt-extension-todolist branch master updated. 454b3a49b63b1681b8f7d0586c34f53d84c7c63e
BPS Git Server
git at git.bestpractical.com
Mon Oct 25 17:19:57 UTC 2021
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-todolist".
The branch, master has been updated
via 454b3a49b63b1681b8f7d0586c34f53d84c7c63e (commit)
via cb4e40b8ce100be24703dd8e485073b9f42ff922 (commit)
from d735e493dfd49bd86af388b5bf1a539df5c8a233 (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 454b3a49b63b1681b8f7d0586c34f53d84c7c63e
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Mon Oct 25 13:01:54 2021 -0400
Version 0.02
diff --git a/MANIFEST b/MANIFEST
index 57945ec..a2d9eb6 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -25,6 +25,6 @@ Makefile.PL
MANIFEST This list of files
META.yml
README
-RT-Extension-TodoList-0.01/lib/RT/CustomFields_Vendor.pm
+lib/RT/CustomFields_Vendor.pm
static/css/rt-extension-todolist.css
static/js/rt-extension-todolist.js
diff --git a/META.yml b/META.yml
index 38b2698..be2fdbf 100644
--- a/META.yml
+++ b/META.yml
@@ -24,7 +24,6 @@ requires:
resources:
license: http://opensource.org/licenses/gpl-license.php
repository: https://github.com/bestpractical/rt-extension-todolist
-version: '0.01'
-x_module_install_rtx_version: '0.40'
-x_requires_rt: 4.2.0
-x_rt_too_new: 4.6.0
+version: '0.02'
+x_module_install_rtx_version: '0.42'
+x_requires_rt: 5.0.0
diff --git a/Makefile.PL b/Makefile.PL
index 2c57b6e..8098753 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,11 +1,11 @@
+BEGIN { push @INC, '.' }
use inc::Module::Install;
RTx 'RT-Extension-TodoList';
license 'gpl_2';
repository 'https://github.com/bestpractical/rt-extension-todolist';
-requires_rt '4.2.0';
-rt_too_new '4.6.0';
+requires_rt '5.0.0';
sign;
WriteAll;
diff --git a/README b/README
index d29e119..6c0a586 100644
--- a/README
+++ b/README
@@ -20,7 +20,7 @@ DESCRIPTION
repeatedly on any ticket created for the queue.
RT VERSION
- Works with RT 4.4
+ Works with RT 5.0
INSTALLATION
perl Makefile.PL
make
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
diff --git a/lib/RT/Extension/TodoList.pm b/lib/RT/Extension/TodoList.pm
index ae0633c..e6ccff9 100644
--- a/lib/RT/Extension/TodoList.pm
+++ b/lib/RT/Extension/TodoList.pm
@@ -2,7 +2,7 @@ use strict;
use warnings;
package RT::Extension::TodoList;
-our $VERSION = '0.01';
+our $VERSION = '0.02';
RT->AddStyleSheets('rt-extension-todolist.css');
RT->AddJavaScript('rt-extension-todolist.js');
@@ -112,7 +112,7 @@ rack. This extension make tracking these tasks from one ticket simple by adding
used repeatedly on any ticket created for the queue.
=head1 RT VERSION
- Works with RT 4.4
+ Works with RT 5.0
=head1 INSTALLATION
commit cb4e40b8ce100be24703dd8e485073b9f42ff922
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Mon Oct 25 12:59:52 2021 -0400
Updates for RT 5
diff --git a/html/Callbacks/RT-Extension-TodoList/Admin/CustomFields/Modify.html/EndOfTable b/html/Callbacks/RT-Extension-TodoList/Admin/CustomFields/Modify.html/EndOfTable
index 5cdd5d9..a09d5c3 100644
--- a/html/Callbacks/RT-Extension-TodoList/Admin/CustomFields/Modify.html/EndOfTable
+++ b/html/Callbacks/RT-Extension-TodoList/Admin/CustomFields/Modify.html/EndOfTable
@@ -1,7 +1,15 @@
-<tr><td class="label"> </td><td>
-<input type="checkbox" class="checkbox" id="TodoListCustomField" name="TodoListCustomField" value="1" <% $TodoListCustomField |n %> />
-<label for="TodoListCustomField"><&|/l&>Todo List (Checking this box applies this custom field as a todo list field)</&></label>
-</td></tr>
+<div class="form-row">
+ <div class="label col-3"></div>
+ <div class="value col-9">
+ <input type="hidden" class="hidden" name="SetEnabled" value="1" />
+ <div class="custom-control custom-checkbox">
+ <input type="checkbox" class="custom-control-input" id="TodoListCustomField" name="TodoListCustomField" value="1" <% $TodoListCustomField |n %> />
+ <label class="custom-control-label" for="TodoListCustomField">
+ <&|/l&>Todo List (Check to apply this custom field as a todo list)</&>
+ </label>
+ </div>
+ </div>
+</div>
<%init>
return unless $CustomField->Id;
diff --git a/html/Elements/TodoList b/html/Elements/TodoList
index f9f8ae8..614dbac 100644
--- a/html/Elements/TodoList
+++ b/html/Elements/TodoList
@@ -1,7 +1,7 @@
<&|/Widgets/TitleBox, title => loc("Todo List"), class => 'ticket-info-basics', &>
<div id="todo-list-container">
<div class="todo-list-container">
- <select id="RT-TodoList-Select" onchange="UpdateTodoList(<%$Object->Id%>)">
+ <select class="form-control selectpicker" id="RT-TodoList-Select" onchange="UpdateTodoList(<%$Object->Id%>)">
<option value="" <% !$default && qq[ selected="selected"] |n %>><&|/l&>(no value)</&></option>
% while ( my $cf = $custom_fields->Next ) {
% $default_cf = $cf if defined $default && $cf->Id eq $default;
@@ -9,20 +9,19 @@
<% $cf->Name %>
</option>
% }
- </select>
- </div>
- <div class="todo-list-container">
- <form id="RT-TodoList" onchange="UpdateTodos()">
+ </select>
+ </div>
+ <div id="todo-list-value-inputs" class="todo-list-container">
+ <form id="RT-TodoList" onchange="UpdateTodos()">
% if ( $default_cf ) {
<& /Elements/EditCustomField,
CustomField => $default_cf,
Object => $Object
&>
% }
- </form>
+ </form>
+ </div>
</div>
- <div>
-</div>
</&>
<%INIT>
diff --git a/static/css/rt-extension-todolist.css b/static/css/rt-extension-todolist.css
index 1efc8c1..6797f57 100644
--- a/static/css/rt-extension-todolist.css
+++ b/static/css/rt-extension-todolist.css
@@ -1,3 +1,8 @@
.todo-list-container {
display: inline-flex;
-}
\ No newline at end of file
+ padding: 10px 15px 15px 15px;
+}
+
+#todo-list-value-inputs {
+ margin-left: 5px;
+}
-----------------------------------------------------------------------
Summary of changes:
MANIFEST | 2 +-
META.yml | 7 ++---
Makefile.PL | 4 +--
README | 2 +-
.../Admin/CustomFields/Modify.html/EndOfTable | 16 +++++++---
html/Elements/TodoList | 15 +++++----
inc/Module/Install/RTx.pm | 36 ++++++++++++++++------
lib/RT/Extension/TodoList.pm | 4 +--
static/css/rt-extension-todolist.css | 7 ++++-
9 files changed, 60 insertions(+), 33 deletions(-)
hooks/post-receive
--
rt-extension-todolist
More information about the Bps-public-commit
mailing list