[Rt-commit] r2949 - in rt/branches/CHALDEA-EXPERIMENTAL/html: Admin/Elements NoAuth

autrijus at bestpractical.com autrijus at bestpractical.com
Tue May 24 16:57:17 EDT 2005


Author: autrijus
Date: Tue May 24 16:57:16 2005
New Revision: 2949

Modified:
   rt/branches/CHALDEA-EXPERIMENTAL/html/Admin/Elements/AddCustomFieldValue
   rt/branches/CHALDEA-EXPERIMENTAL/html/Admin/Elements/EditCustomFieldValues
   rt/branches/CHALDEA-EXPERIMENTAL/html/NoAuth/combobox.js
Log:
* support for multiple combo boxes.

Modified: rt/branches/CHALDEA-EXPERIMENTAL/html/Admin/Elements/AddCustomFieldValue
==============================================================================
--- rt/branches/CHALDEA-EXPERIMENTAL/html/Admin/Elements/AddCustomFieldValue	(original)
+++ rt/branches/CHALDEA-EXPERIMENTAL/html/Admin/Elements/AddCustomFieldValue	Tue May 24 16:57:16 2005
@@ -57,10 +57,13 @@
 <&|/l&>Description</&>:<br>
 <input type="text" size=50 name="CustomField-<%$CustomField->Id%>-Value-new-Description">
 </TD>
+% if ($CustomField->Type ne 'Combobox') {
 <TD><small>
 <&|/l&>Category</&>:<br>
 <input type="text" size=10 name="CustomField-<%$CustomField->Id%>-Value-new-Category">
-</TD></TR>
+</TD>
+% }
+</TR>
 </TABLE>
 
 <%init>

Modified: rt/branches/CHALDEA-EXPERIMENTAL/html/Admin/Elements/EditCustomFieldValues
==============================================================================
--- rt/branches/CHALDEA-EXPERIMENTAL/html/Admin/Elements/EditCustomFieldValues	(original)
+++ rt/branches/CHALDEA-EXPERIMENTAL/html/Admin/Elements/EditCustomFieldValues	Tue May 24 16:57:16 2005
@@ -54,7 +54,9 @@
 <td><&|/l&>Sort</&></td>
 <td><&|/l&>Name</&></td>
 <td><&|/l&>Description</&></td>
+% if ($CustomField->Type ne 'Combobox') {
 <td><&|/l&>Category</&></td>
+% }
 </tr>
 % while (my $value = $values->Next) {
 <tr>
@@ -72,11 +74,13 @@
 <input type="text" size=50 name="CustomField-<%$CustomField->Id%>-Value-<%$value->Id%>-Description" value="<%$value->Description%>">
 </font>
 </td>
+% if ($CustomField->Type ne 'Combobox') {
 <td>
 <font size="-1">
 <input type="text" size=10 name="CustomField-<%$CustomField->Id%>-Value-<%$value->Id%>-Category" value="<%$value->Category%>">
 </font>
 </td>
+% }
 </tr>
 % }
 </table>

Modified: rt/branches/CHALDEA-EXPERIMENTAL/html/NoAuth/combobox.js
==============================================================================
--- rt/branches/CHALDEA-EXPERIMENTAL/html/NoAuth/combobox.js	(original)
+++ rt/branches/CHALDEA-EXPERIMENTAL/html/NoAuth/combobox.js	Tue May 24 16:57:16 2005
@@ -1,13 +1,22 @@
-function ComboBox_Init() {
-    if ( ComboBox_UplevelBrowser() ) {
-        for( var i = 0; i < ComboBoxes.length; i++ ) {
-            ComboBox_Load( ComboBoxes[i] );
+function ComboBox_InitWith(n) {
+    if ( typeof( window.addEventListener ) != "undefined" ) {
+        window.addEventListener("load", ComboBox_Init(n), false);
+    } else if ( typeof( window.attachEvent ) != "undefined" ) {
+        window.attachEvent("onload", ComboBox_Init(n));
+    } else {
+        ComboBox_Init(n)();
+    }
+}
+function ComboBox_Init(n) {
+    return function () {
+        if ( ComboBox_UplevelBrowser( n ) ) {
+            ComboBox_Load( n );
         }
     }
 }
-function ComboBox_UplevelBrowser() {
+function ComboBox_UplevelBrowser( n ) {
     if( typeof( document.getElementById ) == "undefined" ) return false;
-    var combo = document.getElementById( ComboBoxes[0] + "_Container" );
+    var combo = document.getElementById( n + "_Container" );
     if( combo == null || typeof( combo ) == "undefined" ) return false;
     if( typeof( combo.style ) == "undefined" ) return false;
     if( typeof( combo.innerHTML ) == "undefined" ) return false;


More information about the Rt-commit mailing list