Current Path : /var/www/axolotl/data/www/axolotl.ru/www/bitrix/js/crm/entity-editor/js/ |
Current File : /var/www/axolotl/data/www/axolotl.ru/www/bitrix/js/crm/entity-editor/js/model.min.js |
BX.namespace("BX.Crm");if(typeof BX.Crm.EntityModel==="undefined"){BX.Crm.EntityModel=function(){BX.Crm.EntityModel.superclass.constructor.apply(this);this.eventsNamespace="Crm.EntityModel"};BX.extend(BX.Crm.EntityModel,BX.UI.EntityModel);BX.Crm.EntityModel.prototype.initialize=function(t,e){BX.Crm.EntityModel.superclass.initialize.apply(this,[t,e]);this._changeNotifier=BX.CrmNotifier.create(this);this._lockNotifier=BX.CrmNotifier.create(this)};BX.Crm.EntityModel.prototype.getEventArguments=function(){var t=BX.Crm.EntityModel.superclass.getEventArguments.apply(this);t.entityTypeId=this.getEntityTypeId();return t};BX.Crm.EntityModel.prototype.getEntityTypeId=function(){return BX.CrmEntityType.enumeration.undefined};BX.Crm.EntityModel.prototype.getOwnerInfo=function(){return{ownerID:this.getEntityId(),ownerType:BX.CrmEntityType.resolveName(this.getEntityTypeId())}};BX.Crm.EntityModel.create=function(t,e){var r=new BX.Crm.EntityModel;r.initialize(t,e);return r}}if(typeof BX.Crm.LeadModel==="undefined"){BX.Crm.LeadModel=function(){BX.Crm.LeadModel.superclass.constructor.apply(this)};BX.extend(BX.Crm.LeadModel,BX.Crm.EntityModel);BX.Crm.LeadModel.prototype.doInitialize=function(){BX.addCustomEvent(window,"Crm.EntityProgress.Change",BX.delegate(this.onEntityProgressChange,this))};BX.Crm.LeadModel.prototype.onEntityProgressChange=function(t,e){if(BX.prop.getInteger(e,"entityTypeId",0)!==this.getEntityTypeId()||BX.prop.getInteger(e,"entityId",0)!==this.getEntityId()){return}var r=BX.prop.getString(e,"currentStepId","");if(r!==this.getField("STATUS_ID","")){this.setField("STATUS_ID",r)}};BX.Crm.LeadModel.prototype.getEntityTypeId=function(){return BX.CrmEntityType.enumeration.lead};BX.Crm.LeadModel.prototype.isCaptionEditable=function(){return true};BX.Crm.LeadModel.prototype.getCaption=function(){var t=this.getField("TITLE");return BX.type.isString(t)?t:""};BX.Crm.LeadModel.prototype.setCaption=function(t){this.setField("TITLE",t)};BX.Crm.LeadModel.prototype.prepareCaptionData=function(t){t["TITLE"]=this.getField("TITLE","")};BX.Crm.LeadModel.create=function(t,e){var r=new BX.Crm.LeadModel;r.initialize(t,e);return r}}if(typeof BX.Crm.ContactModel==="undefined"){BX.Crm.ContactModel=function(){BX.Crm.ContactModel.superclass.constructor.apply(this)};BX.extend(BX.Crm.ContactModel,BX.Crm.EntityModel);BX.Crm.ContactModel.prototype.getEntityTypeId=function(){return BX.CrmEntityType.enumeration.contact};BX.Crm.ContactModel.prototype.getCaption=function(){return this.getField("FORMATTED_NAME","")};BX.Crm.ContactModel.create=function(t,e){var r=new BX.Crm.ContactModel;r.initialize(t,e);return r}}if(typeof BX.Crm.CompanyModel==="undefined"){BX.Crm.CompanyModel=function(){BX.Crm.CompanyModel.superclass.constructor.apply(this)};BX.extend(BX.Crm.CompanyModel,BX.Crm.EntityModel);BX.Crm.CompanyModel.prototype.isCaptionEditable=function(){return true};BX.Crm.CompanyModel.prototype.getEntityTypeId=function(){return BX.CrmEntityType.enumeration.company};BX.Crm.CompanyModel.prototype.getCaption=function(){return this.getField("TITLE","")};BX.Crm.CompanyModel.prototype.setCaption=function(t){this.setField("TITLE",t)};BX.Crm.CompanyModel.prototype.prepareCaptionData=function(t){t["TITLE"]=this.getField("TITLE","")};BX.Crm.CompanyModel.create=function(t,e){var r=new BX.Crm.CompanyModel;r.initialize(t,e);return r}}if(typeof BX.Crm.DealModel==="undefined"){BX.Crm.DealModel=function(){BX.Crm.DealModel.superclass.constructor.apply(this)};BX.extend(BX.Crm.DealModel,BX.Crm.EntityModel);BX.Crm.DealModel.prototype.doInitialize=function(){BX.addCustomEvent(window,"Crm.EntityProgress.Saved",BX.delegate(this.onEntityProgressSave,this))};BX.Crm.DealModel.prototype.onEntityProgressSave=function(t,e){if(BX.prop.getInteger(e,"entityTypeId",0)!==this.getEntityTypeId()||BX.prop.getInteger(e,"entityId",0)!==this.getEntityId()){return}var r=BX.prop.getString(e,"currentStepId","");if(r!==this.getField("STAGE_ID","")){this.setField("STAGE_ID",r)}};BX.Crm.DealModel.prototype.getEntityTypeId=function(){return BX.CrmEntityType.enumeration.deal};BX.Crm.DealModel.prototype.isCaptionEditable=function(){return true};BX.Crm.DealModel.prototype.getCaption=function(){var t=this.getField("TITLE");return BX.type.isString(t)?t:""};BX.Crm.DealModel.prototype.setCaption=function(t){this.setField("TITLE",t)};BX.Crm.DealModel.prototype.prepareCaptionData=function(t){t["TITLE"]=this.getField("TITLE","")};BX.Crm.DealModel.create=function(t,e){var r=new BX.Crm.DealModel;r.initialize(t,e);return r}}if(typeof BX.Crm.DealRecurringModel==="undefined"){BX.Crm.DealRecurringModel=function(){BX.Crm.DealRecurringModel.superclass.constructor.apply(this)};BX.extend(BX.Crm.DealRecurringModel,BX.Crm.DealModel);BX.Crm.DealRecurringModel.create=function(t,e){var r=new BX.Crm.DealRecurringModel;r.initialize(t,e);return r}}if(typeof BX.Crm.FactoryBasedModel==="undefined"){BX.Crm.FactoryBasedModel=function(){BX.Crm.FactoryBasedModel.superclass.constructor.apply(this);this._entityTypeId=null};BX.extend(BX.Crm.FactoryBasedModel,BX.Crm.EntityModel);BX.Crm.FactoryBasedModel.prototype.initialize=function(t,e){BX.Crm.FactoryBasedModel.superclass.initialize.apply(this,[t,e]);this._entityTypeId=BX.prop.getInteger(e,"entityTypeId",BX.CrmEntityType.enumeration.undefined)};BX.Crm.FactoryBasedModel.prototype.doInitialize=function(){BX.addCustomEvent("BX.Crm.ItemDetailsComponent:onStageChange",this.onStageChange.bind(this))};BX.Crm.FactoryBasedModel.prototype.onStageChange=function(t){var e=BX.prop.getInteger(t.getData(),"entityTypeId",BX.CrmEntityType.enumeration.undefined);var r=BX.prop.getInteger(t.getData(),"id",0);if(e!==this.getEntityTypeId()||r!==this.getEntityId()){return}var o=BX.prop.getString(t.getData(),"stageId","");if(o!==this.getField("STAGE_ID","")&&o!==""){this.setField("STAGE_ID",o);var n=BX.prop.getString(t.getData(),"previousStageId",null);if(n){this.setField("PREVIOUS_STAGE_ID",n)}}};BX.Crm.FactoryBasedModel.prototype.getEntityTypeId=function(){return this._entityTypeId};BX.Crm.FactoryBasedModel.prototype.isCaptionEditable=function(){return true};BX.Crm.FactoryBasedModel.prototype.getCaption=function(){var t=this.getField("TITLE");return BX.type.isString(t)?t:""};BX.Crm.FactoryBasedModel.prototype.setCaption=function(t){this.setField("TITLE",t)};BX.Crm.FactoryBasedModel.prototype.prepareCaptionData=function(t){t["TITLE"]=this.getField("TITLE","")};BX.Crm.FactoryBasedModel.create=function(t,e){var r=new BX.Crm.FactoryBasedModel;r.initialize(t,e);return r}}if(typeof BX.Crm.QuoteModel==="undefined"){BX.Crm.QuoteModel=function(){BX.Crm.QuoteModel.superclass.constructor.apply(this)};BX.extend(BX.Crm.QuoteModel,BX.Crm.FactoryBasedModel);BX.Crm.QuoteModel.prototype.isCaptionEditable=function(){return true};BX.Crm.QuoteModel.prototype.getCaption=function(){var t=this.getField("TITLE");if(BX.Type.isString(t)&&t.length>0){return t}var e=null;if(this.getField("IS_USE_NUMBER_IN_TITLE_PLACEHOLDER")){e=BX.Loc.getMessage("CRM_QUOTE_TITLE",{"#QUOTE_NUMBER#":this.getField("QUOTE_NUMBER"),"#BEGINDATE#":this.getField("BEGINDATE")})}else{var r=Number(this.getField("ID"));if(r<=0){r=""}e=BX.Loc.getMessage("CRM_QUOTE_TITLE_PLACEHOLDER",{"#ID#":r})}return BX.Type.isString(e)?e:""};BX.Crm.QuoteModel.prototype.setCaption=function(t){this.setField("TITLE",t)};BX.Crm.QuoteModel.prototype.prepareCaptionData=function(t){t["TITLE"]=this.getField("TITLE","")};BX.Crm.QuoteModel.create=function(t,e){var r=new BX.Crm.QuoteModel;r.initialize(t,e);return r}}if(typeof BX.Crm.SmartInvoiceModel==="undefined"){BX.Crm.SmartInvoiceModel=function(){BX.Crm.SmartInvoiceModel.superclass.constructor.apply(this)};BX.extend(BX.Crm.SmartInvoiceModel,BX.Crm.FactoryBasedModel);BX.Crm.SmartInvoiceModel.prototype.isCaptionEditable=function(){return true};BX.Crm.SmartInvoiceModel.prototype.getCaption=function(){var t=this.getField("TITLE");if(BX.Type.isString(t)&&t.length>0){return t}var e=null;if(this.getField("IS_USE_NUMBER_IN_TITLE_PLACEHOLDER")){e=BX.Loc.getMessage("CRM_SMART_INVOICE_TITLE",{"#NUMBER#":this.getField("ACCOUNT_NUMBER"),"#BEGINDATE#":this.getField("BEGINDATE")})}else{var r=Number(this.getField("ID"));if(r<=0){r=""}e=BX.Loc.getMessage("CRM_SMART_INVOICE_TITLE_PLACEHOLDER",{"#ID#":r})}return BX.Type.isString(e)?e:""};BX.Crm.SmartInvoiceModel.prototype.setCaption=function(t){this.setField("TITLE",t)};BX.Crm.SmartInvoiceModel.prototype.prepareCaptionData=function(t){t["TITLE"]=this.getField("TITLE","")};BX.Crm.SmartInvoiceModel.create=function(t,e){var r=new BX.Crm.SmartInvoiceModel;r.initialize(t,e);return r}}if(typeof BX.Crm.SmartDocumentModel==="undefined"){BX.Crm.SmartDocumentModel=function(){BX.Crm.SmartDocumentModel.superclass.constructor.apply(this)};BX.extend(BX.Crm.SmartDocumentModel,BX.Crm.FactoryBasedModel);BX.Crm.SmartDocumentModel.create=function(t,e){var r=new BX.Crm.SmartDocumentModel;r.initialize(t,e);return r}} //# sourceMappingURL=model.map.js