<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.opensymphony.xwork2.ActionContext" %>    
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ include file="../language.jsp" %>

<script src="../scripts/itsm/tools/im.js?random=<%=new java.util.Date().getTime()%>"></script>
<script>
	var immanageReply="0";
	var immanageDelete="0";
	
	$(document).ready(function(){
		 $("#InstantMessage_loading").hide();
		 $("#InstantMessage_content").show();
	});
	
</script>
<sec:authorize url="/pages/immanage!reply.action">
	<script>immanageReply="1";</script>
</sec:authorize>
<sec:authorize url="/pages/immanage!delete.action">
	<script>immanageDelete="1";</script>
</sec:authorize>

<div style="padding:10px" id="InstantMessage_loading"><img src="../images/icons/loading.gif" /></div>
<div style="padding:3px;display:none;" id="InstantMessage_content">


			<table id="IMjqGrid"></table>
			<div id="IMpager"></div>

			<div id="IMgridToolbar" style="display: none">
				<sec:authorize url="/pages/immanage!save.action">
					<a class="easyui-linkbutton"  plain="true" icon="icon-add" id="IMjqGrid_add"><fmt:message key="tool.im.writeIM"/></a>
				</sec:authorize> 
				<sec:authorize url="/pages/immanage!reply.action">
					<a class="easyui-linkbutton"  plain="true" icon="icon-back" id="IMjqGrid_reply" ><fmt:message key="tool.im.replayIM"/></a> 
				</sec:authorize>
				<sec:authorize url="/pages/immanage!delete.action">
					<a class="easyui-linkbutton"  plain="true" icon="icon-cancel" id="IMjqGrid_delete" ><fmt:message key="common.delete"/></a>
				</sec:authorize>
				<sec:authorize url="/pages/immanage!findPager.action">	 
					<a class="easyui-linkbutton"  plain="true" icon="icon-search" id="IMjqGrid_search" ><fmt:message key="common.search"/></a>
				</sec:authorize>	 
		</div>
	
	
	<!-- 写消息 -->
	<div id="addMessage" class="easyui-window" closed="true" collapsible="false" minimizable="false" maximizable="false" modal="true" title="<fmt:message key="tool.im.writeIM"/>" style="width:500px;height:auto">
	 

	 <form id="addMessageForm">
	 
	 	<input type="hidden" id="IM_sendUserName" name="imDTO.sendUsers" value="${loginUserName}"/>
	 	<input type="hidden" name="imDTO.status" value="0"/>
	 	
	 	
	 	<div class="lineTableBgDiv">
			<table style="width:100%" class="lineTable" cellspacing="1">
				<tr>
					<td style="width:15%"><fmt:message key="tool.im.receiveUser"/></td>
					<td style="width:85%">
						<input id="receiveUsers" style="width:70%;color:#555" class="easyui-validatebox" required="true" />&nbsp;&nbsp;&nbsp;&nbsp;<a id="write_im_sendUser"><fmt:message key="tool.im.selectUser"/></a>
					</td>
				</tr>
				<tr>
	            	<td><fmt:message key="tool.im.imTitle"/></td>
	             	<td>
	             		<input id="title" name="imDTO.title" class="easyui-validatebox input" required="true" />
	             	</td>
	        	</tr>
				<tr>
	            	<td><fmt:message key="tool.im.imContent"/></td>
	             	<td>
	             		<textarea id="add_content" name="imDTO.content" class="easyui-validatebox" required="true" style="width:96%;height:180px"></textarea>
	           		</td>
	        	</tr>
				<tr>
	            	<td colspan="2" style="height:50px">
	                 	<a id="link_im_add_ok" class="easyui-linkbutton" icon="icon-ok"><fmt:message key="tool.im.confirmSend"/></a>
	        		</td>
	        	</tr>			
			</table>
		</div>
		</form>
	</div>
	

	<!-- 回复消息 -->
	<div id="editMessage" class="easyui-window"  closed="true" collapsible="false" minimizable="false" maximizable="false" modal="true" title="<fmt:message key="tool.im.replayIM"/>" style="width:500px;height:auto"> 
		<form id="editMessageForm">
	 	<div class="lineTableBgDiv">
		<table style="width:100%" class="lineTable" cellspacing="1">
		  
    		<tr>
        		<td><fmt:message key="tool.im.receiveUser"/></td>
        		<td>
       				<input id="rep_toUser" style="width:70%;color:#555" class="easyui-validatebox" required="true" />&nbsp;&nbsp;&nbsp;&nbsp;<a id="write_im_reply"><fmt:message key="tool.im.selectUser"/></a>
        		</td>
    		</tr>
    		<tr>
        		<td><fmt:message key="tool.im.imTitle"/></td>
        		<td>
         			<input id="rep_title" name="imDTO.title" style="width:96%" class="easyui-validatebox" required="true" />
        		</td>
   	 		</tr>
    		<tr>
        		<td><fmt:message key="tool.im.imContent"/></td>
        		<td>
        			<textarea id="rep_content" name="imDTO.content" style="width:96%;height:180px" class="easyui-validatebox" required="true" ></textarea>
        		</td>
    		</tr>   
    		<tr>
        		<td colspan="2" style="padding-top:8px;">
        			<input type="hidden"  name="imDTO.sendUsers" value="${loginUserName}"/>
	 				<input type="hidden" name="imDTO.status" value="0" />
            		<a id="link_im_reply_ok" class="easyui-linkbutton" icon="icon-ok"><fmt:message key="tool.im.confirmReply"/></a>
        		</td>
    		</tr>
		</table>
		</div>
		</form>
	</div>
	
	<!--查看消息 -->
	<div id="lookMessage" class="easyui-window"  closed="true" collapsible="false" minimizable="false"  maximizable="false" modal="true" title="<fmt:message key="tool.im.imDetail"/>" style="width:600px;height:auto"> 
		<form>
		<input type="hidden"  name="imDTO.sendUsers" value="${loginUserName}"/>
	 	<input type="hidden" name="imDTO.status" value="0"/>
	 	<div class="lineTableBgDiv">
		<table style="width:100%" class="lineTable" cellspacing="1">
		
			<tr>
				<td><fmt:message key="tool.im.sendUser"/></td>
				<td><span id="look_im_sendUser"></span></td>
			</tr>  
			<tr>
				<td><fmt:message key="tool.im.sendTime"/></td>
				<td><span id="look_im_sendTime"></span></td>
			</tr>
			<tr>
				<td><fmt:message key="tool.im.imTitle"/></td>
				<td><span id="look_im_title"></span></td>
			</tr>   
			<tr>
				<td><fmt:message key="tool.im.imContent"/></td>
				<td><span id="look_im_content"></span></td>
			</tr>      
    		<tr>
        		<td><fmt:message key="tool.im.receiveUser"/></td>
        		<td>
       				<input id="lookMessage_toUser" style="width:70%;color:#555" />&nbsp;&nbsp;&nbsp;&nbsp;<a id="write_im_reply2"><fmt:message key="tool.im.selectUser"/></a>
        		</td>
    		</tr>
    		<tr>
        		<td><fmt:message key="tool.im.imTitle"/></td>
        		<td>
         			<input id="lookMessage_title" name="imDTO.title" style="width:96%;" />
        		</td>
   	 		</tr>
    		<tr>
        		<td><fmt:message key="tool.im.imContent"/></td>
        		<td>
        			<textarea id="lookMessage_content" name="imDTO.content" style="width:96%;height:180px"></textarea>
        		</td>
    		</tr>   
    		<tr>
        		<td colspan="2" style="padding-top:8px;">
            		
            		<a id="read_im_reply_send" class="easyui-linkbutton" icon="icon-ok" ><fmt:message key="tool.im.confirmReply"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
   
        		</td>
    		</tr>
		</table>
		</div>
		</form>
	</div>
	
	
	
	<!-- 搜索 -->
	<div id="searchImmanage" class="easyui-window" icon="icon-search" closed="true" collapsible="false" minimizable="false" maximizable="false" modal="false" title="<fmt:message key="common.search"/>" style="width:350px;height:205px; padding:10px; line-height:20px;">
		<form>
    		<table width="98%" border="0" height="150" align="center" cellspacing="5">
        		<tr>
            		<td><fmt:message key="tool.im.state"/></td>   
            		<td>
            			<select name="manageQueryDTO.status" >
            				<option value=""><fmt:message key="common.pleaseSelect"/></option>
            				<option value="0"><fmt:message key="tool.im.state.notRead"/></option>
            				<option value="1"><fmt:message key="tool.im.state.readed"/></option>
            				<option value="2"><fmt:message key="tool.im.state.replayed"/></option>
            			</select>
            		</td>         		
        		</tr>
        		<tr>
       				<td>
       					<fmt:message key="tool.im.imTitle"/>
       				</td>
       				<td><input name="manageQueryDTO.title" id="manageQueryDTO_keyWord" /></td>
       			</tr>
       			<tr>
       				<td>
       					<fmt:message key="tool.im.imContent"/>
       				</td>
       				<td><input name="manageQueryDTO.content" id="manageQueryDTO_keyWord" /></td>
       			</tr>
        		<tr align="center">
            		<td colspan="2">
                		<div style="padding-top:8px;">
                			<a id="link_im_search_ok" class="easyui-linkbutton" icon="icon-search"><fmt:message key="common.search"/></a>
                		</div>
       				</td>
        		</tr>
    		</table>
    	</form>
	</div>



</div>	
	
	