<?php 
require_once("module/module.project.php");
$projects = new CModuleProject();
$projects->Init();

$query_id = 0;
$page = 0;
if(array_key_exists("query_id", $_REQUEST))
{
	$query_id = $_REQUEST['query_id'];
	$page = $_REQUEST['page'];
}
?>
<input type="hidden" id="hidden_query_id" value=<?php echo $query_id?>>
<input type="hidden" id="hidden_page" value=<?php echo $page?>>
<input type="hidden" id="hidden_view_job" value="<?php echo $_REQUEST['job']?>">
<table width=100% bgcolor=#ffffff border=0 cellspacing="0" cellpadding="0" align=center>
	<tr>
		<td width=300 valign=top id="query_frame" style="display:block">
		<form name="query_form">
			<table width=100% border=0 cellspacing="0" cellpadding="0">					
				<tr height=1 bgcolor=#cccccc><td colspan=2></td></tr>
				<tr bgcolor=#eeeeee>
				<td colspan=2>					
						<img src="imgs/pg_up.gif" class="icon">查询条件	
						<hr size=1 color=#cccccc>	
						<div id="div_query_content" style="display:block">
							<table border=0>
							<tr>
								<td  align=right valign=top>项目:</td>
								<td>
									<select name="project_id" id="project_id" class="box" onChange="QueryChangeProject()">
										<option value="0" selected>--------所有项目--------</option>
										<?php for($i=0;$i<$projects->GetSize();$i++){?>
											<option value="<?php echo $projects->modules[$i]->project_id?>"><?php echo $projects->modules[$i]->project_name?></option>
										<?php }?>				
									</select>
								</td>
							</tr>
							<tr>
								<td  align=right valign=top>模块:</td>
								<td>
									<select name="project_module" id="project_module" class="box">
										<option value="0" selected>--------所有模块--------</option>			
									</select>
								</td>
							</tr>
							<tr height=34>
								<td align=right>查询:</td>
								<td><input type=text name="query_str" id='query_str' size=20 class=box></td>
							</tr>
							<tr height=34>
								<td>查询字段:</td>
								<td>
								<input type=checkbox value="1" name="content_type[]" >标题
								<input type=checkbox value="2" name="content_type[]" >描述
								<input type=checkbox value="4" name="content_type[]" >日志		
								</td>
							</tr>
							</table>
						</div>
				</td>
			</tr>
			<tr height=1 bgcolor=#cccccc><td colspan=2></td></tr>
			<tr bgcolor=#efefef>
				<td colspan=2>
					<span class="link" onclick="DisplayQueryLayer('div_property')">			
						<img src="imgs/pg_down.gif" id="icon_div_property" class="icon">事务属性
					</span>
					<hr size=1 color=#cccccc>	
					<div id='div_property' style='display:none'>
						<table border=0>				
							<tr height=30>
								<td align=right valign=top>类型:</td>
								<td valign=top>
									<select name="issue_type" id="issue_type" class="box" size=4 onChange="QueryChangeIssueType()">
										<option value="0" selected>--------所有类型--------</option>					
									</select>
								</td>
							</tr>
							<tr height=30>
								<td align=right valign=top>状态:</td>
								<td valign=top>
									<select name="issue_status" id="issue_status" class="box" size=4>
										<option value="0" selected>--------所有状态--------</option>					
									</select>
								</td>
							</tr>
							<tr height=30>
								<td align=right valign=top>严重性:</td>
								<td valign=top>
									<select name='severity' id='severity' class='box'>
										<option value=-1 selected>----所有严重性-----</option>
										<?php for($i=0; $i<sizeof($Config["serverity"]); $i++){?>
											<option value=<?php echo $i;?>><?php echo $Config["serverity"][$i];?></option>
										<?php } ?>
									</select>
								</td>
							</tr>
							<tr height=30>
								<td align=right valign=top>优先级:</td>
								<td valign=top>
									<select name='priority' id='priority' class='box'>
										<option value=-1 selected>----所有优先级-----</option>
										<?php for($i=0; $i<sizeof($Config["priority"]); $i++){?>
											<option value=<?php echo $i;?>><?php echo $Config["priority"][$i];?></option>
										<?php } ?>
									</select>
								</td>
							</tr>
							<tr>
								<td align=right>创建者:</td>
								<td><input type=text name='create_user' id='create_user' class='box' size=16></td>
							</tr>
							<tr height=30>
								<td align=right>处理者:</td>
								<td><input type=text name='process_user' id='process_user' class='box' size=16></td>
							</tr>
						</table>
					</div>
					
				</td>
			</tr>
			<tr height=1 bgcolor=#cccccc><td colspan=2></td></tr>
			<tr bgcolor=#efefef>
				<td colspan=2>
					<span class="link" onclick="DisplayQueryLayer('div_date')">
						<img src="imgs/pg_down.gif" id="icon_div_date" class="icon">日期和时间
					</span>
					<hr size=1 color=#cccccc>	
							<!-----div 日期和时间------------------------------------->
							<script type="text/javascript" src="script/calendar.js"></script>
							<div id='div_date' style="display:none;">
							<table width=100%>
							<tr height=34>
								<td align=right valign=top class='small'>创建时间:</td>
								<td class='small' valign=top> 
									从 <input onfocus=setday(this) size=8 name=create_date_begin id='create_date_begin' class='box'>
									到 <input onfocus=setday(this) size=8 name=create_date_end id='create_date_end' class='box'> 
								</td>
							</tr>
							<tr height=34>
								<td align=right valign=top class='small'>关闭时间:</td>
								<td class='small' valign=top> 
									从 <input onfocus=setday(this) size=8 name=close_date_begin id='close_date_begin' class='box'>
									到 <input onfocus=setday(this) size=8 name=close_date_end id='close_date_end' class='box'> 
								</td>
							</tr>
							</table>
							<div>
							<!-----div 日期和时间------------------------------------->
			</td>
			<tr>
			</table>

			<div style="padding-top:10;" align="center">
				<input type=button value=" 查  询  " class=button onclick="QueryIssue();">
				&nbsp;&nbsp;&nbsp;&nbsp;
				<input type=button value=" 重 置 " class=button onclick="QueryReset();">
			</div>
		</form>
	</td>
	
	<td bgcolor=#cccccc width=6>
		<img id="icon_query_frame" src="imgs/calendarPrev.gif" onclick="DisplayQueryLayer('query_frame')" class="link" alt="隐藏查询框">
	</td>
	
	<td style="padding-left:10" valign=top >
				<table width=100% bgcolor=#FFFFFF border=0 cellspacing="1" cellpadding="0">	
					<tr bgcolor="#D0DCE0" height=20>
						<td width="80" align=center> <b>事务标识
						<td width="120" align=center> <b>项目名称
						<td width="100" align=center> <b>项目模块 
						<td width="100" align=center> <b>事务类型
						<td align=center> <b>事务标题
						<td width="60" align=center> <b>严重性
						<td width="60" align=center> <b>优先级
						<td width="80" align=center> <b>当前状态		
						<td width="80" align=center> <b>创建者   
						<td width="100" align=center> <b>当前处理者					
						<td width="120" align=center><b>创建时间 
						<td width="120" align=center><b>期待完成时间 
						<td width="120" align=center><b>关闭时间 
					</tr>
				</table>
				<span id="span_issue_list"> </span>
				<table width=100% bgcolor=#FFFFFF border=0 cellspacing="1" cellpadding="0">
					<tr bgcolor=#efefef height=30>
						<td align=center class=small id='td_page'></td>
				</tr>
				<tr bgcolor=#efefef height=30>
						<td align=center class=small>
							<input type=hidden id='hidden_save_view' value=0>
							<input type=button id='bt_save_view' value='将查询结果保存为常用视图' class=button style='display:none' onclick="CallSaveQueryView()">
						</td>
				</tr>
			</table>
	</td>
	</tr>
</table>
<?php if($query_id > 0){?>
<script>
		CallIssueList(<?php echo $query_id?>, <?php echo $page?>);
</script>
<?php }?>
