[PATCH] Add 'custom select' custom field
Bram
rtdevel at lists.wizbit.be
Thu Dec 24 05:18:10 EST 2009
---
lib/RT/CustomField_Overlay.pm | 5 +++
share/html/Elements/EditCustomFieldCustomSelect | 41 +++++++++++++++++++++++
2 files changed, 46 insertions(+), 0 deletions(-)
create mode 100644 share/html/Elements/EditCustomFieldCustomSelect
diff --git a/lib/RT/CustomField_Overlay.pm b/lib/RT/CustomField_Overlay.pm
index 9286d7a..0f15152 100755
--- a/lib/RT/CustomField_Overlay.pm
+++ b/lib/RT/CustomField_Overlay.pm
@@ -96,6 +96,11 @@ our %FieldTypes = (
'Enter one value with autocompletion', # loc
'Enter up to [_1] values with autocompletion', # loc
],
+ CustomSelect => [
+ 'Custom Select multiple values', # loc
+ 'Custom Select one value', # loc
+ 'Custom Select up to [_1] values', # loc
+ ],
);
diff --git a/share/html/Elements/EditCustomFieldCustomSelect b/share/html/Elements/EditCustomFieldCustomSelect
new file mode 100644
index 0000000..fbf6f12
--- /dev/null
+++ b/share/html/Elements/EditCustomFieldCustomSelect
@@ -0,0 +1,41 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# END BPS TAGGED BLOCK }}}
+%
+% my $id = $NamePrefix . $CustomField->Id;
+% @Default = grep defined && length, @Default;
+% # $Values->HasEntry is too slow here
+% if ( !@Default && $Values ) {
+% @Default = map $_->Content, @{$Values->ItemsArrayRef};
+% }
+% $_ = lc $_ foreach @Default;
+% my $CFVs = $CustomField->Values;
+
+ <select name="<%$id%>-Values" id="<%$id%>-Values" >
+ <option value="" selected="selected"><&|/l&>< - Select to choose <% $CustomField->Description %> - ></&></option>
+
+% my @selected = ();
+% while ( my $value = $CFVs->Next ) {
+% my $name = $value->Name;
+% my $desc = $value->Description;
+% if ( grep $_ eq lc $name, @Default ) {
+% push @selected, { Name => $value->Name, Desc => $value->Description };
+% }
+ <option value="<% $name %>"><% $desc %></option>
+% }
+ </select>
+ <br />
+
+% for my $sel (@selected) {
+ <input type="checkbox" class="checkbox" name="<%$id%>-Values" checked="checked" value="<% $sel->{Name} %>" /><% $sel->{Desc} %><br />
+% }
+<%ARGS>
+$Object => undef
+$CustomField => undef
+$NamePrefix => undef
+ at Default => ()
+$Values => undef
+$Multiple => 0
+$Rows => undef
+</%ARGS>
+
--
1.5.4.3
--=_owdx90tgwxc
Content-Type: image/jpeg;
name="customselect.jpg"
Content-Disposition: attachment;
filename="customselect.jpg"
Content-Transfer-Encoding: base64
/9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAAAAgAAAAAAAD/2wBDAAUDBAQEAwUE
BAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/
2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e
Hh4eHh4eHh4eHh7/wAARCAA7AVsDASIAAhEBAxEB/8QAHAAAAgMBAQEBAAAAAAAAAAAAAAYDBQcE
AgEI/8QAQxAAAQMDAgIIBAQFAQQLAAAAAQIDBAUGEQASEyEHFBUiMVWT0jJBU5IjYZTRFjNCUZFS
GCQ0RDZxc3SBorGywcLw/8QAGAEBAQEBAQAAAAAAAAAAAAAAAAECAwT/xAAbEQEBAQEBAQEBAAAA
AAAAAAAAESEBAhIDBP/aAAwDAQACEQMRAD8A/VKWpE2qriNy1Rm2mUuEoQkqUVKUMd4Hl3ddXYsj
zmV6TXt14pH/AEglf90a/wDevWczL2ueTXF0+65qOjOEJHDZW5F6yuUndhJTNWDFbKv9BSpXP5HV
6jSexZHnMr0mvbo7FkecyvSa9uumvz5VNpypUKiT608FACLCWwl1QPzBecbRgfmrP9s6Xuk6kyLo
6PXKcmW1Rn5S4zhbnLAQva6haorxbVzS4ElpWxRyFHG75qq47FkecyvSa9ujsWR5zK9Jr26x5d0L
sy17no9v2bRrbrVOqFMYl9iONOwwmY6Gw+jiBlCXEpCu64EgHYVKKTnU8qfeC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