[Rt-commit] rt branch, 4.4/include-article-queue, repushed
Craig Kaiser
craig at bestpractical.com
Mon Jan 29 12:44:18 EST 2018
The branch 4.4/include-article-queue was deleted and repushed:
was 40b43e48c5f3c7acbe4e956b26ec44a4e1f6d335
now d9f44c32938f92bc1d97c2af17442d7baa64b232
1: 578be5b01 ! 1: ef268f350 Add Default Article option for Queues
@@ -1,10 +1,11 @@
Author: Craig Kaiser <craig at bestpractical.com>
- Include Article on Ticket create per Queue
+ Add Default Article option for Queues
- Can add a default Article to Queues. Where the content of the Article
- will be added to each Ticket created in that Queue, on create. The Article to be
- included per Queue can be set in the web UI page for modify Queue.
+ Currently there is not a simple way to apply boilerplate text to
+ tickets automatically. By selecting a Default Article for a Queue, any
+ ticket created in that Queue will automatically have the Article content
+ added to the Ticket content.
diff --git a/lib/RT/Queue.pm b/lib/RT/Queue.pm
--- a/lib/RT/Queue.pm
@@ -71,7 +72,7 @@
+
+
-+<tr><td align="right"><&|/l&>Article Included</&>:</td><td colspan="3">
++<tr><td align="right"><&|/l&>Default Article</&>:</td><td colspan="3">
+<& /Elements/ArticleSelect, %ARGS &>
+</td></tr>
+
@@ -203,6 +204,82 @@
+$QueueObj => undef
+</%ARGS>
+diff --git a/share/html/Elements/ArticleSelect.rej b/share/html/Elements/ArticleSelect.rej
+new file mode 100644
+--- /dev/null
++++ b/share/html/Elements/ArticleSelect.rej
+@@
++***************
++*** 0 ****
++--- 1,67 ----
+++ %# BEGIN BPS TAGGED BLOCK {{{
+++ %#
+++ %# COPYRIGHT:
+++ %#
+++ %# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC
+++ %# <sales at bestpractical.com>
+++ %#
+++ %# (Except where explicitly superseded by other copyright notices)
+++ %#
+++ %#
+++ %# LICENSE:
+++ %#
+++ %# This work is made available to you under the terms of Version 2 of
+++ %# the GNU General Public License. A copy of that license should have
+++ %# been provided with this software, but in any event can be snarfed
+++ %# from www.gnu.org.
+++ %#
+++ %# This work is distributed in the hope that it will be useful, but
+++ %# WITHOUT ANY WARRANTY; without even the implied warranty of
+++ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+++ %# General Public License for more details.
+++ %#
+++ %# You should have received a copy of the GNU General Public License
+++ %# along with this program; if not, write to the Free Software
+++ %# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+++ %# 02110-1301 or visit their web page on the internet at
+++ %# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+++ %#
+++ %#
+++ %# CONTRIBUTION SUBMISSION POLICY:
+++ %#
+++ %# (The following paragraph is not intended to limit the rights granted
+++ %# to you to modify and distribute this software under the terms of
+++ %# the GNU General Public License and is only of importance to you if
+++ %# you choose to contribute your changes and enhancements to the
+++ %# community by submitting them to Best Practical Solutions, LLC.)
+++ %#
+++ %# By intentionally submitting any modifications, corrections or
+++ %# derivatives to this work, or any other work intended for use with
+++ %# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+++ %# you are the copyright holder for those contributions and you grant
+++ %# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
+++ %# royalty-free, perpetual, license to use, copy, create derivative
+++ %# works based on those contributions, and sublicense and distribute
+++ %# those contributions and any derivatives thereof.
+++ %#
+++
+++ <& "SelectArticle$Widget", %ARGS &>
+++
+++ <%INIT>
+++
+++ my $hotlist = RT::Articles->new( $session{'CurrentUser'} );
+++ $hotlist->LimitHotlistClasses;
+++ $hotlist->LimitAppliedClasses( Queue => $QueueObj );
+++ $ARGS{'hotlist'} = $hotlist;
+++
+++ my $dropdown_limit = 50;
+++ $m->callback( CallbackName => 'ModifyDropdownLimit', DropdownLimit => \$dropdown_limit );
+++
+++ my $dropdown = 1 unless ( $hotlist->Count > $dropdown_limit);
+++ my $Widget = $dropdown ? 'Dropdown' : 'Search';
+++
+++ </%INIT>
+++
+++ <%ARGS>
+++ $QueueObj => undef
+++ </%ARGS>
+
diff --git a/share/html/Elements/SelectArticleDropdown b/share/html/Elements/SelectArticleDropdown
new file mode 100644
--- /dev/null
2: 9ee482f4e ! 2: 20114bb8a Make default Article content show on Ticket create
@@ -1,10 +1,10 @@
Author: Craig Kaiser <craig at bestpractical.com>
- Add Default Article content if applied to Queue
+ Make default Article content show on Ticket create
- If the Queue that the Ticket is being created on has a default Article
- set, then the content for the article will be rendered on the create
- page.
+ It is important that, if a default Article is selected for a Queue. Then
+ on Create.html, the content of the Article should be shown for any
+ Ticket created in the Queue.
diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
--- a/share/html/Ticket/Create.html
@@ -25,7 +25,7 @@
+
+ my $ObjectCustomFieldValue = RT::ObjectCustomFieldValue->new(RT->SystemUser);
+ $ObjectCustomFieldValue->LoadByCols(ObjectId => $QueueObj->DefaultArticle);
-+ if ($validArticles{$ObjectCustomFieldValue}) { $ARGS{Content} = $ObjectCustomFieldValue->Content(); }
++ if ($ObjectCustomFieldValue->id and $validArticles{$ObjectCustomFieldValue->id}) { $ARGS{Content} = $ObjectCustomFieldValue->Content(); }
+}
+
PageMenu->child( basics => raw_html => q[<a href="#basics" onclick="return switchVisibility('Ticket-Create-basics','Ticket-Create-details');">] . loc('Basics') . q[</a>]);
3: 689786899 ! 3: d9f44c329 Add test for default Article content on create.html
@@ -1,9 +1,9 @@
Author: Craig Kaiser <craig at bestpractical.com>
- Add test for including Article content for Queue
+ Add test for default Article content on create.html
- Add a test to place an Article on a Queue and ensure that the content of
- the Article is rendered to Create.html.
+ Test to ensure that the default Articles content is rendered on
+ Create.html for Tickets in that Queue.
diff --git a/t/ticket/include-article-by-queue.t b/t/ticket/include-article-by-queue.t
new file mode 100644
@@ -32,7 +32,7 @@
+my $queue = RT::Queue->new(RT->SystemUser);
+$queue->Load('General');
+ok( $queue, 'Loaded General Queue' );
-+($ret, $msg) = $queue->SetArticleIncluded($article->id);
++($ret, $msg) = $queue->SetDefaultArticle($article->id);
+ok( $ret, $msg );
+
+ok $m->login(root => 'password'), "logged in";
@@ -40,4 +40,3 @@
+$m->scraped_id_is('Content', 'My Article Test Content');
+
+done_testing;
-
4: 509801bed < -: ------- Add test for including Article content for Queue
More information about the rt-commit
mailing list