(function(){MAX_CUSTOM_FIELDS=15;DEFAULT_COLS_TO_SHOW=[{check_enabled:!0,header:MyLang.getMsg("DOC_TITLE"),type:"text",custom_field_name:"doc_title"},{check_enabled:!0,header:MyLang.getMsg("SUBMIT_DATE"),type:"date",custom_field_name:"submit_date"},{check_enabled:!0,header:MyLang.getMsg("FLD_TEMPLATE_NAME"),type:"text",custom_field_name:"template_id"},{check_enabled:!1,header:MyLang.getMsg("AUTHOR_NAME"),type:"text",custom_field_name:"author_name"}];REQUIRED_COL_FOR_UTF=["template_id"];SateraitoWF= {symbolArray:[["@","\uff20"],["|","\uff5c"],["!","\uff01"],["#","\uff03"],["$","\uff04"],["%","\uff05"],["&","\uff06"],["'","\u2019"],['"',"\u201d"],["(","\uff08"],[")","\uff09"],["=","\uff1d"],["-","\u30fc"],["~","\uff5e"],["^","\uff3e"],["\\","\uffe5"],["_","\uff3f"],["<","\uff1c"],[">","\uff1e"],["?","\uff1f"],["/","\uff0f"],["+","\uff0b"],["*","\uff0a"],[":","\uff1a"],[";","\uff1b"],["\uff65","\u30fb"],["{","\uff5b"],["}","\uff5d"],["[","\uff3b"],["]","\uff3d"],[".","\uff0e"],[",","\uff0c"],[":", "\uff1a"],[";","\uff1b"]],katakanaArray:[["\uff76\uff9e","\u30ac"],["\uff77\uff9e","\u30ae"],["\uff78\uff9e","\u30b0"],["\uff79\uff9e","\u30b2"],["\uff7a\uff9e","\u30b4"],["\uff7b\uff9e","\u30b6"],["\uff7c\uff9e","\u30b8"],["\uff7d\uff9e","\u30ba"],["\uff7e\uff9e","\u30bc"],["\uff7f\uff9e","\u30be"],["\uff80\uff9e","\u30c0"],["\uff81\uff9e","\u30c2"],["\uff82\uff9e","\u30c5"],["\uff83\uff9e","\u30c7"],["\uff84\uff9e","\u30c9"],["\uff8a\uff9e","\u30d0"],["\uff8a\uff9f","\u30d1"],["\uff8b\uff9e","\u30d3"], ["\uff8b\uff9f","\u30d4"],["\uff8c\uff9e","\u30d6"],["\uff8c\uff9f","\u30d7"],["\uff8d\uff9e","\u30d9"],["\uff8d\uff9f","\u30da"],["\uff8e\uff9e","\u30dc"],["\uff8e\uff9f","\u30dd"],["\uff73\uff9e","\u30f4"],["\uff67","\u30a1"],["\uff71","\u30a2"],["\uff68","\u30a3"],["\uff72","\u30a4"],["\uff69","\u30a5"],["\uff73","\u30a6"],["\uff6a","\u30a7"],["\uff74","\u30a8"],["\uff6b","\u30a9"],["\uff75","\u30aa"],["\uff76","\u30ab"],["\uff77","\u30ad"],["\uff78","\u30af"],["\uff79","\u30b1"],["\uff7a","\u30b3"], ["\uff7b","\u30b5"],["\uff7c","\u30b7"],["\uff7d","\u30b9"],["\uff7e","\u30bb"],["\uff7f","\u30bd"],["\uff80","\u30bf"],["\uff81","\u30c1"],["\uff6f","\u30c3"],["\uff82","\u30c4"],["\uff83","\u30c6"],["\uff84","\u30c8"],["\uff85","\u30ca"],["\uff86","\u30cb"],["\uff87","\u30cc"],["\uff88","\u30cd"],["\uff89","\u30ce"],["\uff8a","\u30cf"],["\uff8b","\u30d2"],["\uff8c","\u30d5"],["\uff8d","\u30d8"],["\uff8e","\u30db"],["\uff8f","\u30de"],["\uff90","\u30df"],["\uff91","\u30e0"],["\uff92","\u30e1"],["\uff93", "\u30e2"],["\uff6c","\u30e3"],["\uff94","\u30e4"],["\uff6d","\u30e5"],["\uff95","\u30e6"],["\uff6e","\u30e7"],["\uff96","\u30e8"],["\uff97","\u30e9"],["\uff98","\u30ea"],["\uff99","\u30eb"],["\uff9a","\u30ec"],["\uff9b","\u30ed"],["\uff9c","\u30ef"],["\uff66","\u30f2"],["\uff9d","\u30f3"],["\uff61","\u3002"],["\uff62","\u300c"],["\uff63","\u300d"],["\uff64","\u3001"],["\uff65","\u30fb"],["\uff70","\u30fc"],["\uff9e","\u309b"],["\uff9f","\u309c"]],_toFullWidthKatakana:function(a){return SateraitoWF._toFullWidth(a, SateraitoWF.katakanaArray)},_toFullWidthSymbol:function(a){return SateraitoWF._toFullWidth(a,SateraitoWF.symbolArray)},_toFullWidth:function(a,b){var c=a;Ext.each(b,function(){for(var d=String(this[0]),f=String(this[1]);-1!=c.indexOf(d);)c=c.replace(d,f)});return c},_toHalfWidthKatakana:function(a){return SateraitoWF._toHalfWidth(a,SateraitoWF.katakanaArray)},_toHalfWidthSymbol:function(a){return SateraitoWF._toHalfWidth(a,SateraitoWF.symbolArray)},_toHalfWidth:function(a,b){var c=a;Ext.each(b,function(){for(var d= String(this[0]),f=String(this[1]);-1!=c.indexOf(f);)c=c.replace(f,d)});return c},toFullWidth:function(a){if("string"!=typeof a)return a;a=SateraitoWF._toFullWidthSymbol(a);a=SateraitoWF._toFullWidthKatakana(a);return a.replace(/[A-Za-z0-9]/g,function(b){return String.fromCharCode(b.charCodeAt(0)+65248)})},toHalfWidth:function(a){if("string"!=typeof a)return a;a=SateraitoWF._toHalfWidthSymbol(a);a=SateraitoWF._toHalfWidthKatakana(a);return a.replace(/[\uff21-\uff3a\uff41-\uff5a\uff10-\uff19]/g,function(b){return String.fromCharCode(b.charCodeAt(0)- 65248)})},addComma:function(a){return NumUtil.addComma(a)},removeComma:function(a){return NumUtil.removeComma(a)},getCalendarCmp:function(a,b){if("form_new_doc"==a.getAttribute("id"))return Ext.getCmp("template_body_new_doc_"+b);a=a.getAttribute("id").split("_")[1];return Ext.getCmp("template_body_"+a+"_"+b)},calcAll:function(a){"form_new_doc"==a.getAttribute("id")?Calc.calcAll("template_body_new_doc"):(a=a.getAttribute("id").split("_")[1],Calc.calcAll("template_body_"+a))},round:function(a,b,c){return Calc.round(a, b,c)},sum:function(a,b){return Calc.sum(a,b)},diff:function(a,b){return Calc.diff(a,b)},multi:function(a,b){return Calc.multi(a,b)},divide:function(a,b){return Calc.divide(a,b)},changeProcessDisplayName:function(a,b,c){var d=$(a).find("div.route_body").find("input[name=process][number='"+Sateraito.Util.jQEscape(b)+"']");if("undefined"==typeof d||null==d)return!1;d=$(d).parents("tr").find("td.detail_name");if("undefined"==typeof d||null==d)return!1;var f=null;if("form_new_doc"==a.getAttribute("id")){a= $("#template_route_to_submit").find("input[name=process][number='"+Sateraito.Util.jQEscape(b)+"']");if("undefined"==typeof a||null==a)return!1;f=$(a).parents("tr").find("td.detail_name");if("undefined"==typeof f||null==f)return!1}$(d).html(c);f&&$(f).html(c);return!0},dateDiff:function(a,b){return""==a||""==b?null:Sateraito.DateUtil.getDateDiff(a,b)},dateAdd:function(a,b){return""==a||null==a||isNaN(b)?null:Sateraito.DateUtil.getFutureDateStr(a,b)},monthAdd:function(a,b){return""==a||null==a||isNaN(b)? null:Sateraito.DateUtil.addMonth(a,b)},yearAdd:function(a,b){return""==a||null==a||isNaN(b)?null:Sateraito.DateUtil.addYear(a,b)},alert:function(a,b,c){"undefined"==typeof a&&(a="");a=(""+a).replace(/\n/g,"
");Ext.Msg.show({title:b,icon:Ext.MessageBox.INFO,msg:a,buttons:Ext.Msg.OK,fn:function(d,f){"undefined"!=typeof c&&c("ok"==d)}});a=Ext.Msg.getDialog();b=a.getPosition();200"); Ext.MessageBox.confirm(b,a,function(d){"undefined"!=typeof c&&c("yes"==d)});a=Ext.Msg.getDialog();b=a.getPosition();200");Ext.MessageBox.show({title:b,msg:a,buttons:Ext.MessageBox.OKCANCEL,fn:function(e,g){"undefined"!=typeof f&&f("ok"==e,g)},value:c,closable:!0,progress:!1,prompt:!0,multiline:d});a=Ext.Msg.getDialog();b=a.getPosition();200');a+=Sateraito.Util.escapeHtml(b);return a+""},showAddressBookPopup:function(a,b,c,d,f,e,g){a.getAttribute("id");a=SateraitoWF.getFormMainBody(a);b=Sateraito.Util.jQFindInputByName($(a),b).get(0);$.isArray(d)&&0=b)b=1;a=WorkflowDoc.docIds[a.getAttribute("id")];var d="";if(1==b)d=WorkflowDoc.relativeDocIds[a];else{var f=WorkflowDoc.relativeDocIdChains[a];"undefined"!=typeof f&&f.length>=b&&(b=f.length-b,0<=b&&(d=f[b]))}if("undefined"!=typeof d&&""!= d)return DocDetailWindow.showWindow(d),c&&(c=Ext.getCmp("doc_detail_window_"+a),"undefined"!=typeof c?c.close():(c=Ext.getCmp("doc_detail_window_new_doc"),"undefined"!=typeof c&&c.close())),!0},requestMasterDataRow:function(a,b,c){MasterData.requestMasterDataRow(a,b,c)},requestMasterDataRows:function(a,b,c){MasterData.requestMasterDataRows(a,b,c)},updateMasterDataRow:function(a,b,c,d,f,e){MasterData.updateMasterDataRow(a,b,c,d,f,e)},requestMasterData:function(a,b){MasterData.requestMasterData(a,"", !0,!1,!1,"",b)},getMasterData:function(a){if(MasterData.hasMasterDataCache(a)){var b;MasterData.requestMasterData(a,"",!0,!1,!1,"",function(c,d,f){b=c});return b}return[]},appendUpdateMasterData:function(a,b,c,d,f,e,g){a=WorkflowDoc.docIds[a.getAttribute("id")];WorkflowDoc.appendMasterRowForUpdate(a,b,c,d,f,e,g)},openSectionArea:function(a,b){SateraitoWF._openSectionArea(a,b,!0)},closeSectionArea:function(a,b){SateraitoWF._openSectionArea(a,b,!1)},_openSectionArea:function(a,b,c){var d=SateraitoWF.getFormMainBody(a); a=String(b).split(" ");Ext.each(a,function(){var f=""+this;$(d).find("div.section_area").each(function(){var e=$(this);if($(e).hasClass(f)){var g=$(e).find("img.section_arrow_img"),h=$(e).find("div.section_show_hide_area");e=!1;0<$(h).find(".sateraito_richtext_render_area").size()&&(e=!0);$(h).css("display");c?($(h).show(),h=$(d).attr("id"),e&&FieldConvert.resizeAutowidthHtmlEditorInDoc(h),$(g).attr("src",SATERAITO_MY_SITE_URL+"/images/arrowDown.gif")):($(h).hide(),$(g).attr("src",SATERAITO_MY_SITE_URL+ "/images/arrowRight.gif"))}})})},resizeAutowidthHtmlEditorInDoc:function(a){a=SateraitoWF.getFormMainBody(a);a=$(a).attr("id");FieldConvert.resizeAutowidthHtmlEditorInDoc(a)},hideRouteSelection:function(a){$("#route_selection").hide()},showRouteSelection:function(a){$("#route_selection").show()},_select_route_no:0,selectRoute:function(a,b){var c="";if("form_new_doc"==a.getAttribute("id")){c="template_body_new_doc";var d={process:function(){ApproverCandidate.checkInitApprover(c)?(b=SateraitoWF._select_route_no, SateraitoWF._select_route_no=0,SateraitoWF.setFormValue(a,"route_selection",b-1),$("#route_selection").trigger("change")):setTimeout(d.process,100)}},f=0>=SateraitoWF._select_route_no;SateraitoWF._select_route_no=b;f&&d.process()}},getCurrentRoute:function(a){a=SateraitoWF.getFormValue(a,"route_selection");return"undefined"!=typeof a&&""!=a?parseInt(a,10)+1:1},getCurrentApproveProcessNumber:function(a){a=$(a).find("div.route_body").find("input[name=process][current_approving=1]").attr("number");return isNaN(a)? 0:parseInt(a,10)},getApproveProcessInfo:function(a){var b=[],c=SateraitoWF.getDocId(a);if("undefined"!=typeof c&&""!=c&&(b=WorkflowDoc.approveProcesses[c],"undefined"!=typeof b))for(c=0;c=d.approvers.length){var f=SateraitoWF.getApprovers(a,d.approve_number),e=f;d.approver_candidates=f;d.not_yet_approvers=e}}"undefined"==typeof b&&(b=[]);return b},getApprovers:function(a,b){var c=[];a=$(a).find("div.route_body").find("input[name=process][number='"+ Sateraito.Util.jQEscape(b)+"']").val();"undefined"!=typeof a&&""!=a&&(c=a.split(","));return c},addApprover:function(a,b,c,d){c=WorkflowUser.getUserByKey(c,d);"undefined"!=typeof c&&null!=c&&(a="form_new_doc"==a.getAttribute("id")?"template_body_new_doc":"template_body_"+a.getAttribute("id").split("_")[1],b=$("#"+a).find("input[name=process][number='"+Sateraito.Util.jQEscape(b)+"']"),ApproverCandidate.addApprover(b,[c.user_email],a))},removeApprover:function(a,b,c,d){c=WorkflowUser.getUserByKey(c, d);"undefined"!=typeof c&&null!=c&&(a="form_new_doc"==a.getAttribute("id")?"template_body_new_doc":"template_body_"+a.getAttribute("id").split("_")[1],ApproverCandidate.removeApprover(b,c.user_email,a))},clearApprovers:function(a,b){a="form_new_doc"==a.getAttribute("id")?"template_body_new_doc":"template_body_"+a.getAttribute("id").split("_")[1];ApproverCandidate.removeAllApprovers(b,a)},addApproversByApproverGroup:function(a,b,c,d){var f="form_new_doc"==a.getAttribute("id")?"template_body_new_doc": "template_body_"+a.getAttribute("id").split("_")[1];var e={process:function(){ApproverCandidate.checkInitApprover(f)?ApproverCandidate.addApproversByApproverGroup(f,b,c,d):setTimeout(e.process,100)}};e.process()},initApproversByApproverGroup:function(a,b,c,d){var f="form_new_doc"==a.getAttribute("id")?"template_body_new_doc":"template_body_"+a.getAttribute("id").split("_")[1];var e={process:function(){ApproverCandidate.checkInitApprover(f)?(ApproverCandidate.removeAllApprovers(b,f),ApproverCandidate.addApproversByApproverGroup(f, b,c,d)):setTimeout(e.process,100)}};e.process()},getUser:function(a,b,c){return WorkflowUser.getUserByKey(b,c)},getViewerUserInfo:function(){return UserSetting.userSetting},getSubmitterUserInfo:function(a){a=a.getAttribute("id");return UserSetting.submitterSetting[a]},getToday:function(a,b){IS_OPENID_MODE?SateraitoWF._getTodayOid(a,b):SateraitoWF._getToday(a,b)},_getTodayOid:function(a,b){"undefined"==typeof b&&(b=1);Ext.Ajax.request({url:MY_SITE_URL+"/"+TENANT_OR_DOMAIN+"/"+APP_ID+"/oid/gettoday?hl="+ SATERAITO_LANG+"&mode="+MyUtil.getMode(),headers:{"Content-Type":"text/plain"},success:function(c,d){c=Ext.decode(c.responseText);a(c)},failure:function(){Sateraito.Util.console("retrying "+b);b=a?a:b;return a},ComboBoxIncrementalSearch:Ext.extend(Ext.form.ComboBox,{constructor:function(a){a=Ext.apply({maxHitCount:500,mode:"local",triggerAction:"all",doQuery:function(b,c){function d(m){if(e> g)return!1;for(var n=0,q=l.length;n=this.minChars)this.lastQuery!==b?(this.lastQuery=b,"local"==this.mode?(this.selectedIndex=-1,c?this.store.clearFilter():this.store.filter([{fn:d}]),this.onLoad()):(this.store.baseParams[this.queryParam]=b,this.store.load({params:this.getParams(b)}),this.expand())):(this.selectedIndex=-1,this.onLoad())}},a);SateraitoUI.ComboBoxIncrementalSearch.superclass.constructor.call(this,a)}})}; EkispertPopup={_transin_type:"R P H F B ALL".split(" "),showPopup:function(a,b,c,d,f){var e=""==MyUtil.getMode()?"https://sateraito-mapsapi.appspot.com":"https://mapsapi.sateraito.jp";var g=LoginMgr.getViewerEmail(),h=TENANT_OR_DOMAIN;if(h&&g){"undefined"==typeof d&&(d={});var l=d.round_trip?"1":"0";d="undefined"!=typeof d.transit_type&&0<=$.inArray(d.transit_type,this._transin_type)?d.transit_type:"ALL";var k="",m="",n="";"[object Date]"==toString.call(c)?(k=""+c.getFullYear()+"-"+("0"+(c.getMonth()+ 1)).slice(-2)+"-"+("0"+c.getDate()).slice(-2),m=("0"+c.getHours()).slice(-2),n=("0"+c.getMinutes()).slice(-2)):"undefined"==typeof c||""==c?(n=new Date,k=""+n.getFullYear()+"-"+("0"+(n.getMonth()+1)).slice(-2)+"-"+("0"+n.getDate()).slice(-2),m=("0"+n.getHours()).slice(-2),n=("0"+n.getMinutes()).slice(-2)):(c=c.split(" "),k=c[0],2<=c.length&&(c=c[1].split(":"),2<=c.length&&(m=c[0],n=c[1])));MyLang.getMsg("ZENRIN_TRANSIT");h=e+"/"+h+"/map_popup/railroad_directions_ekispert?hl="+SATERAITO_LANG;h+="&station_from="+ encodeURIComponent(a);h+="&station_to="+encodeURIComponent(b);h+="&round_trip="+encodeURIComponent(l);h+="&user_email="+encodeURIComponent(g);h+="&d="+encodeURIComponent(k);h+="&h="+encodeURIComponent(m);h+="&m="+encodeURIComponent(n);h+="&tt="+encodeURIComponent(d);var q=window.open(h,"_blank","width=800px height=600px location=no status=no resizable=yes menubar=no toolbar=no");$(window).off("message");$(window).on("message",function(p){p=p.originalEvent;Sateraito.Util.console("message received origin="+ p.origin);if(p.origin===e&&(Sateraito.Util.console(p),p=JSON.parse(p.data),Sateraito.Util.console(p),"response_value"==p.status&&"undefined"!=typeof f)){var r={};r.from_point=p.from;r.to_point=p.to;r.date=p.date;r.round_trip="1"==p.round_trip;r.cost=p.result.cost;r.link=p.result.link;r.desc_text=p.result.desc_text;f(r)}q.close()});(a=window.navigator.userAgent)&&0<=a.indexOf("Macintosh")&&0<=a.indexOf("Chrome")&&setTimeout(function(){q.resizeBy(0,1);q.resizeBy(0,-1)},1E3)}else Sateraito.Util.console("User not log in...")}}; CarfarePopup={popupWindow:null,is_init_event:!1,callBack:null,showPopup:function(a,b){var c=LoginMgr.getViewerEmail(),d=TENANT_OR_DOMAIN;if(d&&c){var f="admin@satelaito.jp"==c?"https://sateraito-carfare-dev.appspot.com":"https://carfare.sateraito.jp";"undefined"==typeof a&&(a={});CarfarePopup.callBack=b;a=function(e){Sateraito.Util.console("message received origin="+e.origin);e.origin===f&&(Sateraito.Util.console(e),e=JSON.parse(e.data),Sateraito.Util.console(e),"ok"==e.status&&"undefined"!=typeof CarfarePopup.callBack&& null!=CarfarePopup.callBack&&CarfarePopup.callBack(e.carfare),CarfarePopup.popupWindow.close())};CarfarePopup.popupWindow=window.open(f+"/a/"+d+"/carfare/?auth=force","_blank","width=900px height=660px location=no status=no resizable=yes menubar=no toolbar=no");CarfarePopup.is_init_event||(window.addEventListener?window.addEventListener("message",a,!1):window.attachEvent&&window.attachEvent("onmessage",a),CarfarePopup.is_init_event=!0)}else Sateraito.Util.console("User not login...")}};AmazonBusinessPopup= {popupWindow:null,is_init_event:!1,callBack:null,showPopup:function(a,b){var c=LoginMgr.getViewerEmail(),d=TENANT_OR_DOMAIN;if(d&&c){if("admin@satelaito.jp"==c)var f="https://amazon-punchout.appspot.com";else"testuser-001@satelaito.jp"==c?(f="https://punchout.sateraito.jp",d="asaraitooffice"):f="https://punchout.sateraito.jp";"undefined"==typeof a&&(a={});AmazonBusinessPopup.callBack=b;b=function(e){Sateraito.Util.console("message received origin="+e.origin);e.origin===f&&(Sateraito.Util.console(e), e=JSON.parse(e.data),Sateraito.Util.console(e),"ok"==e.status&&"undefined"!=typeof AmazonBusinessPopup.callBack&&null!=AmazonBusinessPopup.callBack&&AmazonBusinessPopup.callBack(e),AmazonBusinessPopup.popupWindow.close())};c="";c=a.is_approve&&"undefined"!=typeof a.cart_id&&""!=a.cart_id?f+"/a/"+d+"/amazonbusiness/approve?id="+encodeURIComponent(a.cart_id)+"&auth=force":f+"/a/"+d+"/amazonbusiness/cart/?auth=force";AmazonBusinessPopup.popupWindow=window.open(c,"amazonbusiness","width=900px height=660px location=no status=no resizable=yes menubar=no toolbar=no"); AmazonBusinessPopup.is_init_event||(window.addEventListener?window.addEventListener("message",b,!1):window.attachEvent&&window.attachEvent("onmessage",b),AmazonBusinessPopup.is_init_event=!0)}else Sateraito.Util.console("User not login...")}};FileHubPopup={popupWindow:null,is_init_event:!1,callBack:null,showPopup:function(a,b,c){var d=LoginMgr.getViewerEmail(),f=TENANT_OR_DOMAIN;if(f&&d){var e="admin@satelaito.jp"==d?"https://sateraito-scanner.dt.r.appspot.com":"https://filehub.sateraito.jp";"undefined"== typeof b&&(b={});FileHubPopup.callBack=c;c=function(g){Sateraito.Util.console("message received origin="+g.origin);if(g.origin===e){Sateraito.Util.console(g);var h=JSON.parse(g.data);Sateraito.Util.console(h);"ok"==h.status&&WorkflowUser.requestToken(function(l){l=l.token;SateraitoUI.showLoadingMessage(MyLang.getMsg("UPDATING"));for(var k=h.data.length,m=0,n="",q=0;q';d=d+''+Sateraito.Util.escapeHtml(b);return d+" 

"},getInlinePictureHtml:function(a,b,c){return''}};DragDropUploadForRichText= {listDragDropUploadClass:[],init:function(a,b,c,d,f){window.File&&window.FileReader&&window.FileList&&DragDropUploadForRichText.listDragDropUploadClass.push(new DragDropUploadForRichText.DragDropUploadClass(a,b,c,d,f))},DragDropUploadClass:function(a,b,c,d,f){this.dropFileUpload=this.htmlEditorObj=this.userToken=this.docId=null;this.statusMessge=[];this.maskTargetId=f;$("#"+f).on("drop dragover",function(g){g.stopPropagation();g.preventDefault()});var e=this;this.handleDragOver=function(g){var h= window.navigator.userAgent.toLowerCase();if(Ext.isIE||h.match("trident")||h.match("edge")||0!=g.dataTransfer.files.length)g.stopPropagation(),g.preventDefault(),g.dataTransfer.dropEffect="copy"};this.handleFilePaste=function(g){var h=window.navigator.userAgent.toLowerCase();if(Ext.isIE&&11==document.documentMode)return Sateraito.Util.console("[IE11]use contenteditable."),!0;if(h.match("firefox"))return Sateraito.Util.console("[FireFox]use contenteditable."),!0;if(h.match("safari")&&!h.match("chrome")&& !h.match("crios")&&!h.match("edge"))return Sateraito.Util.console("[Safari]use contenteditable."),!0;if(!g.clipboardData)return Sateraito.Util.console("[Other]use contenteditable."),!0;h=[];for(var l=g.clipboardData.items,k=0;k=h.length)return!0;g.stopPropagation();g.preventDefault();for(k=0;m=h[k];k++)g=new FileReader,g.onload=function(n){n=''; e.htmlEditorObj.activated?e.htmlEditorObj.insertAtCursor(n):e.htmlEditorObj.setValue(e.htmlEditorObj.getValue()+n)},g.readAsDataURL(m)};this.handleFileSelect=function(g){if(0!=g.dataTransfer.files.length){g.stopPropagation();g.preventDefault();e.htmlEditorObj.iframe.contentDocument.removeEventListener("dragover",e.handleDragOver,!1);e.htmlEditorObj.iframe.contentDocument.removeEventListener("drop",e.handleFileSelect,!1);var h=new Ext.LoadMask(Ext.get(e.maskTargetId),{msg:MyLang.getMsg("FILE_UPLOAD")}); h.show();e.statusMessge=[];g=g.dataTransfer.files;for(var l=g.length,k=0,m=0,n;n=g[m];m++){var q="process"+(m+1);var p="undefined"==typeof SCREEN_NAME?LoginMgr.screenName:SCREEN_NAME;var r=new FormData;r.append("attach_file",n);r.append("token",e.userToken);r.append("doc_id",e.docId);r.append("screen",p);DragDropUploadForRichText.requestDropFileUpload(n.name,q,r,e.userToken,function(v,w,t,u){k++;v?(e.statusMessge.push({message:w,isError:!1}),v=AttachFileBase.isImageFile(u)?AttachFileBase.getInlinePictureHtml(t, e.userToken,"undefined"==typeof SCREEN_NAME?LoginMgr.screenName:SCREEN_NAME):AttachFileBase.getFileLinkHtml(t,u),e.htmlEditorObj.activated?e.htmlEditorObj.insertAtCursor(v):e.htmlEditorObj.setValue(e.htmlEditorObj.getValue()+v)):e.statusMessge.push({message:w,isError:!0});if(k==l){e.htmlEditorObj.iframe.contentDocument.addEventListener("dragover",e.handleDragOver,!1);e.htmlEditorObj.iframe.contentDocument.addEventListener("drop",e.handleFileSelect,!1);h.hide();v="";for(w=0;we&&(e=r)});var g= {};"undefined"!=typeof d&&$("#"+a).find("input[name=process]").each(function(){var r="undefined"!=typeof $(this).attr("is_not_exclusion_duplicate_approvers");if("undefined"!=typeof d&&!r){r=$(this).attr("exclusion_approvers_category");"undefined"==typeof r&&(r="");if("undefined"==typeof g[r]){var v={};g[r]=v}else v=g[r];r=$(this).val().split(",");Ext.each(r,function(){var w=""+this,t=w.toLowerCase();""!=w&&("undefined"==typeof v[t]&&(v[t]=0),v[t]+=1)})}});for(var h=0;h';u+=Sateraito.Util.escapeHtml(WorkflowUser.getUserName(t));u+="";if(q){var A=!1;if(null!=r){var y=r[d];if("undefined"!=typeof y&&"undefined"!=typeof y.target_approvers){y=y.target_approvers;for(var E=0;E'):u+(''))}!IS_PRINT_WINDOW&&n&&(u+='");u=u+'')});$(a).after(''+Sateraito.Util.myImplode(v,", ")+"");if(w||k)k=$("#"+c).find(".comment_area").data("comment_list"),"undefined"!=typeof k&&null!=k&&""!=k&&DocDetailWindow.renderApprovingStatus(k,m);if("template_body_new_doc"==c||l)a=$(a).attr("new_and_resubmit_doc_force_sync_approver_to"),a="undefined"==typeof a||null==a||""==a?null:String(a).trim().split(" "),null!=a&&Ext.each(a,function(){var t=""+this;""!=t&&t!=d&&(t=$("#"+c).find("input[name=process][number='"+Sateraito.Util.jQEscape(t)+"']"),"undefined"!= typeof t&&null!=t&&ApproverCandidate.setNewApprovers(t,b,c))})},toggleOpenNotificationButton:function(a,b,c){$("#"+c).find("span.approver_name_list[number="+a+"]").find("img.btn_open_notification[email='"+b+"']").each(function(){var d=$(this);"on"==d.attr("status")?(d.attr("src",SATERAITO_MY_SITE_URL+"/images/open_notification_off.png"),d.attr("status","off"),d.attr("title",MyLang.getMsg("OPEN_NOTIFICATION_OFF"))):(d.attr("src",SATERAITO_MY_SITE_URL+"/images/open_notification_on.png"),d.attr("status", "on"),d.attr("title",MyLang.getMsg("OPEN_NOTIFICATION_ON")))})},removeApprover:function(a,b,c){var d=$("#"+c).find("input[name=process][number='"+Sateraito.Util.jQEscape(a)+"']"),f=!1;if("template_body_new_doc"!=c){var e=c.substring(14,c.length);"1"==$("#template_body_"+e).find("#in_admin_edit_process_"+e).val()&&(f=!0)}if("1"==$(d).attr("current_approving")||f){var g=[];$("#"+c).find('span.approver_status[process_number="'+a+'"]').each(function(){if($(this).attr("approve_status")==WorkflowDoc.STATUS_PASSED|| $(this).attr("approve_status")==WorkflowDoc.STATUS_FINAL_APPROVED){var l=""+$(this).attr("email");g.push(l)}});if(0<=$.inArray(b,g)){Ext.Msg.show({title:MyLang.getMsg("WORKFLOW"),icon:Ext.MessageBox.ERROR,msg:MyLang.getMsg("MSG_UNABLE_TO_DELETE_ALREADY_APPROVED_USER"),buttons:Ext.Msg.OK,fn:function(l){}});return}}a=""+$(d).val();f=[];""!=a&&(f=a.split(","));var h=[];Ext.each(f,function(){""+this!=b&&h.push(""+this)});ApproverCandidate.setNewApprovers(d,h,c)},removeAllApprovers:function(a,b){var c= $("#"+b).find("input[name=process][number='"+Sateraito.Util.jQEscape(a)+"']"),d=!1;if("template_body_new_doc"!=b){var f=b.substring(14,b.length);"1"==$("#template_body_"+f).find("#in_admin_edit_process_"+f).val()&&(d=!0)}if("1"==$(c).attr("current_approving")||d){var e=!1;$("#"+b).find('span.approver_status[process_number="'+Sateraito.Util.jQEscape(a)+'"]').each(function(){if($(this).attr("approve_status")==WorkflowDoc.STATUS_PASSED||$(this).attr("approve_status")==WorkflowDoc.STATUS_FINAL_APPROVED)e= !0});if(e){Ext.Msg.show({title:MyLang.getMsg("WORKFLOW"),icon:Ext.MessageBox.ERROR,msg:MyLang.getMsg("MSG_UNABLE_TO_DELETE_ALREADY_APPROVED_USER"),buttons:Ext.Msg.OK,fn:function(g){}});return}}ApproverCandidate.setNewApprovers(c,[],b)},requestApproverCandidate:function(a,b,c,d,f,e,g){IS_OPENID_MODE?ApproverCandidate._requestApproverCandidateOid(a,b,c,d,f,e,g):ApproverCandidate._requestApproverCandidate(a,b,c,d,f,e,g)},_requestApproverCandidate:function(a,b,c,d,f,e,g){"undefined"==typeof g&&(g=1); "undefined"==typeof f&&(f="");gadgets.io.makeRequest(MY_SITE_URL+"/"+TENANT_OR_DOMAIN+"/"+APP_ID+"/getapprovercandidate?filter="+encodeURIComponent(a)+"&additional_filter="+encodeURIComponent(b)+"&concurrent_user_of="+encodeURIComponent(c)+"&ghost_writer_of="+encodeURIComponent(d)+"&relative_doc_id="+encodeURIComponent(f)+"&hl="+SATERAITO_LANG+"&mode="+MyUtil.getMode(),function(h){h.data?(h=h.data,SateraitoUI.clearMessage(),e(h)):(Sateraito.Util.console("[getapprovercandidate]("+g+")"+h.errors[0]), 401==h.rc?SateraitoUI.showLoadingMessage(MyLang.getMsg("ERROR_TIMEOUT")):(SateraitoUI.showTimerMessage(MyLang.getMsg("RELOADING")+" "+g),g"+a+"");$("#mini_message").append(a).css("width","250px").css("font-size","1.4em").css("font-weight","bold").css("background-color","lemonchiffon").css("text-align","center")}, showNormalMiniMessage:function(a,b){"undefined"==typeof b&&(b=3E3);$("#mini_message").css("width","350px");var c=$("#mini_message").parent().width(),d=$("#mini_message").width();$("#mini_message").css("left",""+(c/2-d/2)+"px");var f=$("
"+a+"
");$("#mini_message").append(f).css("font-size","1.4em").css("width","350px").css("font-weight","bold").css("background-color","lemonchiffon").css("text-align","center");(function(){f.html("").css("width","0px")}).defer(b)},showErrMiniMessage:function(a){$("#mini_message").css("width", "400px");var b=$("#mini_message").parent().width(),c=$("#mini_message").width();$("#mini_message").css("left",""+(b/2-c/2)+"px");var d=$("
"+a+"
");$("#mini_message").append(d).css("font-size","1.2em").css("width","400px").css("font-weight","bold").css("background-color","pink").css("text-align","center");(function(){d.html("").css("width","0px")}).defer(3E3)}};HandleResizeImage={htmlEditorCmp:null,editor:null,currentImage:null,resizing:!1,resizeDirection:"se",revertTop:["nw","n","ne"],revertLeft:["nw", "w","sw"],resizeBoth:["nw","ne","se","sw"],resizeOnlyWidth:["w","e"],resizeOnlyHeight:["n","s"],createDOM:function(a,b,c){a=document.createElement(a);a.className=b;HandleResizeImage.setStyle(a,c);return a},setStyle:function(a,b){for(key in b)a.style[key]=b[key];return a},removeResizeFrame:function(){HandleResizeImage.editor.querySelectorAll(".resize-frame-se, .resize-frame-img-size, .resize-frame-img-preview, .resizer").forEach(function(a){a.parentNode.removeChild(a)})},offset:function(a){a=a.getBoundingClientRect(); var b=HandleResizeImage.editor.scrollLeft,c=HandleResizeImage.editor.scrollTop;return{top:a.top+c,left:a.left+b,bottom:a.bottom+c,right:a.right+b}},clickImage:function(a,b,c){a.width>b.getWidth()-6&&(a.width=b.getWidth()-6);HandleResizeImage.currentImage=a;HandleResizeImage.htmlEditorCmp=b;HandleResizeImage.editor=c;HandleResizeImage.removeResizeFrame();c=a.offsetHeight;var d=a.offsetWidth,f=a.offsetTop,e=a.offsetLeft,g=HandleResizeImage.editor.ownerDocument.documentElement.scrollTop,h=HandleResizeImage.editor.ownerDocument.documentElement.scrollLeft; a=f-g-1;var l=e-h-1;HandleResizeImage.editor.append(HandleResizeImage.createDOM("span","resize-frame-se",{margin:"10px",position:"absolute",top:a+c-14+"px",left:l+d-14+"px",border:"1px solid #4099ff",backgroundColor:"#4099ff",width:"9px",height:"9px",cursor:"se-resize",zIndex:100}));HandleResizeImage.editor.append(HandleResizeImage.createDOM("span","resize-frame-img-size",{margin:"10px",position:"absolute",top:a+c+"px",left:l+d+"px",backgroundColor:"#494949",color:"#fff",whiteSpace:"nowrap",borderRadius:"2px", padding:"5px",zIndex:100,display:"none"}));HandleResizeImage.editor.append(HandleResizeImage.createDOM("img","resize-frame-img-preview",{position:"absolute",top:a+"px",left:l+"px",opacity:"0.7",zIndex:69,display:"none"}));HandleResizeImage.editor.append(HandleResizeImage.createDOM("span","resizer top-border",{position:"absolute",top:a+"px",left:l+"px",width:d+"px",height:"3px",backgroundColor:"#b4d7ff",zIndex:96}));HandleResizeImage.editor.append(HandleResizeImage.createDOM("span","resizer left-border", {position:"absolute",top:a+"px",left:l+"px",width:"3px",height:c+"px",backgroundColor:"#b4d7ff",zIndex:96}));HandleResizeImage.editor.append(HandleResizeImage.createDOM("span","resizer right-border",{position:"absolute",top:a+"px",left:l+d+"px",width:"3px",height:c+"px",backgroundColor:"#b4d7ff",zIndex:96}));HandleResizeImage.editor.append(HandleResizeImage.createDOM("span","resizer bottom-border",{position:"absolute",top:a+c+"px",left:l+"px",width:d+"px",height:"3px",backgroundColor:"#b4d7ff",zIndex:96})); HandleResizeImage.editor.querySelector(".resize-frame-se").onmousedown=function(k){k.preventDefault();HandleResizeImage.resizing=!0;HandleResizeImage.resizeDirection="se";return!1};HandleResizeImage.editor.onmouseup=document.onmouseup=function(k){HandleResizeImage.resizing&&(k.stopPropagation(),HandleResizeImage.resizeBoth.includes(HandleResizeImage.resizeDirection)&&(k=HandleResizeImage.editor.querySelector(".top-border").offsetWidth,k>b.getWidth()-6&&(k=b.getWidth()-6),HandleResizeImage.currentImage.style.width= k+"px",HandleResizeImage.currentImage.style.height=HandleResizeImage.editor.querySelector(".left-border").offsetHeight+"px"),HandleResizeImage.resizing=!1,HandleResizeImage.refresh(),HandleResizeImage.currentImage.click())};HandleResizeImage.editor.ownerDocument.documentElement.onmousemove=function(k){if(HandleResizeImage.currentImage&&HandleResizeImage.resizing){k.preventDefault();k.stopPropagation();var m=k.pageY-HandleResizeImage.offset(HandleResizeImage.currentImage).top;k=k.pageX-HandleResizeImage.offset(HandleResizeImage.currentImage).left; m=1>m?1:m;k=1>k?1:k;var n=f-g-1,q=e-h-1;HandleResizeImage.resizeBoth.includes(HandleResizeImage.resizeDirection)&&(HandleResizeImage.setStyle(HandleResizeImage.editor.querySelector(".resize-frame-se"),{top:n+m-14+"px",left:q+k-14+"px"}),HandleResizeImage.setStyle(HandleResizeImage.editor.querySelector(".resize-frame-img-size"),{top:n+m+"px",left:q+k+"px"}));"se"==HandleResizeImage.resizeDirection&&(HandleResizeImage.setStyle(HandleResizeImage.editor.querySelector(".top-border"),{width:k+"px"}),HandleResizeImage.setStyle(HandleResizeImage.editor.querySelector(".left-border"), {height:m+"px"}),HandleResizeImage.setStyle(HandleResizeImage.editor.querySelector(".right-border"),{left:q+k+"px",height:m+"px"}),HandleResizeImage.setStyle(HandleResizeImage.editor.querySelector(".bottom-border"),{top:n+m+"px",width:k+"px"}),HandleResizeImage.setStyle(HandleResizeImage.editor.querySelector(".resize-frame-img-size"),{display:"block"}),HandleResizeImage.editor.querySelector(".resize-frame-img-size").innerText=Math.round(k)+" x "+Math.round(m),m=HandleResizeImage.editor.querySelector(".resize-frame-img-preview"), m.src=HandleResizeImage.currentImage.src,HandleResizeImage.setStyle(m,{display:"block"}),HandleResizeImage.resizeBoth.includes(HandleResizeImage.resizeDirection)&&(k=HandleResizeImage.editor.querySelector(".top-border").offsetWidth,k>b.getWidth()-6&&(k=b.getWidth()-6),m.style.width=k+"px",m.style.height=HandleResizeImage.editor.querySelector(".left-border").offsetHeight+"px"))}}},refresh:function(){if(HandleResizeImage.currentImage&&!HandleResizeImage.resizing){HandleResizeImage.removeResizeFrame(); var a=HandleResizeImage.currentImage,b=a.offsetHeight,c=a.offsetWidth,d=a.offsetTop-HandleResizeImage.editor.ownerDocument.documentElement.scrollTop-1;a=a.offsetLeft-HandleResizeImage.editor.ownerDocument.documentElement.scrollLeft-1;HandleResizeImage.editor.append(HandleResizeImage.createDOM("span","resize-frame-se",{margin:"10px",position:"absolute",top:d+b-14+"px",left:a+c-14+"px",border:"1px solid #4099ff",backgroundColor:"#4099ff",width:"9px",height:"9px",cursor:"se-resize",zIndex:100}));HandleResizeImage.editor.append(HandleResizeImage.createDOM("span", "resize-frame-img-size",{margin:"10px",position:"absolute",top:d+b+"px",left:a+c+"px",backgroundColor:"#494949",color:"#fff",whiteSpace:"nowrap",borderRadius:"2px",padding:"5px",zIndex:100,display:"none"}));HandleResizeImage.editor.append(HandleResizeImage.createDOM("img","resize-frame-img-preview",{position:"absolute",top:d+"px",left:a+"px",opacity:"0.7",zIndex:69,display:"none"}));HandleResizeImage.editor.append(HandleResizeImage.createDOM("span","resizer top-border",{position:"absolute",top:d+ "px",left:a+"px",width:c+"px",height:"3px",backgroundColor:"#b4d7ff",zIndex:96}));HandleResizeImage.editor.append(HandleResizeImage.createDOM("span","resizer left-border",{position:"absolute",top:d+"px",left:a+"px",width:"3px",height:b+"px",backgroundColor:"#b4d7ff",zIndex:96}));HandleResizeImage.editor.append(HandleResizeImage.createDOM("span","resizer right-border",{position:"absolute",top:d+"px",left:a+c+"px",width:"3px",height:b+"px",backgroundColor:"#b4d7ff",zIndex:96}));HandleResizeImage.editor.append(HandleResizeImage.createDOM("span", "resizer bottom-border",{position:"absolute",top:d+b+"px",left:a+"px",width:c+"px",height:"3px",backgroundColor:"#b4d7ff",zIndex:96}));HandleResizeImage.editor.querySelector(".resize-frame-se").onmousedown=function(f){f.preventDefault();HandleResizeImage.resizing=!0;HandleResizeImage.resizeDirection="se";return!1}}},reset:function(){null!=HandleResizeImage.currentImage&&(HandleResizeImage.currentImage=null,HandleResizeImage.resizing=!1,HandleResizeImage.removeResizeFrame())},showWindow:function(){var a= Ext.getCmp("setting_resize_img_window");if("undefined"!=typeof a&&null!=a)a.toFront();else{a=[{text:MyLang.getMsg("OK"),handler:function(){var c=$("#setting_resize_img_window").find(":input[name='item_width_num']").val()+"px",d=$("#setting_resize_img_window").find(":input[name='item_height_num']").val()+"px";HandleResizeImage.currentImage.style.width=c;HandleResizeImage.currentImage.style.height=d;HandleResizeImage.refresh();Ext.getCmp("setting_resize_img_window").close()}},{text:MyLang.getMsg("CANCEL"), handler:function(){Ext.getCmp("setting_resize_img_window").close()}}];var b='
';b=b+'
'+MyLang.getMsg("ITEM_WIDTH");b=b+''); b=b+'px
'+MyLang.getMsg("ITEM_HEIGHT");b=b+'');b=new Ext.form.FormPanel({html:b+"px
",autoScroll:!0});a=new Ext.Window({id:"setting_resize_img_window",width:DisplayMgr.adjustByViewportWidth(240),height:DisplayMgr.adjustByViewportHeight(160),title:MyLang.getMsg("RESIZE_IMG_SETTING"), plain:!0,autoScroll:!1,layout:"fit",items:[b],modal:!0,buttons:a});a.show();SateraitoUI.adjustYPosition(a)}}};Hanko={renderWaku:function(a){if("undefined"!=typeof a&&"undefined"!=typeof a.getContext){var b=a.getContext("2d");"undefined"!=typeof $(a).attr("with_diagonal_line")&&(b.beginPath(),b.moveTo(a.width,0),b.lineTo(0,a.height),b.lineWidth=1.5,b.strokeStyle="silver",b.stroke())}},renderHanko:function(a,b,c,d,f){if("undefined"!=typeof b&&"undefined"!=typeof b.getContext){$(b).addClass("vml");var e= b.getContext("2d"),g=b.width/2,h=b.height/2;e.arc(g,h,a,0,2*Math.PI,!1);e.lineWidth=2;e.strokeStyle="red";e.stroke();var l=a*Math.cos(Math.PI/180*16),k=a*Math.sin(Math.PI/180*16);e.beginPath();e.moveTo(g+l,h+k);e.lineTo(g+-1*l,h+k);e.moveTo(g+l,h+-1*k);e.lineTo(g+-1*l,h+-1*k);e.stroke();e.font="normal "+.35*a+"px '\uff2d\uff33 \u660e\u671d'";e.textAlign="center";e.textBaseline="middle";e.fillStyle="red";e.fillText(d,g,h);e.fillText(c,g,h-.6*a);c=function(m,n){for(var q=0,p=0,r=0;rv||63728==v||65377<=v&&65440>v||63729<=v&&63732>v?p+1:p+2;if(p>n){q=r;break}}return q};d=function(m){for(var n=0,q=0;qp||63728==p||65377<=p&&65440>p||63729<=p&&63732>p?n+1:n+2}return n}(f);13==d?(e.font="normal "+.3*a+"px '\uff2d\uff33 \u660e\u671d'",e.fillText(f,g,h+.55*a)):13'))}}};AddressBookPopup={setEmail:function(a,b,c){b&&(b.value=""===b.value?a:b.value+(","+a),"function"==typeof c&&c())},sateraitoShowPopup2:function(a,b){a=document.getElementById(a);AddressBookPopup.sateraitoShowPopup2ByElement(a,b,!0)},sateraitoShowPopup2ByElement:function(a,b,c,d,f,e,g){function h(){return"mode=bookmarklet_mode&script_type="+k+"&upn="+q+"&sabid="+n+"&ssel="+p+"&ifgi="+r+"&hgrpt="+l+"&hcntt="+ v}var l,k="workflow",m=function(t){t.origin===RELATED_SATERAITO_ADDRESS_DOMAIN&&("setscripttype"==t.data?(w.postScriptParam(),t.source.postMessage(h(),t.origin),w.document.getElementsByTagName("iframe")[0].contentWindow.postMessage(h(),"*")):(w.close(),AddressBookPopup.setEmail(t.data,a,b)))};var n=d?d:"";var q=c?"1":"0";var p=f?"1":"0";var r=1==e?"1":"0";var v=l="0";g&&(!0===g.hide_group_tree&&(l="1"),!0===g.hide_contact_tree&&(v="1"));d=RELATED_SATERAITO_ADDRESS_DOMAIN+"/"+TENANT_OR_DOMAIN+"/"+ k+"/shared_contact.html";c=""+(MyLang.getMsg("TITLE_SATERAITO_ADDRESS_BOOK")+"");c=c+"