[Rt-commit] rt branch, 3.8/rtir-cf-id-handling, created. rt-3.8.9-14-g2aaac82

Kevin Falcone falcone at bestpractical.com
Fri Mar 4 11:39:55 EST 2011


The branch, 3.8/rtir-cf-id-handling has been created
        at  2aaac82a5d197f0d1f17dd194a7c6c9ce832363c (commit)

- Log -----------------------------------------------------------------
commit 2aaac82a5d197f0d1f17dd194a7c6c9ce832363c
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Mar 4 10:00:11 2011 -0500

    Allow prefixing of the cflabel/cfentry html ids in EditCustomFields
    
    If you have two ticket creation / editing pages in the same web page,
    you'll end up with multiple tds that have the same id which is invalid
    and causes bad things to happen with javascript.  This provides a hook
    to let you tweak the id to form2-cflabel-id on your second form.

diff --git a/share/html/Ticket/Elements/EditCustomFields b/share/html/Ticket/Elements/EditCustomFields
index 6cab8be..918f4d4 100755
--- a/share/html/Ticket/Elements/EditCustomFields
+++ b/share/html/Ticket/Elements/EditCustomFields
@@ -57,11 +57,11 @@
 % if ( $single_column || $i % 2 ) {
 <tr class="edit-custom-field">
 % }
-    <td class="cflabel cftype-<% $type %> cfname-<% $escaped_name %>" id="cflabel-<% $CustomField->Id %>" >
+    <td class="cflabel cftype-<% $type %> cfname-<% $escaped_name %>" id="<% $CFIDPrefix %>cflabel-<% $CustomField->Id %>" >
       <b><% loc($CustomField->Name) %></b><br />
       <i><% $CustomField->FriendlyType %></i>
     </td>
-    <td class="entry cftype-<% $type %> cfname-<% $escaped_name %>" id="cfentry-<% $CustomField->Id %>">
+    <td class="entry cftype-<% $type %> cfname-<% $escaped_name %>" id="<% $CFIDPrefix %>cfentry-<% $CustomField->Id %>">
 % my $default = $m->notes('Field-' . $CustomField->Id);
 % $default ||= $ARGS{"CustomField-". $CustomField->Id };
       <& /Elements/EditCustomField, 
@@ -112,4 +112,5 @@ $TicketObj => undef
 $QueueObj => undef
 $OnCreate => undef
 $DefaultsFromTopArguments => 1
+$CFIDPrefix => ''
 </%ARGS>

-----------------------------------------------------------------------


More information about the Rt-commit mailing list