DefaultView.jsp 10.6 KB
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/page/maint/common/initNoCache.jsp" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<%@ page import="weaver.general.*"%>
<%@ page import="weaver.docs.docs.DocImageManager"%>
<%
	String userid = user.getUID()+"";
	String hrmid = Util.null2String(request.getParameter("hrmid"));
	if(hrmid.equals("")) hrmid = userid;
	/**
	String sql = "select top 10 t1.id,t1.content,t1.hrmid,t1.docids,t1.wfids,t1.crmids,t1.projectids,t1.meetingids,
		t1.fileids,t1.createdate,t1.createtime,t2.id as taskid,t2.name "
		+",(select top 1 tlog.operatedate+' '+tlog.operatetime from TM_TaskLog tlog where tlog.taskid=t2.id 
		and tlog.type=0 and tlog.operator="+userid+" order by tlog.operatedate desc,tlog.operatetime desc) 
		as lastviewdate"
		+" from TM_TaskFeedback t1,TM_TaskInfo t2 "
		+" where t1.taskid=t2.id and (t2.deleted=0 or t2.deleted is null)"
		+" and (t2.creater="+userid+" or t2.principalid="+userid+" 
		or exists (select 1 from TM_TaskPartner tp where tp.taskid=t2.id and tp.partnerid="+userid+"))"
		+" and t1.hrmid<>"+userid
		+" order by t1.createdate desc,t1.createtime desc";
		//System.out.println(sql);
	*/
%>
<style type="text/css">
	.datatable{width: 100%;}	
	.datatable td{padding-top:1px;padding-bottom:1px;text-align: left;}
	.datatable td.title{color: #999999;vertical-align: top;padding-top: 7px;padding-bottom: 7px;
	padding-left: 20px;background: #F6F6F6;border-top: 1px #F6F6F6 solid;border-bottom: 1px #F6F6F6 solid;}
	.datatable td.data{vertical-align: middle;border-top: 1px #fff solid;border-bottom: 1px #E8E8E8 dashed;
	padding-bottom: 10px;}
	#rightinfo a,#rightinfo a:active,#rightinfo a:visited{text-decoration: none;color: #000000;}
	#rightinfo a:hover{text-decoration: underline;color: #0080FF;}
	.feedbackshow{width: 90%;margin-left: 20px;margin-top: 5px;overflow: hidden;}
	.feedbackinfo{width: auto;line-height: 24px;color: #808080;}
	.feedbackinfo a,.feedbackinfo a:active,.feedbackinfo a:visited{
	text-decoration: none !important;color: #808080 !important;}
	.feedbackinfo a:hover{text-decoration: underline !important;color: #0080FF !important;}
	.feedbackrelate{width: auto;line-height: 24px;background: #F9F9F9;overflow:hidden;padding:5px;
		border: 1px #E7E7E7 solid;border-radius: 2px;-moz-border-radius: 2px;-webkit-border-radius: 2px;
		box-shadow:0px 0px 2px #E7E7E7;-moz-box-shadow:0px 0px 2px #E7E7E7;-webkit-box-shadow:0px 0px 2px #E7E7E7;
		behavior:url(/workrelate/css/PIE2.htc);
	}
	.feedbackrelate .relatetitle{color: #808080}
	.feedbackrelate a,.feedbackrelate a:active,.feedbackrelate a:visited{
	text-decoration: none !important;color: #1D76A4 !important;}
	.feedbackrelate a:hover{text-decoration: underline !important;color: #FF0000 !important;}
	.feedbackshow p{padding: 0px;margin: 0px;line-height: 20px !important;}
	
	.dtab{line-height: 25px;float:left;margin-left: 5px;margin-top: 4px;font-weight: bold;
	width: 65px;text-align: center;font-family: 微软雅黑;color: #9D9D9D;cursor: pointer;}
	.dtab_hover{background: #E0E0E0;}
	.dtab_click{color:#000;}
</STYLE>
<div id="rightinfo" style="width: 100%;height: 100%;position: relative;overflow: hidden;">
	<div style="width: 100%;height: 40px;position: relative;
	background:-webkit-gradient(linear, 0 0, 0 bottom, from(#F2F2F2), to(#F6F6F6)) !important;
    	background:-moz-linear-gradient(#F2F2F2, #D7D7D7) !important;
    	-pie-background:linear-gradient(#F2F2F2, #D7D7D7) !important;background: #F2F2F2 !important;">
		<div style="position: absolute;top: 3px;left:0px;height: 23px;width: 100%;">
			<div class="dtab dtab_click" _infoid="maininfo" style="<%if(user.getLanguage()==8){%>width:102px;<%} %>"><%=SystemEnv.getHtmlLabelName(382610,user.getLanguage()) %></div>
			<div class="dtab" _infoid="mainiframe" style="<%if(user.getLanguage()==8){%>width:117px;<%} %>"><%=SystemEnv.getHtmlLabelName(26759,user.getLanguage()) %></div>
			<div id="blogmore" style="float: right;margin-top: 8px;margin-right: 8px;cursor: pointer;
				font-style: italic;font-family: Arial;color: #959595;display:none;" title="<%=SystemEnv.getHtmlLabelName(26468,user.getLanguage()) %>" 
				onclick="openFullWindowHaveBar('/wui/index.html#/main/blog/myBlog')">more</div>
		</div>
	</div>
	<%
	int _pagesize = 10;
	int _total = 0;//总数
	String sql = "";
	int ifMySelf = 0;//0是查看自己 1不是
	if(userid.equals(hrmid)){ 
		sql = "select count(distinct t1.id) "
			+" from TM_TaskFeedback t1,TM_TaskInfo t2 "
			+" where t1.taskid=t2.id and (t2.deleted=0 or t2.deleted is null)"
			+" and (t2.creater="+userid+" or t2.principalid="+userid
			+" or exists (select 1 from TM_TaskPartner tp where tp.taskid=t2.id and tp.partnerid="+userid+")"
			+" or exists (select 1 from TM_TaskSharer ts where ts.taskid=t2.id and ts.sharerid="+userid+"))"
			+" and t1.hrmid<>"+userid;
			//System.out.println(sql);
	}else{
		String currentDate = TimeUtil.getCurrentDateString();
		String sevenDay = TimeUtil.dateAdd(currentDate,-6);
		sql = "select count(distinct t1.id) "
			+" from TM_TaskFeedback t1,TM_TaskInfo t2 "
			+" where t1.taskid=t2.id and (t2.deleted=0 or t2.deleted is null)"
			+" and t1.hrmid="+hrmid
			+" and t1.createdate>='"+sevenDay+"' and t1.createdate <= '"+currentDate+"'";
			ifMySelf = 1;
	}
	rs.executeSql(sql);
	if(rs.next()){
		_total = rs.getInt(1);
	}
	//System.out.println("_total:"+_total);
	%>
	<div id="maininfo" style="width:100%;height: auto;position:absolute;top:40px;left:0px;bottom:0px;border-top:1px #E8E8E8 solid;
		line-height: 40px;font-size: 14px;" class="scroll1 datainfo" align="center">
		<table id="feedbacktable" class="datatable" style="width: 100%;margin: 0px auto;text-align: left;" 
		cellpadding="0" cellspacing="0" border="0">
				<%if(_total==0){ %>
				<tr>
					<td class="data">
						<div class="feedbackshow">
							<div class="feedbackinfo" style="font-style: italic;color:#999999">
								<%=SystemEnv.getHtmlLabelName(382611,user.getLanguage()) %>!
							</div>
						</div>
					</td>
				</tr>
				<%} %>
		</table>
		<div id="btn_more" class="listmore" style="display: none;background-image: none;margin-bottom: 10px;" 
		_currentpage="0"
		 _pagesize="<%=_pagesize %>" _total="<%=_total %>" onclick="getList(this)" title="<%=SystemEnv.getHtmlLabelName(83704,user.getLanguage()) %>"><%=SystemEnv.getHtmlLabelName(131654,user.getLanguage()) %></div>
	</div>
	
	<iframe id="mainiframe" name="mainiframe" class="datainfo" style="width: 100%;height:100%;display:none" scrolling="auto" src="" frameborder="0"></iframe>
	<iframe id="attentionframe" style="display:none"></iframe>
</div>
<script type="text/javascript">
	$(document).ready(function(){
		$("#feedbacktable").find(".data").live("mouseover",function(){
			$(this).css("background-color","#F7FBFF");
		}).live("mouseout",function(){
			$(this).css("background-color","#fff");
		});
		$('#maininfo').perfectScrollbar({"wheelSpeed": 40});
		<%if(_total>0){ %>getList($("#btn_more"))<%}%>

		$("div.dtab").bind("mouseover",function(){
			$(this).addClass("dtab_hover");
		}).bind("mouseout",function(){
			$(this).removeClass("dtab_hover");
		}).bind("click",function(){
			//$("div.dtab").removeClass("dtab_click");
			//$(this).addClass("dtab_click");
			var _infoid = $(this).attr("_infoid");
			//$(".datainfo").hide();
			//$("#"+_infoid).show();
			if(_infoid=="mainiframe"){
				//$("#blogmore").show();
				window.open("/wui/index.html#/main/blog/myBlog?blogid=<%=hrmid %>");
				//if($("#mainiframe").attr("src")=="")
					 //$("#mainiframe").attr("src","/wui/index.html#/main/blog/myBlog?blogid=<%=hrmid %>");
			}else{
				$("#blogmore").hide();
			}
		});

		$("#blogmore").bind("mouseover",function(){
			$(this).css("color","#747474");
		}).bind("mouseout",function(){
			$(this).css("color","#959595");
		});

		var iframe1 = document.getElementById("mainiframe");
		if (iframe1.attachEvent){ 
			iframe1.attachEvent("onload", function(){ 
				setHidden();
			}); 
		} else { 
			iframe1.onload = function(){ 
				setHidden()
			}; 
		} 
		
		$("#mainiframe").height($(window).height()-40);
	});

	function setHidden(){
		//alert($(window.frames["mainiframe"].document).find("div.TopTitle").html());
		$(window.frames["mainiframe"].document).find("div.TopTitle").hide();
		$(window.frames["mainiframe"].document).find("#myBlogdiv").css("min-width","0px");
	}
	function displayLoading(){

	}
	function getList(obj){
		var _currentpage = parseInt($(obj).attr("_currentpage"))+1;
		var _pagesize = $(obj).attr("_pagesize");
		var _total = $(obj).attr("_total");
		$(obj).html("<img src='../images/loading2.gif' style='margin-top:3px;' align='absMiddle'/>");
		$.ajax({
			type: "post",
		    url: "Operation.jsp",
		    data:{"operation":"get_more_fb","currentpage":_currentpage,"hrmid":"<%=hrmid%>",
		    "pagesize":_pagesize,"total":_total,"ifMySelf":"<%=ifMySelf%>"}, 
		    contentType : "application/x-www-form-urlencoded;charset=UTF-8",
		    complete: function(data){ 
		    	var records = $.trim(data.responseText);
		    	$("#feedbacktable").append(records);
		    	if("<%=ifMySelf%>"==0){
			    	if(_currentpage*_pagesize>=_total){
			    		$("#btn_more").hide();
				    }else{
				    	$(obj).attr("_currentpage",_currentpage).html("<%=SystemEnv.getHtmlLabelName(83704,user.getLanguage()) %>");
				    	$("#btn_more").show();
					}
				}
		    	$('#maininfo').perfectScrollbar("update");
			}
	    });
	}
</script>
<%!
	public String getFileDoc(String ids,String taskId) throws Exception{
		String returnstr = "";
		String docid = "";
		String docImagefileid = "";
		int docImagefileSize = 0;
		String docImagefilename = "";
		DocImageManager DocImageManager = null;
		if(ids != null && !"".equals(ids)){
			List idList = Util.TokenizerString(ids, ",");
			for (int i = 0; i < idList.size(); i++) {
				docid = Util.null2String((String)idList.get(i));
				if(!docid.equals("")){
					DocImageManager = new DocImageManager();
					DocImageManager.resetParameter();
		            DocImageManager.setDocid(Integer.parseInt((String)idList.get(i)));
		            DocImageManager.selectDocImageInfo();
		            DocImageManager.next();
		            docImagefileid = DocImageManager.getImagefileid();
		            docImagefileSize = DocImageManager.getImageFileSize(Util.getIntValue(docImagefileid));
		            docImagefilename = DocImageManager.getImagefilename();
		            returnstr += "<a href=javaScript:openFullWindowHaveBar('/workrelate/task/util/ViewDoc.jsp?id="
		            +docid+"&taskId="+taskId+"') >"+docImagefilename+"</a>";
		            returnstr += "&nbsp;<a href='/workrelate/task/util/ViewDoc.jsp?id="
		            +docid+"&taskId="+taskId+"&fileid="+docImagefileid+"'>下载("+docImagefileSize/1000+"K)</a>&nbsp;&nbsp;";
				}
			}
		}
		return returnstr;
	}
%>