SocialGroupManage.jsp
17.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="weaver.general.Util"%>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<%@ page import="weaver.social.service.SocialOpenfireUtil"%>
<%@ page import="weaver.social.SocialUtil"%>
<%@ page import="java.util.*"%>
<%@ include file="/systeminfo/init_wev8.jsp"%>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<jsp:useBean id="SocialIMService" class="weaver.social.service.SocialIMService" scope="page" />
<html>
<head>
<link type="text/css" href="/css/Weaver_wev8.css" rel="stylesheet" />
<script language="javascript" src="/js/weaver_wev8.js"></script>
<style type="text/css">
/*遮罩层*/
#bgAlpha{
display:none;
position: absolute;
top:0;
left: 0;
width: 100%;
height:100%;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; /*IE8*/
filter:alpha(opacity=30); /*IE5、IE5.5、IE6、IE7*/
opacity: 0.3; /*Opera9.0+、Firefox1.5+、Safari、Chrome*/
z-index: 100; /*让其位于in的下面*/
background:#fff;
}
/*加载样式*/
#loading{
position:absolute;
left:35%;
background:#ffffff;
top:40%;
padding:8px;
z-index:20001;
height:auto;
display:none;
border:1px solid #ccc;
font-size: 12px;
}
</style>
<script language="javascript" src="/wui/theme/ecology8/jquery/js/zDialog_wev8.js"></script>
<script language="javascript" src="/wui/theme/ecology8/jquery/js/zDrag_wev8.js"></script>
<script language="javascript" src="/js/datetime_wev8.js"></script>
<script language="javascript" src="/js/JSDateTime/WdatePicker_wev8.js"></script>
</head>
<%
// 总体需要,原因暂时不明
String imagefilename = "/images/hdReport_wev8.gif";
String titlename = "titlename";
String needfav = "1";
String needhelp = "";
String searchName = Util.null2String(request.getParameter("searchName"));
if (!HrmUserVarify.checkUserRight("message:manager", user)) {
response.sendRedirect("/notice/noright.jsp");
return;
}
Boolean isOpenfire = true;
if(!SocialOpenfireUtil.getInstanse().isBaseOnOpenfire()){
isOpenfire = false;
}
%>
<body>
<jsp:include page="/systeminfo/commonTabHead.jsp">
<jsp:param name="mouldID" value="social"/>
<jsp:param name="navName" value="<%= SystemEnv.getHtmlLabelNames("387232",user.getLanguage())%>"/>
</jsp:include>
<!-- 顶部页面右侧按钮及菜单内容 start -->
<%@ include file="/systeminfo/TopTitle_wev8.jsp"%>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp"%>
<%
if(isOpenfire){
RCMenu += "{"+SystemEnv.getHtmlLabelNames("20839,126972",user.getLanguage())+",javascript:batchDeleteGroup(),_self} ";
RCMenuHeight += RCMenuHeightStep;
RCMenu += "{"+SystemEnv.getHtmlLabelNames("126972,83",user.getLanguage())+",javascript:deleteGroupLog(),_self} ";
RCMenuHeight += RCMenuHeightStep;
}
%>
<table id="topTitle" cellpadding="0" cellspacing="0">
<tr>
<td>
</td>
<%if(isOpenfire){%>
<td class="rightSearchSpan">
<input type="button" value="<%=SystemEnv.getHtmlLabelNames("20839,126972",user.getLanguage())%>" class="e8_btn_top" onclick="batchDeleteGroup()" />
<input type="text" class="searchInput" id="searchName" name="searchName" value="<%=searchName %>" placeholder="<%=SystemEnv.getHtmlLabelNames("131663",user.getLanguage())%>"/>
<span title="<%=SystemEnv.getHtmlLabelNames("20839,126972",user.getLanguage())%>" class="cornerMenu"></span>
</td>
<%}else{%>
<td class="rightSearchSpan">
<input type="text" class="searchInput" id="searchName" name="searchName" value="<%=searchName %>" placeholder="<%=SystemEnv.getHtmlLabelNames("131663",user.getLanguage())%>"/>
</td>
<%}%>
</tr>
</table>
<!-- 顶部页面右侧按钮及菜单内容 end -->
<form id="weaver" name="frmmain" method="post" action="SocialGroupManage.jsp">
<%
String language = String.valueOf(user.getLanguage());
String backFields = "";
String sqlFrom = "";
String whereclause ="";
String header = "";
String operateString ="";
String sql_page = "select pageSize from ecology_pagesize where pageId = 'SocialIMGroupList' and userId="+user.getUID();
String tableString ="";
rs.executeSql(sql_page);
int perpage =0 ;
if(rs.next()){
perpage =Util.getIntValue(rs.getString("pageSize"),10);
}else{
perpage =10;
}
if(isOpenfire){
backFields = " t1.groupName,t1.description,t1.groupName as groupAdmin,t1.groupName as groupnum,t1.groupName as filenum,t2.lasttime ";
sqlFrom = " ofGroup t1,social_IMConversation t2 ";
whereclause = " where t1.groupName = t2.targetid and t1.groupName not in (select groupName from ofGroupProp t3 where t3.name = 'deleteGroup' and t3.propValue = 'true')";
if(!"".equals(searchName)){
whereclause += " and (t1.description like '%"+searchName+"%') ";
}
header = " <sql backfields=\""+backFields+"\" sqlform=\""+sqlFrom+"\" sqlprimarykey=\"t1.groupName\" sqlorderby=\"t1.description\" sqlsortway=\"asc\" sqldistinct=\"true\" sqlwhere=\""+Util.toHtmlForSplitPage(whereclause)+"\"/>";
//每条右侧工具
operateString += "<operates width=\"15%\">";
operateString += " <operate href=\"javascript:singleDeleteGroup()\" text=\""+SystemEnv.getHtmlLabelNames("126972",user.getLanguage())+"\" otherpara=\"column:description\" target=\"_self\" index=\"0\"/>";
operateString += "</operates>";
tableString=""+
"<table tabletype=\"checkbox\" pageId=\"SocialIMGroupList\" pagesize=\""+perpage+"\" cellSpacing=\"0\" cellPadding=\"1\">"+
header +
"<head>"+
"<col width=\"10%\" text=\""+SystemEnv.getHtmlLabelNames("131663",user.getLanguage())+"\" column=\"description\" orderkey=\"groupName\" linkvaluecolumn=\"groupName\" href=\"javascript:openGroupInfo(\'{0}\')\"/>"+
"<col width=\"10%\" text=\""+SystemEnv.getHtmlLabelNames("1507",user.getLanguage()) +"\" column=\"groupAdmin\" orderkey=\"description\" transmethod=\"weaver.social.SocialUtil.getGroupAdmin\"/>"+
"<col width=\"10%\" text=\""+SystemEnv.getHtmlLabelNames("431,1331",user.getLanguage()) +"\" column=\"groupnum\" transmethod=\"weaver.social.SocialUtil.getGroupNum\" />"+
"<col width=\"10%\" text=\""+SystemEnv.getHtmlLabelNames("126809,18493,1331",user.getLanguage()) +"\" column=\"filenum\" transmethod=\"weaver.social.SocialUtil.getGroupFileNum\"/>"+
"<col width=\"10%\" text=\""+SystemEnv.getHtmlLabelNames("84279,277",user.getLanguage()) +"\" column=\"lasttime\" orderkey=\"lasttime\" transmethod=\"weaver.social.SocialUtil.getGroupTime\"/>"+
"</head>"+ operateString +
"</table>";
}else{
backFields = " t1.targetname ,t1.userid,t1.targetid as groupnum,t1.targetid as filenum,t1.lasttime ";
sqlFrom = " social_IMConversation t1 ";
whereclause = " where 1>2 ";
if(!"".equals(searchName)){
whereclause += " and (t1.targetname like '%"+searchName+"%') ";
}
header = " <sql backfields=\""+backFields+"\" sqlform=\""+sqlFrom+"\" sqlprimarykey=\"t1.targetid\" sqlorderby=\"t1.targetid\" sqlsortway=\"asc\" sqldistinct=\"true\" sqlwhere=\""+Util.toHtmlForSplitPage(whereclause)+"\"/>";;
operateString +="";
tableString=""+
"<table tabletype=\"none\" pageId=\"SocialIMGroupList\" pagesize=\""+perpage+"\" cellSpacing=\"0\" cellPadding=\"1\">"+
header +
"<head>"+
"<col width=\"10%\" text=\""+SystemEnv.getHtmlLabelNames("131663",user.getLanguage())+"\" column=\"targetname\" orderkey=\"targetname\" linkvaluecolumn=\"targetname\" />"+
"<col width=\"10%\" text=\""+SystemEnv.getHtmlLabelNames("1507",user.getLanguage()) +"\" column=\"userid\" orderkey=\"userid\" transmethod=\"weaver.social.SocialUtil.getGroupAdmin\" />"+
"<col width=\"10%\" text=\""+SystemEnv.getHtmlLabelNames("431,1331",user.getLanguage()) +"\" column=\"groupnum\" transmethod=\"weaver.social.SocialUtil.getGroupNum\" />"+
"<col width=\"10%\" text=\""+SystemEnv.getHtmlLabelNames("126809,18493,1331",user.getLanguage())+"\" column=\"filenum\" transmethod=\"weaver.social.SocialUtil.getGroupFileNum\"/>"+
"<col width=\"10%\" text=\""+SystemEnv.getHtmlLabelNames("84279,277",user.getLanguage()) +"\" column=\"lasttime\" orderkey=\"lasttime\" transmethod=\"weaver.social.SocialUtil.getGroupTime\"/>"+
"</head>"+ operateString +
"</table>";
}
%>
<input type="hidden" name="pageId" id="pageId" value="SocialIMGroupList">
<wea:SplitPageTag tableString='<%=tableString%>' mode="run" isShowTopInfo="true"/>
</form>
<!-- 页面右键菜单 -->
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp"%>
<!-- 遮罩层 -->
<div id=bgAlpha></div>
<div id="loading">
<span><img src="/images/loading2_wev8.gif" align="absmiddle"></span>
<span id="loading-msg" style="font-size:12"><%=SystemEnv.getHtmlLabelName(33592, user.getLanguage())%></span><!-- 正在执行,请稍候... -->
</div>
<script type="text/javascript">
var isOpenfire = "<%=isOpenfire%>";
var userInfos={};
var isOpen={};
$(document).ready(function(){
$("#topTitle").topMenuTitle({searchFn:searchName});
$("#hoverBtnSpan").hoverBtn();
});
function searchName(){
var searchName = jQuery("#searchName").val();
location.href = "SocialGroupManage.jsp?searchName="+searchName;
}
//加载本地用户信息
function loadLocalUserInfo(discussid,cbSuccess){
var url=getPostUrl("/social/im/SocialIMOperation.jsp?operation=getResourceid");
$.getJSON(url,{"discussid":discussid},function(data){
try {
var userList=data;
for(var i=0;i<userList.length;i++){
var userInfo=userList[i];
var resourceid=userInfo.userid;
if(!userInfos[resourceid]){
userInfos[resourceid]=userInfo;
}
}
isOpen[discussid]=true;
cbSuccess();
} catch(e){
console.error(e);
}
})
}
//群组解散
function batchDeleteGroup(){
var targetid =flag;
var msg = '';
var ids = _xtable_CheckedCheckboxIdForCP();
if(!ids){
window.top.Dialog.alert("<%=SystemEnv.getHtmlLabelNames("22686",user.getLanguage())%> ");
return;
}
ids = ids.substring(0, ids.length-1);
targetid = ids;
msg = '<%=SystemEnv.getHtmlLabelNames("126913",user.getLanguage())%> ';
window.top.Dialog.confirm(msg, function(){
showLoading(1);
$.post('/social/im/SocialIMOperation.jsp', { operation : 'batchDeleteGroup', targetid : targetid }, function(data){
data = $.trim(data);
showLoading(0);
if(data == 1) {
window.top.Dialog.alert('<%=SystemEnv.getHtmlLabelName(30700, user.getLanguage())%>', function(){ // 操作成功
window.location.reload();
});
} else {
window.top.Dialog.alert('<%=SystemEnv.getHtmlLabelName(30651, user.getLanguage())%>', function(){ //操作失败
window.location.reload();
});
}
});
});
document.body.click();
}
function singleDeleteGroup(targetid,targetname,obj){
var msg = '<%=SystemEnv.getHtmlLabelNames("126913",user.getLanguage())%>【'+targetname+'】?';
window.top.Dialog.confirm(msg, function(){
showLoading(1);
$.post('/social/im/SocialIMOperation.jsp', { operation : 'batchDeleteGroup', targetid : targetid }, function(data){
data = $.trim(data);
showLoading(0);
if(data == "1") {
window.top.Dialog.alert('<%=SystemEnv.getHtmlLabelName(30700, user.getLanguage())%>', function(){ // 操作成功
window.location.reload();
});
} else {
window.top.Dialog.alert('<%=SystemEnv.getHtmlLabelName(30651, user.getLanguage())%>', function(){ //操作失败
window.location.reload();
});
}
});
});
document.body.click();
}
function deleteGroupLog(){
var title='<%=SystemEnv.getHtmlLabelNames("126972,83",user.getLanguage())%>';
var url=getPostUrl("/social/manager/SocialDelGroupLog.jsp");
var diag=getSocialDialog(title,600,530);
diag.URL =encodeURI(url);
diag.show();
document.body.click();
}
function getPostUrl(url){
return url;
}
function openGroupInfo(discussid){
function open(){
var title='<%=SystemEnv.getHtmlLabelNames("126969",user.getLanguage())%>';
var url=getPostUrl("/social/manager/SocialGroupMemList.jsp?discussid="+discussid+"&type=2&IS_BASE_ON_OPENFIRE="+"<%=isOpenfire%>");
var diag=getSocialDialog(title,600,530);
diag.URL =encodeURI(url);
diag.show();
document.body.click();
}
if(!isOpen[discussid]){
loadLocalUserInfo(discussid,open);
}else{
open();
}
}
function getSocialDialog(title,width,height,closeHandler){
var diag =new window.top.Dialog();
diag.currentWindow = window;
diag.Modal = true;
diag.Drag=true;
diag.Width =width?width:680;
diag.Height =height?height:420;
diag.ShowButtonRow=false;
diag.Title = title;
diag.closeHandle = function(){
if(typeof closeHandler == 'function'){
closeHandler(diag);
}
//pc端关闭时恢复拖动绑定
if(typeof from != 'undefined' && from == 'pc'){
DragUtils.restoreDrags();
}
}
if(typeof from != 'undefined' && from == 'pc'){
DragUtils.closeDrags();
}
return diag;
}
// 遮罩层
function showLoading(isShow){
if(isShow==1){
$("#bgAlpha").show();
$("#loading").show();
}else{
$("#bgAlpha").hide();
$("#loading").hide();
}
}
</script>
</body>
</html>