var eMessageBoxStyle = new Object(); eMessageBoxStyle.okOnly = 1; eMessageBoxStyle.okCancel = 2; eMessageBoxStyle.yesNo = 4; eMessageBoxStyle.yesNoCancel = 8; eMessageBoxStyle.information = 128; eMessageBoxStyle.question = 256; eMessageBoxStyle.exclamation = 512; eMessageBoxStyle.critical = 1024; eMessageBoxStyle.homeOffice = 2048; var formAntiXsrfToken = 'ccaVQVHhpdSy4yIYQYAL4J04N34zK128by8My6YPprqOVAxgX7voVRW4saXwLCDrEwr3JKAnzviwI9saoMYx4J9dHsCMTgX-GZjZVt_Ts2p80qb1pCAOdwA7zuPmpjRig1LWEuD_dsUZH4TuPl7vNA'; function getSoftwareControlsPath(software) { switch (software.toLowerCase()) { case "workflowengine": return "/applications/ProcessEngine/Workflow/pages"; case "flowchart": return "/applications/ProcessEngine/Flowchart/pages"; case "reporting": return "/applications/Reporting/Pages"; case "timekeeper": return "/applications/HumanResources/Timekeeper/Pages"; case "personnelsystem": return "/applications/HumanResources/PersonnelSystem/Pages"; case "payroll": return "/applications/HumanResources/Payroll/Pages"; case "humanresourcescommon": return "/applications/HumanResources/HumanResourcesCommon/Pages"; case "gateway": return "/applications/Gateway/pages"; case "general": return "/applications/General/Pages"; case "financialaccounting": return "/applications/bureau/FinancialAccounting/Pages"; case "budgets": return "/applications/bureau/Budgets/Pages"; case "documentmanager": return "/applications/Automation/DocumentManager/Pages"; case "contacts": return "/applications/Automation/Contacts/Pages"; case "automationcommon": return "/applications/Automation/AutomationCommon/Pages"; case "common": return "/applications/Common/pages"; case "transformer": return "/applications/"; } } function showChargoonPrintViewerWindow(softwareGuid, templateGuid, entityGuid, sharedDataKey, sharedDataType, parametersValue, outputType) { var parametersValueTempObjectGuid = getServerResponse("Common", "StoreTempObject", "", parametersValue); windowOpen("." + getSoftwareControlsPath("Reporting") + "/Viewer.aspx" + "?softwareGuid=" + softwareGuid + "&templateGuid=" + templateGuid + "&entityGuid=" + entityGuid + "&sharedDataType=" + sharedDataType + "&sharedDataKey=" + sharedDataKey + "&printMode=1&outputType=" + outputType + "¶metersValueTempObjectGuid=" + parametersValueTempObjectGuid , "", "resizable=yes"); } function validateAllowExtensionsFileUpload(filename) { var extensions = ''; if( extensions.length > 0) { extensions = extensions.split(','); filename = '' + filename; for (var i = 0; i < extensions.length; i++) { extensions[i] = extensions[i].trim(); if(extensions[i].length > 0) { if(extensions[i].substr(0, 1) != '.') extensions[i] = '.' + extensions[i]; if (filename.substr(filename.length - extensions[i].length, extensions[i].length).toLowerCase() == extensions[i].toLowerCase()) return true; } } messageBox("NotAllowAttachFileExtensions", "b90f03a0-5b3b-4027-b9ec-247c2d6ddaac"); return false; } return true; } function validateBlockedExtensionsFileUpload(filename) { var extensions = 'exe'; if( extensions.length > 0) { extensions = extensions.split(','); filename = '' + filename; for (var i = 0; i < extensions.length; i++) { extensions[i] = extensions[i].trim(); if(extensions[i].length > 0) { if(extensions[i].substr(0, 1) != '.') extensions[i] = '.' + extensions[i]; if (filename.substr(filename.length - extensions[i].length, extensions[i].length).toLowerCase() == extensions[i].toLowerCase()){ messageBox("NotAllowUploadBlockedFileExtensions", "b90f03a0-5b3b-4027-b9ec-247c2d6ddaac"); return false; } } } } return true; } function messageBox(prompt, softwareGuid, buttons, extraOptions, dontTranslateMessage, defaultButtonIndex) { if (softwareGuid == undefined) softwareGuid = "b90f03a0-5b3b-4027-b9ec-247c2d6ddaac"; if (dontTranslateMessage) prompt = "EXACT:" + encodeURI(prompt); var param = new Object(); var optionCheckBoxCaption = ""; var optionCheckBoxCookie = ""; var optionCheckBoxComments = ""; if (extraOptions!=undefined) { optionCheckBoxCaption = importData(extraOptions, "optionCheckBoxCaption"); optionCheckBoxCookie = importData(extraOptions, "optionCheckBoxCookie"); optionCheckBoxComments = importData(extraOptions, "optionCheckBoxComments"); } param.prompt = prompt; param.softwareGuid = softwareGuid; param.buttons = parseInt(buttons, 10); param.optionCheckBoxCaption = optionCheckBoxCaption; param.optionCheckBoxCookie = optionCheckBoxCookie; param.optionCheckBoxComments = optionCheckBoxComments; param.windowTtitle = document.title; param.defaultButtonIndex = defaultButtonIndex; param.window = getRootWindowObject(); if (optionCheckBoxCaption!="") { var retVal = getSoftwareCookie("b90f03a0-5b3b-4027-b9ec-247c2d6ddaac", optionCheckBoxCookie); if (!((buttons & eMessageBoxStyle.yesNo)==eMessageBoxStyle.yesNo && retVal=="no")) { //Don't remember "NO" answer to DidgahConfirm if (retVal!=null) return retVal; } } try { SetModalDialogIsOpen(true); return window.showModalDialog("/MessageBox.html?p=" + prompt + "&s=" + softwareGuid + "&b=" + parseInt(buttons, 10), param, "dialogWidth:260px; dialogHeight:131px; resizable:no; scroll:no; status:no; center:yes; help:no;"); } catch(e) { var ret = "cancel"; if ((buttons & eMessageBoxStyle.okCancel) != 0 || (buttons & eMessageBoxStyle.yesNoCancel) != 0) ret = "cancel"; else if (buttons & eMessageBoxStyle.yesNo) ret = "no"; alert("Pop-up Blocker\nمرورگر شما (یا نرم‌افزارهای مشابه) منجر به عدم امکان عملکرد صحیح\nاین قسمت از سیستم می‌گردد\nلطفاً پس از رفع مشکل دوباره اقدام کنید و یا با مدیر سیستم تماس بگیرید"); return ret; } finally { SetModalDialogIsOpen(false); } } function DidgahConfirm(message, softwareGuid, icon, optionCheckBoxCookie, optionCheckBoxCaption, optionCheckBoxComments, dontTranslateMessage, setNoAsDefaultReply) { var extraOptions = undefined; if (message==undefined) message = "AreYouSure"; if (icon==undefined || isNaN(icon)) { optionCheckBoxComments = optionCheckBoxCaption; optionCheckBoxCaption = optionCheckBoxCookie; optionCheckBoxCookie = icon; icon = eMessageBoxStyle.question; } if (optionCheckBoxCaption==undefined) { optionCheckBoxCaption = "ثبت گزينه و عدم پرسش دوباره"; optionCheckBoxComments = "با انتخاب اين گزينه، پاسخ انتخابی شما به اين پرسش ذخيره خواهد شد و در دفعات آينده، به‌جای نمايش اين پنجره، همين انتخاب مدنظر قرار خواهد گرفت."; } if (optionCheckBoxCookie!=undefined) extraOptions = "optionCheckBoxCookie{(" + optionCheckBoxCookie + ")}optionCheckBoxCaption{(" + optionCheckBoxCaption + ")}optionCheckBoxComments{(" + optionCheckBoxComments + ")}"; return messageBox(message, softwareGuid, eMessageBoxStyle.yesNo + icon, extraOptions, dontTranslateMessage, setNoAsDefaultReply ? 2 : undefined)=="yes"; } function inputBox(prompt, softwareGuid, defaultValue, inputCssClass, multiLine, required) { if (softwareGuid == undefined) softwareGuid = "b90f03a0-5b3b-4027-b9ec-247c2d6ddaac"; var param = new Object(); if (defaultValue==undefined) defaultValue = ""; if (inputCssClass=="" || inputCssClass==undefined) inputCssClass = "textInput"; param.prompt = prompt; param.softwareGuid = softwareGuid; param.multiLine = multiLine; param.defaultValue = defaultValue; param.inputCssClass = inputCssClass; param.windowTtitle = document.title; if (required != undefined) param.required = required; else param.required = false; return showModal("/InputBox.html?p=" + prompt + "&m=" + (multiLine ? "1" : "0") + "&c=" + inputCssClass + "&d=" + toUTF8(defaultValue), param, "dialogWidth:320px; dialogHeight:165px; resizable:no; scroll:no; status:no; center:yes; help:no;"); } function showReferencedObject(referenceId, referenceGuid, referenceFlag, referenceSoftwareGuid, alertId, extendedData) { if (referenceSoftwareGuid=="3614ad9f-9051-4e82-a3d1-2c4171705928") { switch (val(referenceFlag)) { case 1: return (showControlModal("990000&referenceGuid=" + referenceGuid)=="true"); case 2: return (showControlModal("990001&referenceGuid=" + referenceGuid)=="true"); } } if (referenceSoftwareGuid=="f7cd3e04-ce51-4c4a-a7b6-f599ca2d1fd2") { switch (val(referenceFlag)) { case 101: showFrozenObjectReference(referenceId); return true; case 13: processDeadlineAlert(referenceId); return true; case 23: var fileName = getServerResponse("Reporting", "GetFileReport", "referenceGuid=" + referenceGuid+ "&alertMode=True");downloadTempFile(fileName, true, true);case 24: showChargoonReportViewerWindowForAlert(referenceGuid); return true; } } if (referenceSoftwareGuid=="0e80338a-135f-4f89-b9ae-85b2ee582656") { switch (val(referenceFlag)) { case 66: return (showControlModal("520147&WorkflowUseCaseGuid=b251bbc2-5ca9-425f-b70c-252c0a7c5e77&Title=WorkingPeriodStatisticsCorrection&Adhoc=0&isAlert=1&RecordGuid=" + referenceGuid)=="true"); case 43: return (showControlModal("520045&Guid=" + referenceGuid)=="true"); case 42: return (showControlModal("520053&Guid=" + referenceGuid)=="true"); case 49: return (showControlModal("520053&mode=cc&Guid=" + referenceGuid)=="true"); case 90: return (showControlModal("520177&mode=cc&Guid=" + referenceGuid + "&s=subject")=="true"); case 23: return (showControlModal("520181&WorkflowUseCaseGuid=6deaef99-2c22-4822-974b-b7caf563f9fe&Title=ForgottenLogRequest&Adhoc=1&isAlert=1&IsWorkFlowMode=false&RecordGuid=" + referenceGuid)=="true"); } } if (referenceSoftwareGuid=="66944d9c-31f4-4594-9407-4e1f64c079d9") { switch (val(referenceFlag)) { case 40: return (showControlModal("510207&WorkflowUseCaseGuid=258d5b90-95f4-46ac-9423-e9360d1c6461&Title=MissionRequest&Adhoc=1&isAlert=1&ShowTracingTree=true&RecordGuid=" + referenceGuid)=="true"); case 17: return (showControlModal("510207&WorkflowUseCaseGuid=258d5b90-95f4-46ac-9423-e9360d1c6461&Title=MissionRequest&Adhoc=1&isAlert=1&ShowTracingTree=true&RecordGuid=" + referenceGuid)=="true"); case 73: return (showControlModal("510209&WorkflowUseCaseGuid=a04975eb-1106-4794-ac55-2e59998f11f0&Title=MissionCancel&Adhoc=1&isAlert=1&ShowTracingTree=true&RecordGuid=" + referenceGuid)=="true"); case 49: return (showControlModal("510210&WorkflowUseCaseGuid=906b3dfc-6a8f-4df0-baa3-a42c204a42ff&Title=MissionExtraction&Adhoc=1&isAlert=1&ShowTracingTree=true&RecordGuid=" + referenceGuid)=="true"); case 15: return (showControlModal("510009&WorkflowUseCaseGuid=c17e961d-f93a-46e7-a53a-d22dce5ff89b&Title=LeaveRequest&Adhoc=1&isAlert=1&ShowTracingTree=true&RecordGuid=" + referenceGuid)=="true"); case 44: return (showControlModal("510009&leaveGuid=" + referenceGuid + "&ShowTracingTree=true&mode=personnal")=="true"); case 136: return (showControlModal("510010&id=" + referenceId)=="true"); case 137: return (showControlModal("510010&mode=cc&id=" + referenceId)=="true"); case 46: return (showControlModal("510016&WorkflowUseCaseGuid=b0de2d6f-b39f-4290-a928-7cc45c536d7b&Title=ExtraWorkRequest&Adhoc=1&isAlert=1&ShowTracingTree=true&RecordGuid=" + referenceGuid)=="true"); case 16: return (showControlModal("510016&WorkflowUseCaseGuid=b0de2d6f-b39f-4290-a928-7cc45c536d7b&Title=ExtraWork&Adhoc=1&isAlert=1&ShowTracingTree=true&RecordGuid=" + referenceGuid)=="true"); case 60: return (showControlModal("510192&id=" + referenceId)=="true"); case 25: return (showControlModal("510136&alertMode=true&decreeGuid=" + referenceGuid)=="true"); case 193: return (showControlModal("510307&alertMode=true&decreeGuid=" + referenceGuid)=="true"); case 26: return (showControlModal("510136&alertMode=true&decreeGuid=" + referenceGuid)=="true"); case 39: return (showControlModal("510136&alertMode=true&decreeGuid=" + referenceGuid)=="true"); case 20: return (showControlModal("510136&CheckForSign=1&alertMode=true&decreeGuid=" + referenceGuid)=="true"); case 62: return (showControlModal("510137&ReferenceSoftwareGuid=66944d9c-31f4-4594-9407-4e1f64c079d9&personnelBaseId=" + referenceId + "&formMode=upgradeGroup")=="true"); case 51: return (showControlModal("510137&ReferenceSoftwareGuid=66944d9c-31f4-4594-9407-4e1f64c079d9&personnelBaseId=" + referenceId + "&formMode=edit")=="true"); case 61: return (showControlModal("510137&ReferenceSoftwareGuid=66944d9c-31f4-4594-9407-4e1f64c079d9&personnelBaseId=" + referenceId + "&formMode=summonResponse")=="true"); case 50: return (showControlModal("510001&FormId=" + referenceId + "&formMode=FormStatusChangedAlert")=="true"); case 74: return (showControlModal("510137&ReferenceSoftwareGuid=66944d9c-31f4-4594-9407-4e1f64c079d9&personnelBaseId=" + referenceId + "&formMode=dependencyQuit")=="true"); case 139: return (showControlModal("510137&ReferenceSoftwareGuid=66944d9c-31f4-4594-9407-4e1f64c079d9&personnelBaseId=" + referenceId + "&formMode=edit")=="true"); case 138: return (showControlModal("510126&ReferenceSoftwareGuid=66944d9c-31f4-4594-9407-4e1f64c079d9&PostGuid=" + referenceGuid + "&Mode=Personnel")=="true"); case 154: return (showControlModal("510018&MissionBatchGuid=" + referenceGuid)=="true"); case 155: return (showControlModal("510143&ReferenceSoftwareGuid=66944d9c-31f4-4594-9407-4e1f64c079d9&personnelBaseId=" + referenceId + "&formMode=alert")=="true"); case 178: return (showControlModal("510143&ReferenceSoftwareGuid=66944d9c-31f4-4594-9407-4e1f64c079d9&personnelBaseId=" + referenceId + "&formMode=alert")=="true"); case 158: return (showControlModal("510143&ReferenceSoftwareGuid=66944d9c-31f4-4594-9407-4e1f64c079d9&personnelBaseId=" + referenceId + "&formMode=alert")=="true"); case 163: return (showControlModal("510040¬iceID=" + referenceId + "&formMode=alert")=="true"); case 177: return (showControlModal("510275&WorkflowUseCaseGuid=eec59fdf-60ae-4650-a38e-1e00211418fa&ControlCode=510273&Title=PromotionRequest&RecordGuid=" + referenceGuid)=="true"); case 198: return (showControlModal("510310&WorkflowUseCaseGuid=cb8680c5-3d35-45cd-aa97-bf309c6997c1&ControlCode=510311&Title=PromotionBatchRequest&RecordGuid=" + referenceGuid)=="true"); case 192: return (showControlModal("510297&WorkflowUseCaseGuid=6f680e5f-2621-490e-bf2d-ed236f6ca1aa&ControlCode=510298&Title=ProclamationRequest&RecordGuid=" + referenceGuid)=="true"); case 205: return (showControlModal("510297&WorkflowUseCaseGuid=3db1e3af-1572-4232-b12a-9c7d9ca9cb2d&ControlCode=510298&Title=ProclamationRequest&RecordGuid=" + referenceGuid)=="true"); case 205: return (showControlModal("510297&WorkflowUseCaseGuid=3db1e3af-1572-4232-b12a-9c7d9ca9cb2d&ControlCode=510298&Title=ProclamationRequest&RecordGuid=" + referenceGuid)=="true"); case 220: return (showControlModal("510390&WorkflowUseCaseGuid=fcc2022c-5c4a-49c6-b9d2-d2837c7472ba&ControlCode=510388&Title=EducationLicenseApplyRequest&RecordGuid=" + referenceGuid)=="true"); case 222: return (showControlModal("510396&WorkflowUseCaseGuid=f7380f98-38e6-4e43-a07e-b2564bc2e281&ControlCode=510394&Title=WorkHistoryApplyRequest&RecordGuid=" + referenceGuid)=="true"); case 225: return (showControlModal("510297&Readonly=true&WorkflowUseCaseGuid=6f680e5f-2621-490e-bf2d-ed236f6ca1aa&ControlCode=510298&Title=ProclamationRequest&RecordGuid=" + referenceGuid)=="true"); case 226: return (showControlModal("510126&ReferenceSoftwareGuid=66944d9c-31f4-4594-9407-4e1f64c079d9&PostGuid=" + referenceGuid + "&Mode=Personnel")=="true"); } } if (referenceSoftwareGuid=="b2dfd9ec-776f-4169-80fd-0888bf7de601") { switch (val(referenceFlag)) { case 27: return showControlModal("530055&ShowPersonal=1");} } if (referenceSoftwareGuid=="eb8ec091-42e8-45a3-b13e-0423097bcb0d") { switch (val(referenceFlag)) { case 37: var retVal = showControlModal("310074&VoucherGuid=" + referenceGuid + "&AlertId=" + alertId); return (retVal != 'CANCELLED'); } } if (referenceSoftwareGuid=="7c48f1ee-18c0-4406-84b0-3ad426ce5aee") { switch (val(referenceFlag)) { case 1: showControlModal("110068&LetterId=" + referenceId + "&LetterGuid=" + referenceGuid + "&AlertId=" + alertId); return true; case 2: showControlModal("110068&LetterInstanceId=" + referenceId+ "&AlertId=" + alertId); return true; case 3: showControlModal("110016&DraftId=" + referenceId + "&DraftGuid=" + referenceGuid); return true; case 29: showControlModal("110016&DraftInstanceId=" + referenceId); return true; case 61: showControlModal("110100&AnnouncementReceiverId=" + referenceId); return true; case 4: showControlModal("110083&MessageId=" + referenceId + "&messageGuid=" + referenceGuid); return true; case 30: showControlModal("110083&MessageInstanceId=" + referenceId); return true; case 10: windowOpen("/applications/Automation/DocumentManager/pages/email/showEmail.aspx?referenceId="+referenceId+"&referenceGuid="+referenceGuid, undefined, "location=no, titlebar=no, scrollbars=yes, resizable=yes"); return true; case 5: showControlModal("110030&DeleteAlert=1&FaxInboxID=" + referenceId + "&FaxInboxGuid=" + referenceGuid); return true; case 14: showControlModal("110088&PendingLetterId=" + referenceId + "&PendingLetterGuid=" + referenceGuid); return true; case 55: showControlModal("110068&LetterInstanceId=" + referenceId + "&AlertId=" + alertId + "&LetterExternalForward=" + 1); return true; case 6: showControlModal("110143&DeleteAlert=1&FaxOutboxID=" + referenceId); return true; case 69: showControlModal("110133&EceLetterId=" + referenceId + "&EceLetterGuid=" + referenceGuid); return true; } } if (referenceSoftwareGuid=="b90f03a0-5b3b-4027-b9ec-247c2d6ddaac") { switch (val(referenceFlag)) { case 101: var controlOpener = getServerResponse("Common", "GetFrozenReferenceOpenerControl", "FrozenObjectId=" + referenceId);showFrozenObjectReference(referenceId, controlOpener); return true; case 13: var references = getServerResponse("Common", "ProcessDeadlineAlert", "DeadlineID=" + referenceId);processDeadlineAlert(referenceId, references); return true; case 119: showControlModal("100194&EmailAccountID=" + referenceId); return true; case 21: case 22: getDelegateConfirmation(referenceGuid,extendedData); return true; case 120: showControlModal("100191&AlertID=" + alertId);return "refresh"; case 121: showControlModal("100200"); } } } function showModal(URL, data, option) { var retVal; if (data==null) data = new Object(); if(!option) option = "dialogWidth:120px; dialogHeight:140px; dialogTop:0px; dialogLeft:0px; resizable:no; scroll:no; status:no; center:no; help:no;"; data.window = getRootWindowObject(); try { SetModalDialogIsOpen(true); retVal = window.showModalDialog("/GenericModal.aspx?" + URL, data, option); } catch(e) { if (messageBox("ErrorInOpeningModalWindow", "b90f03a0-5b3b-4027-b9ec-247c2d6ddaac", eMessageBoxStyle.okCancel + eMessageBoxStyle.critical)=="cancel") alert(e.description); } finally{ SetModalDialogIsOpen(false); } if(typeof(retVal) == typeof("loginNotOK") && retVal == "loginNotOK") { handleLoginNotOK(); } else return retVal; } function showControlModal(control, args) { return showModal("/Loader.aspx?c=" + control, args); } function getRootWindowObject() { var win = null; try { var x = dialogArguments.window.location.href; win = dialogArguments.window; } catch (e) { win = window; } return win; } function downloadTempFile(encryptedFilename, forceDownload, openNewWindow) { var url = "/TempDownloader.aspx?Filename=" + encryptedFilename + "&forceDownload=" + (forceDownload ? "1" : "0"); if (isTrue(openNewWindow)) { try { windowOpen(url); } catch(e) { window.open(url); } } else { var downloadWindow = document.createElement("iframe"); Container.appendChild(downloadWindow); downloadWindow.style.display = "none"; document.location.href = url; } } function downloadFile(fileID, forceDownload, downloadWindow, bpsc, extension, shadowVersion, extraParams) { var downloadAllowed = isTrue(bpsc) || false; if (!downloadAllowed) { messageBox("YouDontHaveAccessToDownloadFiles", "b90f03a0-5b3b-4027-b9ec-247c2d6ddaac", eMessageBoxStyle.exclamation); return; } if (forceDownload == null || forceDownload == undefined) forceDownload = true; var url = "/DownloadHandler.ashx?Id=" + fileID + "&forceDownload=" + (isTrue(forceDownload) ? "1" : "0"); if (shadowVersion != null && shadowVersion != undefined) url += "&ShadowVersion=" + shadowVersion; if (extension != null && extension != undefined) url += "&ext=" + extension; if (extraParams != null && extraParams != undefined) { if(extraParams.startsWith("&") || extraParams.startsWith("#")) url += extraParams; else url += "&" + extraParams; } if (downloadWindow != null && downloadWindow != undefined) downloadWindow.location.href = url; else if (isTrue(forceDownload)) { if (downloadWindow == null || downloadWindow == undefined) window.location.href = url; else downloadWindow.location.href = url; } else { try { windowOpen(url, "_download", "location=no, titlebar=no, scrollbars=yes, resizable=yes"); } catch(e) { window.open(url, "_download", "location=no, titlebar=no, scrollbars=yes, resizable=yes"); } } } function downloadFileReference(encFileReferenceType, encFilereferenceGuid, forceDownload, downloadWindow, bpsc) { var downloadAllowed = isTrue(bpsc) || false; if (!downloadAllowed) { messageBox("YouDontHaveAccessToDownloadFiles", "b90f03a0-5b3b-4027-b9ec-247c2d6ddaac", eMessageBoxStyle.exclamation); return; } if (forceDownload == null || forceDownload == undefined) forceDownload = true; var url = "/DownloadHandler.ashx?encFileReferenceType=" + encFileReferenceType + "&encFilereferenceGuid=" + encFilereferenceGuid + "&forceDownload=" + (isTrue(forceDownload) ? "1" : "0"); if (downloadWindow != null && downloadWindow != undefined) downloadWindow.location.href = url; else if (isTrue(forceDownload)) { if (downloadWindow == null || downloadWindow == undefined) window.location.href = url; else downloadWindow.location.href = url; } else { try { windowOpen(url, "_download", "location=no, titlebar=no, scrollbars=yes, resizable=yes"); } catch(e) { window.open(url, "_download", "location=no, titlebar=no, scrollbars=yes, resizable=yes"); } } } function getHotkeyValue(keyCode, modifier, actionType) { var hotKeys = []; for(i in hotKeys) { var key = hotKeys[i]; if(key.KeyCode == keyCode && key.Modifier == modifier && key.ActionType == actionType) return key.Value; } return null; } function handleHotkeys() { if (window.event.ctrlKey && window.event.keyCode == 78 /* 'n' */ && window.parent.location.href.toLowerCase().indexOf("genericmodal.aspx") != -1) { windowOpen("/"); window.event.returnValue = false; return; } if (event.srcElement.className != "textInput") return; var actionType = 1; var hotkeyValue = null; var keyCode = window.event.keyCode; var modifier = 0; //collects modifiers in flags way. var hotKeyModifierEnum = {"None":0,"Ctrl":2,"Alt":4,"Shift":8}; if(window.event.ctrlKey) modifier |= hotKeyModifierEnum.Ctrl; if(window.event.altKey) modifier |= hotKeyModifierEnum.Alt; if(window.event.shiftKey) modifier |= hotKeyModifierEnum.Shift; if(keyCode == 112 /* F1 */ && window.event.ctrlKey) hotkeyValue = showControlModal("100011"); else { hotkeyValue = getHotkeyValue(keyCode, modifier, actionType); } if (hotkeyValue != null) { insertTextAtCursor(window.event.srcElement.value, replaceString(hotkeyValue, "{خ}", "\n")); window.event.returnValue = false; } } try { document.onhelp=new Function("return false;"); window.onhelp=new Function("return false;"); } catch(e) {} function getDirection() { return "rtl"; } function selectStaff(targetDropDown, workSectionDropDown, errorMessage, staffValidationFunction, softwareGuid, checkUnavailableStaff, considerAccessZone) { var retVal = showControlModal("100020&softwareGuid=" + softwareGuid + (checkUnavailableStaff == undefined ? "" : "&checkUnavailableStaff=" + checkUnavailableStaff) + (considerAccessZone == undefined ? "" : "&considerAccessZone=" + considerAccessZone)); if (retVal!="") { var selEncStaffId = importData(retVal, "encId"); if (staffValidationFunction!=undefined) { eval("var staffIsValid = " + staffValidationFunction + "(" + selEncStaffId + ");"); if (!staffIsValid) return false; } for (i=0; i < cboAllStaff.children.length; i++) { if (importData(cboAllStaff.children[i].value, "encId")==selEncStaffId) { workSectionDropDown.value = importData(cboAllStaff.children[i].value, "workSectionId"); workSectionDropDown.fireEvent("onchange"); targetDropDown.value = selEncStaffId; targetDropDown.fireEvent("onchange"); } } if (targetDropDown.value=="" && errorMessage!="") messageBox(errorMessage, "b90f03a0-5b3b-4027-b9ec-247c2d6ddaac", eMessageBoxStyle.exclamation); } } function selectDeptFor(encIdBox, titleBox, selectableFlag, selectedEncId) { var url = "100015&selectableFlag=" + val(selectableFlag); if (selectedEncId!=undefined) url += "&selectedEncId=" + selectedEncId; else url += "&selectedEncId=" + encIdBox.value; var retVal = showControlModal(url); if (retVal!="") { if (titleBox!=undefined) encIdBox.value = importData(retVal, "encId"); if (titleBox!=undefined) titleBox.value = importData(retVal, "title"); } return retVal; } function selectMultipleDept(encIdBox, titleBox, selectableFlag, selectableEncID, filterByAuthorizationFactors) { var url = "100019&selectableFlag=" + val(selectableFlag); if(filterByAuthorizationFactors!= undefined) url += "&filterByAuthorizationFactors="+ filterByAuthorizationFactors; if (selectableEncID != undefined) url += "&selectableEncID=" + selectableEncID; if (encIdBox != undefined) url += "&selectedEncDepartmentIds=" + encIdBox.value; var retVal = showControlModal(url); if (retVal == "") return ""; if(encIdBox != undefined) encIdBox.value = ""; if(titleBox != undefined) titleBox.value = ""; if (encIdBox != undefined || titleBox != undefined) { var count = val(importData(retVal, "count")); for (var i = 1; i <= count; i++) { if (encIdBox != undefined) encIdBox.value += (i > 1 ? "," : "") + importData(retVal, "encId" + i); if (titleBox != undefined) titleBox.value += (i > 1 ? " - " : "") + importData(retVal, "title" + i); } } return retVal; } function selectStaffFor(encIdBox, titleBox, selectedEncStaffId, encIdList, sessionVariable, softwareGuid, disableUnassignedStaff, multiSelected, checkUnavailableStaff, considerAccessZone) { var url = "100020"; if (selectedEncStaffId!=undefined) url += "&selectedEncStaffId=" + selectedEncStaffId; else if (encIdBox != undefined) url += "&selectedEncStaffId=" + encIdBox.value; if (encIdList!=undefined && encIdList!="" && encIdList!=null){ url += "&EncStaffIdList=" + encIdList; } if (sessionVariable!=undefined) url += "&StaffIdListSessionVariable=" + sessionVariable; if (softwareGuid!=undefined) url += "&softwareGuid=" + softwareGuid; if (disableUnassignedStaff != undefined) if (disableUnassignedStaff) url += "&disableUnassignedStaff=1"; if (multiSelected != undefined) if (multiSelected) url += "&multiSelected=1"; if (checkUnavailableStaff != undefined && checkUnavailableStaff) url += "&checkUnavailableStaff=true"; if (considerAccessZone != undefined && considerAccessZone) url += "&considerAccessZone=true"; var retVal = showControlModal(url); if (retVal!="") { if (!multiSelected) { if (titleBox!=undefined) encIdBox.value = importData(retVal, "encId"); if (titleBox!=undefined) titleBox.value = importData(retVal, "title"); } else { if (encIdBox != undefined) encIdBox.value = ""; if (titleBox != undefined) titleBox.value = ""; for (var i = 1; i <= importData(retVal, "count"); i++) { if (encIdBox != undefined) encIdBox.value += (i == 1 ? "" : ",") + importData(retVal, "encId" + i); if (titleBox != undefined) titleBox.value += (i == 1 ? "" : ",") + importData(retVal, "title" + i); } } } return retVal; } function selectUserFor(usernameBox, idBox, firstNameBox, lastNameBox, operationGuid) { var retVal = showControlModal("100071&OpenForSelect=1&OperationGuid=" + operationGuid); if (retVal=="") return false; usernameBox.value = importData(retVal, "username"); if (idBox!=undefined) idBox.value = importData(retVal, "id"); if (firstNameBox!=undefined) firstNameBox.value = importData(retVal, "firstName"); if (lastNameBox!=undefined) lastNameBox.value = importData(retVal, "lastName"); if (firstNameBox==lastNameBox && lastNameBox!=undefined) firstNameBox.value = importData(retVal, "firstName") + " " + importData(retVal, "lastName"); return retVal; } function replaceEditControlWithDisplayValue(editControl) { var displayValue = null; switch (editControl.tagName.toLowerCase()) { case "input": if (editControl.type=="radio" || editControl.type=="checkbox") displayValue = editControl.checked ? "بله" : "خير"; else if (editControl.type=="select") displayValue = getSelectText(editControl); else if (editControl.parentElement.innerHTML.indexOf("datePicker")!=-1) displayValue = editControl.parentElement.innerHTML.toLowerCase().indexOf("showtime")!=-1 ? getPersianShortDateTime(new Date(Date.parse(editControl.value))) : getPersianDateString(new Date(Date.parse(editControl.value))); else if (editControl.parentElement.innerHTML.indexOf("selectButton")!=-1) displayValue = editControl.parentElement.children(1).value; else displayValue = editControl.value; break; case "select": displayValue = getSelectText(editControl); break; case "textarea": displayValue = editControl.innerText; break; case "a": displayValue = editControl.outerHTML; break; case "editor": editControl = editControl.parentElement.parentElement.parentElement.parentElement.parentElement.children(0); displayValue = editControl.value; break; } if (displayValue != null) editControl.parentElement.innerHTML = displayValue; } function setFTPClientObjectAttributes(oFTP) { oFTP.ServerName = "chargoon"; oFTP.Port = 21; oFTP.Username = "chargoonUpload"; oFTP.Password = "chargoonUpload"; oFTP.RemoteDir = "didgahUpload"; try {oFTP.PassiveMode = false;} catch(e) {} } function showFrozenObjectReference(referenceID, controlOpener) { if (!DidgahConfirm("FrozenObjectAndAlertDeleteAfterUnfreeze.YouMustFreezeItAgain.AreYouSure", "b90f03a0-5b3b-4027-b9ec-247c2d6ddaac", "frozenObjectView")) return false; showControlModal(controlOpener + "&frozenObjectId=" + referenceID + "&unfreezeObject=1"); } function processDeadlineAlert(referenceID, references) { showReferencedObject(importData(references, "referenceID"), undefined, importData(references, "referenceFlag"), importData(references, "referenceSoftwareGuid")); } function getDelegateConfirmation(delegateUserGuid, extendedData) { var reconfirm = importData(extendedData,"reconfirm"); var ret = showControlModal("100160&isAlertConfirm=1&reconfirm="+ reconfirm+"&delegateUserGuid=" + delegateUserGuid); if(ret == "Reload") messageBox("ToApplyDelegateLogoutAndLoginAgain", "b90f03a0-5b3b-4027-b9ec-247c2d6ddaac"); } function getStandardizeCharacters(inputString, isExpressionField) { var t = inputString; if (isExpressionField == undefined || !isTrue(isExpressionField)) t = replaceString(t, "'", "`"); var persianKeyboardBehavior = "persian"; if (persianKeyboardBehavior=="arabic") { re = /ى/i; while (t.search(re)!=-1) t=t.replace(re, "ي"); re = /ی/i; while (t.search(re)!=-1) t=t.replace(re, "ي"); re = /ک/i; while (t.search(re)!=-1) t=t.replace(re, "ك"); } else { re = /ي/i; while (t.search(re)!=-1) t=t.replace(re, "ی"); re = /ى/i; while (t.search(re)!=-1) t=t.replace(re, "ی"); re = /ك/i; while (t.search(re)!=-1) t=t.replace(re, "ک"); } return t; } var rootWindow = getRootWindowObject(); function setTrackingStatus(softwareGuid, tableKey, recordID, departmentID) { showControlModal("140002&SoftwareGuid=" + softwareGuid + "&TableKey=" + tableKey + "&RecordID=" + recordID + "&DepartmentID=" + departmentID); } function selectUser(sessionVarName, windowParams, disallowSelectAll) { if (disallowSelectAll == undefined) disallowSelectAll = false; return showControlModal("100021" + (sessionVarName == "" ? "" : "&excludeListsSessionVarName=" + sessionVarName) + "&" + windowParams + "&disallowSelectAll=" + disallowSelectAll); } function selectOrganizationRelatedPeople(sessionVarName, windowParams) { return showControlModal("100033" + (sessionVarName == "" ? "" : "&excludeListsSessionVarName=" + sessionVarName) + "&" + windowParams); } function startWorkflow(workflowUsecaseGuid, workflowInstanceTitle, recordGuid, extraParameters, adhoc) { return showControlModal("990002&WorkflowUseCaseGuid=" + workflowUsecaseGuid + "&WorkflowInstanceTitle=" + workflowInstanceTitle + "&RecordGuid=" + recordGuid + "&ExtraParameters=" + escape(extraParameters) + "&adhoc=" + adhoc); } function showWorkflowPage(encWorkflowInstanceNodeGuid) { return showControlModal("990000&encWorkflowInstanceNodeGuid=" + encWorkflowInstanceNodeGuid); } function defineDigitalSignature(workSpaceKey) { try{ return showControlModal("100161&workspace=" + workSpaceKey); } catch(e){ alert("Pop-up Blocker\nمرورگر شما (یا نرم‌افزارهای مشابه) منجر به عدم امکان عملکرد صحیح\nاین قسمت از سیستم می‌گردد\nلطفاً پس از رفع مشکل دوباره اقدام کنید و یا با مدیر سیستم تماس بگیرید"); } } function defineCmsDigitalSignature(workSpaceKey) { try{ return showControlModal("100205&workspace=" + workSpaceKey); } catch(e){ alert("Pop-up Blocker\nمرورگر شما (یا نرم‌افزارهای مشابه) منجر به عدم امکان عملکرد صحیح\nاین قسمت از سیستم می‌گردد\nلطفاً پس از رفع مشکل دوباره اقدام کنید و یا با مدیر سیستم تماس بگیرید"); } } function definePdfFilesDigitalSignature(workspaceKey){ try{ return showControlModal("100213&FilesWorkspace=" + workspaceKey); } catch(e){ alert("Pop-up Blocker\nمرورگر شما (یا نرم‌افزارهای مشابه) منجر به عدم امکان عملکرد صحیح\nاین قسمت از سیستم می‌گردد\nلطفاً پس از رفع مشکل دوباره اقدام کنید و یا با مدیر سیستم تماس بگیرید"); } } function showIndicatorSequenceNoReserveForm(encIndicatorGuid) { return showControlModal("100173&encIndicatorGuid=" + encIndicatorGuid); } function showIndicatorSequenceNoReservedList(encIndicatorGuid) { return showControlModal("100172&encIndicatorGuid=" + encIndicatorGuid); } function selectInitialFinancialInfo(softwareGuid, callbackIfDone) { var retVal = openModalWindow("/Applications/Common/Pages/SelectFinancialInitialInfo.aspx?SoftwareGuid=" + softwareGuid + "&IncludeDepartment=1&IncludeDatabaseName=1", "Chargoon Didgah ", "dialogWidth:450px; dialogHeight:140px; resizable:no; scroll:no; status:no; center:yes; help:no;"); if (retVal=="DONE") { if(callbackIfDone) callbackIfDone(); window.parent.reloadPage(); } else if (retVal=="ERROR") alert("ERROR Occured!"); else if (retVal=="MoveToDesktop") { var functionContainer = getFunctionContainer("selectSoftware"); functionContainer.selectSoftware("9a41a970-bce6-476d-af9e-8abb84108f8e"); } else if (retVal=="CANCEL") { } else selectInitialFinancialInfo(); } function showOutbox(encTransportableItemType, encReferenceIdentifier) { showControlModal("100207&encTransportableItemType=" + encTransportableItemType + "&encReferenceIdentifier=" + encReferenceIdentifier); } function showTrackingOutbox(encRecordGuid) { showControlModal("100207&encTransportableItemType=ixWdE4FSAX3HKLBuxv1ggA" + "&encReferenceIdentifier=" + encReferenceIdentifier); } function renderLogoutButton() { var rootWindow = getFirstRootWindowObject(); $(rootWindow.document).ready(function () { var loadByDefaultParent = $(rootWindow.document).find('#default').length > 0 && $(rootWindow.document).find('#default').prop("tagName").toLowerCase() == 'body'; if(loadByDefaultParent) return; $('body').append("خروج از سيستم"); }); } function logout() { redirectToLoginPage(); } function redirectToLoginPage() { var rootWindow = getFirstRootWindowObject(); if(isCurrentUserAuthenticatedByCAS()) { rootWindow.location.href = ""; } else if(isCurrentUserAuthenticatedByOAuth()) { rootWindow.location.href = ""; } else if(isCurrentUserAuthenticatedByADFS()) { rootWindow.location.href = "?wa=wsignout1.0&wtrealm="; } else { rootWindow.location.href = "/userLogin.aspx?logout=1&rnd=yrbfebmadcqosrmbocwcvcyrjdbrpewo"; } } function renderSessionCommandNotifier(remaining) { var script = ' \
\
پیام سیستمی
\ \ \ \ \ \ \ \ \


هشدار!

\

\
\
\