fix ticket creation, from #9260
[freeside.git] / rt / share / html / Ticket / Elements / EditCustomFields
index 6cab8be..ee55e99 100755 (executable)
 % 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, 
@@ -105,6 +105,13 @@ $m->callback( %ARGS, CallbackName => 'MassageCustomFields', CustomFields => $Cus
 
 my $single_column = RT->Config->Get('EditCustomFieldsSingleColumn');
 
+# show hints for missing required fields
+if ( $TicketObj ) {
+    foreach my $field ( $TicketObj->MissingRequiredFields ) {
+        $m->notes('InvalidField-' . $field->Id => 'Required to resolve');
+    }
+}
+
 </%INIT>
 <%ARGS>
 $NamePrefix => ''
@@ -112,4 +119,5 @@ $TicketObj => undef
 $QueueObj => undef
 $OnCreate => undef
 $DefaultsFromTopArguments => 1
+$CFIDPrefix => ''
 </%ARGS>