Files
eapim-admin/WebContent/jsp/common/acl/user/userManPopup.jsp
Rinjae c54ef1903f init
2025-09-05 17:16:26 +09:00

149 lines
4.5 KiB
Plaintext

<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ page import="java.io.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ include file="/jsp/common/include/localemessage.jsp" %>
<%
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Expires", "0");
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<jsp:include page="/jsp/common/include/css.jsp"/>
<jsp:include page="/jsp/common/include/script.jsp"/>
<script language="javascript" >
var url = '<c:url value="/common/acl/user/userMan.json" />';
var userId = window.dialogArguments["userId"];
function isValid(){
return true;
}
function unformatterFunction(cellvalue, options, rowObject){
return $('input:checkbox', rowObject).is(':checked') ? "true" : "false";
}
function formatterFunction(cellvalue, options, rowObject){
var rowId = options["rowId"];
var name = options["colModel"]["name"];
if (cellvalue == "true"){
return "<input type ='checkbox' id ='chk"+name + rowId + "' checked='checked' />";
}else if (cellvalue == "false"){
return "<input type ='checkbox' id ='chk"+name + rowId + "' />";
}else{
return "";
}
}
$(document).ready(function() {
$('#grid').jqGrid({
datatype:"json",
mtype: 'POST',
url: url,
postData : { cmd : 'LIST_USER_ROLE' , userId : userId
},
colNames:['<input type="checkbox" id="chkCheck" />',
'<%= localeMessage.getString("role.id") %>',
'<%= localeMessage.getString("role.name") %>',
'<%= localeMessage.getString("role.description") %>'
],
colModel:[
{ name : 'CHK' , align:'center' ,unformat: unformatterFunction, formatter: formatterFunction , width:"20"},
{ name : 'ROLEID' , align:'left' ,key :true ,width:"100"},
{ name : 'ROLENAME' , align:'left' ,width:"100"},
{ name : 'ROLEDESC' , align:'left' }
],
cmTemplate: {
sortable: false,
},
jsonReader: {
repeatitems:false
},
rowNum: 10000,
height: '500',
autowidth: true,
viewrecords: true,
ondblClickRow: function(rowId) {
}
});
$("#chkCheck").click(function(e){
e = e || event;/* get IE event ( not passed ) */
e.stopPropagation ? e.stopPropagation() : e.cancelBubble = false;
$("input[id*=chkCHK]").prop("checked",$(this).is(":checked"));
});
$("#btn_modify").click(function(){
if (confirm("<%= localeMessage.getString("common.checkModify")%>") != true)
return;
if (!isValid()){
return;
}
var data = $("#grid").getRowData();
var gridData = new Array();
for (var i = 0; i <data.length; i++) {
if (data[i]['CHK'] == "false") continue;
gridData.push($("#grid").jqGrid('getRowData', data[i]['ROLEID']));
}
var roleIds = gridData.map(function(item) { return item.ROLEID; }).join(",");
localStorage.setItem('updatedRoleId', roleIds);
var postData = new Array();
postData.push({ name: "cmd" , value:"TRANSACTION_USER_ROLE"});
postData.push({ name: "userId" , value:userId});
postData.push({ name: "gridData" , value:JSON.stringify(gridData)});
$.ajax({
type : "POST",
url:url,
data:postData,
success:function(args){
alert("<%= localeMessage.getString("common.saveMsg") %>");
window.returnValue = "ok";
$("#btn_close").trigger("click");
},
error:function(e){
alert(e.responseText);
}
});
});
$("#btn_close").click(function(){
window.close();
});
buttonControl();
});
</script>
</head>
<body>
<div class="popup_box">
<div class="search_wrap">
<button type="button" class="cssbtn" id="btn_modify" level="R" status="DETAIL,NEW"><i class="material-icons">save</i> <%= localeMessage.getString("button.modify") %></button>
<button type="button" class="cssbtn" id="btn_close" level="R" status="DETAIL,NEW"><i class="material-icons">cancel</i> <%= localeMessage.getString("button.close") %></button>
<%-- <img id="btn_modify" src="<c:url value="/img/btn_modify.png"/>" level="R" status="DETAIL,NEW"/> --%>
<%-- <img id="btn_close" src="<c:url value="/img/btn_close.png"/>" level="R" status="DETAIL,NEW"/> --%>
</div>
<div class="title"><%= localeMessage.getString("userPop.title") %></div>
<table id="grid" ></table>
<div id="pager"></div>
</div><!-- end content_middle -->
</body>
</html>