#!/usr/bin/perl
# STTA Rev. 1.3 Copyright (c) 2001-2004 Jesús Pérez Lorenzo  --- license GNU GPL
# stta: (@#) 1.31051043346- [2004_01_29_102036]
# feedback_form.cgi
# Display a form so that the user can send in a webmin bug report

require './stta-lib.pl';
&init_config();
&load_dataconf();
&ReadParse();
&error_setup($text{'feedback_err'});
$access{'feedback'} || &error($text{'feedback_ecannot'});

&load_more_text('feedback');

&headerstta($text{'feedback_title'}, "", "feedback" ,undef,1,0,"$text{'headpage_right'}"."$text{'head_logout'}",undef,undef,"$text{head_below}" );
print "<hr>\n";

$fb = $config{'feedback_to'} ? $config{'feedback_to'}
			      : '';
print &text('feedback_desc', "<tt>$fb</tt>"),"<p>\n";
print "<b>$text{'feedback_desc2'}</b><p>\n" if (!$config{'feedback_to'});

print "<form action=feedback.cgi method=post enctype=multipart/form-data>\n";
print "<table border width=100%>\n";
print "<tr $tb> <td><font color='$revtext'><b>$text{'feedback_header'}</b></font></td> </tr>\n";
print "<tr $cb> <td><table width=100%>\n";

print "<tr> <td><b>$text{'feedback_name'}</b></td>\n";
print "<td><input name=name size=25 value='$config{'feedback_name'}'></td>\n";

print "<td><b>$text{'feedback_email'}</b></td>\n";
print "<td><input name=email size=25 value='$config{'feedback_email'}'></td> </tr>\n";
%minfo=&load_minfo();
$ldesc="desc_$current_lang";

print "<tr> <td><b>$text{'feedback_module'}</td><td><b><font >$minfo{$ldesc}</b></font></b></td></tr>\n";
print "  <input TYPE=\"hidden\" NAME=\"module\" VALUE=\"stta\">\n";

print "<tr> <td><b>".&text('feedback_dirname', $in{'dirname'})."</b></td>\n";
print "<td><input type=text name=dirname value='$config{'feedback_dirname'}'></td>";
print "<td colspan=2>($text{'feedback_configDIRNAME'})</td> </tr>\n";
print "<tr><td valign=top>$text{'f_packcmd'}&nbsp;</td>\n";
 print "<td><input TYPE=\"text\" NAME=\"packcmd\" VALUE=\"$config{feedback_packcmd}\" cols=\"60\" size=\"60\" ALIGN=left >\n";
print "<td colspan=2>($text{'feedback_packcmddesc'})</td> </tr>\n";
print "<tr><td><b>$text{'feedback_mailserver'}</b></td>\n";
printf "<td><input type=radio name=mailserver_def value=1 %s> %s\n",
	$config{'feedback_mailserver'} ? "" : "checked",
	$text{'feedback_mailserver_def'};
printf "</td><td><input type=radio name=mailserver_def value=0 %s>\n",
	$config{'feedback_mailserver'} ? "checked" : "";
printf "<input name=mailserver size=15 value='%s'></td> </tr>\n",
	$config{'feedback_mailserver'};

if (!$gconfig{'nofeedbackcc'}) {
	print "<tr> <td valign=top><b>$text{'feedback_to'}</b></td>\n";
	print "<td colspan=3><textarea name=to rows=4 cols=50>",
		$fb,"</textarea></td> </tr>\n";
	}

print "<tr> <td valign=top><b>$text{'feedback_text'}</b></td>\n";
print "<td colspan=3><textarea name=text rows=6 cols=70 wrap=on>",
      "</textarea></td> </tr>\n";

print "<tr> <td colspan=2 nowrap><b>$text{'feedback_cfg'}</b>&nbsp;&nbsp;\n";
printf "<input type=radio name=cfg value=1> $text{'yes'}\n";
printf "<input type=radio name=cfg value=0 checked> $text{'no'}</td>\n";
print "<td colspan=2>($text{'feedback_cfgdesc'})</td> </tr>\n";

if (!$gconfig{'nofeedbackconfig'}) {
	print "<tr> <td colspan=2 nowrap><b>$text{'feedback_config'}</b>&nbsp;&nbsp;\n";
	printf "<input type=radio name=config value=1> $text{'yes'}\n";
	printf "<input type=radio name=config value=0 checked> $text{'no'}</td>\n";
	print "<td colspan=2>($text{'feedback_configdesc'})</td> </tr>\n";
	}

if (!$gconfig{'nofeedbackconfig'}) {
	print "<tr> <td colspan=2 nowrap><b>$text{'feedback_DBS'}</b>&nbsp;&nbsp;\n";
	printf "<input type=radio name=dbs value=1> $text{'yes'}\n";
	printf "<input type=radio name=dbs value=0 checked> $text{'no'}</td>\n";
	print "<td colspan=2>($text{'feedback_configDBS'})</td> </tr>\n";
}

if (!$gconfig{'nofeedbackconfig'}) {
	print "<tr> <td colspan=2 nowrap><b>$text{'feedback_BACKUPS'}</b>&nbsp;&nbsp;\n";
	printf "<input type=radio name=backups value=1> $text{'yes'}\n";
	printf "<input type=radio name=backups value=0 checked> $text{'no'}</td>\n";
	print "<td colspan=2>($text{'feedback_configBACKUPS'})</td> </tr>\n";
}

if (!$gconfig{'nofeedbackconfig'}) {
	print "<tr> <td colspan=2 nowrap><b>$text{'feedback_LOGS'}</b>&nbsp;&nbsp;\n";
	printf "<input type=radio name=logs value=1> $text{'yes'}\n";
	printf "<input type=radio name=logs value=0 checked> $text{'no'}</td>\n";
	print "<td colspan=2>($text{'feedback_configLOGS'})</td> </tr>\n";
	print "<tr><td colspan=2>$text{'feedback_taillogs'}&nbsp;&nbsp;\n";
	printf "<input type=text name=tailn cols=\"4\" size=4 value=\"50\"> $text{'l_line'}</td>\n";
	print "<td colspan=2>$text{'feedback_timelogs'}&nbsp;&nbsp;\n";
	printf "<input type=text name=timelog cols=\"4\" size=4 value=5> $text{'edit_mins'}</td></tr>\n";
}

print "<tr> <td><b>$text{'feedback_attach'}</b></td>\n";
print "<td><input type=file name=attach0></td>",
      "<td colspan=2><input type=file name=attach1></td> </tr>\n";

print "</table></td></tr></table>\n";
print "<input type=submit value='$text{'feedback_send'}'></form>\n";

print "<hr>\n";
do "footer.pl";
exit;


