Modified: ofbiz/trunk/specialpurpose/ecommerce/template/catalog/MiniLastViewedCategories.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/template/catalog/MiniLastViewedCategories.ftl?rev=1761135&r1=1761134&r2=1761135&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/template/catalog/MiniLastViewedCategories.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/template/catalog/MiniLastViewedCategories.ftl Sat Sep 17 07:17:15 2016 @@ -20,28 +20,46 @@ under the License. <#assign maxToShow = 8/> <#assign lastViewedCategories = sessionAttributes.lastViewedCategories!/> <#if lastViewedCategories?has_content> - <#if (lastViewedCategories?size > maxToShow)><#assign limit=maxToShow/><#else><#assign limit=(lastViewedCategories?size-1)/></#if> + <#if (lastViewedCategories?size > maxToShow)> + <#assign limit=maxToShow/> + <#else> + <#assign limit=(lastViewedCategories?size-1)/> + </#if> <div id="minilastviewedcategories" class="screenlet"> <div class="screenlet-title-bar"> <ul> <li class="h3">${uiLabelMap.EcommerceLastCategories}</li> - <li><a href="<@ofbizUrl>clearLastViewed</@ofbizUrl>">[${uiLabelMap.CommonClear}]</a></li> + <li> + <a href="<@ofbizUrl>clearLastViewed</@ofbizUrl>">[${uiLabelMap.CommonClear}]</a> + </li> </ul> <br class="clear"/> </div> <div class="screenlet-body"> <ul class="browsecategorylist"> <#list lastViewedCategories[0..limit] as categoryId> - <#assign category = delegator.findOne("ProductCategory", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("productCategoryId", categoryId), true)!> + <#assign category = delegator.findOne("ProductCategory", + Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("productCategoryId", categoryId), true)!> <#if category?has_content> <li class="browsecategorytext"> - <#if catContentWrappers?? && catContentWrappers[category.productCategoryId]?? && catContentWrappers[category.productCategoryId].get("CATEGORY_NAME", "html")??> - <a href="<@ofbizCatalogAltUrl productCategoryId=categoryId/>" class="browsecategorybutton">${catContentWrappers[category.productCategoryId].get("CATEGORY_NAME", "html")}</a> - <#elseif catContentWrappers?? && catContentWrappers[category.productCategoryId]?? && catContentWrappers[category.productCategoryId].get("DESCRIPTION", "html")??> - <a href="<@ofbizCatalogAltUrl productCategoryId=categoryId/>" class="browsecategorybutton">${catContentWrappers[category.productCategoryId].get("DESCRIPTION", "html")}</a> - <#else> - <a href="<@ofbizCatalogAltUrl productCategoryId=categoryId/>" class="browsecategorybutton">${category.description!}</a> - </#if> + <#if catContentWrappers?? && catContentWrappers[category.productCategoryId]?? && + catContentWrappers[category.productCategoryId].get("CATEGORY_NAME", "html")??> + <a href="<@ofbizCatalogAltUrl productCategoryId=categoryId/>" + class="browsecategorybutton"> + ${catContentWrappers[category.productCategoryId].get("CATEGORY_NAME", "html")} + </a> + <#elseif catContentWrappers?? && catContentWrappers[category.productCategoryId]?? && + catContentWrappers[category.productCategoryId].get("DESCRIPTION", "html")??> + <a href="<@ofbizCatalogAltUrl productCategoryId=categoryId/>" + class="browsecategorybutton"> + ${catContentWrappers[category.productCategoryId].get("DESCRIPTION", "html")} + </a> + <#else> + <a href="<@ofbizCatalogAltUrl productCategoryId=categoryId/>" + class="browsecategorybutton"> + ${category.description!} + </a> + </#if> </li> </#if> </#list> Modified: ofbiz/trunk/specialpurpose/ecommerce/template/catalog/MiniLastViewedProducts.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/template/catalog/MiniLastViewedProducts.ftl?rev=1761135&r1=1761134&r2=1761135&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/template/catalog/MiniLastViewedProducts.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/template/catalog/MiniLastViewedProducts.ftl Sat Sep 17 07:17:15 2016 @@ -20,14 +20,26 @@ under the License. <#assign maxToShow = 4/> <#assign lastViewedProducts = sessionAttributes.lastViewedProducts!/> <#if lastViewedProducts?has_content> - <#if (lastViewedProducts?size > maxToShow)><#assign limit=maxToShow/><#else><#assign limit=(lastViewedProducts?size-1)/></#if> + <#if (lastViewedProducts?size > maxToShow)> + <#assign limit=maxToShow/> + <#else> + <#assign limit=(lastViewedProducts?size-1)/> + </#if> <div id="minilastviewedproducts" class="screenlet"> <div class="screenlet-title-bar"> <ul> <li class="h3">${uiLabelMap.EcommerceLastProducts}</li> - <li><a href="<@ofbizUrl>clearLastViewed</@ofbizUrl>">[${uiLabelMap.CommonClear}]</a></li> + <li> + <a href="<@ofbizUrl>clearLastViewed</@ofbizUrl>"> + [${uiLabelMap.CommonClear}] + </a> + </li> <#if (lastViewedProducts?size > maxToShow)> - <li><a href="<@ofbizUrl>lastviewedproducts</@ofbizUrl>">[${uiLabelMap.CommonMore}]</a></li> + <li> + <a href="<@ofbizUrl>lastviewedproducts</@ofbizUrl>"> + [${uiLabelMap.CommonMore}] + </a> + </li> </#if> </ul> <br class="clear"/> Modified: ofbiz/trunk/specialpurpose/ecommerce/template/catalog/MiniProductSummary.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/template/catalog/MiniProductSummary.ftl?rev=1761135&r1=1761134&r2=1761135&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/template/catalog/MiniProductSummary.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/template/catalog/MiniProductSummary.ftl Sat Sep 17 07:17:15 2016 @@ -17,45 +17,81 @@ specific language governing permissions under the License. --> <#if miniProduct??> - <a href="<@ofbizCatalogAltUrl productId=miniProduct.productId/>" class="linktext">${miniProductContentWrapper.get("PRODUCT_NAME", "html")?default("No Name Available")}</a> - <ul> - <li>${miniProduct.productId} - <#if (priceResult.price?default(0) > 0 && miniProduct.requireAmount?default("N") == "N")> - <#if "Y" = miniProduct.isVirtual!> ${uiLabelMap.CommonFrom} </#if> - <#if totalPrice??> - <li>${uiLabelMap.ProductAggregatedPrice}: <span class='basePrice'><@ofbizCurrency amount=totalPrice isoCode=priceResult.currencyUsed/></span></li> - <#else> - <span class="<#if priceResult.isSale>salePrice<#else>normalPrice</#if>"> - <@ofbizCurrency amount=priceResult.price isoCode=priceResult.currencyUsed/></span> - </#if> - </#if> - </li> + <a href="<@ofbizCatalogAltUrl productId=miniProduct.productId/>" class="linktext"> + ${miniProductContentWrapper.get("PRODUCT_NAME", "html")?default("No Name Available")} + </a> + <ul> + <li> + ${miniProduct.productId} + <#if (priceResult.price?default(0) > 0 && miniProduct.requireAmount?default("N") == "N")> + <#if "Y" = miniProduct.isVirtual!> + ${uiLabelMap.CommonFrom} + </#if> + <#if totalPrice??> + <li> + ${uiLabelMap.ProductAggregatedPrice}: + <span class='basePrice'> + <@ofbizCurrency amount=totalPrice isoCode=priceResult.currencyUsed/> + </span> + </li> + <#else> + <span class="<#if priceResult.isSale>salePrice<#else>normalPrice</#if>"> + <@ofbizCurrency amount=priceResult.price isoCode=priceResult.currencyUsed/></span> + </#if> + </#if> + </li> <#if (miniProduct.introductionDate??) && (nowTimeLong < miniProduct.introductionDate.getTime())> - <#-- check to see if introductionDate hasn't passed yet --> - <li>${uiLabelMap.ProductNotYetAvailable}</li> + <#-- check to see if introductionDate hasn't passed yet --> + <li>${uiLabelMap.ProductNotYetAvailable}</li> <#elseif (miniProduct.salesDiscontinuationDate??) && (nowTimeLong > miniProduct.salesDiscontinuationDate.getTime())> - <#-- check to see if salesDiscontinuationDate has passed --> - <li>${uiLabelMap.ProductNoLongerAvailable}</li> + <#-- check to see if salesDiscontinuationDate has passed --> + <li>${uiLabelMap.ProductNoLongerAvailable}</li> <#elseif miniProduct.isVirtual?default("N") == "Y"> - <li><a href="<@ofbizCatalogAltUrl productCategoryId=requestParameters.category_id?? productId=miniProduct.productId/>" class="buttons"><span style="white-space: nowrap;">${uiLabelMap.OrderChooseVariations}...</span></a></li> + <li> + <a href="<@ofbizCatalogAltUrl productCategoryId=requestParameters.category_id?? productId=miniProduct.productId/>" + class="buttons"> + <span style="white-space: nowrap;">${uiLabelMap.OrderChooseVariations}...</span> + </a> + </li> <#elseif miniProduct.requireAmount?default("N") == "Y"> - <li><a href="<@ofbizCatalogAltUrl productCategoryId=requestParameters.category_id?? productId=miniProduct.productId/>" class="buttons"><span style="white-space: nowrap;">${uiLabelMap.OrderChooseAmount}...</span></a></li> + <li> + <a href="<@ofbizCatalogAltUrl productCategoryId=requestParameters.category_id?? productId=miniProduct.productId/>" + class="buttons"> + <span style="white-space: nowrap;">${uiLabelMap.OrderChooseAmount}...</span> + </a> + </li> <#else> <li> - <form method="post" action="<@ofbizUrl>additem<#if requestAttributes._CURRENT_VIEW_?has_content>/${requestAttributes._CURRENT_VIEW_}</#if></@ofbizUrl>" name="${miniProdFormName}" style="margin: 0;"> + <form method="post" + action="<@ofbizUrl>additem<#if requestAttributes._CURRENT_VIEW_?has_content>/${requestAttributes._CURRENT_VIEW_}</#if></@ofbizUrl>" + name="${miniProdFormName}" style="margin: 0;"> <fieldset> <input type="hidden" name="add_product_id" value="${miniProduct.productId}"/> <input type="hidden" name="quantity" value="${miniProdQuantity?default("1")}"/> - <#if requestParameters.orderId?has_content><input type="hidden" name="orderId" value="${requestParameters.orderId}"/></#if> - <#if requestParameters.product_id?has_content><input type="hidden" name="product_id" value="${requestParameters.product_id}"/></#if> - <#if requestParameters.category_id?has_content><input type="hidden" name="category_id" value="${requestParameters.category_id}"/></#if> - <#if requestParameters.VIEW_INDEX?has_content><input type="hidden" name="VIEW_INDEX" value="${requestParameters.VIEW_INDEX}"/></#if> - <#if requestParameters.VIEW_SIZE?has_content><input type="hidden" name="VIEW_SIZE" value="${requestParameters.VIEW_SIZE}"/></#if> + <#if requestParameters.orderId?has_content> + <input type="hidden" name="orderId" value="${requestParameters.orderId}"/> + </#if> + <#if requestParameters.product_id?has_content> + <input type="hidden" name="product_id" value="${requestParameters.product_id}"/> + </#if> + <#if requestParameters.category_id?has_content> + <input type="hidden" name="category_id" value="${requestParameters.category_id}"/> + </#if> + <#if requestParameters.VIEW_INDEX?has_content> + <input type="hidden" name="VIEW_INDEX" value="${requestParameters.VIEW_INDEX}"/> + </#if> + <#if requestParameters.VIEW_SIZE?has_content> + <input type="hidden" name="VIEW_SIZE" value="${requestParameters.VIEW_SIZE}"/> + </#if> <input type="hidden" name="clearSearch" value="N"/> - <a href="javascript:document.${miniProdFormName}.submit()" class="buttons"><span style="white-space: nowrap;">${uiLabelMap.CommonAdd} ${miniProdQuantity} ${uiLabelMap.OrderToCart}</span></a> + <a href="javascript:document.${miniProdFormName}.submit()" class="buttons"> + <span style="white-space: nowrap;"> + ${uiLabelMap.CommonAdd} ${miniProdQuantity} ${uiLabelMap.OrderToCart} + </span> + </a> </fieldset> </form> </li> </#if> - </ul> + </ul> </#if> Modified: ofbiz/trunk/specialpurpose/ecommerce/template/catalog/MiniReOrderProds.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/template/catalog/MiniReOrderProds.ftl?rev=1761135&r1=1761134&r2=1761135&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/template/catalog/MiniReOrderProds.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/template/catalog/MiniReOrderProds.ftl Sat Sep 17 07:17:15 2016 @@ -17,24 +17,23 @@ specific language governing permissions under the License. --> <#if reorderProducts?has_content> -<div id ="minireorderprods" class="screenlet"> + <div id="minireorderprods" class="screenlet"> <div class="screenlet-title-bar"> - <ul> - <li class="h3">${uiLabelMap.ProductQuickReorder}...</li> - </ul> + <ul> + <li class="h3">${uiLabelMap.ProductQuickReorder}...</li> + </ul> </div> <div class="screenlet-body"> - <#list reorderProducts as miniProduct> - <div> - ${setRequestAttribute("miniProdQuantity", reorderQuantities.get(miniProduct.productId))} - ${setRequestAttribute("miniProdFormName", "theminireorderprod" + miniProduct_index + "form")} - ${setRequestAttribute("optProductId", miniProduct.productId)} - ${screens.render("component://ecommerce/widget/CatalogScreens.xml#miniproductsummary")} - </div> - <#if miniProduct_has_next> - - </#if> - </#list> + <#list reorderProducts as miniProduct> + <div> + ${setRequestAttribute("miniProdQuantity", reorderQuantities.get(miniProduct.productId))} + ${setRequestAttribute("miniProdFormName", "theminireorderprod" + miniProduct_index + "form")} + ${setRequestAttribute("optProductId", miniProduct.productId)} + ${screens.render("component://ecommerce/widget/CatalogScreens.xml#miniproductsummary")} + </div> + <#if miniProduct_has_next> + </#if> + </#list> </div> -</div> + </div> </#if> Modified: ofbiz/trunk/specialpurpose/ecommerce/template/catalog/PopularTags.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/template/catalog/PopularTags.ftl?rev=1761135&r1=1761134&r2=1761135&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/template/catalog/PopularTags.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/template/catalog/PopularTags.ftl Sat Sep 17 07:17:15 2016 @@ -27,7 +27,10 @@ under the License. </div> <div class="screenlet-body"> <#list tagCloudList as tagCloud> - <a style="font-size: ${tagCloud.fontSize}pt;" href="<@ofbizUrl>tagsearch?SEARCH_STRING=${tagCloud.tag}&keywordTypeId=KWT_TAG&statusId=KW_APPROVED</@ofbizUrl>">${tagCloud.tag}</a> + <a style="font-size: ${tagCloud.fontSize}pt;" + href="<@ofbizUrl>tagsearch?SEARCH_STRING=${tagCloud.tag}&keywordTypeId=KWT_TAG&statusId=KW_APPROVED</@ofbizUrl>"> + ${tagCloud.tag} + </a> </#list> </div> </div> Modified: ofbiz/trunk/specialpurpose/ecommerce/template/catalog/ProductCategories.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/template/catalog/ProductCategories.ftl?rev=1761135&r1=1761134&r2=1761135&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/template/catalog/ProductCategories.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/template/catalog/ProductCategories.ftl Sat Sep 17 07:17:15 2016 @@ -16,194 +16,209 @@ specific language governing permissions and limitations under the License. --> -<script language="javascript" type="text/javascript" src="<@ofbizContentUrl>/images/jquery/plugins/jsTree/jquery.jstree.js</@ofbizContentUrl>"></script> -<script type="text/javascript" src="<@ofbizContentUrl>/images/jquery/ui/js/jquery.cookie-1.4.0.js</@ofbizContentUrl>"></script> - +<script language="javascript" type="text/javascript" + src="<@ofbizContentUrl>/images/jquery/plugins/jsTree/jquery.jstree.js</@ofbizContentUrl>"></script> +<script type="text/javascript" + src="<@ofbizContentUrl>/images/jquery/ui/js/jquery.cookie-1.4.0.js</@ofbizContentUrl>"></script> + <script type="text/javascript"> -<#-- some labels are not unescaped in the JSON object so we have to do this manuely --> -function unescapeHtmlText(text) { + <#-- some labels are not unescaped in the JSON object so we have to do this manuely --> + function unescapeHtmlText(text) { return jQuery('<div />').html(text).text() -} + } -jQuery(window).load(createTree()); + jQuery(window).load(createTree()); -<#-- creating the JSON Data --> -var rawdata = [ + <#-- creating the JSON Data --> + var rawdata = [ <#if (requestAttributes.topLevelList)??> <#assign topLevelList = requestAttributes.topLevelList> </#if> <#if (topLevelList?has_content)> <@fillTree rootCat=completedTree/> </#if> - <#macro fillTree rootCat> - <#if (rootCat?has_content)> - <#list rootCat?sort_by("productCategoryId") as root> - { - "data": {"title" : unescapeHtmlText("<#if root.categoryName??>${root.categoryName?js_string}<#elseif root.categoryDescription??>${root.categoryDescription?js_string}<#else>${root.productCategoryId?js_string}</#if>"), "attr": { "href":"javascript: void(0);", "onClick":"callDocument('${root.productCategoryId}', '${root.parentCategoryId}')" , "class" : "${root.cssClass!}"}}, - "attr": {"id" : "${root.productCategoryId}"} - <#if root.child?has_content> - ,"children": [ - <@fillTree rootCat=root.child/> - ] - </#if> - <#if root_has_next> - }, - <#else> - } - </#if> - </#list> - </#if> -</#macro> - ]; + <#if (rootCat?has_content)> + <#list rootCat?sort_by("productCategoryId") as root> + { + "data": { + "title": unescapeHtmlText( + "<#if root.categoryName??>${root.categoryName?js_string}<#elseif root.categoryDescription??>${root.categoryDescription?js_string}<#else>${root.productCategoryId?js_string}</#if>"), + "attr": { + "href": "javascript: void(0);", + "onClick": "callDocument('${root.productCategoryId}', '${root.parentCategoryId}')", + "class": "${root.cssClass!}" + } + }, + "attr": {"id": "${root.productCategoryId}"} + <#if root.child?has_content> + , "children": [ + <@fillTree rootCat=root.child/>] + </#if> + <#if root_has_next> + }, + <#else> + } + </#if> + </#list> + </#if> + </#macro> + ] + ; - <#-------------------------------------------------------------------------------------define Requests--> + <#-------------------------------------------------------------------------------------define Requests--> var editDocumentTreeUrl = '<@ofbizUrl>/views/EditDocumentTree</@ofbizUrl>'; - var listDocument = '<@ofbizUrl>/views/ListDocument</@ofbizUrl>'; + var listDocument = '<@ofbizUrl>/views/ListDocument</@ofbizUrl>'; var editDocumentUrl = '<@ofbizUrl>/views/EditDocument</@ofbizUrl>'; var deleteDocumentUrl = '<@ofbizUrl>removeDocumentFromTree</@ofbizUrl>'; - <#-------------------------------------------------------------------------------------create Tree--> + <#-------------------------------------------------------------------------------------create Tree--> function createTree() { jQuery(function () { - jQuery("#tree").jstree({ - "themes" : { - "theme" : "classic", - "icons" : false + jQuery("#tree").jstree({ + "themes": { + "theme": "classic", + "icons": false }, - "cookies" : { - "cookie_options" : {path: '/'} + "cookies": { + "cookie_options": {path: '/'} }, - "plugins" : [ "themes", "json_data", "cookies"], - "json_data" : { - "data" : rawdata - } - }); - }); - } - -<#-------------------------------------------------------------------------------------callDocument function--> - function callDocument(id, parentCategoryStr) { - var checkUrl = '<@ofbizUrl>productCategoryList</@ofbizUrl>'; - if(checkUrl.search("http")) - var ajaxUrl = '<@ofbizUrl>productCategoryList</@ofbizUrl>'; - else - var ajaxUrl = '<@ofbizUrl>productCategoryListSecure</@ofbizUrl>'; - - //jQuerry Ajax Request - jQuery.ajax({ - url: ajaxUrl, - type: 'POST', - data: {"category_id" : id, "parentCategoryStr" : parentCategoryStr}, - error: function(msg) { - alert("An error occurred loading content! : " + msg); - }, - success: function(msg) { - jQuery('#div3').html(msg); - } - }); - } -<#-------------------------------------------------------------------------------------callCreateDocumentTree function--> - function callCreateDocumentTree(contentId) { - jQuery.ajax({ - url: editDocumentTreeUrl, - type: 'POST', - data: {contentId: contentId, - contentAssocTypeId: 'TREE_CHILD'}, - error: function(msg) { - alert("An error occurred loading content! : " + msg); - }, - success: function(msg) { - jQuery('#Document').html(msg); - } - }); - } -<#-------------------------------------------------------------------------------------callCreateSection function--> - function callCreateDocument(contentId) { - jQuery.ajax({ - url: editDocumentUrl, - type: 'POST', - data: {contentId: contentId}, - error: function(msg) { - alert("An error occurred loading content! : " + msg); - }, - success: function(msg) { - jQuery('#Document').html(msg); - } - }); - } -<#-------------------------------------------------------------------------------------callEditSection function--> - function callEditDocument(contentIdTo) { - jQuery.ajax({ - url: editDocumentUrl, - type: 'POST', - data: {contentIdTo: contentIdTo}, - error: function(msg) { - alert("An error occurred loading content! : " + msg); - }, - success: function(msg) { - jQuery('#Document').html(msg); - } - }); - - } -<#-------------------------------------------------------------------------------------callDeleteItem function--> - function callDeleteDocument(contentId, contentIdTo, contentAssocTypeId, fromDate) { - jQuery.ajax({ - url: deleteDocumentUrl, - type: 'POST', - data: {contentId : contentId, contentIdTo : contentIdTo, contentAssocTypeId : contentAssocTypeId, fromDate : fromDate}, - error: function(msg) { - alert("An error occurred loading content! : " + msg); - }, - success: function(msg) { - location.reload(); - } - }); - } - <#-------------------------------------------------------------------------------------callRename function--> - function callRenameDocumentTree(contentId) { - jQuery.ajax({ - url: editDocumentTreeUrl, - type: 'POST', - data: { contentId: contentId, - contentAssocTypeId:'TREE_CHILD', - rename: 'Y' - }, - error: function(msg) { - alert("An error occurred loading content! : " + msg); - }, - success: function(msg) { - jQuery('#Document').html(msg); - } - }); - } - <#------------------------------------------------------pagination function --> - function nextPrevDocumentList(url){ - url= '<@ofbizUrl>'+url+'</@ofbizUrl>'; - jQuery.ajax({ - url: url, - type: 'POST', - error: function(msg) { - alert("An error occurred loading content! : " + msg); - }, - success: function(msg) { - jQuery('#Document').html(msg); - } - }); - } + "plugins": ["themes", "json_data", "cookies"], + "json_data": { + "data": rawdata + } + }); + }); + } -</script> + <#-------------------------------------------------------------------------------------callDocument function--> + function callDocument(id, parentCategoryStr) { + var checkUrl = '<@ofbizUrl>productCategoryList</@ofbizUrl>'; + if (checkUrl.search("http")) + var ajaxUrl = '<@ofbizUrl>productCategoryList</@ofbizUrl>'; + else + var ajaxUrl = '<@ofbizUrl>productCategoryListSecure</@ofbizUrl>'; + + //jQuerry Ajax Request + jQuery.ajax({ + url: ajaxUrl, + type: 'POST', + data: {"category_id": id, "parentCategoryStr": parentCategoryStr}, + error: function (msg) { + alert("An error occurred loading content! : " + msg); + }, + success: function (msg) { + jQuery('#div3').html(msg); + } + }); + } + <#-------------------------------------------------------------------------------------callCreateDocumentTree function--> + function callCreateDocumentTree(contentId) { + jQuery.ajax({ + url: editDocumentTreeUrl, + type: 'POST', + data: { + contentId: contentId, + contentAssocTypeId: 'TREE_CHILD' + }, + error: function (msg) { + alert("An error occurred loading content! : " + msg); + }, + success: function (msg) { + jQuery('#Document').html(msg); + } + }); + } + <#-------------------------------------------------------------------------------------callCreateSection function--> + function callCreateDocument(contentId) { + jQuery.ajax({ + url: editDocumentUrl, + type: 'POST', + data: {contentId: contentId}, + error: function (msg) { + alert("An error occurred loading content! : " + msg); + }, + success: function (msg) { + jQuery('#Document').html(msg); + } + }); + } + <#-------------------------------------------------------------------------------------callEditSection function--> + function callEditDocument(contentIdTo) { + jQuery.ajax({ + url: editDocumentUrl, + type: 'POST', + data: {contentIdTo: contentIdTo}, + error: function (msg) { + alert("An error occurred loading content! : " + msg); + }, + success: function (msg) { + jQuery('#Document').html(msg); + } + }); + } + <#-------------------------------------------------------------------------------------callDeleteItem function--> + function callDeleteDocument(contentId, contentIdTo, contentAssocTypeId, fromDate) { + jQuery.ajax({ + url: deleteDocumentUrl, + type: 'POST', + data: { + contentId: contentId, + contentIdTo: contentIdTo, + contentAssocTypeId: contentAssocTypeId, + fromDate: fromDate + }, + error: function (msg) { + alert("An error occurred loading content! : " + msg); + }, + success: function (msg) { + location.reload(); + } + }); + } + <#-------------------------------------------------------------------------------------callRename function--> + function callRenameDocumentTree(contentId) { + jQuery.ajax({ + url: editDocumentTreeUrl, + type: 'POST', + data: { + contentId: contentId, + contentAssocTypeId: 'TREE_CHILD', + rename: 'Y' + }, + error: function (msg) { + alert("An error occurred loading content! : " + msg); + }, + success: function (msg) { + jQuery('#Document').html(msg); + } + }); + } + <#------------------------------------------------------pagination function --> + function nextPrevDocumentList(url) { + url = '<@ofbizUrl>'+ url+'</@ofbizUrl>'; + jQuery.ajax({ + url: url, + type: 'POST', + error: function (msg) { + alert("An error occurred loading content! : " + msg); + }, + success: function (msg) { + jQuery('#Document').html(msg); + } + }); + } +</script> <div id="quickadd" class="screenlet"> - <div class="screenlet-title-bar"> - <ul> - <li class="h3">${uiLabelMap.ProductCategories}</li> - </ul> - </div> - <div class="screenlet-body" id="tree"> - </div> + <div class="screenlet-title-bar"> + <ul> + <li class="h3">${uiLabelMap.ProductCategories}</li> + </ul> + </div> + <div class="screenlet-body" id="tree"> + </div> </div> Modified: ofbiz/trunk/specialpurpose/ecommerce/template/catalog/ProductCategoryLink.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/template/catalog/ProductCategoryLink.ftl?rev=1761135&r1=1761134&r2=1761135&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/template/catalog/ProductCategoryLink.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/template/catalog/ProductCategoryLink.ftl Sat Sep 17 07:17:15 2016 @@ -19,29 +19,44 @@ under the License. <#assign productCategoryLink = requestAttributes.productCategoryLink!/> <#if productCategoryLink?has_content> -<#if productCategoryLink.detailSubScreen?has_content> + <#if productCategoryLink.detailSubScreen?has_content> ${screens.render(productCategoryLink.detailSubScreen)} -<#else> + <#else> <#assign titleText = productCategoryLink.titleText!/> <#assign imageUrl = productCategoryLink.imageUrl!/> <#assign detailText = productCategoryLink.detailText!/> <#if productCategoryLink.linkTypeEnumId == "PCLT_SEARCH_PARAM"> - <#assign linkUrl = requestAttributes._REQUEST_HANDLER_.makeLink(request, response, "keywordsearch?" + productCategoryLink.linkInfo)/> + <#assign linkUrl = requestAttributes._REQUEST_HANDLER_.makeLink( + request, response, "keywordsearch?" + productCategoryLink.linkInfo)/> <#elseif productCategoryLink.linkTypeEnumId == "PCLT_ABS_URL"> <#assign linkUrl = productCategoryLink.linkInfo!/> <#elseif productCategoryLink.linkTypeEnumId == "PCLT_CAT_ID"> - <#assign linkUrl = requestAttributes._REQUEST_HANDLER_.makeLink(request, response, "category/~category_id=" + productCategoryLink.linkInfo) + "/~pcategory=" + productCategoryId/> - <#assign linkProductCategory = delegator.findOne("ProductCategory", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("productCategoryId", productCategoryLink.linkInfo), true)/> - <#assign linkCategoryContentWrapper = Static["org.apache.ofbiz.product.category.CategoryContentWrapper"].makeCategoryContentWrapper(linkProductCategory, request)/> - <#assign titleText = productCategoryLink.titleText?default(linkCategoryContentWrapper.get("CATEGORY_NAME", "html"))!/> - <#assign imageUrl = productCategoryLink.imageUrl?default(linkCategoryContentWrapper.get("CATEGORY_IMAGE_URL", "url"))!/> - <#assign detailText = productCategoryLink.detailText?default(linkCategoryContentWrapper.get("DESCRIPTION", "html"))!/> + <#assign linkUrl = requestAttributes._REQUEST_HANDLER_.makeLink( + request, response, "category/~category_id=" + productCategoryLink.linkInfo) + + "/~pcategory=" + productCategoryId/> + <#assign linkProductCategory = delegator.findOne( + "ProductCategory", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap( + "productCategoryId", productCategoryLink.linkInfo), true)/> + <#assign linkCategoryContentWrapper = + Static["org.apache.ofbiz.product.category.CategoryContentWrapper"] + .makeCategoryContentWrapper(linkProductCategory, request)/> + <#assign titleText = productCategoryLink.titleText?default( + linkCategoryContentWrapper.get("CATEGORY_NAME", "html"))!/> + <#assign imageUrl = productCategoryLink.imageUrl?default( + linkCategoryContentWrapper.get("CATEGORY_IMAGE_URL", "url"))!/> + <#assign detailText = productCategoryLink.detailText?default( + linkCategoryContentWrapper.get("DESCRIPTION", "html"))!/> </#if> <div class="productcategorylink"> <#if imageUrl?string?has_content> - <div class="smallimage"><a href="${linkUrl}"><img src="<@ofbizContentUrl>${imageUrl}</@ofbizContentUrl>" alt="${titleText?default("Link Image")}"/></a></div> + <div class="smallimage"> + <a href="${linkUrl}"> + <img src="<@ofbizContentUrl>${imageUrl}</@ofbizContentUrl>" + alt="${titleText?default("Link Image")}"/> + </a> + </div> </#if> <#if titleText?has_content> <a href="${linkUrl}" class="linktext">${titleText}</a> @@ -50,5 +65,5 @@ under the License. <div>${detailText}</div> </#if> </div> -</#if> + </#if> </#if> |
Free forum by Nabble | Edit this page |