Just sharing.  This is how I disabled editing of certain custom
fields via the web UI.

Part 1: Make the word READONLY appear in your custom field's
        description.

Part 2: Edit share/html/Tickets/Elements/EditCustomFields
        (or whatever proper 'local' file :)) to look like this
        for the "table row" block.


...stuff here...
<tr>
% }
    <td class="cflabel">
      <b><% loc($CustomField->Name) %></b><br />
      <i>Type: <% $CustomField->FriendlyType %></i>
    </td>
% if ($CustomField->Description =~ /READONLY/) {
    <td class="entry"><b>READ-ONLY FIELD</b></td>
% } else {
    <td class="entry">
%   my $default = $m->notes('Field-' . $CustomField->Id);
%   $default ||= $ARGS{"CustomField-". $CustomField->Id };
        <& /Elements/EditCustomField,
            %ARGS,
            Object => $TicketObj,
            CustomField => $CustomField,
            NamePrefix => $NamePrefix,
            Default => $default,
        &>
%   if (my $msg = $m->notes('InvalidField-' . $CustomField->Id)) {
          <br />
          <span class="cfinvalidfield"><% $msg %></span>
%   }
    </td>
% }

% unless ( $i % 2 ) {
</tr>
...stuff here...


Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Reply via email to