<?
	#---------------------------------------------------------------------#
	# This source code is (c)2000 White Pajamas, Inc                      #
	# see http://www.stonekeep.com/license.html for licensing information #
	#---------------------------------------------------------------------#

	#---------------------------------------------------------------------#
	# $Id: addslips.php3,v 1.53 2000/12/29 05:46:41 shevett Exp $
	#---------------------------------------------------------------------#
	
	# Add a new slip.  This is to be called from within the normal 
	# html structure.... it should build it's own layout within that big row.

?>

<?
	include "./sliputils.php3";
	if ($sys_bugtrack) {
		include "./verutils.php3";
	}
?>

	<form method="post" action="nbrowse.php3">
	<input type=hidden name="f_process" value="postslip">
	<input type=hidden name="f_flag" value="add">
	<? if (!$sys_enableacl) { ?>
	<input name="a_spolicy" type="hidden" value=0>
	<? } ?>

	<tr bgcolor=#BBBBcB>
	<td width=100% bgcolor=#202020>
	<table width=100% bgcolor=#bbbbbb cellspacing=2>
	<tr>
		<td align=center colspan=2>
			Add a 
			<?
				if ($f_func == 'addchild') {
					echo "child to Slip # $sid";
					$pq = db_query("select * from slips where sid=$parent");
					$parentinfo = db_fetch_array($pq);
				} else {
					echo "new slip";
				}
			?>
		</td>
	</tr>
	<tr bgcolor=#bbbbbb valign=top>
		<td bgcolor=#808080>
		<table width=100% border=0 cellspacing=0 cellpadding=0>
		<tr bgcolor=#bbbbbb valign=top>
			<td bgcolor=#808080 width=50%>
				<? ChooseParent("a_spid",$parent); ?>
			</td>
			<td bgcolor=#808080 width=50%>
				<? ChooseDependent(); ?>		
			</td>			  
		</tr>
		</table>
		</td>

		<td bgcolor=#808080>
		<table width=100% border=0 cellspacing=0 cellpadding=0>
		<tr bgcolor=#bbbbbb valign=top>
			<td bgcolor=#808080 width=50%>
				<? TimeSpent(); ?>
			</td>
			<td bgcolor=#808080 width=50%>
			  <? ChooseGroup(); ?>
			</td>
		</tr>
		</table>
		</td>
	</tr>


	<tr bgcolor=#bbbbbb valign=top>
		
		<td bgcolor=#808080>
			<table width=100% border=0 cellspacing=0 cellpadding=0>
			<tr bgcolor=#bbbbbb valign=top>
				<td bgcolor=#808080 width=34%>
					<? ChooseCurrtech(); ?>
				</td>
				<td bgcolor=#808080 width=33%>
					<? ChooseStatus(); ?>
				</td>
				<td bgcolor=#808080 width=33%>
					<? 
						LogIt("DEBUG","addslips.php3","sys_def_prio is $sys_defprio");
						ChoosePriority("a_priority",$sys_defprio); ?>
				</td>
			</tr>
			</table>
		</td>
		<td bgcolor=#808080>
		<table width=100% border=0 cellspacing=0 cellpadding=0>
		<tr bgcolor=#bbbbbb valign=top>
			<td bgcolor=#808080 width=50%>
				<? ChooseResource(); ?>
			</td>
			<? if ($sys_enableacl) { ?>
			<td bgcolor=#808080 width=50%>
	   		<? ChoosePolicy(); ?>
			</td>
			<? } ?>
		</tr>
		</table>
		</td>
		
	</tr>

	<tr bgcolor=#bbbbbb valign=top>
		<td bgcolor=#808080>
			<table width=100% border=0 cellspacing=0 cellpadding=0>
			<tr bgcolor=#bbbbbb valign=top>
				<td bgcolor=#808080 width=34%>
					<? ChooseContact(); ?>
				</td>
				<td bgcolor=#808080 width=33%>
					<? ChooseCadd(); ?>
				</td>
				<td bgcolor=#808080 width=33%>
					<? ChooseCphone(); ?>
				</td>
			</tr>
			</table>
		</td>

	<? if ($sys_schedule) { ?>
		<td bgcolor=#808080>
		<table width=100% border=0 cellspacing=0 cellpadding=0>
		<tr bgcolor=#bbbbbb valign=top>
			<td bgcolor=#808080 width=45%>
				<i>Scheduled Open Date (MM/DD/YYYY)</i><br>
				<!-- FIXME: needs maxsize based on database query -->
				<input type="text" name="a_so_date" size=10>
			</td>
			<td bgcolor=#808080 width=45%>
				<i>Scheduled Close Date (MM/DD/YYYY)</i><br>
				<!-- FIXME: needs maxsize based on database query -->
				<input type="text" name="a_sc_date" size=10>
			</td>
		</tr>
		</table>
		</td>
		<? } ?>

	<? if ($sys_bugtrack) { ?>
		<tr bgcolor=#bbbbbb valign=top>
			<td bgcolor=#808080 colspan=2>
				<table width=50% border=0>
					<tr>
						<td><? ChooseProduct("a_v_prod",""); ?> </td>
						<td><? ChooseModule("a_v_mod",""); ?> </td>
						<td><? ChooseVersion("a_v_foundin","","Found in"); ?> </td>
						<td><? ChooseVersion("a_v_target","","Will be fixed in"); ?> </td>
						<td><? ChooseVersion("a_v_verify","","Verified fixed in"); ?> </td>
						<td><? ChooseRescode("a_v_resolve",""); ?> </td>
					</tr>
				</table>
			</td>
		</tr>
	<? } ?>
						

							
	<tr bgcolor=#bbbbbb valign=top>
		<td bgcolor=#808080 colspan=2>
			<i>Problem</i><br>
			<!-- FIXME: needs maxsize based on database query -->
			<input name="a_problem" size=80>
		</td>
	</tr>
	<tr bgcolor=#bbbbbb valign=top>
		<td bgcolor=#808080>
			<i>Summary</i><br>
			<font size=<?echo $sys_selfont?>><textarea name="a_summary" rows=10 cols=60 wrap="soft"></textarea></font>
		</td>
		<td bgcolor=#808080>
			<? 
			if ($sys_choosepublic) {
				ChoosePublic();
			}
			if ($sys_choosepublic && $sys_mailopts) {
				echo "<hr>";
			}
			if ($sys_mailopts) {
				MailOptions();
			}
			?>
		</td>
	</tr>
	<tr bgcolor=#bbbbbb valign=top>
		<td bgcolor=#808080 colspan=2>
			<?
				# Load up an associative array of values from the bulk table.
				
#				$dquery=db_query("select belement,bvalue from ebulk where btable='slips' and browref=$row[sid]");
#				while ($ddata=db_fetch_array($dquery)) {
#					$edata[$ddata[belement]] = $ddata[bvalue] ;
#				}
				
				# +-----------+-------------+------+-----+---------+----------------+
				# | _rowid    | int(10)     |      | PRI | 0       | auto_increment |
				# | etable    | varchar(15) |      | MUL |         |                |
				# | element   | varchar(15) | YES  |     |         |                |
				# | etype     | char(1)     | YES  |     |         |                |
				# | eflags    | varchar(80) | YES  |     |         |                |
				# | esequence | int(2)      | YES  |     |         |                |
				# | elength   | int(2)      | YES  |     |         |                |
			 	# | elabel    | varchar(20) | YES  |     |         |                |
				# +-----------+-------------+------+-----+---------+----------------+

				ShowExtras("slips",$edata);	
			?>
		</td>
	</tr>
	</table>
	</td>
	</tr>
	<tr bgcolor=#000000 valign=top><td colspan=2>
	<?
		PostBar("Add slip");
	?>
	</tr>
