Author: pgil
Date: Fri Aug 10 14:11:22 2018
New Revision: 1837806

URL: http://svn.apache.org/viewvc?rev=1837806&view=rev
Log:
Fixed: Use of layered-modal with parameter does not work
(OFBIZ-10511)

Thanks Deepak and Aditya for the review and providing a better patch

Modified:
    
ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl
    
ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlMenuMacroLibrary.ftl
    
ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlScreenMacroLibrary.ftl
    
ofbiz/ofbiz-framework/trunk/themes/rainbowstone/template/macro/HtmlMenuMacroLibrary.ftl

Modified: 
ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl?rev=1837806&r1=1837805&r2=1837806&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl
 Fri Aug 10 14:11:22 2018
@@ -803,17 +803,17 @@ Parameter: delegatorName, String, option
 </#macro>
 <#macro makeHyperlinkString hiddenFormName imgSrc title  alternate linkUrl 
description linkStyle="" event="" action="" targetParameters="" targetWindow="" 
confirmation="" uniqueItemName="" height="" width="" id="">
     <#if uniqueItemName?has_content>
-        <#local params = "{ 'presentation': 'layer'">
+        <#local params = "{\"presentation\": \"layer\"">
         <#if targetParameters?has_content>
           <#assign parameterMap = targetParameters?eval>
           <#assign parameterKeys = parameterMap?keys>
           <#list parameterKeys as key>
-            <#local params += ",'${key}': '${parameterMap[key]}'">
+            <#local params += ",\"${key}\": \"${parameterMap[key]}\"">
           </#list>
         </#if>
-        <#local params += " }">
+        <#local params += "}">
         <a href="javascript:void(0);" id="${uniqueItemName}_link"
-           data-dialog-params="${params}"
+           data-dialog-params='${params}'
            data-dialog-width="${width}"
            data-dialog-height="${height}"
            data-dialog-url="${linkUrl}"

Modified: 
ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlMenuMacroLibrary.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlMenuMacroLibrary.ftl?rev=1837806&r1=1837805&r2=1837806&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlMenuMacroLibrary.ftl
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlMenuMacroLibrary.ftl
 Fri Aug 10 14:11:22 2018
@@ -55,15 +55,15 @@ under the License.
 </form><#rt/>
   </#if>
   <#if uniqueItemName?has_content && "layered-modal" == linkType>
-    <#local params = "{ 'presentation': 'layer'">
+    <#local params = "{\"presentation\":\"layer\" ">
     <#if parameterList?has_content>
       <#list parameterList as parameter>
-        <#local params += ",'${parameter.name}': '${parameter.value}'">
+        <#local params += ",\"${parameter.name}\": \"${parameter.value}\"">
       </#list>
     </#if>
-    <#local params += " }">
+    <#local params += "}">
     <a href="javascript:void(0);" id="${uniqueItemName}_link"
-       data-dialog-params="${params}"
+       data-dialog-params='${params}'
        data-dialog-width="${width}"
        data-dialog-height="${height}"
        data-dialog-url="${linkUrl}"

Modified: 
ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlScreenMacroLibrary.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlScreenMacroLibrary.ftl?rev=1837806&r1=1837805&r2=1837806&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlScreenMacroLibrary.ftl
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlScreenMacroLibrary.ftl
 Fri Aug 10 14:11:22 2018
@@ -16,7 +16,6 @@ KIND, either express or implied.  See th
 specific language governing permissions and limitations
 under the License.
 -->
-
 <#macro renderScreenBegin>
 <!DOCTYPE html>
 </#macro>
@@ -108,15 +107,15 @@ under the License.
             <#if imgStr?has_content>${imgStr}</#if><#if 
text?has_content>${text}</#if>
         </a>
     <#else>
-        <#local params = "{ 'presentation': 'layer'">
+        <#local params = "{\"presentation\":\"layer\" ">
         <#if parameterList?has_content>
           <#list parameterList as parameter>
-            <#local params += ",'${parameter.name}': '${parameter.value}'">
+            <#local params += ",\"${parameter.name}\": \"${parameter.value}\"">
           </#list>
         </#if>
-        <#local params += " }">
+        <#local params += "}">
         <a href="javascript:void(0);" id="${uniqueItemName}_link"
-           data-dialog-params="${params}"
+           data-dialog-params='${params}'
            data-dialog-width="${width}"
            data-dialog-height="${height}"
            data-dialog-url="${target}"
@@ -326,4 +325,4 @@ ${menuString}
 
 <#macro renderColumnEnd>
   </td>
-</#macro>
+</#macro>
\ No newline at end of file

Modified: 
ofbiz/ofbiz-framework/trunk/themes/rainbowstone/template/macro/HtmlMenuMacroLibrary.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/rainbowstone/template/macro/HtmlMenuMacroLibrary.ftl?rev=1837806&r1=1837805&r2=1837806&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/themes/rainbowstone/template/macro/HtmlMenuMacroLibrary.ftl
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/themes/rainbowstone/template/macro/HtmlMenuMacroLibrary.ftl
 Fri Aug 10 14:11:22 2018
@@ -28,10 +28,15 @@ under the License.
     </form><#rt/>
     </#if>
     <#if uniqueItemName?has_content && "layered-modal" == linkType>
-        <#local params = "{ 'presentation': 'layer'">
-        <#local params += " }">
+      <#local params = "{\"presentation\":\"layer\" ">
+      <#if parameterList?has_content>
+        <#list parameterList as parameter>
+          <#local params += ",\"${parameter.name}\": \"${parameter.value}\"">
+        </#list>
+      </#if>
+      <#local params += "}">
     <a href="javascript:void(0);" id="${uniqueItemName}_link"
-       data-dialog-params="${params}"
+       data-dialog-params='${params}'
        data-dialog-width="${width}"
        data-dialog-height="${height}"
        data-dialog-url="${linkUrl}"


Reply via email to