2 # Show a page for just adding, editing or removing an autoreply message
4 require './filter-lib.pl';
7 &ui_print_header(undef, $text{'auto_title'}, "");
9 # Get the autoreply filter, if any
10 @filters = &list_filters();
11 ($filter) = grep { $_->{'actionreply'} && $_->{'nocond'} } @filters;
14 print &ui_form_start("save_auto.cgi", "post");
15 print &ui_table_start($text{'auto_header'}, "width=100%", 2);
19 $dis1 = &js_disable_inputs(\@names, [ ]);
20 $dis2 = &js_disable_inputs([ ], \@names);
21 print &ui_table_row($text{'auto_enabled'},
22 &ui_radio("enabled", $filter ? 1 : 0,
23 [ [ 1, $text{'yes'}, "onClick='$dis2'" ],
24 [ 0, $text{'no'}, "onClick='$dis1'" ] ]));
27 print &ui_table_row($text{'auto_reply'},
29 $filter ? $filter->{'reply'}->{'autotext'} : "", 5, 80,
33 $cs = $filter ? $filter->{'reply'}->{'charset'} :
34 &get_charset() eq $default_charset ? undef : &get_charset();
35 $csmode = $cs eq &get_charset() ? 2 :
37 print &ui_table_row($text{'auto_charset'},
38 &ui_radio("charset_def", $csmode,
39 [ [ 1, $text{'default'}." ($default_charset)" ],
40 &get_charset() eq $default_charset ? ( ) :
41 ( [ 2, $text{'auto_charsetdef'}.
42 " (".&get_charset().")" ] ),
43 [ 0, $text{'auto_charsetother'} ] ])." ".
44 &ui_textbox("charset", $csmode == 0 ? $cs : "", 20));
47 if (!$config{'reply_force'}) {
48 $r = $filter ? $filter->{'reply'} : undef;
49 $period = !$filter ? 60 :
50 $r->{'replies'} && $r->{'period'} ? int($r->{'period'}/60) :
51 $r->{'replies'} ? 60 : undef;
52 if ($config{'reply_min'}) {
53 # Forced on, with a minimum
54 print &ui_table_row($text{'auto_period'},
55 &ui_textbox("period", $period, 3).
56 " ".$text{'index_mins'});
59 # Can turn off reply tracking
60 print &ui_table_row($text{'auto_period'},
61 &ui_opt_textbox("period", $period, 3,
62 $text{'index_noperiod'}).
63 " ".$text{'index_mins'});
67 print &ui_table_end();
68 print &ui_form_end([ [ undef, $text{'save'} ] ]);
70 &ui_print_footer("", $text{'index_return'});