<?php
$job = 'add';
$title = '新增事务类型';
$type_id=0;
$type_name='';
$type_desc='';
$project_id=$_REQUEST['project_id'];
$flow_id=0;

require_once('../module/module.flow.php');
$flows = new CModuleFlow();
$flows->Init();

if(array_key_exists("job", $_REQUEST))
	$job = $_REQUEST['job'];
	
if($job=='mod')
{
	$title = '修改事务类型';
	$type_id=$_REQUEST['type_id'];
	require_once('../module/module.project_issuetype.php');
	$type = new CModuleIssueType();
	$type->InitModule($project_id);
	if($type->module != '')
	{
		$type_name=$type->module->type_name;
		$type_desc=$type->module->type_desc;
		$flow_id=$type->module->flow_id;
	}
}
?>
<input type='hidden' id='project_id' value='<?php echo $project_id?>'>
<input type='hidden' id='type_id' value='<?php echo $type_id?>'>
<table border=0 cellspacing='1' cellpadding='0' width=100% bgcolor='#ffffff'>
	<tr bgcolor="#efefef" height=20>
		<td colspan=2>
			<b><span id="project_form_desc"><?php echo $title?></span></b>
			<hr size=1>
		</td>
	</tr>
	<tr>
		<td align=right width=80>类型名称:</td>
		<td><input type=text id="type_name" class=txtput value='<?php echo $type_name?>'></td>
	</tr>
	<tr>
		<td align=right width=80>关联流程:</td>
		<td>
			<select id='flow_id' class=txtput>
				<?php for($i=0;$i<$flows->GetSize();$i++){?>
					<option value="<?php echo $flows->modules[$i]->flow_id?>" <?php if($flows->modules[$i]->flow_id==$flow_id) echo "selected"?>> 
						<?php echo $flows->modules[$i]->flow_name;?> 
					</option>>
				<?php }?>
			</select>
		</td>
	</tr>
	<tr height=30>
		<td align=right>类型描述:</td>
		<td><input type=text id="type_desc" class=txtput size=40 value='<?php echo $type_desc?>'></td>
	</tr>
	<tr height=30>
		<td colspan=2 bgcolor="#efefef">
				&nbsp;&nbsp;&nbsp;&nbsp;
				<input type=button value=" 提交 " class=button onclick="SubmitIssueType('<?php echo $job?>')">
				&nbsp;&nbsp;&nbsp;&nbsp;
				<input type=button value=" 取消 " class=button onclick="CloseDialog(0)">
		</td>
	</tr>
</table>