123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622 |
- /**
- * 교육일정등록관리
- * 2007/11/29 dhkim 신규 작성
- *
- */
-
- var currentdate = getCurrentDate();//현재일자
- var sdate = ((currentdate.toDate()).getAddDate(-1, "M")).getDateFormat(); //보름전
-
- var xEduPath = '/root/main/educsche/educscheinfo'; //교육일정내역 xPath
- var xAttendPath = '/root/main/attntrlist/attntrlistinfo'; //참석자그리드 xPath
- var xUserInfoPath = '/root/main/userpopupinfo'; //참석자팝업결과 xPath
- var xHiddenAttdPath = '/root/hidden/grdattnd'; //참석자조회 xPath
-
- /*
- * 초기화
- */
- function fInit(isUpdate){
- //참석자그리드 초기화
- model.removeNodeSet(xAttendPath);
-
- //파라메터에서 가져오는 값을 저장하기 위한 임시 변수
- var scrnstatus = '';
- var condclsnm = '';
- var condclscd = '';
- var grd_clscd = '';
- var grd_seqno = '';
-
- //팝업띄울때 가져오는 파라메터값을 변수에 임시 저장
- if (checkOpener()) {
-
- scrnstatus = opener.javascript.getParameter("scrnstatus"); //INSERT/UPDATE상태값
- condclsnm = opener.javascript.getParameter("condclsnm"); //교육명
- condclscd = opener.javascript.getParameter("condclscd"); //교육코드
-
- grd_clscd = opener.javascript.getParameter("grd_clscd"); //그리드에서 선택한 교육코드(update시)
- grd_seqno = opener.javascript.getParameter("grd_seqno"); //그리드에서 선택한 일련번호(update시)
-
- } else {
- messageBox("상위화면이 변경되어 데이터를 전달할 수 ", "I004");
- }
-
- if(isUpdate){
- scrnstatus = 'updt';
- grd_clscd = model.getValue('root/main/hidden/keys/clscd');
- grd_seqno = model.getValue('root/main/hidden/keys/seqno');
- }
-
- //신규등록 버튼 클릭해서 팝업 띄웠을때
- if (scrnstatus == 'ins') {
- model.setValue(xEduPath + "/clsnm", condclsnm); //화면 오픈시 교육명에 이름 띄우기
- model.setValue(xEduPath + "/clscd", condclscd); //화면 오픈시 교육코드에 값 가져가기
- model.setValue(xEduPath + "/status", 'i'); //등록 status설정
-
- //default값 세팅..
- model.setValue(xEduPath + "/fromdd", currentdate); //교육시작일
- model.setValue(xEduPath + "/todd", currentdate); //교육종료일
-
- model.makeNode("/root/temp/main/educsche/educscheinfo");
- model.copyNode("/root/temp/main/educsche/educscheinfo",xEduPath);
-
- }
- //수정버튼 클릭해서 팝업 띄웠을때
- else if (scrnstatus == 'updt') {
-
- //저장되어 있던 데이터 조회를 위한 key 값 세팅
- model.removeNodeset("/root/send/reqdata");
- model.makeNode("/root/send/reqdata");
- model.makeNode("/root/send/reqdata/clscd");
- model.makeNode("/root/send/reqdata/seqno");
-
- model.setValue("/root/send/reqdata/clscd", grd_clscd);
- model.setValue("/root/send/reqdata/seqno", grd_seqno);
-
- fSearch();//교육일정 및 교육참석현황 조회
-
- }
-
- model.setValue('/root/hidden/addrowcnt', 1); //default로 행추가 버튼 클릭시 추가할 row 갯수 세팅
-
- model.refresh();
-
- }
-
-
-
- /*
- * 교육일정 및 교육참석현황 조회
- */
- function fSearch(){
-
- model.removeNodeset(xAttendPath); //교육참석현황 그리드 초기화
-
- //교육일정조회
- if (submit("TRAYA00601")) { //가져온 카값을 가지고 저장되어있던 데이터를 조회하여 화면에 로드.
-
- //저장시 구분하기 위한 화면 코드
- model.makeNode(xEduPath + '/status');
-
- //수정 status설정
- model.setValue(xEduPath + "/status",'u');
-
-
- //node 복사
- model.removeNodeSet('/root/temp');
- model.makeNode("/root/temp/main");
- model.copyNode("/root/temp/main","/root/main");
-
- //교육참석현황 조회
- submit("TRAYA00602");
-
- }
-
- }
- /**
- * 2007-12-18
- * 참석자를 선택하기 위한 팝업화면을 호출한다.
- * 참석현황그리드의 행추가버튼 클릭이벤트 발생시 호출된다.
- */
- function fGetAttendant(){
-
- var curRow = grd_attntrlist.row;
-
-
- model.removenodeset(xUserInfoPath);
-
- model.makeValue(xUserInfoPath + '/param', '_OneS_DD');
- //modal("../../userdeptinfoweb/xrw/SPZSU10103_사용자부서선택조회", "", "200", "200", "SPZSU10103","/root/main/userpopupinfo","/root/main/temp");
- modal("../../userdeptinfoweb/xrw/SPZSU10103_사용자부서선택조회", "", "200", "200", "SPZSU10103")
- var iParam = getParameter('SPZSU10103_');
-
-
- //alert(iParam);
- if(iParam != ''){
-
- setCSVToNode(xUserInfoPath, iParam);
- var nodecnt = getNodesetCount(xUserInfoPath + '/list');
-
- //alert(nodecnt);
- for(var i = 1; i <= nodecnt; i++){
- var userid = model.getValue(xUserInfoPath + '/list[' + i +']/userid');
- var usernm = model.getValue(xUserInfoPath + '/list[' + i +']/usernm');
- var dutplcenm = model.getValue(xUserInfoPath + '/list[' + i +']/dutplcenm');
- var baptnm = fGetBaptNm(userid);
-
- //alert("userid:" + userid + " baptnm:" + baptnm);
-
- if (i == 1)
- {
- model.setValue(xAttendPath + '[' + curRow + ']/attntrid', userid);
- model.setValue(xAttendPath + '[' + curRow + ']/attntrnm', usernm);
- model.setValue(xAttendPath + '[' + curRow + ']/baptnm', baptnm);
- model.setValue(xAttendPath + '[' + curRow + ']/depthngnm', dutplcenm);
- }
- else
- {
- grd_attntrlist.insertRow(curRow, "below");//행추가
- curRow = curRow + 1;
- //alert(curRow);
-
- model.setValue(xAttendPath + '[' + curRow + ']/status', "i");//status
- grd_attntrlist.cellStyle("background-image", curRow, 1) = "../../../com/commonweb/images/icon_i.gif";//insert img
-
- model.setValue(xAttendPath + '[' + curRow + ']/attntrid', userid);
- model.setValue(xAttendPath + '[' + curRow + ']/attntrnm', usernm);
- model.setValue(xAttendPath + '[' + curRow + ']/baptnm', baptnm);
- model.setValue(xAttendPath + '[' + curRow + ']/depthngnm', dutplcenm);
-
- }
- }
- model.refresh();
- /*
- if(getNodesetCount(xUserInfoPath) == 1){
- ///root/main/userpopupinfo
- var userid = model.getValue(xUserInfoPath + '/list/userid');
- var usernm = model.getValue(xUserInfoPath + '/list/usernm');
- var dutplcenm = model.getValue(xUserInfoPath + '/list/dutplcenm');
-
- model.setValue(xAttendPath + '[' + curRow + ']/attntrid', userid);
- model.setValue(xAttendPath + '[' + curRow + ']/attntrnm', usernm);
- model.setValue(xAttendPath + '[' + curRow + ']/baptnm', fGetBaptNm(userid));
- model.setValue(xAttendPath + '[' + curRow + ']/depthngnm', dutplcenm);
- model.refresh();
- }
- */
-
-
- }else{
- //grd_attntrlist.deleteItem(curRow);
- }
- clearParameter("SPZSU10103_");
-
- }
-
-
- /**
- * 2007-12-33
- * 아이디를 입력하면 이름과 세례명을 자동조회해 선택된 그리드에 출력한다. 이름이 존재하지 않으면 사원조회팝업을 호출한다.
- * 이름을 입력하면 이름에 해당하는 아이디, 세례명을 자동조회해 선택된 그리드에 출력한다. 동명이인이 있으면 사원조회팝업을 호출한다.
- */
- function fGetAtdIdNm(kind, keyword){
-
- model.removeNodeset('/root/send/grdattnd');
- model.removeNodeset(xUserInfoPath);
- model.makeNode(xUserInfoPath);
- model.makeValue('/root/send/grdattnd/flag', kind);
- model.makeValue('/root/send/grdattnd/searchitem', keyword);
- model.makeValue('/root/send/grdattnd/searchitem_dutplce', getUserInfo('dutplceinstcd'));
- model.makeValue('/root/send/grdattnd/searchitem_dutplceinst', getUserInfo('dutplceinstcd'));
- model.makeValue('/root/send/grdattnd/flag_dutplce', 'dutplcecd');
-
- if(submit('TRAYA00604')){
-
- var popCnt = getNodesetCount(xUserInfoPath + '/list');
-
- if(popCnt != 1){
- fGetAttendant();
- }else if(popCnt == 1){
- var curRow = grd_attntrlist.row;
- var userid = model.getValue(xUserInfoPath + '/list/userid');
- var usernm = model.getValue(xUserInfoPath + '/list/usernm');
- var dutplcenm = model.getValue(xUserInfoPath + '/list/dutplcenm');
- model.setValue(xAttendPath + '[' + curRow + ']/attntrid', userid);
- model.setValue(xAttendPath + '[' + curRow + ']/attntrnm', usernm);
- model.setValue(xAttendPath + '[' + curRow + ']/baptnm', fGetBaptNm(userid));
- model.setValue(xAttendPath + '[' + curRow + ']/depthngnm', dutplcenm);
- model.refresh();
- }
- }
-
- }
-
- /*
- * 2007-12-17
- * 행삭제시 status와 delete img를 세팅한다.
- * addRow한 데이터(rowStatus=1)는 그리드내에서 바루 지워버리고 db에서 select한 데이터(rowStatus=0)는 delete상태 이미지를 보여준다.
- */
- function fDeleteAttendRow(){
- var curRow = grd_attntrlist.row;
- if(curRow > 0){
- if(grd_attntrlist.rowStatus(curRow) == 1 || grd_attntrlist.rowStatus(curRow) == 3){
- grd_attntrlist.deleteRow(curRow);
- }else if(grd_attntrlist.rowStatus(curRow) == 0){
- model.setValue(xAttendPath + '[' + curRow + ']/status', "d");//status
- grd_attntrlist.cellStyle("background-image", grd_attntrlist.row, 1) = "../../../com/commonweb/images/icon_d.gif";//delete img
- //delete강제setting
- grd_attntrlist.addStatus(curRow, "delete");
- }
-
- }
- }
-
- /*
- * 2007-12-17
- * 세례명 조회
- */
- function fGetBaptNm(userid){
- var baptnm = '';
-
- model.removenodeset('/root/temp');
- model.makeNode('/root/temp');
-
- model.removenodeset('/root/send/cond/userid');
- model.makeNode('/root/send/cond/userid');
-
- model.setValue('/root/send/cond/userid', userid);
-
- var xTempPath = '/root/temp/popdetailinfo';
- if(submit('TRAYA00703')){
- baptnm = model.getValue(xTempPath + '/baptnm');
- //return model.getValue(xTempPath + '/baptnm');
- }
-
- return baptnm;
- }
-
-
- /*
- * 저장전 유효성 체크
- */
- function fIsValid(){
-
- //마스터데이터 체크
-
- var fromdd = model.getValue(xEduPath + '/fromdd');
- var todd = model.getValue(xEduPath + '/todd');
-
- if(model.getValue(xEduPath + '/clscd') == ''){
- messageBox('교육일정 관련사항의 교육명이 선택되지 않아 저장', 'E001');
- return false;
- }
- if(model.getValue(xEduPath + '/titlnm') == ''){
- messageBox('교육제목을', 'C001');
- return false;
- }
- if(fromdd == '' || !isValidDateTime(fromdd, "YYYYMMDD")){
- messageBox('교육시작일을 날짜형식에 맞게', 'C001');
- return false;
- }
- if(todd == '' || !isValidDateTime(todd, "YYYYMMDD")){
- messageBox('교육종료일을 날짜형식에 맞게', 'C001');
- return false;
- }
-
- var userid = '';
- var _usrid = '';
- var _usrnm = '';
-
- //디테일 체크
- //alert(grd_attntrlist.rows);
- for(var i = 1; i < grd_attntrlist.rows; i++){
-
- //grd_attntrlist.rowStatus(i) -> 0:new, 1 : insert, 2 : update, 3 : insert & new , 4 : delete, 5 : delete & insert , 6 : delete & update
- //alert(i + " :" +grd_attntrlist.rowStatus(i));
- if(grd_attntrlist.rowStatus(i) !="4"){
- userid = model.getValue(xAttendPath + '[' + i + ']/attntrid');
-
- if(userid == ''){
- messageBox(i+ '번째의 참석자를 ', 'C002');
- return false;
- }
-
-
- for(var j = i+1; j < grd_attntrlist.rows; j++){
-
- if(grd_attntrlist.rowStatus(j) != "4"){
- //alert(grd_attntrlist.rowStatus(j));
- _usrid = model.getValue(xAttendPath + '[' + j + ']/attntrid');
- _usrnm = model.getValue(xAttendPath + '[' + j + ']/attntrnm');
- if(userid == _usrid){
- messageBox(i+ '번째와 '+ j + '번째의 참석자(' + _usrnm + ')가', 'E006');
- return false;
- }
- }
- }
-
- }
-
- }
-
- return true;
-
- }
-
-
- /*
- * 교육일정 관련사항 저장
- */
- function fSave(){
-
- if(fIsValid()){
-
- //keys
- var clscd = model.getValue(xEduPath + "/clscd");
- var seqno = model.getValue(xEduPath + "/seqno");
-
- //적립시간 계산
- var milehh = eval(model.getValue(xEduPath + '/milehh'));
- var milemm = eval(model.getValue(xEduPath + '/milemm'));
- if(milehh == null)
- milehh = 0;
- if(milemm == null)
- milemm = 0;
-
- var miletm = (milehh*60) + milemm;
-
- var trgtpsnqty = model.getValue(xEduPath + "/trgtpsnqty");
- if(trgtpsnqty == '')
- trgtpsnqty = 0;
-
- //교육일정
- var sEduData ="clscd" //01.분류코드
- + "▦seqno" //02.일련번호
- + "▦fromdd" //03.시작일자
- + "▦todd" //04.종료일자
- + "▦titlnm" //05.제목명
- + "▦fromtm" //06.시작시간
- + "▦totm" //07.종료시간
- + "▦miletm" //08.적립시간
- + "▦plcenm" //09.장소명
- + "▦trgtpsnqty" //10.참석인원
- + "▦chrgconslrid" //11.담당원목자ID
- + "▦goalnm" //12.목적
- + "▦lactrnm" //13.강사명
- + "▦pastorid" //14.주례자id
- + "▦pastornm" //15.주례자이름
- + "▦voluntrnm" //16.봉사자명
- + "▦schecnts" //17.일정내용
- + "▦valursltcnts" //18.평가결과내용
- + "▦valubugtcnts" //19.평가예산내용
- + "▦status" //20.IUD상태값
- + "▩" ;
- sEduData += clscd //01.분류코드
- + "▦" + seqno //02.일련번호
- + "▦" + model.getValue(xEduPath + "/fromdd") //03.시작일자
- + "▦" + model.getValue(xEduPath + "/todd") //04.종료일자
- + "▦" + model.getValue(xEduPath + "/titlnm") //05.제목명
- + "▦" + model.getValue(xEduPath + "/fromtm") //06.시작시간
- + "▦" + model.getValue(xEduPath + "/totm") //07.종료시간
- + "▦" + miletm //08.적립시간
- + "▦" + model.getValue(xEduPath + "/plcenm") //09.장소명
- + "▦" + trgtpsnqty //10.참석인원
- + "▦" + model.getValue(xEduPath + "/chrgconslrid") //11.담당원목자ID
- + "▦" + model.getValue(xEduPath + "/goalnm") //12.목적
- + "▦" + model.getValue(xEduPath + "/lactrnm") //13.강사명
- + "▦" + model.getValue(xEduPath + "/pastorid") //14.주례자id
- + "▦" + model.getValue(xEduPath + "/pastornm") //15.주례자이름
- + "▦" + model.getValue(xEduPath + "/voluntrnm") //16.봉사자명
- + "▦" + model.getValue(xEduPath + "/schecnts") //17.일정내용
- + "▦" + model.getValue(xEduPath + "/valursltcnts") //18.평가결과내용
- + "▦" + model.getValue(xEduPath + "/valubugtcnts") //19.평가예산내용
- + "▦" + model.getValue(xEduPath + "/status") //20.IUD상태값
- + "▩" ;
-
- var sEduDetailData = grd_attntrlist.getUpdateDataAll('u');//참석자그리드데이터
-
- //alert(sEduData);
- //alert(sEduDetailData);
-
- model.removenode("/root/send");
- model.makeNode("/root/send");
- model.makeValue("/root/send/eduData", sEduData );
- model.makeValue("/root/send/eduDetailData", sEduDetailData );
-
- model.refresh();
-
- var chrgconslrid = model.getValue("/root/main/educsche/educscheinfo/chrgconslrid");
- if ( chrgconslrid == "" ){
- messageBox("원목자정보를","C001" );
- model.refresh();
- return;
- }
-
- if(submit("TXAYA00601")){
- messageBox("자료 저장이 ","I002");
- window.close();
- }
-
-
- }
-
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- //담당원목자, 주례자 팝업 호출
- function fConslrSearch() {
-
- model.resetInstanceNode('/root/popdata/');
- setParameter("SPAYA02800_joblncd", "A"); //원목자,사제
- modal("SPAYA02800", 1, 200, 100,"SPAYA02800");
-
- //담당원목자 셋팅
- if (model.getValue("/root/popdata/conslrid") != "")
- {
- model.setValue(xEduPath + '/chrgconslrid', model.getValue('/root/popdata/conslrid'));
- model.setValue(xEduPath + '/chrgconslrnm', model.getValue('/root/popdata/conslrnm'));
- }
- model.refresh();
- }
-
- /*
- //원목자명 입력후 엔터키 치면 실제 원목자팝업 조회쿼리에서 아이디를 찾는다.
- //명칭 입력한 것에 대한 아이디가 없으면 원목자선택하는 팝업을 띄워준다.
- */
- function fgetConslrId(pcNm){
-
- model.removenodeset('/root/send/conslr');
- model.makeValue('/root/send/conslr/conslrpastornm', pcNm);
-
- if(submit('TRAYA00603')){
-
- fsetConslrId();
-
- }
-
- }
-
-
- /*
- 조회해 온 원목자를 세팅한다.
- */
- function fsetConslrId(){
-
- var pcId = model.getValue('/root/hidden/conslr/conslrinfo/conslrid');
- var pcNm = model.getValue('/root/hidden/conslr/conslrinfo/conslrnm');
-
- model.setValue(xEduPath + '/chrgconslrid', pcId);
- model.setValue(xEduPath + '/chrgconslrnm', pcNm);
-
- model.refresh();
-
- if(pcId == ''){
- fConslrSearch();//조회해온 아이디값이 없으면 원목자, 주례자 선택 팝업을 호출한다.
- }
-
- }
-
-
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
- //팝업
- function fSearchLactr() {
-
- model.resetInstanceNode("/root/popdata");
- modal("SPAYA02800", 1, 200, 100);
-
- if (model.getValue("/root/popdata/conslrid") != "")
- {
- model.setValue("/root/main/educsche/educscheinfo/chrgconslrid", model.getValue("/root/popdata/conslrid"));
- model.setValue("/root/main/educsche/educscheinfo/chrgconslrnm", model.getValue("/root/popdata/conslrnm"));
- //model.setValue("/root/main/attdabsnrgst/attdabsnrgstinfo/outer_chk", "");
- }
-
- model.refresh();
-
-
- /*
- var chkflag = setParameter("chkflag", 'doctrinelactr');
- modal("SPAYA02800", 1, 200, 100);
-
- if (model.getValue("/root/main/attdabsnrgst/attdabsnrgstinfo/lactrid") != "") {
- model.resetInstanceNode("/root/main/attdabsnrgst/attdabsnrgstinfo/outer_chk");
- ipt_lactrnm.disabled = true;
- } else {
- ipt_lactrnm.disabled = false;
- }
- model.refresh();
- */
- }
- // 담당원목자명/주례자명으로 찾기
- function fGetConslrID(pastornm){
- model.removeNodeset('/root/send/conslrpastor');
- model.resetInstanceNode("/root/hidden/conslrpastor/chrgconslrlistinfo");
-
- model.makeNode('/root/send/conslrpastor/conslrpastornm');
- model.setValue('/root/send/conslrpastor/conslrpastornm', pastornm);
-
-
- if (pastornm == "")
- {
- model.setValue("/root/main/educsche/educscheinfo/chrgconslrid", "");
- model.setValue("/root/main/educsche/educscheinfo/chrgconslrnm", "");
- //model.setValue("/root/main/attdabsnrgst/attdabsnrgstinfo/outer_chk", "");
- return;
- }
- if(submit('TRAYA01303', false) == true)
- {
- var nodecnt = model.instances(0).selectNodes("/root/hidden/conslrpastor/chrgconslrlistinfo").length;
-
- // 두건 이상일때는 팝업
- if (nodecnt > 1)
- {
- fSearchLactr();
- }
- else
- {
-
- var conslrid = model.getValue('/root/hidden/conslrpastor/chrgconslrlistinfo/conslrpastorid');
-
- // 찾는 사람이 없을 때도 팝업
- if (conslrid == "")
- {
- fSearchLactr();//팝업
- }
- else
- {
- model.setValue("/root/main/educsche/educscheinfo/chrgconslrid", model.getValue("/root/hidden/conslrpastor/chrgconslrlistinfo/conslrpastorid"));
- model.setValue("/root/main/educsche/educscheinfo/chrgconslrnm", model.getValue("/root/hidden/conslrpastor/chrgconslrlistinfo/conslrpastornm"));
- //model.setValue("/root/main/attdabsnrgst/attdabsnrgstinfo/outer_chk", "");
- }
- }
- }
-
- }
-
-
-
-
|