| | |
| | | self.selectedProgGroup = selectedProgGroup;
|
| | | self.modName = mod.id;
|
| | | self.artNo = art.ArtNr;
|
| | | if(art.ArtNr === "205"){
|
| | | debugger;
|
| | | }
|
| | | self.artNoGroup = art.TypG;
|
| | | self.hingeSide = art.Anschl;
|
| | | self.manufacturer = art.Manu;
|
| | |
| | |
|
| | |
|
| | | self.artCategories = [];
|
| | | self.artSections = [];
|
| | |
|
| | | self.artPropVars = [];
|
| | | if (art.artPropVars) {
|
| | |
| | |
|
| | | if (type === ArticleType.NORMAL) {
|
| | | //Zubehör zuordnene
|
| | | this.artPoEquipment = Article.registeredPoEquipment(art.PoString, mod.cfg["ArtPropsToHide"], mod.cfg["ArtPropsToShow"], devMode);
|
| | | this.artShoppingCartArticles = Article.registeredShoppingCartArticles(art.ShoppingCartString, devMode);
|
| | |
|
| | | |
| | |
|
| | | if (!useDynZub) {
|
| | | self.artFittings = Article.registeredFittings(art.FittingString, mod.cfg["ArtPropsToHide"], mod.cfg["ArtPropsToShow"], devMode);
|
| | | self.artPoEquipment = Article.registeredPoEquipment(art.artPoEquipment);
|
| | | self.artShoppingCartArticles = Article.registeredShoppingCartArticles(art.artShoppingCartArticles);
|
| | |
|
| | | self.artFittings = Article.registeredFittings(art.artFittings);
|
| | | if (self.artFittings.length > 0) {
|
| | | var fittingInfoByArtNr = buildIndexMap(fittingInfo, "artNr"); // O(1)-Lookup statt fittingInfo.find() je Fitting
|
| | | self.artFittings.forEach(function (apt) {
|
| | | var found = fittingInfo.find(function (pti) {
|
| | | return apt.artNoFitting === pti.artNr;
|
| | | });
|
| | | if (found) { |
| | | var found = fittingInfoByArtNr["$" + apt.artNoFitting];
|
| | | if (found) {
|
| | | apt.hideInsert = found.hideInsert;
|
| | | apt.jsAN = found.jsAN;
|
| | | apt.hideFront = found.hideFront;
|
| | |
| | | apt.hideFittingbyAN = true;
|
| | | }
|
| | | }
|
| | | }); |
| | | }
|
| | |
|
| | | this.artPropTrans = Article.registeredPropTrans(art.PropTransString, mod.cfg["ArtPropsToHide"], mod.cfg["ArtPropsToShow"], devMode);
|
| | | });
|
| | | } |
| | | |
| | | self.artPropTrans = Article.registeredPropTrans(art.artPropTrans);
|
| | | if (self.artPropTrans.length > 0) {
|
| | | var propTransInfoById = buildIndexMap(propTransInfo, "id"); // O(1)-Lookup statt propTransInfo.find() je PropTrans
|
| | | self.artPropTrans.forEach(function (apt) {
|
| | | var found = propTransInfo.find(function (pti) {
|
| | | return apt.id === pti.id;
|
| | | });
|
| | | var found = propTransInfoById["$" + apt.id];
|
| | | if (found) {
|
| | | apt.img = found.img;
|
| | | apt.text = found.text;
|
| | | apt.hideDelete = found.hideDelete;
|
| | | apt.hideFront = found.hideFront; |
| | | apt.hideFront = found.hideFront;
|
| | | apt.artNo = found.artNo;
|
| | |
|
| | | apt.controls = found.controls.map(function (control) {
|
| | |
| | | })
|
| | | }
|
| | | }
|
| | | }else{
|
| | | self.artFittings = Article.registeredFittings(art.artFittings);
|
| | | self.artPropTrans = Article.registeredPropTrans(art.artPropTrans);
|
| | | self.artPoEquipment = Article.registeredPoEquipment(art.artPoEquipment);
|
| | | self.artShoppingCartArticles = Article.registeredShoppingCartArticles(art.artShoppingCartArticles);
|
| | | }
|
| | |
|
| | | //ArtInfoTexte zuordnen
|
| | | Article.registeredInfoTexts(art.CatString).forEach(function (tmpCat) {
|
| | | var foundCategory = definedArtInfoTextCategories.find(function (cat) {
|
| | | return cat.id === tmpCat;
|
| | | });
|
| | | var artInfoTextCatById = buildIndexMap(definedArtInfoTextCategories, "id"); // O(1)-Lookup statt .find() je Kategorie
|
| | | art.ArtInfoCategories.forEach(function (tmpCat) {
|
| | | var foundCategory = artInfoTextCatById["$" + tmpCat];
|
| | | if (foundCategory) {
|
| | | if (foundCategory.priority === 3000) {
|
| | | //Wenn Prio 3000 dann auch im Filter anzegien
|
| | |
| | |
|
| | | //Artikelkategorien zuordnen
|
| | | var artHasSperateCat = false;
|
| | | Article.registeredCategoriesAndSections(art.ArtCategories).forEach(function (tmpCat) {
|
| | | var definedCatById = buildIndexMap(definedCategories, "id"); // O(1)-Lookup statt .find() in der (grossen) Kategorienliste je Kategorie
|
| | | art.ArtCategories.forEach(function (tmpCat) {
|
| | | //Wenn die Artikelkategorie in der Separierliste drin ist
|
| | | if (tmpCat === separatelist.cat) {
|
| | | if (separatelist.typ === "exclude") {
|
| | |
| | | artHasSperateCat = true;
|
| | | }
|
| | | }
|
| | | var foundCategory = definedCategories.find(function (cat) {
|
| | | return cat.id === tmpCat;
|
| | | });
|
| | | var foundCategory = definedCatById["$" + tmpCat];
|
| | |
|
| | | if (foundCategory) self.artCategories.push(foundCategory);
|
| | | });
|
| | |
| | | return this.imgPath;
|
| | | };
|
| | |
|
| | | Article.registeredCategoriesAndSections = function (ArtCategories) {
|
| | | function isDhCat(cat) {
|
| | | return cat.includes("dhcat_");
|
| | | }
|
| | |
|
| | | return ArtCategories.filter(isDhCat);
|
| | | };
|
| | |
|
| | | Article.registeredProgGroups = function (catString) {
|
| | | function isManuCat(cat) {
|
| | | return cat.includes("manucat_");
|
| | | }
|
| | |
|
| | | return catString.split(",").filter(isManuCat);
|
| | | };
|
| | |
|
| | | Article.registeredInfoTexts = function (catString) {
|
| | | function isManuCat(cat) {
|
| | | return cat.includes("dhartinfo_");
|
| | | }
|
| | |
|
| | | return catString.split(",").filter(isManuCat);
|
| | | };
|
| | |
|
| | | Article.registeredAccessoiresCategories = function (catString) {
|
| | | function isDhAccesCat(cat) {
|
| | | return cat.includes("dhacces_");
|
| | | }
|
| | |
|
| | | return catString.split(",").filter(isDhAccesCat);
|
| | | };
|
| | |
|
| | | Article.checkPropTransByCfg = function (ptId, ArtPropsToHide, ArtPropsToShow) {
|
| | | if (ArtPropsToShow.length > 0) {
|
| | |
| | | return true;
|
| | | };
|
| | |
|
| | | Article.registeredPropTrans = function (propTransString, ArtPropsToHide, ArtPropsToShow, devMode) {
|
| | | Article.registeredPropTrans = function (propTransString) {
|
| | | var ret = [];
|
| | |
|
| | | function isDummy(propTrans) {
|
| | | return propTrans !== "DUMMY";
|
| | | }
|
| | |
|
| | | if (propTransString && propTransString.length > 0) {
|
| | | if (ArtPropsToShow.length > 0) {
|
| | | propTransString.split(",").filter(isDummy).forEach(function (propTrans) {
|
| | | if (ArtPropsToShow.indexOf(propTrans) > -1) {
|
| | | ret.push(new ArticlePropertyTrans(propTrans));
|
| | | }
|
| | | });
|
| | | } else if (ArtPropsToHide.length > 0) {
|
| | | propTransString.split(",").filter(isDummy).forEach(function (propTrans) {
|
| | | if (ArtPropsToHide.indexOf(propTrans) === -1) {
|
| | | ret.push(new ArticlePropertyTrans(propTrans));
|
| | | }
|
| | | });
|
| | | } else {
|
| | | // if (devMode) {
|
| | | // Prüfung auf DEV-Mod in katapage.js weil hier die ArtNr nochb nicht bekannt ist
|
| | | propTransString.split(",").filter(isDummy).forEach(function (propTrans) {
|
| | | ret.push(new ArticlePropertyTrans(propTrans));
|
| | | });
|
| | | // } else {
|
| | | // propTransString.split(",").filter(isDummy).forEach(function (propTrans) {
|
| | | // if (!propTrans.startsWith("devMode_")) {
|
| | | // ret.push(new ArticlePropertyTrans(propTrans));
|
| | | // }
|
| | | // });
|
| | | // }
|
| | | }
|
| | | }
|
| | |
|
| | | return ret;
|
| | | };
|
| | |
|
| | | Article.registeredShoppingCartArticles = function (shoppingCartString, devMode) {
|
| | | var ret = [];
|
| | |
|
| | | if (shoppingCartString && shoppingCartString.length > 0) {
|
| | | function isDummy(shoppingCartArticle) {
|
| | | return shoppingCartArticle !== "DUMMY";
|
| | | }
|
| | | if (devMode) {
|
| | | shoppingCartString.split(",").filter(isDummy).forEach(function (shoppingCartItem) {
|
| | | ret.push(new ArticleShoppingCart(shoppingCartItem));
|
| | | });
|
| | | } else {
|
| | | shoppingCartString.split(",").filter(isDummy).forEach(function (shoppingCartItem) {
|
| | | if (!shoppingCartItem.startsWith("devMode_")) {
|
| | | ret.push(new ArticleShoppingCart(shoppingCartItem));
|
| | | }
|
| | | });
|
| | | }
|
| | | for (var index = 0; index < propTransString.length; index++) {
|
| | | ret.push(new ArticlePropertyTrans(propTransString[index]));
|
| | | }
|
| | | return ret;
|
| | | };
|
| | |
|
| | | Article.registeredFittings = function (FittingString, ArtPropsToHide, ArtPropsToShow, devMode) {
|
| | | Article.registeredShoppingCartArticles = function (shoppingCartString) {
|
| | | var ret = [];
|
| | |
|
| | | function isDummy(fitting) {
|
| | | return fitting !== "DUMMY";
|
| | | for (var index = 0; index < shoppingCartString.length; index++) {
|
| | | ret.push(new ArticleShoppingCart(shoppingCartString[index]));
|
| | | }
|
| | |
|
| | | if (FittingString && FittingString.length > 0) {
|
| | | if (ArtPropsToShow.length > 0) {
|
| | | FittingString.split(",").filter(isDummy).forEach(function (fitting) {
|
| | | if (ArtPropsToShow.indexOf(fitting) > -1) {
|
| | | ret.push(new ArticleFitting(fitting));
|
| | | }
|
| | | });
|
| | | } else if (ArtPropsToHide.length > 0) {
|
| | | FittingString.split(",").filter(isDummy).forEach(function (fitting) {
|
| | | if (ArtPropsToHide.indexOf(fitting) === -1) {
|
| | | ret.push(new ArticleFitting(fitting));
|
| | | }
|
| | | });
|
| | | } else {
|
| | | if (devMode) {
|
| | | FittingString.split(",").filter(isDummy).forEach(function (fitting) {
|
| | | ret.push(new ArticleFitting(fitting));
|
| | | });
|
| | | } else {
|
| | | FittingString.split(",").filter(isDummy).forEach(function (fitting) {
|
| | | if (!fitting.startsWith("devMode_")) {
|
| | | ret.push(new ArticleFitting(fitting));
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return ret;
|
| | | };
|
| | |
|
| | | Article.registeredPoEquipment = function (PoEquipmentString, ArtPropsToHide, ArtPropsToShow, devMode) {
|
| | | Article.registeredFittings = function (FittingString) {
|
| | | var ret = [];
|
| | | for (var index = 0; index < FittingString.length; index++) { |
| | | ret.push(new ArticleFitting(FittingString[index]));
|
| | | }
|
| | | return ret;
|
| | | };
|
| | |
|
| | | if (PoEquipmentString && PoEquipmentString.length > 0) {
|
| | | function isDummy(artPoEquipment) {
|
| | | return artPoEquipment !== "DUMMY";
|
| | | }
|
| | | if (devMode) {
|
| | | PoEquipmentString.split(",").filter(isDummy).forEach(function (artPoEquipment) {
|
| | | ret.push(new ArticlePoEquipment(artPoEquipment));
|
| | | });
|
| | | } else {
|
| | | PoEquipmentString.split(",").filter(isDummy).forEach(function (artPoEquipment) {
|
| | | if (!artPoEquipment.startsWith("devMode_")) {
|
| | | ret.push(new ArticlePoEquipment(artPoEquipment));
|
| | | }
|
| | | });
|
| | | }
|
| | | Article.registeredPoEquipment = function (PoEquipmentString) {
|
| | | var ret = [];
|
| | | for (var index = 0; index < PoEquipmentString.length; index++) {
|
| | | ret.push(new ArticlePoEquipment(PoEquipmentString[index]));
|
| | | }
|
| | | return ret;
|
| | | };
|