suspension and cancellation reasons
[freeside.git] / httemplate / edit / reason.html
1 %
2 % $cgi->param('class') =~ /^(\w)$/ or die "illegal class";
3 % my $class=$1;
4 %
5 % my %classmap = ('C' => 'cancel',
6 %              'S' => 'suspend',
7 %             );
8 % my $classname = $classmap{$class};
9 %
10 % my (@types) = qsearch( 'reason_type', { 'class' => $class } );
11 %
12 <% include( 'elements/edit.html',
13                  'name'   => ucfirst($classname) . ' Reason',
14                  'table'  => 'reason',
15                  'labels' => { 
16                                'reasonnum'   => ucfirst($classname) .  ' Reason',
17                                'reason_type' => ucfirst($classname) . ' Reason type',
18                                'reason'      => ucfirst($classname) . ' Reason',
19                                'disabled'    => 'Disabled',
20                                'class'       => '',
21                              },
22                  'fields' => [
23                                { 'field' => 'reason_type',
24                                  'type'  => 'select',
25                                  'value' => { 'vcolumn' => 'typenum',
26                                               'ccolumn' => 'type',
27                                               'values'  => \@types,
28                                             },
29                                },
30                                'reason',
31                                { 'field' => 'class',
32                                  'type'  => 'fixedhidden',
33                                  'value' => $class,
34                                },
35                                { 'field' => 'disabled',
36                                  'type'  => 'checkbox',
37                                  'value' => 'Y'
38                                },
39                              ],
40                  'viewall_url' => $p . "browse/reason.html?class=$class",
41            )
42 %>