%PDF-
%PDF-
Mini Shell
Mini Shell
BX.namespace("BX.Sale.Delivery.Request.Component");BX.Sale.Delivery.Request.Component={ajaxUrl:"",timeout:120,processRequest:function(e,t){ShowWaitWindow();var i=e;i["sessid"]=BX.bitrix_sessid();i["lang"]=BX.message("LANGUAGE_ID");BX.ajax({timeout:this.timeout,method:"POST",dataType:"json",url:this.ajaxUrl,data:i,onsuccess:function(e){CloseWaitWindow();if(e){if(e.RESULT!=="ERROR"){if(e.FILE_NAME&&e.FILE_PATH){window.location.href=BX.Sale.Delivery.Request.Component.ajaxUrl+"?action=downloadFile&fileName="+encodeURI(e.FILE_NAME)+"&filePath="+encodeURI(e.FILE_PATH)+"&sessid="+BX.bitrix_sessid()}else if(e.DAILOG_PARAMS){BX.Sale.Delivery.Request.Component.showRequestDialog(e.DAILOG_PARAMS,t)}if(e.DELIVERY_BLOCK_HTML&&e.DELIVERY_ID){var i=BX("delivery-request-for-"+e.DELIVERY_ID);if(i)i.innerHTML=e.DELIVERY_BLOCK_HTML}}else{var o=BX.message("SALE_CSDRTJ_ERROR")+"\n";if(e.ERRORS)for(var n in e.ERRORS)if(e.ERRORS.hasOwnProperty(n))o+=e.ERRORS[n]+"\n";alert(o)}}else{alert(BX.message("SALE_CSDRTJ_RESPONSE_ERROR"))}},onfailure:function(){CloseWaitWindow();alert(BX.message("SALE_CSDRTJ_RESPONSE_PROCESSING_ERROR"))}})},showRequestDialog:function(e,t){var i=new BX.CDialog({title:e.TITLE,content:'<form id="dailogContentForm">'+e.CONTENT+"</form>",width:500,height:550});var o=[{title:BX.message("SALE_CSDRTJ_DIALOG_CLOSE"),id:"close",name:"close",action:function(){if(t)window.location.reload(true);this.parentWindow.Close()}}];if(e.IS_FINAL!==true){o.push({title:BX.message("SALE_CSDRTJ_DIALOG_NEXT"),id:"next",name:"next",action:function(){var e=BX("dailogContentForm"),i={},o=/\[\]$/g;for(var n=0,s=e.elements.length;n<s;n++){var a=e.elements[n].name;if(a.search(o)===-1){i[a]=e.elements[n].value}else{a=a.replace(o,"");if(typeof i[a]==="undefined")i[a]=[];i[a].push(e.elements[n].value)}}BX.Sale.Delivery.Request.Component.processRequest(i,t);this.parentWindow.Close()}})}BX.addCustomEvent(i,"onWindowClose",function(e){e.DIV.parentNode.removeChild(e.DIV);BX.proxy(function(){this.Register()},this)});i.ClearButtons();i.SetButtons(o);i.Show();i.adjustSizeEx()}};
Zerion Mini Shell 1.0