X-Git-Url: http://git.uio.no/git/?p=usit-rt.git;a=blobdiff_plain;f=share%2Fhtml%2FAdmin%2FArticles%2FClasses%2FModify.html;h=95bb176a9ff244b84f8d6bb0a1a3250e445c5f33;hp=ef71ac3996f36e8eaaf6d15fae9a5bf1492b657a;hb=af59614dbbf895bf0b0ab155fe158b6152edf32b;hpb=632513a6db31ba1c9e5151dc69cff85f7925c8bc diff --git a/share/html/Admin/Articles/Classes/Modify.html b/share/html/Admin/Articles/Classes/Modify.html index ef71ac3..95bb176 100644 --- a/share/html/Admin/Articles/Classes/Modify.html +++ b/share/html/Admin/Articles/Classes/Modify.html @@ -68,29 +68,60 @@
<&|/l&>If a Custom Field is selected, the Subject of your outgoing email will be overridden by this article.&>
+ +<& /Widgets/Form/Select, + Name => 'SubjectOverride', + DefaultLabel => 'No Subject Override', + Values => $subject_cfs, + ValuesLabel => $subject_cf_labels, + CurrentValue => $ClassObj->SubjectOverride, +&> +% } + %$m->callback( CallbackName => 'BeforeSubmit', CustomFields => $cfs, ClassObj => $ClassObj ); % if ( $Create ) { @@ -132,8 +163,17 @@ if ($Create) { } if ($ClassObj->Id()) { + + if ($ARGS{SubjectOverride}) { + $ARGS{SubjectOverride} = $m->comp('/Widgets/Form/Select:Process', + Arguments => \%ARGS, + Name => 'SubjectOverride', + DefaultValue => (''), + ); + } + $ARGS{HotList} ||= 0 if $Submitted; - my @attribs= qw(Description Name HotList); + my @attribs= qw(Description Name HotList SubjectOverride); $m->callback( CallbackName => 'AttributeList', Attributes => \@attribs, ARGSRef => \%ARGS ); push @results, UpdateRecordObject( AttributesRef => \@attribs, Object => $ClassObj, @@ -148,11 +188,17 @@ if ((defined $Enabled && $Enabled == 1) or (not defined $Enabled and $Create)) { } my %include = (Name => 1, Summary => 1); +my $subject_cfs = []; +my $subject_cf_labels = {}; my $cfs; if ( $ClassObj->id ) { $cfs = $ClassObj->ArticleCustomFields; - $include{"CF-Title-".$_->Id} = $include{"CF-Value-".$_->Id} = 1 while $_ = $cfs->Next; + while ( my $cf = $cfs->Next ) { + $include{"CF-Title-".$cf->Id} = $include{"CF-Value-".$cf->Id} = 1; + push @$subject_cfs,$cf->Id; + $subject_cf_labels->{$cf->Id} = $cf->Name; + } } if ( $ClassObj->id && $Submitted ) {