/****************************************************** - e-Labeling - javascriptJRG.php - 概要 :e-LabelingのJavaScript共通処理 - 言語設定反映のため、拡張子をphpで利用 - 作成日:2012.11.12 #000 R.Ishii - 更新日:YYYY.MM.DD #001 Name ******************************************************/  /************************************** * function Paging * ページ遷移を実行する関数 * @param p_method : 1:get 2:post * @param p_target : 1:self 2:new Window * @param p_action : Target Page * @param p_formName : formName * @param p_pageNum : JumpPageNo * @param p_pageAction : PageAction * ***************************************/ function Paging(p_method , p_target , p_action , p_formName , p_pageNum , p_pageAction){ //フォームをセット var obj = document.forms[p_formName]; var status = null; //hidden項目 CurrentPageがある場合は、ページをセット if(document.getElementById("CurrentPage")){ document.getElementById("CurrentPage").value = p_pageNum; } //hidden項目PageActionがある場合はページアクションをセット if(p_pageAction != ""){ if(document.getElementById("PageAction")){ document.getElementById("PageAction").value = p_pageAction; } } //検索結果表示画面の場合は、DownLoadチェックボックスのチェックを実施 if(p_pageAction != "BatchDownLoad" && p_pageAction != "DownLoad"){ if (p_formName == "JGRG001RE"){ status ="0"; for (i = 0; i < document.JGRG001RE.elements.length; i++){ if (document.JGRG001RE.elements[i].checked){ status = "1"; } } //チェックがあった場合 if(status == "1"){ ret = window.confirm('Do you wish to leave this page?\n(Any file selections will be cleared.)'); if( ret ){ null; }else{ return false; } } } } //メソッドをセット if(p_method == 1 ){ obj.method = "GET"; }else{ obj.method = "POST"; } //遷移先のターゲットをセット if(p_target == 1){ //次画面 obj.target = "_self"; }else{ //新規ウィンドウ・タブ obj.target = "_blank"; } //アクションをセット obj.action = p_action; //フォームの内容をSubmit obj.submit(); //return false; } /************************************** * function setOrdBy * 並び替えボタンの制御を実施 * @param type : 並び替え条件 * ***************************************/ function setOrdBy(type){ var condition = null; /* // Document No. 並び替え if(type == "Doc"){ switch(document.JGRG001RE.DOC_ORD.value){ //未選択の場合 case 'Document No. ': condition = "DocAsc"; break; //昇順の場合 case '': condition = "DocDesc"; break; //降順の場合 case '': condition = "DocAsc"; break; default: condition = "DocAsc"; } } //タイトル 並び替え if(type == "Ttl"){ switch(document.JGRG001RE.TTL_ORD.value){ //未選択の場合 case 'Document Title ': condition = "TtlAsc"; break; //昇順の場合 case '': condition = "TtlDesc"; break; //降順の場合 case '': condition = "TtlAsc"; break; default: condition = "TtlAsc"; } } // 登録日 並び替え if(type == "Reg"){ switch(document.JGRG001RE.REG_ORD.value){ //未選択の場合 case 'Registered ': condition = "RegAsc"; break; //昇順の場合 case '': condition = "RegDesc"; break; //降順の場合 case '': condition = "RegAsc"; break; default: condition = "RegAsc"; } } // 仕向地 並び替え if(type == "Frd"){ switch(document.JGRG001RE.FRD_ORD.value){ //未選択の場合 case 'Region ': condition = "FrdAsc"; break; //昇順の場合 case '': condition = "FrdDesc"; break; //降順の場合 case '': condition = "FrdAsc"; break; default: condition = "FrdAsc"; } } */ condition = type; //hidden項目 LAN_HDN_ORDERへ並び替え条件をセット if(document.getElementById("LAN_HDN_ORDER")){ document.getElementById("LAN_HDN_ORDER").value = condition; } return false; } /************************************** * function btnCtrl * 並び替えボタンの制御を実施 * @param type : 並び替え条件 * ***************************************/ function btnCtrl(type){ //引数の分割 var arg1 = type.substring(0,3) //ソート対象; var arg2 = type.substring(3,7); //昇順か降順か //Document No. if(arg1 == "Doc"){ //初期化 //ボタン色 document.JGRG001RE.DOC_ORD.style.backgroundColor = ''; document.JGRG001RE.TTL_ORD.style.backgroundColor = ''; document.JGRG001RE.REG_ORD.style.backgroundColor = ''; document.JGRG001RE.FRD_ORD.style.backgroundColor = ''; //ボタン表示値 document.JGRG001RE.TTL_ORD.value = 'Document Title '; document.JGRG001RE.REG_ORD.value = 'Registered '; document.JGRG001RE.FRD_ORD.value = 'Region '; //昇順の場合 if(arg2 == "Asc"){ document.JGRG001RE.DOC_ORD.value = ''; //降順の場合 }else{ document.JGRG001RE.DOC_ORD.value = ''; } } //タイトル if(arg1 == "Ttl"){ //初期化 //ボタン色 document.JGRG001RE.DOC_ORD.style.backgroundColor = ''; document.JGRG001RE.TTL_ORD.style.backgroundColor = ''; document.JGRG001RE.REG_ORD.style.backgroundColor = ''; document.JGRG001RE.FRD_ORD.style.backgroundColor = ''; //ボタン表示値 document.JGRG001RE.DOC_ORD.value = 'Document No. '; document.JGRG001RE.REG_ORD.value = 'Registered '; document.JGRG001RE.FRD_ORD.value = 'Region '; //昇順の場合 if(arg2 == "Asc"){ document.JGRG001RE.TTL_ORD.value = ''; //降順の場合 }else{ document.JGRG001RE.TTL_ORD.value = ''; } } //登録日 if(arg1 == "Reg"){ //初期化 //ボタン色 document.JGRG001RE.DOC_ORD.style.backgroundColor = ''; document.JGRG001RE.TTL_ORD.style.backgroundColor = ''; document.JGRG001RE.REG_ORD.style.backgroundColor = ''; document.JGRG001RE.FRD_ORD.style.backgroundColor = ''; //ボタン表示値 document.JGRG001RE.DOC_ORD.value = 'Document No. '; document.JGRG001RE.TTL_ORD.value = 'Document Title '; document.JGRG001RE.FRD_ORD.value = 'Region '; //昇順の場合 if(arg2 == "Asc"){ document.JGRG001RE.REG_ORD.value = ''; //降順の場合 }else{ document.JGRG001RE.REG_ORD.value = ''; } } //仕向地 if(arg1 == "Frd"){ //初期化 //ボタン色 document.JGRG001RE.DOC_ORD.style.backgroundColor = ''; document.JGRG001RE.TTL_ORD.style.backgroundColor = ''; document.JGRG001RE.REG_ORD.style.backgroundColor = ''; document.JGRG001RE.FRD_ORD.style.backgroundColor = ''; //ボタン表示値 document.JGRG001RE.DOC_ORD.value = 'Document No. '; document.JGRG001RE.TTL_ORD.value = 'Document Title '; document.JGRG001RE.REG_ORD.value = 'Registered '; //昇順の場合 if(arg2 == "Asc"){ document.JGRG001RE.FRD_ORD.value = ''; //降順の場合 }else{ document.JGRG001RE.FRD_ORD.value = ''; } } } /************************************** * function checkChkBox * 一括DownLoadボタン押下後の処理 * @param url : ドキュメントURL * ***************************************/ function checkChkBox(url) { //初期化 var status = null; var size=0; var temp; var temparray; //チェックボックスの選択チェック for (i = 0; i < document.JGRG001RE.elements.length; i++){ if (document.JGRG001RE.elements[i].checked){ //チェックがある場合 status = 1; temp = document.JGRG001RE.elements[i].value; temparray = temp.split(","); size = size + Number(temparray[1]); } } //チェックなし if(!status){ alert('Please select the appropriate file.'); return true; //チェックあり } else { //size = size/1000; if(size > 500000){ alert('Cannot download more than 500,000 KB.'); }else{ //ダイアログの表示 //ret = window.confirm('Do you wish to start download of the selected?'); //if( ret ){ //ダウンロード情報をSubmit Paging( 2 , 2 , 'JGRG001.php' , 'JGRG001RE' , 1 , 'BatchDownLoad' ) //}else{ // return false; //} return false; } } } /************************************** * function setURL * ドキュメントURLをセットする * @param url : ドキュメントURL * ***************************************/ function setURL(url){ if(document.getElementById("LAN_HDN_URL")){ document.getElementById("LAN_HDN_URL").value = url; } } /************************************** * function setModality * モダリティをセットする * @param modality : モダリティ * ***************************************/ function setModality(modality){ if(document.getElementById("Modality")){ document.getElementById("Modality").value = modality; alert(modality); } } /************************************** * function setActionfromPress * 並び替えボタンの制御を実施 * @param keyEvent : PressされたキーのEvent * ***************************************/ function setActionfromPress(keyEvent){ if(keyEvent.keyCode != 0){ keyNo = keyEvent.keyCode; }else{ keyNo = keyEvent.charCode; } if(keyNo=="13"){ Paging(2,1,'JGRG001.php','JGRG001SE', 1 , 'SearchResult'); } } /************************************** * function NoAlertMessage * Noクリック時動作 * * ***************************************/ function NoAlertMessage(){ var msg; msg = 'For customers outside the EU,TURKEY,AUSTRALIA,\nplease contact your representative to obtain operation manuals.'; alert(msg); window.location.href = 'https://global.medical.canon/'; } /************************************** * function DialogDisp * 確認メッセージ表示 * * ***************************************/ function DialogDisp(){ $("#dialog").dialog({ modal:true, title:" ", buttons: { "Cancel": function() { $(this).dialog("close"); document.getElementById("cancelFlg").value = "yes"; }, "I Agree": function() { Paging( 2, 1, 'JGRG001.php', 'JGRG001_Login' , 1, 'LoginSuccess'); } } }); }