1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
% if ($CustomFieldObj->Type eq 'FreeformSingle') {
<input name="Article-<%$id%>-CustomField-<%$CustomFieldObj->Id%>-Value"
value="<%$Values->First && $Values->First->Content%>">
% }
% elsif ($CustomFieldObj->Type eq 'FreeformMultiple') {
<textarea name="Article-<%$id%>-CustomField-<%$CustomFieldObj->Id%>-Values">
%while (my $value = $Values->Next ) {
<%$value->Content%>
%}
</textarea>
% }
% elsif ($CustomFieldObj->Type =~ /(?:Text)/) {
% my $name = "Article-$id-CustomField-".$CustomFieldObj->Id."-Value";
<textarea rows="25" cols="70" name="<%$name%>">
% my $content;
%while (my $value = $Values->Next ) {
% $content .= $value->Content;
%}
<%$content || $ARGS{$name}%>
</textarea>
% }
% elsif ($CustomFieldObj->Type =~ /^Select/) {
% my $CustomFieldValues = $CustomFieldObj->ValuesObj();
<select name="Article-<%$id%>-CustomField-<%$CustomFieldObj->Id%>-Values"
size="5"
<%$CustomFieldObj->Type eq 'SelectMultiple' && 'MULTIPLE'%>
>
% while (my $value = $CustomFieldValues->Next) {
<option value="<%$value->Name%>"
<% $Values->HasEntryWithContent($value->Name) && 'SELECTED' %>
><% $value->Name%></option>
% }
<option value="" <%$Values->Count == 0 && 'SELECTED' %>><&|/l&>(no value)</&></option>
</select>
% }
<%INIT>
if (!$Values ) {
if ($ArticleObj) {
$Values = $ArticleObj->CustomFieldValues($CustomFieldObj->id);
} else {
$Values = RT::FM::ArticleCFValues->new($session{'CurrentUser'});
}
}
</%INIT>
<%ARGS>
$id => undef
$ArticleObj => undef
$CustomFieldObj => undef
$Values => undef
</%ARGS>
|