[Bps-public-commit] RT-Extension-QuickCalls branch master updated. 1.03-13-gad0765f
BPS Git Server
git at git.bestpractical.com
Fri Oct 6 21:19:01 UTC 2023
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-QuickCalls".
The branch, master has been updated
via ad0765f85b19f16caf20ab0cca9000da8df8fae9 (commit)
via 36f1bece3b79b721a5d3e7c2f2fe2a4648d1a037 (commit)
via 903e4a6f3ed35753804a038ac4849cce29b6787b (commit)
via ff70a8ea1b6b122406a63b30d21fd140b9d5e632 (commit)
via 59d315710c1e290049face1652c70d8c8c43c520 (commit)
via c272bae6913f87ab1a91e03b3d41fc1ba905149f (commit)
via 2051c23c706c5958f6c8b864fd3c9d13ebfd50bb (commit)
via 90693483f24b6ff2f29b74847d7b7140d02c7a40 (commit)
via 09e335c2097cc746c50a5b239c5eaf3489a7ef48 (commit)
via b32220e3168dec05d655f6623e07e6d50aaa093d (commit)
via 302b2307ecb743521f857427094752dc091b1a9a (commit)
via 446786a20f36a05a6be0ad3ba5140f5820e2ec9d (commit)
via 03dcab80caf642598ec67bdd74d80f9f27c1dbf8 (commit)
from 33e2a6a5325b3b2771c6f480eb5faf2839799da7 (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 ad0765f85b19f16caf20ab0cca9000da8df8fae9
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Oct 6 17:09:56 2023 -0400
Prep 1.04
diff --git a/Changes b/Changes
index 7a52e63..dfb6148 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,8 @@
+1.04 2023-10-06
+ - Support QuickCalls to be added to User Summary page
+ - Support QuickCalls to render different options for each dashboard
+ - Add QuickCreate option
+
1.03 2022-01-14
- Add RT 5 compatibility
diff --git a/MANIFEST b/MANIFEST
index 37ae376..66ea32c 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,6 +1,7 @@
Changes
html/Elements/QuickCalls
html/Helpers/QuickCalls
+html/User/Elements/Portlets/QuickCalls
inc/Module/Install.pm
inc/Module/Install/Base.pm
inc/Module/Install/Can.pm
@@ -18,6 +19,7 @@ lib/RT/Extension/QuickCalls.pm
Makefile.PL
MANIFEST This list of files
META.yml
+patches/0001-Support-QuickCreate-to-pass-arguments-to-redirect-UR.patch
README
xt/00.load.t
xt/pod-coverage.t
diff --git a/META.yml b/META.yml
index c9ba07e..63f22b3 100644
--- a/META.yml
+++ b/META.yml
@@ -21,10 +21,11 @@ no_index:
- inc
- xt
requires:
- perl: 5.8.3
+ perl: 5.10.1
resources:
license: http://opensource.org/licenses/gpl-license.php
-version: '1.03'
+ repository: https://github.com/bestpractical/rt-extension-quickcalls
+version: '1.04'
x_module_install_rtx_version: '0.43'
-x_requires_rt: 4.0.0
+x_requires_rt: 4.4.0
x_rt_too_new: 5.2.0
diff --git a/Makefile.PL b/Makefile.PL
index 2172a10..063b2c6 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -2,10 +2,12 @@ use lib '.';
use inc::Module::Install;
RTx 'RT-Extension-QuickCalls';
+repository 'https://github.com/bestpractical/rt-extension-quickcalls';
-requires_rt '4.0.0';
+requires_rt '4.4.0';
rt_too_new '5.2.0';
test_requires('Test::More');
+sign;
&WriteAll;
diff --git a/README b/README
index 1bf7183..5082391 100644
--- a/README
+++ b/README
@@ -5,41 +5,19 @@ NAME
RT VERSION
Works with RT 4.4, 5.0
-SYNOPSIS
- You will need to enable the new QuickCalls portlet with a line like this
- in your RT_SiteConfig.pm file:
-
- Set($HomepageComponents, [qw(QuickCreate Quicksearch MyAdminQueues MySupportQueues MyReminders
- RefreshHomepage QuickCalls)]);
-
- This is the default portlet list with QuickCalls added to the end People
- can then choose to add the portlet to their homepage in Preferences ->
- RT at a glance
-
- To set up your Quick Calls, you will want to specify a Name and a Queue
- in the config file. The Name will become the Subject of the task unless
- you specify a Subject option. You can add other Ticket options as
- needed, such as Status. Additionally, if the SetOwnerToCurrentUser
- option is set, the ticket will be owned by the current user.
+ To use the QuickCreate option RT must be newer than 4.4.1
- Set($QuickCalls,[{Name => "Foo", Queue => 'General', Status => 'resolved'},
- {Name => "Bar", Queue => 'Queue2', Status => 'resolved'}]);
+DESCRIPTION
+ This RT extension allows you to add a QuickCalls portlet to your RT
+ dashboards.
- If a value is an anonymous subref, it will be called when the QuickCall
- is selected, and its return value filled in for the appropriate key:
+ You can configure the portlet to show the same Quick Calls on every
+ dashboard or customize the Quick Calls per dashboard.
- Set($QuickCalls,[ {
- Queue => 'General',
- Name => 'This will have the current time on the server in its content',
- Content => sub {
- my $date = localtime;
- return "When: $date\n\n";
- },
- }]);
+ The QuickCalls portlet can also be added to the user summary page:
- After you have added QuickCalls to your home page, you will be able to
- select one, click Create and be brought to the ticket creation page with
- multiple fields pre-filled.
+ Set(@UserSummaryPortlets, (qw/ExtraInfo CreateTicket ActiveTickets
+ InactiveTickets UserAssets QuickCalls/));
INSTALLATION
perl Makefile.PL
@@ -47,22 +25,106 @@ INSTALLATION
make install
May need root permissions
+ To use the QuickCreate option apply this patch for RT earlier than 5.0.6
+ patch -d /opt/rt5 -p1 < patches/0001-Support-QuickCreate-to-pass-arguments-to-redirect-UR.patch
+
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::QuickCalls');
- For RT 4.0, add this line:
-
- Set(@Plugins, qw(RT::Extension::QuickCalls));
-
- or add RT::Extension::QuickCalls to your existing @Plugins line.
-
Clear your mason cache
rm -rf /opt/rt4/var/mason_data/obj
Restart your webserver
+CONFIGURATION
+ You will need to enable the new QuickCalls portlet with a line like this
+ in your RT_SiteConfig.pm file:
+
+ Set($HomepageComponents, [qw(QuickCreate Quicksearch MyAdminQueues MySupportQueues MyReminders
+ RefreshHomepage QuickCalls)]);
+
+ This is the default portlet list with QuickCalls added to the end People
+ can then choose to add the portlet to their homepage in Preferences ->
+ RT at a glance
+
+ BASIC CONFIGURATION
+ To set up your Quick Calls, you will want to specify a Name and a Queue
+ in the config file. The Name will become the Subject of the task unless
+ you specify a Subject option. You can add other Ticket options as
+ needed, such as Status. Additionally, if the SetOwnerToCurrentUser
+ option is set, the ticket will be owned by the current user.
+
+ The following configuration will show the same Quick Calls on all
+ dashboards:
+
+ Set(
+ $QuickCalls, [
+ { Name => "Foo", Queue => 'General', Status => 'resolved' },
+ { Name => "Bar", Queue => 'Queue2', Status => 'resolved' },
+ ]
+ );
+
+ CUSTOM CONFIGURATION PER DASHBOARD
+ If you would like different dashboards to show different Quick Calls you
+ can use a different configuration format:
+
+ Set(
+ $QuickCalls, {
+ Default => {
+ Actions => [
+ { Name => "Default Foo", Queue => 'General', Status => 'resolved' },
+ { Name => "Default Bar", Queue => 'Queue2', Status => 'resolved' }
+ ],
+ },
+ 1 => { # use the ID of the Dashboard as the hash key
+ Title => 'Optional Title',
+ Actions => [
+ { Name => "Dashboard ID 1 Foo", Queue => 'General', Status => 'resolved' },
+ { Name => "Dashboard ID 1 Bar", Queue => 'Queue2', Status => 'resolved' }
+ ],
+ },
+ ...
+ }
+ );
+
+ The above configuration would show different Quick Calls when the
+ portlet is loaded on the Dashboard with ID 1. If there is not a custom
+ configuration for a Dashboard ID it will use the 'Default' value.
+
+ SUBREF VALUES
+ If a value is an anonymous subref, it will be called when the Quick Call
+ is selected, and its return value filled in for the appropriate key:
+
+ Set(
+ $QuickCalls, [
+ {
+ Queue => 'General',
+ Name => 'This will have the current time on the server in its content',
+ Content => sub {
+ my $date = localtime;
+ return "When: $date\n\n";
+ },
+ },
+ ]
+ );
+
+ QUICK CREATE
+ After you have added the QuickCalls portlet to your home page, you will
+ be able to select one, click Create and be brought to the ticket
+ creation page with multiple fields pre-filled.
+
+ If you would like the Quick Call to automatically create the ticket and
+ stay on the dashboard you can use the QuickCreate option:
+
+ Set(
+ $QuickCalls, [
+ { Name => "Foo", Queue => 'General', Status => 'resolved', QuickCreate => 1 },
+ { Name => "Bar", Queue => 'Queue2', Status => 'resolved' },
+ ]
+ );
+
AUTHOR
Best Practical Solutions, LLC <modules at bestpractical.com>
@@ -76,7 +138,7 @@ BUGS
L<rt.cpan.org|http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-QuickCalls>.
LICENSE AND COPYRIGHT
- This software is Copyright (c) 2014 by Best Practical Solutions
+ This software is Copyright (c) 2014-2023 by Best Practical Solutions
This is free software, licensed under:
diff --git a/lib/RT/Extension/QuickCalls.pm b/lib/RT/Extension/QuickCalls.pm
index 428c6b4..053c74d 100644
--- a/lib/RT/Extension/QuickCalls.pm
+++ b/lib/RT/Extension/QuickCalls.pm
@@ -2,7 +2,7 @@ package RT::Extension::QuickCalls;
use warnings;
use strict;
-our $VERSION = '1.03';
+our $VERSION = '1.04';
=head1 NAME
commit 36f1bece3b79b721a5d3e7c2f2fe2a4648d1a037
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Oct 6 17:05:03 2023 -0400
Clean up obsolete docs and update copyright year
diff --git a/lib/RT/Extension/QuickCalls.pm b/lib/RT/Extension/QuickCalls.pm
index 39a5a11..428c6b4 100644
--- a/lib/RT/Extension/QuickCalls.pm
+++ b/lib/RT/Extension/QuickCalls.pm
@@ -45,16 +45,10 @@ 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::QuickCalls');
-For RT 4.0, add this line:
-
- Set(@Plugins, qw(RT::Extension::QuickCalls));
-
-or add C<RT::Extension::QuickCalls> to your existing C<@Plugins> line.
-
=item Clear your mason cache
rm -rf /opt/rt4/var/mason_data/obj
@@ -184,7 +178,7 @@ or via the web at
=head1 LICENSE AND COPYRIGHT
-This software is Copyright (c) 2014 by Best Practical Solutions
+This software is Copyright (c) 2014-2023 by Best Practical Solutions
This is free software, licensed under:
commit 903e4a6f3ed35753804a038ac4849cce29b6787b
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Oct 6 17:04:26 2023 -0400
Update M:I
diff --git a/META.yml b/META.yml
index b7c2c8c..c9ba07e 100644
--- a/META.yml
+++ b/META.yml
@@ -9,7 +9,7 @@ configure_requires:
ExtUtils::MakeMaker: 6.59
distribution_type: module
dynamic_config: 1
-generated_by: 'Module::Install version 1.19'
+generated_by: 'Module::Install version 1.21'
license: gpl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -25,6 +25,6 @@ requires:
resources:
license: http://opensource.org/licenses/gpl-license.php
version: '1.03'
-x_module_install_rtx_version: '0.42'
+x_module_install_rtx_version: '0.43'
x_requires_rt: 4.0.0
x_rt_too_new: 5.2.0
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index 7ba98c2..3dd721b 100644
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -31,7 +31,7 @@ BEGIN {
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
- $VERSION = '1.19';
+ $VERSION = '1.21';
# Storage for the pseudo-singleton
$MAIN = undef;
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index 9fa42c2..67ce900 100644
--- a/inc/Module/Install/Base.pm
+++ b/inc/Module/Install/Base.pm
@@ -4,7 +4,7 @@ package Module::Install::Base;
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
- $VERSION = '1.19';
+ $VERSION = '1.21';
}
# Suspend handler for "redefined" warnings
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index d65c753..93fc4f9 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -8,7 +8,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.19';
+ $VERSION = '1.21';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index 3072b08..3c9390a 100644
--- a/inc/Module/Install/Fetch.pm
+++ b/inc/Module/Install/Fetch.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.19';
+ $VERSION = '1.21';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Include.pm b/inc/Module/Install/Include.pm
index 13fdcd0..b9b926f 100644
--- a/inc/Module/Install/Include.pm
+++ b/inc/Module/Install/Include.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.19';
+ $VERSION = '1.21';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index 13a4464..1e214a0 100644
--- a/inc/Module/Install/Makefile.pm
+++ b/inc/Module/Install/Makefile.pm
@@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.19';
+ $VERSION = '1.21';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index 11bf971..2ae8036 100644
--- a/inc/Module/Install/Metadata.pm
+++ b/inc/Module/Install/Metadata.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.19';
+ $VERSION = '1.21';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -455,12 +455,8 @@ sub author_from {
my %license_urls = (
perl => 'http://dev.perl.org/licenses/',
apache => 'http://apache.org/licenses/LICENSE-2.0',
- apache_1_1 => 'http://apache.org/licenses/LICENSE-1.1',
artistic => 'http://opensource.org/licenses/artistic-license.php',
- artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php',
lgpl => 'http://opensource.org/licenses/lgpl-license.php',
- lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php',
- lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html',
bsd => 'http://opensource.org/licenses/bsd-license.php',
gpl => 'http://opensource.org/licenses/gpl-license.php',
gpl2 => 'http://opensource.org/licenses/gpl-2.0.php',
@@ -471,6 +467,12 @@ my %license_urls = (
unrestricted => undef,
restrictive => undef,
unknown => undef,
+
+ # these are not actually allowed in meta-spec v1.4 but are left here for compatibility:
+ apache_1_1 => 'http://apache.org/licenses/LICENSE-1.1',
+ artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php',
+ lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php',
+ lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html',
);
sub license {
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;
}
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index f7aa615..b6c1d37 100644
--- a/inc/Module/Install/Win32.pm
+++ b/inc/Module/Install/Win32.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.19';
+ $VERSION = '1.21';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index 2db861a..d87eb9a 100644
--- a/inc/Module/Install/WriteAll.pm
+++ b/inc/Module/Install/WriteAll.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.19';
+ $VERSION = '1.21';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
diff --git a/inc/YAML/Tiny.pm b/inc/YAML/Tiny.pm
index fb157a6..db3ae5c 100644
--- a/inc/YAML/Tiny.pm
+++ b/inc/YAML/Tiny.pm
@@ -2,12 +2,12 @@
use 5.008001; # sane UTF-8 support
use strict;
use warnings;
-package YAML::Tiny; # git description: v1.72-7-g8682f63
+package YAML::Tiny; # git description: v1.73-12-ge02f827
# XXX-INGY is 5.8.1 too old/broken for utf8?
# XXX-XDG Lancaster consensus was that it was sufficient until
# proven otherwise
-our $VERSION = '1.73';
+our $VERSION = '1.74';
#####################################################################
# The YAML::Tiny API.
commit ff70a8ea1b6b122406a63b30d21fd140b9d5e632
Merge: 59d3157 03dcab8
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Oct 6 16:59:49 2023 -0400
Merge branch 'add-quickcalls-to-user-summary'
diff --cc lib/RT/Extension/QuickCalls.pm
index bce8628,c93cb93..39a5a11
--- a/lib/RT/Extension/QuickCalls.pm
+++ b/lib/RT/Extension/QuickCalls.pm
@@@ -12,16 -12,49 +12,21 @@@ RT::Extension::QuickCalls - Quickly cre
Works with RT 4.4, 5.0
-=head1 SYNOPSIS
+To use the QuickCreate option RT must be newer than 4.4.1
-You will need to enable the new QuickCalls portlet with a line
-like this in your F<RT_SiteConfig.pm> file:
-
- Set($HomepageComponents, [qw(QuickCreate Quicksearch MyAdminQueues MySupportQueues MyReminders
- RefreshHomepage QuickCalls)]);
-
-This is the default portlet list with QuickCalls added to the end
-People can then choose to add the portlet to their homepage
-in Preferences -> RT at a glance
-
-To set up your Quick Calls, you will want to specify a C<Name> and a
-C<Queue> in the config file. The C<Name> will become the C<Subject> of
-the task unless you specify a C<Subject> option. You can add other
-Ticket options as needed, such as C<Status>. Additionally, if the
-C<SetOwnerToCurrentUser> option is set, the ticket will be owned by the
-current user.
+=head1 DESCRIPTION
- Set($QuickCalls,[{Name => "Foo", Queue => 'General', Status => 'resolved'},
- {Name => "Bar", Queue => 'Queue2', Status => 'resolved'}]);
-
-If a value is an anonymous subref, it will be called when the QuickCall
-is selected, and its return value filled in for the appropriate key:
+This RT extension allows you to add a QuickCalls portlet to your RT
+dashboards.
- Set($QuickCalls,[ {
- Queue => 'General',
- Name => 'This will have the current time on the server in its content',
- Content => sub {
- my $date = localtime;
- return "When: $date\n\n";
- },
- }]);
-
-After you have added QuickCalls to your home page, you will be able to select
-one, click Create and be brought to the ticket creation page with multiple
-fields pre-filled.
+You can configure the portlet to show the same Quick Calls on every
+dashboard or customize the Quick Calls per dashboard.
+ The QuickCalls portlet can also be added to the user summary page:
+
+ Set(@UserSummaryPortlets, (qw/ExtraInfo CreateTicket ActiveTickets
+ InactiveTickets UserAssets QuickCalls/));
+
=head1 INSTALLATION
=over
commit 59d315710c1e290049face1652c70d8c8c43c520
Merge: 33e2a6a c272bae
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Oct 6 16:59:16 2023 -0400
Merge branch 'allow-multiple-custom-quickcall-portlets-via-config'
commit c272bae6913f87ab1a91e03b3d41fc1ba905149f
Author: Brad Embree <brad at bestpractical.com>
Date: Fri Oct 6 10:23:33 2023 -0700
Add screenshots to POD
diff --git a/lib/RT/Extension/QuickCalls.pm b/lib/RT/Extension/QuickCalls.pm
index b354668..bce8628 100644
--- a/lib/RT/Extension/QuickCalls.pm
+++ b/lib/RT/Extension/QuickCalls.pm
@@ -89,6 +89,12 @@ dashboards:
]
);
+=begin HTML
+
+<p><img width="500px" src="https://static.bestpractical.com/images/quickcalls/QuickCallsScreenshot01.png" alt="Basic Configuration" /></p>
+
+=end HTML
+
=head2 CUSTOM CONFIGURATION PER DASHBOARD
If you would like different dashboards to show different Quick Calls you
@@ -117,6 +123,12 @@ The above configuration would show different Quick Calls when the
portlet is loaded on the Dashboard with ID 1. If there is not a custom
configuration for a Dashboard ID it will use the 'Default' value.
+=begin HTML
+
+<p><img width="500px" src="https://static.bestpractical.com/images/quickcalls/QuickCallsScreenshot02.png" alt="Basic Configuration" /></p>
+
+=end HTML
+
=head2 SUBREF VALUES
If a value is an anonymous subref, it will be called when the Quick Call
commit 2051c23c706c5958f6c8b864fd3c9d13ebfd50bb
Author: Brad Embree <brad at bestpractical.com>
Date: Thu Sep 28 15:31:25 2023 -0700
Update POD
diff --git a/lib/RT/Extension/QuickCalls.pm b/lib/RT/Extension/QuickCalls.pm
index a0740d7..b354668 100644
--- a/lib/RT/Extension/QuickCalls.pm
+++ b/lib/RT/Extension/QuickCalls.pm
@@ -12,43 +12,15 @@ RT::Extension::QuickCalls - Quickly create tickets in specific queues with defau
Works with RT 4.4, 5.0
-=head1 SYNOPSIS
+To use the QuickCreate option RT must be newer than 4.4.1
-You will need to enable the new QuickCalls portlet with a line
-like this in your F<RT_SiteConfig.pm> file:
-
- Set($HomepageComponents, [qw(QuickCreate Quicksearch MyAdminQueues MySupportQueues MyReminders
- RefreshHomepage QuickCalls)]);
-
-This is the default portlet list with QuickCalls added to the end
-People can then choose to add the portlet to their homepage
-in Preferences -> RT at a glance
-
-To set up your Quick Calls, you will want to specify a C<Name> and a
-C<Queue> in the config file. The C<Name> will become the C<Subject> of
-the task unless you specify a C<Subject> option. You can add other
-Ticket options as needed, such as C<Status>. Additionally, if the
-C<SetOwnerToCurrentUser> option is set, the ticket will be owned by the
-current user.
+=head1 DESCRIPTION
- Set($QuickCalls,[{Name => "Foo", Queue => 'General', Status => 'resolved'},
- {Name => "Bar", Queue => 'Queue2', Status => 'resolved'}]);
+This RT extension allows you to add a QuickCalls portlet to your RT
+dashboards.
-If a value is an anonymous subref, it will be called when the QuickCall
-is selected, and its return value filled in for the appropriate key:
-
- Set($QuickCalls,[ {
- Queue => 'General',
- Name => 'This will have the current time on the server in its content',
- Content => sub {
- my $date = localtime;
- return "When: $date\n\n";
- },
- }]);
-
-After you have added QuickCalls to your home page, you will be able to select
-one, click Create and be brought to the ticket creation page with multiple
-fields pre-filled.
+You can configure the portlet to show the same Quick Calls on every
+dashboard or customize the Quick Calls per dashboard.
=head1 INSTALLATION
@@ -62,6 +34,10 @@ fields pre-filled.
May need root permissions
+=item To use the QuickCreate option apply this patch for RT earlier than 5.0.6
+
+ patch -d /opt/rt5 -p1 < patches/0001-Support-QuickCreate-to-pass-arguments-to-redirect-UR.patch
+
=item Edit your F</opt/rt4/etc/RT_SiteConfig.pm>
If you are using RT 4.2 or greater, add this line:
@@ -82,6 +58,99 @@ or add C<RT::Extension::QuickCalls> to your existing C<@Plugins> line.
=back
+=head1 CONFIGURATION
+
+You will need to enable the new QuickCalls portlet with a line
+like this in your F<RT_SiteConfig.pm> file:
+
+ Set($HomepageComponents, [qw(QuickCreate Quicksearch MyAdminQueues MySupportQueues MyReminders
+ RefreshHomepage QuickCalls)]);
+
+This is the default portlet list with QuickCalls added to the end
+People can then choose to add the portlet to their homepage
+in Preferences -> RT at a glance
+
+=head2 BASIC CONFIGURATION
+
+To set up your Quick Calls, you will want to specify a C<Name> and a
+C<Queue> in the config file. The C<Name> will become the C<Subject> of
+the task unless you specify a C<Subject> option. You can add other
+Ticket options as needed, such as C<Status>. Additionally, if the
+C<SetOwnerToCurrentUser> option is set, the ticket will be owned by the
+current user.
+
+The following configuration will show the same Quick Calls on all
+dashboards:
+
+ Set(
+ $QuickCalls, [
+ { Name => "Foo", Queue => 'General', Status => 'resolved' },
+ { Name => "Bar", Queue => 'Queue2', Status => 'resolved' },
+ ]
+ );
+
+=head2 CUSTOM CONFIGURATION PER DASHBOARD
+
+If you would like different dashboards to show different Quick Calls you
+can use a different configuration format:
+
+ Set(
+ $QuickCalls, {
+ Default => {
+ Actions => [
+ { Name => "Default Foo", Queue => 'General', Status => 'resolved' },
+ { Name => "Default Bar", Queue => 'Queue2', Status => 'resolved' }
+ ],
+ },
+ 1 => { # use the ID of the Dashboard as the hash key
+ Title => 'Optional Title',
+ Actions => [
+ { Name => "Dashboard ID 1 Foo", Queue => 'General', Status => 'resolved' },
+ { Name => "Dashboard ID 1 Bar", Queue => 'Queue2', Status => 'resolved' }
+ ],
+ },
+ ...
+ }
+ );
+
+The above configuration would show different Quick Calls when the
+portlet is loaded on the Dashboard with ID 1. If there is not a custom
+configuration for a Dashboard ID it will use the 'Default' value.
+
+=head2 SUBREF VALUES
+
+If a value is an anonymous subref, it will be called when the Quick Call
+is selected, and its return value filled in for the appropriate key:
+
+ Set(
+ $QuickCalls, [
+ {
+ Queue => 'General',
+ Name => 'This will have the current time on the server in its content',
+ Content => sub {
+ my $date = localtime;
+ return "When: $date\n\n";
+ },
+ },
+ ]
+ );
+
+=head2 QUICK CREATE
+
+After you have added the QuickCalls portlet to your home page, you will
+be able to select one, click Create and be brought to the ticket
+creation page with multiple fields pre-filled.
+
+If you would like the Quick Call to automatically create the ticket and
+stay on the dashboard you can use the QuickCreate option:
+
+ Set(
+ $QuickCalls, [
+ { Name => "Foo", Queue => 'General', Status => 'resolved', QuickCreate => 1 },
+ { Name => "Bar", Queue => 'Queue2', Status => 'resolved' },
+ ]
+ );
+
=head1 AUTHOR
Best Practical Solutions, LLC E<lt>modules at bestpractical.comE<gt>
commit 90693483f24b6ff2f29b74847d7b7140d02c7a40
Author: Brad Embree <brad at bestpractical.com>
Date: Fri Oct 6 08:44:01 2023 -0700
Check Quick Call for QuickCreate option
If the Quick Call config has the QuickCreate option set call
ProcessQuickCreate, passing in the PassArguments if there are any.
diff --git a/html/Helpers/QuickCalls b/html/Helpers/QuickCalls
index 084298b..1871ca4 100644
--- a/html/Helpers/QuickCalls
+++ b/html/Helpers/QuickCalls
@@ -75,8 +75,23 @@ if ( $QuickCall ) {
$QuickCall->{$_} = $QuickCall->{$_}->()
for grep { ref $QuickCall->{$_} eq "CODE" } keys %{$QuickCall};
- my $query = $m->comp( '/Elements/QueryString', %$QuickCall );
- RT::Interface::Web::Redirect( $RT::WebURL . "Ticket/Create.html?$query" );
+ if ( $QuickCall->{QuickCreate} ) {
+ ProcessQuickCreate(
+ Path => $ARGS{QuickCallsPath},
+ ARGSRef => $QuickCall,
+ $ARGS{PassArguments}
+ ? (
+ PassArguments => {
+ map { $_ => $ARGS{$_} } ref $ARGS{PassArguments} eq 'ARRAY' ? @{ $ARGS{PassArguments} } : $ARGS{PassArguments}
+ },
+ )
+ : (),
+ );
+ }
+ else {
+ my $query = $m->comp( '/Elements/QueryString', %$QuickCall );
+ RT::Interface::Web::Redirect( $RT::WebURL . "Ticket/Create.html?$query" );
+ }
}
}
</%init>
commit 09e335c2097cc746c50a5b239c5eaf3489a7ef48
Author: Brad Embree <brad at bestpractical.com>
Date: Fri Oct 6 08:47:21 2023 -0700
Add hidden inputs for pass args for QuickCreate
QuickCreate calls ProcessQuickCreate which needs some pass args to
ensure the path is correct when redirecting for results.
Add hidden inputs to the form to ensure the pass args are submitted.
diff --git a/html/Elements/QuickCalls b/html/Elements/QuickCalls
index 85ec778..ffe0f01 100644
--- a/html/Elements/QuickCalls
+++ b/html/Elements/QuickCalls
@@ -54,6 +54,12 @@
<form method="post" action="<%$RT::WebPath%>/Helpers/QuickCalls">
% if ( $quickcall_dashboard_id ) {
<input type="hidden" class="hidden" name="QuickCallsDashboard" value="<% $quickcall_dashboard_id %>">
+% }
+% for my $pass_argument ( keys %$DECODED_ARGS ) {
+ <input type="hidden" class="hidden" name="PassArguments" value="<% $pass_argument %>">
+% for my $value ( ref $DECODED_ARGS->{$pass_argument} eq 'ARRAY' ? @{ $DECODED_ARGS->{$pass_argument} } : $DECODED_ARGS->{$pass_argument} ) {
+ <input type="hidden" class="hidden" name="<% $pass_argument %>" value="<% $value // '' %>">
+% }
% }
<input type="hidden" class="hidden" name="QuickCallsPath" value="<%RT->Config->Get('WebPath')%><% $r->path_info %>">
<select name="QuickCall" class="selectpicker form-control">
commit b32220e3168dec05d655f6623e07e6d50aaa093d
Author: Brad Embree <brad at bestpractical.com>
Date: Fri Oct 6 09:54:41 2023 -0700
Add patch for pass arguments
diff --git a/patches/0001-Support-QuickCreate-to-pass-arguments-to-redirect-UR.patch b/patches/0001-Support-QuickCreate-to-pass-arguments-to-redirect-UR.patch
new file mode 100644
index 0000000..502b90e
--- /dev/null
+++ b/patches/0001-Support-QuickCreate-to-pass-arguments-to-redirect-UR.patch
@@ -0,0 +1,27 @@
+From 2ded707673d13706a6dad0769ecfa514fe204f62 Mon Sep 17 00:00:00 2001
+From: sunnavy <sunnavy at bestpractical.com>
+Date: Wed, 4 Oct 2023 14:38:46 -0400
+Subject: [PATCH] Support QuickCreate to pass arguments to redirect URL after
+ ticket creation
+
+This is initially for QuickCalls extension, where we need to pass user
+id on user summary page, to "QuickCreate" a ticket there.
+---
+ lib/RT/Interface/Web.pm | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
+index 64ce8dc64..5b4722428 100644
+--- a/lib/RT/Interface/Web.pm
++++ b/lib/RT/Interface/Web.pm
+@@ -4329,6 +4329,7 @@ sub ProcessQuickCreate {
+ MaybeRedirectForResults(
+ Actions => \@results,
+ Path => $path,
++ $params{PassArguments} ? ( Arguments => $params{PassArguments} ) : (),
+ );
+ }
+
+--
+2.25.1
+
commit 302b2307ecb743521f857427094752dc091b1a9a
Author: Brad Embree <brad at bestpractical.com>
Date: Fri Oct 6 08:46:12 2023 -0700
Check for custom dashboard config
Support both the old and new format for QuickCalls config.
If using the new config format determine the Dashboard loading the
portlet and check for a custom dashboard config. Fallback to the Default
config setting if no custom config.
If there is a dashboard id add hidden input to the form so it gets
passed on when submitted.
diff --git a/html/Elements/QuickCalls b/html/Elements/QuickCalls
index 6ed493a..85ec778 100644
--- a/html/Elements/QuickCalls
+++ b/html/Elements/QuickCalls
@@ -48,13 +48,16 @@
% if ( RT::Handle::cmp_version($RT::VERSION, '5.0.0') >= 0 ) {
% # RT 5 version
-<&| /Widgets/TitleBox, title => loc('Quick Calls') &>
+<&| /Widgets/TitleBox, title => $title &>
<div class="form-row">
<div class="col-auto">
- <form method="post"
- action="<%$RT::WebPath%>/Helpers/QuickCalls">
+ <form method="post" action="<%$RT::WebPath%>/Helpers/QuickCalls">
+% if ( $quickcall_dashboard_id ) {
+ <input type="hidden" class="hidden" name="QuickCallsDashboard" value="<% $quickcall_dashboard_id %>">
+% }
+ <input type="hidden" class="hidden" name="QuickCallsPath" value="<%RT->Config->Get('WebPath')%><% $r->path_info %>">
<select name="QuickCall" class="selectpicker form-control">
-% foreach my $QuickCall (@{$RT::QuickCalls||[]}) {
+% foreach my $QuickCall (@$quickcalls) {
<option value="<%$QuickCall->{Name}%>"><%$QuickCall->{Name}%>
% }
</select>
@@ -71,7 +74,7 @@
<&| /Widgets/TitleBox, title => loc('Quick Calls') &>
<form action="<%$RT::WebPath%>/Helpers/QuickCalls">
<select name="QuickCall">
-% foreach my $QuickCall (@{$RT::QuickCalls||[]}) {
+% foreach my $QuickCall (@$quickcalls) {
<option value="<%$QuickCall->{Name}%>"><%$QuickCall->{Name}%>
% }
</select>
@@ -79,3 +82,46 @@
</form>
</&>
% }
+<%INIT>
+my $title = loc('Quick Calls');
+my $config = RT->Config->Get('QuickCalls') || [];
+my $quickcalls;
+
+my $arg = $m->dhandler_arg || '';
+my ( $dashboard_id, $dashboard_name ) = split '/', $arg;
+my $system_default_id = 0;
+
+unless ( $dashboard_id ) {
+ # if there is no dhandler_arg we are on the default homepage dashboard
+ # following logic copied from share/html/Elements/MyRT to find user's default dashboard
+ my $user = $session{'CurrentUser'}->UserObj;
+ my ( $system_default ) = RT::System->new( $session{'CurrentUser'} )->Attributes->Named('DefaultDashboard');
+ $system_default_id = $system_default ? $system_default->Content : 0;
+ $dashboard_id = $user->Preferences( DefaultDashboard => $system_default_id );
+}
+
+# Allow any user to read system default dashboard
+my $Dashboard = RT::Dashboard->new( $system_default_id == $dashboard_id ? RT->SystemUser : $session{'CurrentUser'} );
+my ( $ok, $msg ) = $Dashboard->LoadById( $dashboard_id );
+if ( !$ok ) {
+ RT->Logger->error("Unable to load Dashboard '$dashboard_id': $msg");
+}
+
+my $quickcall_dashboard_id;
+if ( ref $config eq 'ARRAY' ) {
+ # old behavior
+ $quickcalls = $config;
+}
+elsif ( ref $config eq 'HASH' ) {
+ # new behavior
+ $quickcall_dashboard_id = $Dashboard ? $Dashboard->id : '';
+
+ my $quickcall_config = $config->{$quickcall_dashboard_id} || $config->{Default} || {};
+
+ if ( my $quickcall_title = $quickcall_config->{Title} ) {
+ $title .= " - $quickcall_title";
+ }
+ $quickcalls = $quickcall_config->{Actions};
+}
+
+</%INIT>
\ No newline at end of file
diff --git a/html/Helpers/QuickCalls b/html/Helpers/QuickCalls
index f15f6c4..084298b 100644
--- a/html/Helpers/QuickCalls
+++ b/html/Helpers/QuickCalls
@@ -46,21 +46,38 @@
%#
%# END BPS TAGGED BLOCK }}}
<%init>
-if ($QuickCall) {
- my ($QuickCall) = grep { $_->{Name} eq $QuickCall} @{$RT::QuickCalls||[]};
- # copy so we don't nuke the config variable
- $QuickCall = { map { $_ => $QuickCall->{$_} } keys %$QuickCall };
- $QuickCall->{Subject} ||= $QuickCall->{Name};
- $QuickCall->{Owner} = $session{CurrentUser}->Id if ($QuickCall->{SetOwnerToCurrentUser});
- delete $QuickCall->{SetOwnerToCurrentUser};
- delete $QuickCall->{Name};
+if ( $QuickCall ) {
+ my $config = RT->Config->Get('QuickCalls');
+ my $quickcalls;
- # Anon subrefs can be used to generate dynamic values
- $QuickCall->{$_} = $QuickCall->{$_}->()
- for grep {ref $QuickCall->{$_} eq "CODE"} keys %{$QuickCall};
+ if ( ref $config eq 'ARRAY' ) {
+ # old behavior
+ $quickcalls = $config;
+ }
+ elsif ( ref $config eq 'HASH' ) {
+ # new behavior
+ my $quickcall_dashboard_id = $ARGS{QuickCallsDashboard} || '';
+ my $quickcall_config = $config->{$quickcall_dashboard_id} || $config->{Default} || {};
+ $quickcalls = $quickcall_config->{Actions} || [];
+ }
- my $query = $m->comp( '/Elements/QueryString', %$QuickCall);
- RT::Interface::Web::Redirect($RT::WebURL."Ticket/Create.html?$query");
+ if ( my ( $QuickCall ) = grep { $_->{Name} eq $QuickCall } @$quickcalls ) {
+ # copy so we don't nuke the config variable
+ $QuickCall = { map { $_ => $QuickCall->{$_} } keys %$QuickCall };
+ $QuickCall->{Subject} ||= $QuickCall->{Name};
+ $QuickCall->{Owner} = $session{CurrentUser}->Id
+ if ( $QuickCall->{SetOwnerToCurrentUser} );
+
+ delete $QuickCall->{SetOwnerToCurrentUser};
+ delete $QuickCall->{Name};
+
+ # Anon subrefs can be used to generate dynamic values
+ $QuickCall->{$_} = $QuickCall->{$_}->()
+ for grep { ref $QuickCall->{$_} eq "CODE" } keys %{$QuickCall};
+
+ my $query = $m->comp( '/Elements/QueryString', %$QuickCall );
+ RT::Interface::Web::Redirect( $RT::WebURL . "Ticket/Create.html?$query" );
+ }
}
</%init>
<%args>
-----------------------------------------------------------------------
Summary of changes:
Changes | 5 +
MANIFEST | 2 +
META.yml | 11 +-
Makefile.PL | 4 +-
README | 140 +++++++++++++-----
html/Elements/.#QuickCalls | 1 -
html/Elements/QuickCalls | 62 +++++++-
html/Helpers/QuickCalls | 58 ++++++--
html/User/Elements/Portlets/QuickCalls | 3 +
inc/Module/Install.pm | 2 +-
inc/Module/Install/Base.pm | 2 +-
inc/Module/Install/Can.pm | 2 +-
inc/Module/Install/Fetch.pm | 2 +-
inc/Module/Install/Include.pm | 2 +-
inc/Module/Install/Makefile.pm | 2 +-
inc/Module/Install/Metadata.pm | 12 +-
inc/Module/Install/RTx.pm | 4 +-
inc/Module/Install/Win32.pm | 2 +-
inc/Module/Install/WriteAll.pm | 2 +-
inc/YAML/Tiny.pm | 4 +-
lib/RT/Extension/QuickCalls.pm | 158 ++++++++++++++++-----
...ckCreate-to-pass-arguments-to-redirect-UR.patch | 27 ++++
22 files changed, 387 insertions(+), 120 deletions(-)
delete mode 120000 html/Elements/.#QuickCalls
create mode 100644 html/User/Elements/Portlets/QuickCalls
create mode 100644 patches/0001-Support-QuickCreate-to-pass-arguments-to-redirect-UR.patch
hooks/post-receive
--
RT-Extension-QuickCalls
More information about the Bps-public-commit
mailing list