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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
%# BEGIN LICENSE BLOCK
%#
%# Copyright (c) 2002-2003 Jesse Vincent <jesse@bestpractical.com>
%#
%# This program is free software; you can redistribute it and/or modify
%# it under the terms of version 2 of the GNU General Public License
%# as published by the Free Software Foundation.
%#
%# A copy of that license should have arrived with this
%# software, but in any event can be snarfed from www.gnu.org.
%#
%# This program 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.
%#
%# END LICENSE BLOCK
<& /RTFM/Elements/Tabs, Title => loc('Create a new article') &>
<FORM METHOD=POST ACTION="Edit.html">
<INPUT TYPE=HIDDEN NAME=id VALUE="new">
<INPUT TYPE=HIDDEN NAME=Class VALUE="<%$ClassObj->Id%>">
<TABLE>
<TR>
<TD>
<&|/l&>Name</&>
</td>
<td>
<input name=Name SIZE=50>
</TD>
</TR>
<TR>
<TD>
<&|/l&>Summary</&>
</td>
<td>
<input name=Summary SIZE=50 VALUE="<%$ARGS{'Summary'}%>">
</TD>
</TR>
<TR>
<TD>
<&|/l&>Class</&>
</TD>
<TD>
<%$ClassObj->Name%>
</TD>
</TR>
</TABLE>
% while (my $CustomField = $CustomFields->Next) {
<%$CustomField->Name%> - <%$CustomField->Type%><br>
% if ($CustomField->Type eq 'FreeformSingle') {
<input name="CustomField-<%$CustomField->Id%>">
% } elsif ($CustomField->Type eq 'FreeformMultiple') {
<textarea name="CustomField-<%$CustomField->Id%>">
</textarea>
% }
% elsif ($CustomField->Type =~ /(?:TextSingle)$/) {
<textarea rows="30" cols="70" name="CustomField-<%$CustomField->Id%>">
<%exists $cfcontent{$CustomField->Id} && $cfcontent{$CustomField->Id}%></textarea>
% }
% elsif ($CustomField->Type =~ /^Select/) {
% my $CustomFieldValues = $CustomField->ValuesObj();
<select name="CustomField-<%$CustomField->Id%>" size="5" <%$CustomField->Type eq 'SelectMultiple' && 'MULTIPLE'%> >
% while (my $value = $CustomFieldValues->Next) {
<option value="<%$value->Name%>" ><% $value->Name%></option>
% }
<option value="" ><&|/l&>(no value)</&></option>
</select>
% }
% }
<TABLE width=100%>
<h3><&|/l&>Relationships</&></h3>
<i><&|/l&>Enter Articles or URIs to link Articles to. Seperate multiple entries with spaces.</&></i><br>
<TABLE>
<TR><TD><&|/l&>Refers to</&>:</TD><TD><input name="new-RefersTo"
value="<%$ARGS{'new-RefersTo'}%>"></TD></TR>
<TR><TD><&|/l&>Referred to by</&>:</TD><TD> <input name="RefersTo-new"
value="<%$ARGS{'RefersTo-new'}%>"></TD></TR>
</TABLE>
<%ARGS>
$ArticleObj => undef
</%ARGS>
<& /Elements/Submit, Label => loc('Create'), color => "#993333" &>
</form>
<%INIT>
my %cfcontent;
foreach my $arg (sort keys %ARGS) {
if ($arg =~ /^Transaction-(\d+)$/) {
my $trans = RT::Transaction->new($session{'CurrentUser'});
$trans->Load($1);
$cfcontent{$ARGS{$arg}} .= $trans->Content;
}
}
my $ClassObj = RT::FM::Class->new($session{'CurrentUser'});
$ClassObj->Load($Class);
unless ($ClassObj->Id) {
$m->comp("/RTFM/Elements/Error", Why => "'%1' isn't a valid class identifier", $Class);
}
my $CustomFields = $ClassObj->CustomFields();
</%init>
<%ARGS>
$Class=>undef
</%ARGS>
|