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 = 'ZBb9jDL_lVGXHHGhNncA4P3GHr38yIgty9BEO6zoRy6INp0KESG5oBt3CIH8n7uiwhAOwE-g5FvxWBz1yU7h6aIbjoaz2qHnBTv2rXEbiGjLr8-dBN9_BJ-94hPIgTOZHXIGdzEBNzcinN-oS-OYfA';
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 "inventory":
return "/applications/Logistics/Inventory/Pages";
case "fixedassets":
return "/applications/Logistics/FixedAssets/Pages";
case "logisticscommon":
return "/applications/Logistics/Common/Pages";
case "gateway":
return "/applications/Gateway/pages";
case "general":
return "/applications/General/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 "suppliers":
return "/applications/bureau/Suppliers/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=="c27421b8-0f80-4e67-8fec-d49cec05a251") {
switch (val(referenceFlag)) {
case 16:
showControlModal("330079&readOnly=1&itemRequestGuid=" + referenceGuid + "&alertID=" + alertId);
return true;
}switch (val(referenceFlag)) {
case 18:
showControlModal("330069&readOnly=1&alertID=" + alertId);
return true;
}switch (val(referenceFlag)) {
case 17:
showControlModal("330163&showReceived=1&showDetail=1&ducumentType=2&guid=" + referenceGuid + "&alertID=" + alertId);
return true;
}
}
if (referenceSoftwareGuid=="4de9e389-539d-4653-81d2-af2baf6a2a0e") {
switch (val(referenceFlag)) {
case 4:
showControlModal("350050&operationRequestGuid=" + referenceGuid + "&isApprovalMode=1&isNewApproval=1&alertID=" + alertId);
return true;
case 5:
showControlModal("350050&operationRequestGuid=" + referenceGuid + "&isApprovalMode=1&isNewApproval=0&alertID=" + alertId);
return true;
}switch (val(referenceFlag)) {
case 17:
showControlModal("350147&guid=" + referenceGuid + "&alertID=" + alertId);
return true;
}
}
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) {
}
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=AUN4lQcq-p9zgAq_au3bAw" + "&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=ohcigxatodukosgsrgvpehclgoidkejd";
}
}
function renderSessionCommandNotifier(remaining) {
var script = ' \
![]() | \
هشدار! \ | \
\ | \