[rt-users] Mods to "EditCustomFields" Element

rt at viewbankrise.net.au rt at viewbankrise.net.au
Mon Aug 11 05:51:42 EDT 2008


Hi all,

I'm trying to make a modification to the EditCustomFields element so that I
can control which fields are displayed by a url parameter, e.g:

When I do: Modify.html?id=1024&fieldDef=5

Then I want to see only customfield 5 in the modify page.

I looked at this:

<table>
% }
% $i++;
  <tr id="CF-<%$CustomField->id%>-EditRow">
    <td class="labeltop">
      <b><%$CustomField->Name%></b><br />
      <i><%$CustomField->FriendlyType%></i>
    </td>
    <td class="entry"><& /Elements/EditCustomField, 
        Object => $TicketObj,
        CustomField => $CustomField,
        NamePrefix => $NamePrefix ,
        Default => $m->notes('Field-' . $CustomField->Id),
        &>
%  if (my $msg = $m->notes('InvalidField-' . $CustomField->Id)) {
        <br />
        <em style="color: red"><% $msg %></em></td>
%  }
  </tr>
% }
</table>

And added something like this (makred with "# ++>"):

<table>
% }
% $i++;
# ++>  % if ( ~defined $ARGS{'fieldDef'} || $ARGS{'fieldDef'} eq
$CustomField->id ) {
  <tr id="CF-<%$CustomField->id%>-EditRow">
    <td class="labeltop">
      <b><%$CustomField->Name%></b><br />
      <i><%$CustomField->FriendlyType%></i>
    </td>
    <td class="entry"><& /Elements/EditCustomField, 
        Object => $TicketObj,
        CustomField => $CustomField,
        NamePrefix => $NamePrefix ,
        Default => $m->notes('Field-' . $CustomField->Id),
        &>
%  if (my $msg = $m->notes('InvalidField-' . $CustomField->Id)) {
        <br />
        <em style="color: red"><% $msg %></em></td>
%  }
  </tr>
# ++ > % }
% }
</table>

I was kind of expecting the URL query_string parameters to show up in the
ARGS array, but I am apparently mistaken ;-)

If anyone can suggest a simple way that I can make the above concept work
out, I will be most appreciative!

Thanks, regards, Mike.




More information about the rt-users mailing list