403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/ilovecveti.ru/bitrix/js/sale/admin/discountpreset/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/ilovecveti.ru/bitrix/js/sale/admin/discountpreset/select_product_preset.min.js
BX.namespace("BX.Sale.Admin.DiscountPreset");BX.Sale.Admin.DiscountPreset.SelectProduct=function(){var e=function(e){this.tableId="sale_discount_preset_product_table";this.emptyRowId="sale_discount_preset_product_table_empty_row";this.idPrefix="idPrefix";this.siteId=e.siteId;this.presetId=e.presetId;this.sectionCount=e.sectionCount||1;this.inputNameProduct=e.inputNameProduct||"discount_product[]";this.inputNameSection=e.inputNameSection||"discount_section[]";this.container=BX("sale_discount_preset_section_box");this.productIds={};if(e.products){for(var t in e.products){if(!e.products.hasOwnProperty(t))continue;this.productAdd(e.products[t])}}setTimeout(BX.delegate((function(){var e=BX.findChildrenByClassName(this.container,"mli-field",true);for(var t in e){if(!e.hasOwnProperty(t)){continue}BX.adjust(e[t],{style:{width:"99%"}})}}),this),200);this.setEvents()};e.prototype.setEvents=function(){BX.bind(BX("sale_discount_preset_section_add"),"click",BX.delegate(this.onClickAddSection,this));BX.bind(BX("sale_discount_preset_product_add"),"click",BX.delegate(this.onClickAddProduct,this));BX.addCustomEvent("onDeletePresetProduct",BX.delegate(this.onDeletePresetProduct,this))};e.prototype.onClickSectionToShowPopup=function(e){var t=e.srcElement||e.target;var i=t.getAttribute("data-section-number");const r="cat_section_search.php?lang="+BX.message.LANGUAGE_ID+"&discount=Y&n=sect_"+i;window.open(r,"","scrollbars=yes,resizable=yes,width=900,height=600,top="+parseInt((screen.height-500)/2-14,10)+",left="+parseInt((screen.width-600)/2-5,10));BX.PreventDefault(e)};e.prototype.onClickDeleteSection=function(e){var t=e.srcElement||e.target;var i=BX.findParent(t,{tagName:"tr"},10);if(i){BX.remove(i)}BX.PreventDefault(e)};e.prototype.onDeletePresetProduct=function(e){var t=BX(this.createProductRowId({PRODUCT_ID:e}));this.productIds[e]=false;BX.remove(t);if(BX.findChildren(BX(this.tableId),{tagName:"tbody"}).length===1){BX.show(BX(this.emptyRowId),"block")}};e.prototype.createProductRowId=function(e){return this.idPrefix+"discount-preset-product-"+(e.OFFER_ID||e.PRODUCT_ID)};e.prototype.createProductMenuContent=function(e){return[{ICON:"delete",TEXT:BX.message("JS_SALE_HANDLERS_DISCOUNTPRESET_DELETE_PRODUCT"),ACTION:"BX.onCustomEvent('onDeletePresetProduct', ["+e+"])"}]};e.prototype.createMenuCell=function(e,t){var i,r=this.createProductMenuContent(t.OFFER_ID||t.PRODUCT_ID);if(r.length<=0)return false;if(t.IS_SET_ITEM!="Y"){i=BX.create("span",{props:{className:"adm-s-order-item-title-icon"}});BX.bind(i,"click",BX.proxy((function(e){i.blur();BX.adminList.ShowMenu(i,r)}),this))}else{i=BX.create("span",{html:"&nbsp;"})}return BX.create("td",{props:{className:"tac bdb-line",id:this.idPrefix+"sale-order-basket-product-"+e+"-menu"},children:[i]})};e.prototype.createFieldImage=function(e,t,i){var r,s;if(t.PICTURE_URL){r=BX.create("img",{props:{src:t.PICTURE_URL}})}else{r=BX.create("div",{props:{className:"no_foto"},text:BX.message("SALE_ORDER_BASKET_NO_PICTURE")})}if(typeof t.EDIT_PAGE_URL!="undefined"){s=BX.create("a",{props:{href:t.EDIT_PAGE_URL?t.EDIT_PAGE_URL:"",target:"_blank"},children:[r]});s.style.textAlign="center"}else{s=BX.create("div",{style:{width:"150px",textAlign:"center"},children:[r]})}return s};e.prototype.createFieldSkuProps=function(e,t,i){return this.createSkuPropsTable(e,t)};e.prototype.createSkuPropsTable=function(e,t){var i=BX.create("table"),r,s=[],n=null;if(t.SKU_PROPS){for(var o in t.SKU_PROPS){if(!t.SKU_PROPS.hasOwnProperty(o))continue;if(!t.SKU_PROPS[o]["VALUE"])t.SKU_PROPS[o]["VALUE"]={NAME:o};if(t.SKU_PROPS[o]["VALUE"]["PICT"])r='<div style="width: 17px; height: 17px; text-align: center; border: 1px solid gray;">'+'<img  width="17" height="17" src="'+t.SKU_PROPS[o]["VALUE"]["PICT"]+'">'+"</div>";else r='<div style="font-size: 9px; padding: 2px 5px; text-align: center; border: 1px solid gray;">'+BX.util.htmlspecialchars(t.SKU_PROPS[o]["VALUE"]["NAME"])+"</div>";if(!t.SKU_PROPS[o]["NAME"])t.SKU_PROPS[o]["NAME"]=o;var a=BX.create("td",{html:'<span style="color: gray; font-size: 11px">'+BX.util.htmlspecialchars(t.SKU_PROPS[o]["NAME"])+" </span>",style:{"text-align":"left"}});i.appendChild(BX.create("tr",{children:[a,BX.create("td",{html:r})]}));s.push(t.SKU_PROPS[o]["CODE"])}}if(t.PROPS){for(var d in t.PROPS){if(!t.PROPS.hasOwnProperty(d))continue;if(!t.PROPS[d]||s.indexOf(t.PROPS[d]["CODE"])!=-1)continue;if(!t.PROPS[d]["NAME"])t.PROPS[d]["NAME"]="";if(!t.PROPS[d]["VALUE"])t.PROPS[d]["VALUE"]="";if(t.PROPS[d]["CODE"]=="PRODUCT.XML_ID"||t.PROPS[d]["CODE"]=="CATALOG.XML_ID")continue;var a=BX.create("td",{html:'<span style="color: gray; font-size: 11px">'+BX.util.htmlspecialchars(t.PROPS[d]["NAME"])+" </span>",style:{"text-align":"left"}});var c=BX.create("tr",{children:[a,BX.create("td",{html:'<div style="font-size: 9px; padding: 2px 5px; text-align: center;">'+BX.util.htmlspecialchars(t.PROPS[d]["VALUE"])+"</div>"})]});i.appendChild(c)}}if(i.children.length)n=i;return n};e.prototype.createProductCell=function(e,t,i){var r=null,s=[],n=t[i],o="",a=this;switch(i){case"NUMBER":s.push(BX.create("span",{props:{id:t.IS_SET_ITEM!="Y"?this.idPrefix+"sale_order_product_"+e+"_number":"&nbsp;"},html:"&nbsp;"}));break;case"NAME":if(t.EDIT_PAGE_URL){d=BX.create("a",{props:{href:t.EDIT_PAGE_URL,target:"_blank"},html:BX.util.htmlspecialchars(n)})}else{d=BX.create("span",{style:{fontWeight:"bold"},html:BX.util.htmlspecialchars(t[i])})}s.push(d);break;case"IMAGE":s.push(this.createFieldImage(e,t,i));o="adm-s-order-table-ddi-table-img";break;case"PROPS":var d=this.createFieldSkuProps(e,t,i);if(d)s.push(d);break}if(s.length>0){r=BX.create("td");if(o)BX.addClass(r,o);while(s.length>0)r.appendChild(s.pop());if(i=="NAME"){r.style.minWidth="250px";if(t.IS_SET_ITEM=="Y"){r.style.fontStyle="italic";r.style.paddingLeft="40px"}}}return r};e.prototype.productAdd=function(e){if(e.PRODUCT_ID&&!e.OFFER_ID){if(this.productIds[e.PRODUCT_ID]){return}this.productIds[e.PRODUCT_ID]=true}if(e.PRODUCT_ID&&e.OFFER_ID){if(this.productIds[e.OFFER_ID]){return}this.productIds[e.OFFER_ID]=true}var t=e.id;var i=this.createProductRow(t,e);BX(this.tableId).appendChild(i);BX.hide(BX(this.emptyRowId))};e.prototype.createProductRow=function(e,t){var i,r=BX.create("tbody",{props:{id:this.createProductRowId(t)},style:{textAlign:"left",borderBottom:"1px solid #DDD"}}),s=this.createMenuCell(e,t),n=BX.create("tr");if(s){n.appendChild(s)}var o,a=[];if(t.IS_SET_ITEM!="Y"){r.setAttribute("data-product-id",t.OFFER_ID||t.PRODUCT_ID);if(t.IS_SET_PARENT&&t.OLD_PARENT_ID)r.setAttribute("data-old-parent-id-parent",t.OLD_PARENT_ID)}else{BX.addClass(r,"bundle-child-"+t.OLD_PARENT_ID);BX.addClass(r,"basket-bundle-child-hidden");BX.addClass(r,"bundle-child")}for(var d in{IMAGE:"IMAGE",NAME:"NAME",PROPS:"PROPS"}){i=this.createProductCell(e,t,d);if(i){if(a)while(o=a.pop())i.appendChild(o);n.appendChild(i)}else{var c=n.lastChild.getAttribute("colspan")||1;c++;n.lastChild.setAttribute("colspan",c)}}n.appendChild(BX.create("input",{props:{type:"hidden",name:this.inputNameProduct,value:t.OFFER_ID||t.PRODUCT_ID}}));r.appendChild(n);return r};e.prototype.getParamsByProductId=function(e,t){BX.ajax({url:"sale_discount_preset_detail.php?"+"lang="+BX.message.LANGUAGE_ID+"&"+"action=getProductDetails&"+"PRESET_ID="+BX.util.urlencode(this.presetId)+"&public=y",method:"POST",dataType:"json",data:{productId:e.id,iblockId:t,quantity:e.quantity,sessid:BX.bitrix_sessid(),siteId:this.siteId},onsuccess:BX.delegate((function(e){this.productAdd(e)}),this),onfailure:function(e){}})};e.prototype.onClickAddProduct=function(e){var t="perDayPreset"+".getParamsByProductId";window[t]=BX.proxy((function(e,t){this.getParamsByProductId(e,t)}),this);var i=new BX.CDialog({content_url:"/bitrix/tools/sale/product_search_dialog.php?"+"lang="+BX.message.LANGUAGE_ID+"&LID="+this.siteId+"&caller=preset_edit"+"&allow_select_parent=Y"+"&func_name="+t+"&STORE_FROM_ID=0",height:Math.max(500,window.innerHeight-400),width:Math.max(800,window.innerWidth-400),draggable:true,resizable:true,min_height:500,min_width:800});BX.addCustomEvent(i,"onWindowRegister",BX.defer((function(){i.Get().style.position="fixed";i.Get().style.top=parseInt(i.Get().style.top)-BX.GetWindowScrollPos().scrollTop+"px"})));i.Show();BX.PreventDefault(e)};e.prototype.onClickAddSection=function(e){var t="iblock_section_search.php?lang="+BX.message.LANGUAGE_ID+"&discount=Y&lookup=jsMLI_select_section";var i=window.open(t,"","scrollbars=yes,resizable=yes,width=900,height=600,top="+parseInt((screen.height-500)/2-14,10)+",left="+parseInt((screen.width-600)/2-5,10));BX.PreventDefault(e)};return e}();
//# sourceMappingURL=select_product_preset.map.js

Youez - 2016 - github.com/yon3zu
LinuXploit