#!/usr/bin/perl
# file_deflists.cgi
# Select Definiton Object list
# STTA Rev. 1.3 Copyright (c) 2001-2002 Jesús Pérez Lorenzo  --- license GNU GPL 

require './stta-lib.pl';

 &ReadParse();
 $postform = ($in{form}) ? $in{form} : "showlist"; 
 &headerstta($text{"index_".$postform}, "", $postform,undef,1,1,$text{headpage_rigth} );
 print "<hr><p>\n";
 print "<SCRIPT SRC=\"global.js\">\n"; 
 print "</SCRIPT>\n"; 
 print "<SCRIPT LANGUAGE=\"JavaScript\">\n"; 
 print "<!--\n"; 
 print "/*  Strings for locales  */\n"; 
 print "var msg0=\"".$text{'msg_0'},"\";\n";
 print "var msg1=\"".$text{'msg_1'},"\";\n";
 print "var msg2=\"".$text{'msg_2'},"\";\n";
 print "var msg3=\"".$text{'msg_3'},"\";\n";
 print "var msg4=\"".$text{'msg_4'},"\";\n";
 print "var msg5=\"".$text{'msg_5'},"\";\n";
 print "var msg6=\"".$text{'msg_6'},"\";\n";
 print "var msg7=\"".$text{'msg_7'},"\";\n";
 print "var ask_confadmin=true;\n"; 
 print "\n"; 
 print "/******************************************************************\n"; 
 print "   Chek_fields(obj)\n"; 
 print "*******************************************************************/\n"; 
 print "function Chek_fields(obj) {\n"; 
 print "     if ( get_value(\"select\",obj.fExt) == \"none\" ) {\n";
 print "          alert(obj.fExt.name+\":\"+msg1);\n";
 print "                    obj.fExt.focus();\n";
 print "          return false;\n";
 print "     }         \n";
 print "\n"; 
 print "     return true;\n"; 
 print "}\n"; 
 print "//-->\n"; 
 print "</SCRIPT>\n"; 
 print "\n"; 
 print "<table width=100% border>\n";
 print "<tr $tb> <td><b>".$text{"titidx_".$postform}."</b></td> </tr>\n";
 print "<tr $cb> <td><table width=100%>\n";
 print "<form METHOD=POST name=file_$postform ACTION=\"file_$postform.cgi\" onSubmit=\"return Chek_fields(this)\">\n"; 
 print "  <input TYPE=\"hidden\" NAME=\"postform\" VALUE=\"$postform\">\n";
 print "   <tr><td valign=top>",&hlink("<b>$text{'f_deflists'}</b>","fdeflists"),"&nbsp;</td>\n";
 print "   <td valign=top><select NAME=\"fExt\">\n";
 print "                <option VALUE=\"none\">",&hlink("<b>$text{'f_selecdeflists'}</b>","fselecdeflists"),"\n";
$nItems=0;
@l_lists = split(/,/,$text{'defs_lists_value'}, -1);
$nItems=0;
foreach $item (@l_lists) {
     print "         <option ";
     if ( $postform ne "" && $item eq $fExt ) { print "selected " ; }
     print "VALUE=\"$item\" ";
     print ">".$text{"index_".$item}."</b>\n";
     $nItems++;
}
 print "        </select></td></tr>\n";
 print "        <tr><td valign=top><input TYPE=\"submit\" NAME=\"",$text{'f_sendreq'},"\" VALUE=\"",$text{'f_sendreq'},"\">\n";
 print "        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>\n";
 print "        <td valign=top><input TYPE=\"reset\" NAME=\"",$text{'f_cancelreq'},"\" VALUE=\"",$text{'f_cancelreq'},"\"></td></tr>\n";
 print "	</form>\n"; 
 print "<tr><tr></table></table><hr><p>\n"; 
 &footer($config{'back_return'},$text{'index'}); 
 print "<p><p><p>\n";
 do "footer.pl";
 exit;



