[rt-commit] [svn] r487 - in rt/branches: .
autrijus-3.1/html/Elements
autrijus at fsck.com
autrijus at fsck.com
Sun Mar 7 04:30:37 EST 2004
Author: autrijus
Date: Sun Mar 7 04:30:37 2004
New Revision: 487
Modified:
rt/branches/ (props changed)
rt/branches/autrijus-3.1/html/Elements/EditCustomField
rt/branches/autrijus-3.1/html/Elements/EditCustomFieldBinary
rt/branches/autrijus-3.1/html/Elements/EditCustomFieldImage
rt/branches/autrijus-3.1/html/Elements/EditCustomFieldText
Log:
* UI for Text, Image and Binary CFs.
Modified: rt/branches/autrijus-3.1/html/Elements/EditCustomField
==============================================================================
--- rt/branches/autrijus-3.1/html/Elements/EditCustomField (original)
+++ rt/branches/autrijus-3.1/html/Elements/EditCustomField Sun Mar 7 04:30:37 2004
@@ -64,6 +64,7 @@
my $Values;
if ($Object) {
$Values = $Object->CustomFieldValues($CustomField->id);
+ $Values->Columns( qw( id CustomField ObjectType ObjectId Current Content ContentType ContentEncoding ) );
$NamePrefix ||= join('-', 'Object', ref($Object), $Object->Id, 'CustomField', '');
}
my $Type = $CustomField->Type;
Modified: rt/branches/autrijus-3.1/html/Elements/EditCustomFieldBinary
==============================================================================
--- rt/branches/autrijus-3.1/html/Elements/EditCustomFieldBinary (original)
+++ rt/branches/autrijus-3.1/html/Elements/EditCustomFieldBinary Sun Mar 7 04:30:37 2004
@@ -21,11 +21,12 @@
%#
%#
%# END LICENSE BLOCK
-% if ($Multiple) {
-<input type="hidden" name="<%$NamePrefix%><%$CustomField->Id%>-Values-Magic" value="1">
-<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><%$Default%></textarea>
-% } else {
-<input name="<%$NamePrefix%><%$CustomField->Id%>-Value" size="<%$Cols%>" value="<%$Default ? $Default : ''%>">
+% while (my $value = $Values->Next ) {
+%# XXX - let user download the file(s) here?
+<input type="checkbox" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValues" value="<% $value->Id %>"><% $value->Content %><br>
+% }
+% if (!$MaxValues or $Values->Count >= $MaxValues) {
+<input type="file" name="<%$NamePrefix%><%$CustomField->Id%>-Value">
% }
<%ARGS>
$Object => undef
@@ -33,7 +34,5 @@
$NamePrefix => undef
$Default => undef
$Values => undef
-$Multiple => undef
-$Cols
-$Rows
+$MaxValues => undef
</%ARGS>
Modified: rt/branches/autrijus-3.1/html/Elements/EditCustomFieldImage
==============================================================================
--- rt/branches/autrijus-3.1/html/Elements/EditCustomFieldImage (original)
+++ rt/branches/autrijus-3.1/html/Elements/EditCustomFieldImage Sun Mar 7 04:30:37 2004
@@ -21,27 +21,18 @@
%#
%#
%# END LICENSE BLOCK
-% if ($Multiple) {
-<input type="hidden" name="<%$NamePrefix%><%$CustomField->Id%>-Values-Magic" value="1">
-<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><%$Default%></textarea>
-% } else {
-<input name="<%$NamePrefix%><%$CustomField->Id%>-Value" size="<%$Cols%>" value="<%$Default ? $Default : ''%>">
+% while (my $value = $Values->Next ) {
+%# XXX - display thumbnails or full images?
+<input type="checkbox" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValues" value="<% $value->Id %>"><% $value->Content %><br>
+% }
+% if (!$MaxValues or $Values->Count < $MaxValues) {
+<input type="file" name="<%$NamePrefix%><%$CustomField->Id%>-Value">
% }
-<%INIT>
-if ($Multiple and $Values) {
- $Default = '';
- while (my $value = $Values->Next ) {
- $Default .= $value->Content;
- }
-}
-</%INIT>
<%ARGS>
$Object => undef
$CustomField => undef
$NamePrefix => undef
$Default => undef
$Values => undef
-$Multiple => undef
-$Cols
-$Rows
+$MaxValues => undef
</%ARGS>
Modified: rt/branches/autrijus-3.1/html/Elements/EditCustomFieldText
==============================================================================
--- rt/branches/autrijus-3.1/html/Elements/EditCustomFieldText (original)
+++ rt/branches/autrijus-3.1/html/Elements/EditCustomFieldText Sun Mar 7 04:30:37 2004
@@ -21,27 +21,20 @@
%#
%#
%# END LICENSE BLOCK
-% if ($Multiple) {
+% while (my $value = $Values->Next ) {
+<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><% $value->Content %></textarea><br>
+% }
+% if (!$MaxValues or $Values->Count < $MaxValues) {
<input type="hidden" name="<%$NamePrefix%><%$CustomField->Id%>-Values-Magic" value="1">
-<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><%$Default%></textarea>
-% } else {
-<input name="<%$NamePrefix%><%$CustomField->Id%>-Value" size="<%$Cols%>" value="<%$Default ? $Default : ''%>">
+<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"></textarea>
% }
-<%INIT>
-if ($Multiple and $Values) {
- $Default = '';
- while (my $value = $Values->Next ) {
- $Default .= $value->Content;
- }
-}
-</%INIT>
<%ARGS>
$Object => undef
$CustomField => undef
$NamePrefix => undef
$Default => undef
$Values => undef
-$Multiple => undef
+$MaxValues => undef
$Cols
$Rows
</%ARGS>
More information about the Rt-commit
mailing list