notify on custom field change, #11274
[freeside.git] / rt / share / html / Admin / Elements / EditScripOptions
1 % return if !@options;
2 <tr><td></td><td><table>
3 % my $prefix = $Name.'Rules-';
4 % foreach my $o (@options) {
5 %   my $curr_value = $rules{ $o->{'name'} };
6   <tr><td align="right"><% $o->{'label'} %>:</td>
7   <td>
8 %   if ( $o->{'type'} eq 'text' ) {
9   <input type="text" name="<% $prefix.$o->{'name'} %>" value="<% $curr_value %>">
10 %   }
11 %   elsif ( $o->{'type'} eq 'checkbox' ) {
12   <input type="checkbox" name="<% $prefix.$o->{'name'} %>" value="1" <% $curr_value ? 'CHECKED' : '' %>>
13 %   }
14 %   elsif ( $o->{'type'} eq 'select' and ref $o->{'options'} ) {
15   <select name="<% $prefix.$o->{'name'} %>">
16 %     my @choices = @{ $o->{'options'} };
17 %     while (@choices) {
18 %       my $v = shift @choices;
19 %       my $l = shift @choices;
20   <option value="<% $v %>"<% ($curr_value eq $v) ? ' SELECTED' : ''%>>
21   <% $l %></option>
22 %     }
23   </select>
24 %   } # else $o->{'type'}
25 </td></tr>
26 % } #foreach $o
27 </table></td></tr>
28
29 <%INIT>
30 my (@options, %rules);
31 if ( $ScripX ) {
32   my $ScripXObj = "RT::Scrip$Name"->new($session{'CurrentUser'});
33   $ScripXObj->Load($ScripX);
34   my $QueueObj = RT::Queue->new($session{'CurrentUser'});
35   $QueueObj->Load($Queue);
36   my $method = "Load$Name";
37   my $XObj = $ScripXObj->$method();
38   @options = $XObj->Options('QueueObj' => $QueueObj);
39   %rules = split("\n", $Default);
40 }
41 </%INIT>
42
43 <%ARGS>
44 $Name => undef
45 $Default => undef
46 $Queue => 0
47 $ScripX => undef
48 </%ARGS>