var maxrow=0; var curelm=''; function InitPage() { var pid = $("#portfolio").val(); maxrow=$('#emaillistbody tr').length; $('#emaillistbody tr').click(function () { GetRowData(this); }); } function GetMoreDetails(SelectedRow) { //$('#table tr:eq(' + rowIndex + ') td:eq(' + columnIndex + ')') alert($(SelectedRow).find('td').eq(0).html()); /*QueryStr="rand="+Math.round(Math.random()*4+1)+"&uuid="+$("#"+SelectedRow.id+"uuid").val()+"&pid="+$("#"+SelectedRow.id+"portid").val(); var retVal=0; // Legacy commented example retained without removed browser API. if(retVal==1) { $("#"+SelectedRow.id+"col").html(""); }*/ $("#uuid").val($("#"+SelectedRow.id+"uuid").val()); SubmitForm("caseedit", "_blank", "caseGrid"); } function ValidateEmailSearch() { var emailid = $("#emailid").val(); var portfolio = $("#portfolio").val(); var branch = $("#branch").val(); validate(document.getElementById("emailid"),'f','Email'); if(emailid.legth == 0 && portfolio == '-1' && branch == '-1') { CallMessage('INV:error:Please select any one criteria for search.',2000,200,300); return false; } if(checkForm()) { SubmitForm('filteremailids','_parent','emailmanager'); } } function fetchBranch(pid) { QueryStr="val0="+pid; LoadingMsg("Fetching branch list, please wait...","ajaxmsg"); RunAjax("POST","branchlist",QueryStr,1); } function AfterResponse(AjaxResponse,OprID) { $("#ajaxmsg").remove(); if(OprID==1) { if(AjaxResponse.search('Error')>=0) { CallMessage(AjaxResponse,3000,200,300); } else { $("#branch").html(""); recs=AjaxResponse.split(RowDelim); for(indx=0;indx"+recs[indx].split(ColDelim)[1]+""); } } } if(OprID==2) { if(AjaxResponse.search('Error')>=0) { CallMessage(AjaxResponse,3000,200,300); } else { CallMessage("9809:info:Recipient type changed CC -> TO",3000,200,300); //SubmitForm('filteremailids','_parent','emailmanager'); var pElm = $("#"+$(curelm).attr("pid")+"-"+$(curelm).attr("bid")); $("input[name=bt-"+$(pElm).val()+"]").removeClass("buttondisabled").addClass("button"); $("input[name=bt-"+$(pElm).val()+"]").attr("onclick","emailidActions(this,4)"); $("input[name=bd-"+$(pElm).val()+"]").removeClass("buttondisabled").addClass("button"); $("input[name=bd-"+$(pElm).val()+"]").attr("onclick","emailidActions(this,5)"); var html = ''; $(pElm).parent().html(html); html = "TO "; $("input[name=bt-"+$(curelm).attr("cid")+"]").removeClass("button").addClass("buttondisabled"); $("input[name=bt-"+$(curelm).attr("cid")+"]").attr("onclick","return false"); $("input[name=bd-"+$(curelm).attr("cid")+"]").removeClass("button").addClass("buttondisabled"); $("input[name=bd-"+$(curelm).attr("cid")+"]").attr("onclick","return false"); $(curelm).parent().html(html); } } if(OprID==3) { if(AjaxResponse.search('Error')>=0) { if(AjaxResponse.search('NULST')>=0) { CallMessage('2001:error:No records found.',3000,200,300); } else { CallMessage('2001:error:Fetching change history failed. '+AjaxResponse,3000,200,300); } } else { showEditorList(AjaxResponse,"Email ID Editors"); } } if(OprID==4) { if(AjaxResponse.trim().search('Error')==-1) { emailTransferDialog(AjaxResponse,OprID); } else { CallMessage(AjaxResponse,2000,200,300); } } if(OprID==5) { if(AjaxResponse.trim().search('Error')==-1) { CallMessage("9809:info:Transfer completed successfully.",2000,200,300); SubmitForm('filteremailids','_parent','emailmanager'); } else { var btn = $("input[name='b-btntransfer']"); $(btn).attr("id","btntransfer"); $(btn).removeAttr("disabled"); CallMessage(AjaxResponse,2000,200,300); } } if(OprID==6) { if(AjaxResponse.trim().search('Error')==-1) { CallMessage("9809:info:Email ID removed successfully.",2000,200,300); SubmitForm('filteremailids','_parent','emailmanager'); } else { CallMessage(AjaxResponse,2000,200,300); } } if(OprID==7) { if(AjaxResponse.trim().search('Error')==-1) { CallMessage("9809:info:Email ID revoked successfully.",2000,200,300); SubmitForm('filteremailids','_parent','emailmanager'); } else { CallMessage(AjaxResponse,2000,200,300); } } } function addEmailid() { OpenMatrixDialog("addemailid","Add Email Address",{width:"600px",height:"430px"}).then(function(retVal) { if(retVal) { SubmitForm('filteremailids','_parent','emailmanager'); } }); } function ValidateNAddEmail() { validate(document.getElementById("portfolio"),'t',''); validate(document.getElementById("branch"),'t',''); validate(document.getElementById("contactperson"),'t','AlphaSpace'); validate(document.getElementById("emailid"),'t','Email'); if(checkForm()) { SubmitForm('addemailid','_parent','addemail'); } } function emailidActions(elm,opr) { curelm = null; if(opr==2) { if(preActionCall()) { if(confirm("This action will change the recipient type CC - TO. Do you want to continue?")) { curelm = elm; LoadingMsg("Changing recipient type, please wait...","ajaxmsg"); $(curelm).attr("id","btnajaxproc"); RunAjax("POST","emailmgractions","opr="+opr+"&cid="+$(curelm).attr("cid")+"&pid="+$(curelm).attr("pid")+"&bid="+$(curelm).attr("bid"),opr); } } } if(opr==3) { if(preActionCall()) { LoadingMsg("Fetching editors list, please wait...","ajaxmsg"); RunAjax("POST","shwoemaileditors","cid="+elm,opr); } } if(opr==4) { if(preActionCall()) { curelm = elm; LoadingMsg("Initializing transfer form, please wait...","ajaxmsg"); RunAjax("POST","getddvalues","val0=4&val1="+$(curelm).attr("pid"),opr); } } if(opr==5) { if(preActionCall()) { if(confirm("This action will deactivate this Email ID and the recipient will not receive any further email communication through Nimble. Do you want to continue?")) { curelm = elm; LoadingMsg("Performing delete operation, please wait...","ajaxmsg"); RunAjax("POST","emailmgractions","opr="+opr+"&cid="+$(curelm).attr("cid")+"&pid="+$(curelm).attr("pid")+"&bid="+$(curelm).attr("bid"),(opr+1)); } } } if(opr==6) { if(preActionCall()) { if(confirm("This action will revoke this Email ID and the receipient will be able to receive further emails through Nimble. Do you want to continue?")) { curelm = elm; LoadingMsg("Revoking Email ID, please wait...","ajaxmsg"); RunAjax("POST","emailmgractions","opr="+opr+"&cid="+$(curelm).attr("cid")+"&pid="+$(curelm).attr("pid")+"&bid="+$(curelm).attr("bid"),(opr+1)); } } } } function emailTransferDialog(respHtml,opr) { var optDiv=document.createElement("div"); optDiv.setAttribute("id","optDiv"); optDiv.setAttribute("class","FormPanel"); optDiv.setAttribute("style","font-family:Tahoma;overflow:visible;padding-right:15px"); var OptionPanel=""; OptionPanel=OptionPanel+"
"; OptionPanel=OptionPanel+"
Branch
"; OptionPanel=OptionPanel+"
"; OptionPanel=OptionPanel+"

"; OptionPanel=OptionPanel+"
"; optDiv.innerHTML=OptionPanel; if(ShowInputDialog(optDiv,"Transfer Email ID","hint","inptDialog")) { $("#tbranch option[value='"+$(curelm).attr("bid")+"']").remove(); if($('#tbranch > option').length <= 1) { $("input[name='b-btntransfer']").remove(); } } } function initiateTransfer(branch,opr) { if(confirm("Do you want to transfer this email?")) { LoadingMsg("Transferring Email ID, please wait...","ajaxmsg"); var btn = $("input[name='b-btntransfer']"); $(btn).attr("id","btnajaxproc"); $(btn).attr("disabled","disabled"); RunAjax("POST","emailmgractions","opr="+opr+"&cid="+$(curelm).attr("cid")+"&pid=0&bid="+$(branch).val(),(opr+1)); } } function preActionCall() { if(document.getElementById("ajaxmsg") !== null) { CallMessage('1001AJX:warning:Another operation is being processed, please wait..',3000,200,300); return false; } if(document.getElementById('inptDialog') !== null) { document.getElementById('inptDialog').parentNode.removeChild(document.getElementById('inptDialog')); } return true; }