[Rt-commit] rt branch, 4.4/queue-include-article, repushed
Craig Kaiser
craig at bestpractical.com
Mon Jan 22 15:28:31 EST 2018
The branch 4.4/queue-include-article was deleted and repushed:
was a463f51276c4fad552ddfea7a5e8a29748e99d23
now 9592a5675a5a025b4bdcb9093338d18c27711c2e
1: 350a53162 ! 1: f6d27cb75 Include Article on Ticket create per Queue
@@ -65,7 +65,8 @@
+ Content => $value,
+ );
+ return ($status, $msg) unless $status;
-+ return (0, $self->loc("Article Included updated to [_1]", $value));
++ if ($value){ return (1, $self->loc("Article Included updated to [_1]", $value)); }
++ return (1, $self->loc("Article Included removed"));
+}
sub Delete {
@@ -108,9 +109,8 @@
+
+
-+<tr><td class='label' valign="right"><&|/l&>Article Included</&>:</td>
-+<td class="messagebox-container">
-+<& /Articles/Elements/BeforeMessageBox, %ARGS &>
++<tr><td align="right"><&|/l&>Article Included</&>:</td><td colspan="3">
++<& /Elements/ArticleSelect, %ARGS &>
+</td></tr>
+
<tr><td align="right"><&|/l&>Subject Tag</&>:</td>
@@ -125,18 +125,6 @@
$QueueObj->Load( $id ) if !$id || $id eq 'new';
+$ARGS{QueueObj} = $QueueObj;
-+
-+my @ArticlesIncluded = grep {/Articles-Include-Article-(.+)/} keys %ARGS;
-+
-+foreach(@ArticlesIncluded){
-+ if( $ARGS{$_} eq 'Go' && length $ARGS{$_} ){
-+ $_ =~ /Articles-Include-Article-(.+)/;
-+ $ARGS{'ArticleIncluded'} = $1;
-+ }elsif ( $ARGS{$_} ){
-+ $ARGS{'ArticleIncluded'} = $ARGS{$_};
-+ }
-+}
-+
$EnabledChecked = 'checked="checked"';
unless ($Create) {
@@ -180,29 +168,217 @@
$SetCrypt => undef
$SLAEnabled => undef
-diff --git a/share/html/Articles/Elements/BeforeMessageBox b/share/html/Articles/Elements/BeforeMessageBox
---- a/share/html/Articles/Elements/BeforeMessageBox
-+++ b/share/html/Articles/Elements/BeforeMessageBox
-@@
- <tr>
- <td><&|/l&>Select an Article to include</&></td>
- <td><select name="<% $name_prefix %>Articles-Include-Article-Named-Hotlist" onchange="this.form.submit()">
--<option value="" selected><&|/l&>-</&></option>
-+% my $QueueObj = $ARGS{QueueObj};
-+<option value="" selected><&|/l&><% $QueueObj? $QueueObj->ArticleIncluded? $QueueObj->ArticleIncluded: '-':'-'%></&></option>
+diff --git a/share/html/Elements/ArticleSelect b/share/html/Elements/ArticleSelect
+new file mode 100644
+--- /dev/null
++++ b/share/html/Elements/ArticleSelect
+@@
++%# 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 $count = 0;
++while (my $article = $hotlist->Next){
++ $count +=1;
++}
++
++my $dropdown_limit = 50;
++$m->callback( CallbackName => 'ModifyDropdownLimit', DropdownLimit => \$dropdown_limit );
++
++my $dropdown = 1 unless ( $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
++++ b/share/html/Elements/SelectArticleDropdown
+@@
++%# 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.
++%#
++%# END BPS TAGGED BLOCK }}}
++
++<select name='ArticleIncluded'>
++<option value="undef" selected><&|/l&><% $QueueObj? $QueueObj->ArticleIncluded? $QueueObj->ArticleIncluded: '-':'-'%></&></option>
+% if ( $QueueObj && $QueueObj->ArticleIncluded ) {
-+<option value="undef">-</option>
++<option value="">-</option>
+% }
- % while (my $article = $hotlist->Next) {
--<option value="<% $article->Id %>"><%$article->Name|| loc('(no name)')%>: <%$article->Summary || ''%></option>
-+% if( $QueueObj ) { unless( $article->Name eq $QueueObj->ArticleIncluded ){
-+<option value="<% $article->Id %>"><% $article->Name|| loc('(no name)')%>: <%$article->Summary || ''%></option>
-+% } }else{
-+<option value="<% $article->Id %>"><% $article->Name|| loc('(no name)')%>: <%$article->Summary || ''%></option>
++% while (my $article = $hotlist->Next) {
++% unless ($article->Name eq $QueueObj->ArticleIncluded) {
++<option value="<% $article->Id %>"><% $article->Name|| loc('(no name)')%><%$article->Summary || ''%></option>
+% }
- % }
- </select>
- </td>
++% }
++</select>
++
++<%ARGS>
++$id => undef
++$QueueObj => undef
++$hotlist => undef
++$ArticleIncluded => undef
++</%ARGS>
+
+diff --git a/share/html/Elements/SelectArticleSearch b/share/html/Elements/SelectArticleSearch
+new file mode 100644
+--- /dev/null
++++ b/share/html/Elements/SelectArticleSearch
+@@
++%# 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.
++%#
++%# END BPS TAGGED BLOCK }}}
++
++<input value="" selected placeholder="<% $QueueObj->ArticleIncluded? $QueueObj->ArticleIncluded: ''%>">
++<%ARGS>
++$id => undef
++$QueueObj => undef
++$hotlist => undef
++$ArticleIncluded => undef
++</%ARGS>
+\ No newline at end of file
diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
--- a/share/html/Ticket/Create.html
2: a463f5127 ! 2: 9592a5675 Add test for including Article content for Queue
@@ -14,7 +14,6 @@
+use warnings;
+
+use RT::Test tests => undef;
-+use Data::Printer;
+
+my $m = RT::Test->started_ok;
+my $url = $m->rt_base_url;
More information about the rt-commit
mailing list