SYSRightPgmList.jsp 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <%--
  2. - FileName : SYSRightPgmList.jsp
  3. - Author(s) : gyeongmo an
  4. - Date : 2014-06-22
  5. - Copyright : Copyright (c) 2014 www.udapsoft.co.kr, Inc.
  6. -
  7. - Description: 권한별 사용가능 프로그램 관리
  8. --%>
  9. <%@ page contentType="text/html; charset=utf-8" %>
  10. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  11. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  12. <%@ page import="kr.co.hsnc.common.sql.*" %>
  13. <%@ page import="kr.co.hsnc.common.sql.util.*" %>
  14. <%@ page import="kr.co.hsnc.common.util.*"%>
  15. <%@ include file="/jsp/work/taglib.jsp" %>
  16. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  17. <%
  18. ctx.init(request, response);
  19. HandlerStorage storage = ctx.getHandlerStorage();
  20. String event = storage.getEvent();
  21. ValueObject user = storage.getUser();
  22. ValueObject params = storage.getParams();
  23. String systemSelectTag = (String)storage.getObject("SystemSelectTag");
  24. RowSet listRowSet = storage.getRowSet("ListRowSet");
  25. String url = request.getRequestURL().toString();
  26. url = url.substring(0, url.indexOf("/",7));
  27. %>
  28. <SCRIPT language="JavaScript">
  29. /*예약함수*/
  30. var sheet1;
  31. var sheet1Row;
  32. var sheet1PageNo = 1;
  33. var pageLastRowIndex = 1;
  34. var validationResult = false;
  35. var filterShow = false;
  36. function _onReady(){
  37. gridInit(sheet1);
  38. jQuery("#btnSearch").click(function() {
  39. jQuery("#fevent").val("GET_RIGHT_PGM_LIST");
  40. var url = Modular.model.PageContext.CONTEXT_ROOT + "/sycs/security/SYSRightPgmList_sheet.screen";
  41. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
  42. });
  43. jQuery("#btnClear").click(function() {
  44. jQuery("#system_id").val("");
  45. jQuery("#pgm_gr_name").val("");
  46. jQuery("#pgm_name").val("");
  47. jQuery("#screen_name").val("");
  48. });
  49. jQuery("#btnDelete").click(function() {
  50. var temp = false;
  51. for( var i=0; i<sheet1.RowCount(); i++ ) {
  52. if(sheet1.GetCellValue(i+1, "check") != "0") {
  53. temp = true;
  54. }
  55. }
  56. if(temp == true) {
  57. if( confirm("삭제 하시겠습니까?")) {
  58. jQuery("#fevent").val("DELETE_RIGHT_PGM_LIST");
  59. var url = Modular.model.PageContext.CONTEXT_ROOT + "/sycs/security/SYSRightPgmList_sheet.screen";
  60. var result = Modular.view.IBSheet7.doSave(sheet1, url, jQuery("#form1"), false);
  61. }
  62. } else {
  63. alert("삭제할 대상을 선택해 주십시오.");
  64. }
  65. });
  66. jQuery("#btnModGroupSeqProc").click(function() {
  67. var win_id = "_modGroupSeqProc";
  68. var right_id = document.form1.right_id.value;
  69. var link = "/sycs/security/SYSRightPgmListGrSortForm.screen";
  70. link += "?pop_win_id="+win_id+"&right_id="+right_id;
  71. fLayerPop(win_id, link, 450,400, '', '', 'NO');
  72. });
  73. jQuery("#btnAddPgmProc").click(function() {
  74. var win_id = "_addPgmProc";
  75. var right_id = document.form1.right_id.value;
  76. var link = "/sycs/security/SYSRightPgmListAddForm.screen";
  77. link += "?pop_win_id="+win_id + "&right_id="+right_id;
  78. fLayerPop(win_id, link, 820,530, '', '', 'NO');
  79. });
  80. jQuery("#btnList").click(function() {
  81. var f = document.form1;
  82. f.target = "_self";
  83. f.action = "/sycs/security/SYSRightList.screen";
  84. f.fevent.value = "";
  85. formSubmit(f);
  86. });
  87. autoResize();
  88. jQuery("#btnSearch").click();
  89. }
  90. function gridInit(sheetName){
  91. var init_sheet = {};
  92. init_sheet.Cfg = {SearchMode:2, Page:30};
  93. init_sheet.Cols = [
  94. {Header:'status', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
  95. {Header:'그룹번호', Type:"Text", SaveName:"pgm_gr_id", Width:20, Align:"Center", Hidden:"True"},
  96. {Header:'☞그룹명', Type:"Text", SaveName:"pgm_gr_name", Width:50, Align:"Center", Edit:"false", Cursor:"Pointer"},
  97. {Header:'삭제', Type:"DelCheck", SaveName:"check", Width:20, Align:"Center", ColMerge:"false"},
  98. {Header:'번호', Type:"Text", SaveName:"pgm_seq", Width:20, Align:"Center", Edit:"false"},
  99. {Header:'유형', Type:"Text", SaveName:"gubun", Width:20, Align:"Center", Edit:"false"},
  100. {Header:'프로그램', Type:"Text", SaveName:"pgm_name", Width:70, Align:"Left", Edit:"false" },
  101. {Header:'시스템', Type:"Text", SaveName:"name", Width:30, Align:"Center", Edit:"false" },
  102. {Header:'Screen', Type:"PopupEdit", SaveName:"screen_name", Width:250, Align:"Left"},
  103. {Header:'pgm_list_id', Type:"Text", SaveName:"pgm_list_id", Width:30, Align:"Left", Hidden:"True"}
  104. ];
  105. init_sheet.HeaderMode = {Sort:1};
  106. IBS_InitSheet(sheetName, init_sheet);
  107. sheetName.SetDataAutoTrim(0);
  108. sheetName.SetMergeSheet(msPrevColumnMerge);
  109. setGridSize();
  110. }
  111. function setGridSize() {
  112. sheet1.FitColWidth();
  113. }
  114. function sortPgmProc(pgmGrID) {
  115. var win_id = "_sysRightPgmListSortForm";
  116. var right_id = document.form1.right_id.value;
  117. var link = "/sycs/security/SYSRightPgmListSortForm.screen";
  118. link += "?pop_win_id="+win_id+"&right_id="+right_id+"&pgm_gr_id="+pgmGrID;
  119. fLayerPop(win_id, link, 450,400, '', '', 'NO');
  120. }
  121. function sysRightPgmListSortFormClose(result) {
  122. fLayerPopClose('_sysRightPgmListSortForm');
  123. if(result != "close") {
  124. reloadProc();
  125. }
  126. }
  127. function reloadProc() {
  128. document.form1.scrollTopValue.value = document.body.scrollTop;
  129. jQuery("#btnSearch").click();
  130. }
  131. function modGroupSeqProcClose(result) {
  132. fLayerPopClose('_modGroupSeqProc');
  133. if(result != "close") {
  134. reloadProc();
  135. }
  136. }
  137. function addPgmProcClose(result) {
  138. fLayerPopClose('_addPgmProc');
  139. if(result != "close") {
  140. reloadProc();
  141. }
  142. }
  143. function enterKeyPress(param) {
  144. if (event.keyCode == 13) {
  145. jQuery("#btnSearch").click();
  146. }
  147. }
  148. function doKeyPressEvent(param1, param2) {
  149. }
  150. function sheet1_OnSaveEnd(code, msg) {
  151. if(code >= 0) {
  152. alert("삭제 성공!");
  153. } else {
  154. alert(msg);
  155. }
  156. jQuery("#btnSearch").click();
  157. }
  158. function sheet1_OnSearchEnd(code, message) {
  159. if(code == 0) {
  160. setGridSize();
  161. sheet1.SetColFontColor("pgm_gr_name", "#0000ff");
  162. } else {
  163. //조회 에러 수행
  164. alert(message);
  165. //alert("조회 실패");
  166. }
  167. }
  168. function sheet1_OnPopupClick(Row, Col) {
  169. var sName = sheet1.ColSaveName(Col);
  170. var sScreen = sheet1.GetCellValue(Row,Col);
  171. var url = "<%=url%>";
  172. if(sName == "screen_name")
  173. {
  174. var sUrl = url + sScreen;
  175. window.open(sUrl);
  176. }
  177. }
  178. function sheet1_OnSmartResize(Width, Height) {
  179. sheet1.FitColWidth();
  180. autoResize();
  181. }
  182. function autoResize(){
  183. var t1_height = document.getElementById("search-table1").scrollHeight + document.getElementById("search-table2").scrollHeight + document.getElementById("title").scrollHeight + 24;
  184. var iframeHeight= document.body.scrollHeight - t1_height;
  185. var iframeWidth= document.body.scrollWidth;
  186. sheet1.SetSheetHeight(iframeHeight);
  187. }
  188. function sheet1_OnClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  189. if(sheet1.ColSaveName(Col) == "pgm_gr_name") {
  190. sortPgmProc(sheet1.GetCellValue(Row, "pgm_gr_id"));
  191. }
  192. }
  193. document.body.onresize = addEvent( document.body.onresize, "autoResize()");
  194. </SCRIPT>
  195. <modular:search id="form1">
  196. <modular:key id="fevent" />
  197. </modular:search>
  198. <form id="form1" name="form1" method="post" modular:type="search" style="width:100%;height:100%;">
  199. <INPUT type="hidden" name="fevent" value="">
  200. <INPUT type="hidden" name="right_id" value="<%= params.get("right_id") %>">
  201. <INPUT type="hidden" name="scrollTopValue" value="<%= params.get("scrollTopValue") %>">
  202. <div align="left" id="title">
  203. <ul>
  204. <li>권한 관리</li>
  205. </ul>
  206. </div>
  207. <!-- 검색조건 시작 -->
  208. <table id="search-table1" class="search-form-table">
  209. <colgroup>
  210. <col width="100" />
  211. <col width="400" />
  212. <col width="100" />
  213. <col width="*" />
  214. <col width="200" />
  215. </colgroup>
  216. <tr>
  217. <th>시스템</th>
  218. <td>
  219. <%= systemSelectTag %>
  220. </td>
  221. <th>그룹명</th>
  222. <td>
  223. <%= InputText.get("pgm_gr_name", params.get("pgm_gr_name"), 80, 30, "hangul, enterTab,PerSize") %>
  224. </td>
  225. <td class="button" rowspan="2">
  226. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
  227. <span class="btnSearch center"><a href="javascript:void(0);" id="btnClear">초기화</a></span>
  228. </td>
  229. </tr>
  230. <tr>
  231. <th>프로그램명</th>
  232. <td>
  233. <%= InputText.get("pgm_name", params.get("pgm_name"), 79, 30, "hangul, enterTab,PerSize") %>
  234. </td>
  235. <th>Screen</th>
  236. <td>
  237. <%= InputText.get("screen_name", params.get("screen_name"), 80, 30, "english, PerSize") %>
  238. </td>
  239. </tr>
  240. </table>
  241. <!-- 검색조건 종료 -->
  242. <table id="search-table2" width="100%">
  243. <tr>
  244. <td class="button" align="right">
  245. <span class="btnSearch center"><a href="javascript:void(0);" id="btnModGroupSeqProc">그룹순서변경</a></span>
  246. <span class="btnSearch center"><a href="javascript:void(0);" id="btnAddPgmProc">추가</a></span>
  247. <span class="btnSearch center"><a href="javascript:void(0);" id="btnDelete">삭제</a></span>
  248. <span class="btnSearch center"><a href="javascript:void(0);" id="btnList">목록</a></span>
  249. </td>
  250. </tr>
  251. </table>
  252. <!-- 본문시작 -->
  253. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 400px; overflow: auto;">
  254. <script>createIBSheet('sheet1','100%', '400px');</script>
  255. </div>
  256. </FORM>