[Rt-commit] r9657 - in rt/branches/3.6-EXPERIMENTAL-CATEGORIES: . lib/RT

falcone at bestpractical.com falcone at bestpractical.com
Tue Nov 13 18:02:44 EST 2007


Author: falcone
Date: Tue Nov 13 18:02:44 2007
New Revision: 9657

Modified:
   rt/branches/3.6-EXPERIMENTAL-CATEGORIES/   (props changed)
   rt/branches/3.6-EXPERIMENTAL-CATEGORIES/html/Elements/EditCustomFieldSelect
   rt/branches/3.6-EXPERIMENTAL-CATEGORIES/lib/RT/CustomFieldValue_Overlay.pm

Log:
 r26548 at ketch:  falcone | 2007-11-13 17:46:52 -0500
 * move the join nonsense back into the code


Modified: rt/branches/3.6-EXPERIMENTAL-CATEGORIES/html/Elements/EditCustomFieldSelect
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-CATEGORIES/html/Elements/EditCustomFieldSelect	(original)
+++ rt/branches/3.6-EXPERIMENTAL-CATEGORIES/html/Elements/EditCustomFieldSelect	Tue Nov 13 18:02:44 2007
@@ -111,9 +111,7 @@
 %             push @levels, $level;
 %         }
 %     }
-%     # use >>|<< as a bizarre joiner and we'll disallow it in category names
-%     my $optionname = join(">>|<<",("Category", $category, $value->Name));
-        <option value="<%$optionname%>" 
+        <option value="<%$value->EncodedName%>" 
 % if ($Values) {
 %   if ( $Values->HasEntry(Value => $value->Name, Category => ($value->Category||'')) ) {
 %        $$SelectedRef = 1;

Modified: rt/branches/3.6-EXPERIMENTAL-CATEGORIES/lib/RT/CustomFieldValue_Overlay.pm
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-CATEGORIES/lib/RT/CustomFieldValue_Overlay.pm	(original)
+++ rt/branches/3.6-EXPERIMENTAL-CATEGORIES/lib/RT/CustomFieldValue_Overlay.pm	Tue Nov 13 18:02:44 2007
@@ -112,4 +112,20 @@
 
 sub ValidateName { 1 };
 
+=head2 EncodedName
+
+Returns a CustomFieldValue Name suitable for use in drop down lists
+It encodes the Category name along with the Value name in a way that
+can be extracted later so we can store Category.
+
+=cut
+
+sub EncodedName {
+    my $self = shift;
+
+    # use >>|<< as a bizarre joiner and we'll disallow it in category names
+    return join(">>|<<",("Category", ($self->Category||''), $self->Name));
+
+}
+
 1;


More information about the Rt-commit mailing list