[Rt-commit] rt branch, 4.4/queue-include-article, repushed
Craig Kaiser
craig at bestpractical.com
Thu Dec 28 13:42:05 EST 2017
The branch 4.4/queue-include-article was deleted and repushed:
was f068a4d8443a9c975e06b3eb92b992c8ad9902b8
now 0639ea1850493b6d9cc1f6d0c26dbf08f057f2ea
1: f068a4d ! 1: 0639ea1 Include Article on ticket create, based on queue
@@ -42,16 +42,21 @@
+sub SetArticleIncluded {
+ my $self = shift;
+ my $value = shift;
-+
+
+ return ( 0, $self->loc('Permission Denied') )
+ unless $self->CurrentUserHasRight('AdminQueue');
-
++
++ my $MyArticle = RT::Article->new(RT->SystemUser);
++ if ( $MyArticle->ValidateName($value) and $value ){
++ return (0, $self->loc("Invalid Article Name [_1]", $value));
++ }
++
+ my ($status, $msg) = $self->SetAttribute(
+ Name => 'ArticleIncluded',
+ Description => 'Include Article on ticket create, for Queue.',
+ Content => $value,
+ );
-+ return ($status, $msg) unless $status;
++ return (0, $self->loc("Article Included updated to [_1]", $value));
+}
sub Delete {
@@ -121,15 +126,7 @@
$QueueObj->Load($id) || $QueueObj->Load($Name) || Abort(loc("Couldn't load queue '[_1]'", $Name));
}
}
-+use Data::Printer;
-+my $MyArticle = RT::Article->new( $session{'CurrentUser'});
-+p($ARGS{'ArticleIncluded'});
-+p($MyArticle->ValidateName($ARGS{'ArticleIncluded'}));
-+if ( $MyArticle->ValidateName($ARGS{'ArticleIncluded'}) ){
-+ $ARGS{'ArticleIncluded'} = undef;
-+ p($ARGS{'ArticleIncluded'});
-+}
-
+-
if ( $QueueObj->Id ) {
$title = loc('Configuration for queue [_1]', $QueueObj->Name );
my @attribs= qw(Description CorrespondAddress CommentAddress Name SortOrder
More information about the rt-commit
mailing list