You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2015/07/29 15:33:13 UTC

svn commit: r1693258 - /ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl

Author: jleroux
Date: Wed Jul 29 13:33:12 2015
New Revision: 1693258

URL: http://svn.apache.org/r1693258
Log:
Fixes an issue crossed while checking OFBIZ-6504 - how to Create PDF with password Protected in Ofbiz

There was still an issue in normal (not PDF) mode, I thought I had just to replace \' by void, but I got fooled, because \' already transformed in Unicode characters (\') at this stage. So I replaced "\'" by "'"

Modified:
    ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl

Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1693258&r1=1693257&r2=1693258&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Wed Jul 29 13:33:12 2015
@@ -231,7 +231,7 @@ under the License.
   <span class="ui-widget">
     <select name="${name?default("")}<#rt/>" <@renderClass className alert /><#if id?has_content> id="${id}"</#if><#if multiple?has_content> multiple="multiple"</#if><#if otherFieldSize gt 0> onchange="process_choice(this,document.${formName}.${otherFieldName})"</#if><#if event?has_content> ${event}="${action}"</#if><#if size?has_content> size="${size}"</#if><#if tabindex?has_content> tabindex="${tabindex}"</#if><#rt/>>
       <#if firstInList?has_content && currentValue?has_content && !multiple?has_content>
-        <option selected="selected" value="${currentValue}">${explicitDescription}</option><#rt/>
+        <option selected="selected" value="${currentValue}">${explicitDescription?replace("&#x5c;&#x27;","&#x27;")}</option><#rt/>
         <option value="${currentValue}">---</option><#rt/>
       </#if>
       <#if allowEmpty?has_content || !options?has_content>
@@ -239,9 +239,9 @@ under the License.
       </#if>
       <#list options as item>
         <#if multiple?has_content>
-          <option<#if currentValue?has_content && item.selected?has_content> selected="${item.selected}" <#elseif !currentValue?has_content && noCurrentSelectedKey?has_content && noCurrentSelectedKey == item.key> selected="selected" </#if> value="${item.key}">${item.description}</option><#rt/>
+          <option<#if currentValue?has_content && item.selected?has_content> selected="${item.selected}" <#elseif !currentValue?has_content && noCurrentSelectedKey?has_content && noCurrentSelectedKey == item.key> selected="selected" </#if> value="${item.key}">${item.description?replace("&#x5c;&#x27;","&#x27;")}</option><#rt/>
         <#else>
-          <option<#if currentValue?has_content && currentValue == item.key && dDFCurrent?has_content && "selected" == dDFCurrent> selected="selected"<#elseif !currentValue?has_content && noCurrentSelectedKey?has_content && noCurrentSelectedKey == item.key> selected="selected"</#if> value="${item.key}">${item.description}</option><#rt/>
+          <option<#if currentValue?has_content && currentValue == item.key && dDFCurrent?has_content && "selected" == dDFCurrent> selected="selected"<#elseif !currentValue?has_content && noCurrentSelectedKey?has_content && noCurrentSelectedKey == item.key> selected="selected"</#if> value="${item.key}">${item.description?replace("&#x5c;&#x27;","&#x27;")}</option><#rt/>
         </#if>
       </#list>
     </select>



Re: svn commit: r1693258 - /ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl

Posted by Jacques Le Roux <ja...@les7arts.com>.
If you suggest to use
     <#escape x as x?xml>
inside the renderDropDownField macro (after reverting my change), I just tried and it does not work for not ASCII chars. In French at least the result 
is disastrous (accents, etc.)

Thanks

Jacques

Le 29/07/2015 17:10, Adrian Crum a écrit :
> Wouldn't it be simpler to use
>
> <#escape x as x?html>
>
> ?
>
> Adrian Crum
> Sandglass Software
> www.sandglass-software.com
>
> On 7/29/2015 6:33 AM, jleroux@apache.org wrote:
>> Author: jleroux
>> Date: Wed Jul 29 13:33:12 2015
>> New Revision: 1693258
>>
>> URL: http://svn.apache.org/r1693258
>> Log:
>> Fixes an issue crossed while checking OFBIZ-6504 - how to Create PDF with password Protected in Ofbiz
>>
>> There was still an issue in normal (not PDF) mode, I thought I had just to replace \' by void, but I got fooled, because \' already transformed in 
>> Unicode characters (&#x5c;&#x27;) at this stage. So I replaced "&#x5c;&#x27;" by "&#x27;"
>>
>> Modified:
>> ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
>>
>> Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1693258&r1=1693257&r2=1693258&view=diff
>> ==============================================================================
>> --- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
>> +++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Wed Jul 29 13:33:12 2015
>> @@ -231,7 +231,7 @@ under the License.
>>     <span class="ui-widget">
>>       <select name="${name?default("")}<#rt/>" <@renderClass className alert /><#if id?has_content> id="${id}"</#if><#if multiple?has_content> 
>> multiple="multiple"</#if><#if otherFieldSize gt 0> onchange="process_choice(this,document.${formName}.${otherFieldName})"</#if><#if 
>> event?has_content> ${event}="${action}"</#if><#if size?has_content> size="${size}"</#if><#if tabindex?has_content> tabindex="${tabindex}"</#if><#rt/>>
>>         <#if firstInList?has_content && currentValue?has_content && !multiple?has_content>
>> -        <option selected="selected" value="${currentValue}">${explicitDescription}</option><#rt/>
>> +        <option selected="selected" value="${currentValue}">${explicitDescription?replace("&#x5c;&#x27;","&#x27;")}</option><#rt/>
>>           <option value="${currentValue}">---</option><#rt/>
>>         </#if>
>>         <#if allowEmpty?has_content || !options?has_content>
>> @@ -239,9 +239,9 @@ under the License.
>>         </#if>
>>         <#list options as item>
>>           <#if multiple?has_content>
>> -          <option<#if currentValue?has_content && item.selected?has_content> selected="${item.selected}" <#elseif !currentValue?has_content && 
>> noCurrentSelectedKey?has_content && noCurrentSelectedKey == item.key> selected="selected" </#if> 
>> value="${item.key}">${item.description}</option><#rt/>
>> +          <option<#if currentValue?has_content && item.selected?has_content> selected="${item.selected}" <#elseif !currentValue?has_content && 
>> noCurrentSelectedKey?has_content && noCurrentSelectedKey == item.key> selected="selected" </#if> 
>> value="${item.key}">${item.description?replace("&#x5c;&#x27;","&#x27;")}</option><#rt/>
>>           <#else>
>> -          <option<#if currentValue?has_content && currentValue == item.key && dDFCurrent?has_content && "selected" == dDFCurrent> 
>> selected="selected"<#elseif !currentValue?has_content && noCurrentSelectedKey?has_content && noCurrentSelectedKey == item.key> 
>> selected="selected"</#if> value="${item.key}">${item.description}</option><#rt/>
>> +          <option<#if currentValue?has_content && currentValue == item.key && dDFCurrent?has_content && "selected" == dDFCurrent> 
>> selected="selected"<#elseif !currentValue?has_content && noCurrentSelectedKey?has_content && noCurrentSelectedKey == item.key> 
>> selected="selected"</#if> value="${item.key}">${item.description?replace("&#x5c;&#x27;","&#x27;")}</option><#rt/>
>>           </#if>
>>         </#list>
>>       </select>
>>
>>
>

Re: svn commit: r1693258 - /ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl

Posted by Adrian Crum <ad...@sandglass-software.com>.
Wouldn't it be simpler to use

<#escape x as x?html>

?

Adrian Crum
Sandglass Software
www.sandglass-software.com

On 7/29/2015 6:33 AM, jleroux@apache.org wrote:
> Author: jleroux
> Date: Wed Jul 29 13:33:12 2015
> New Revision: 1693258
>
> URL: http://svn.apache.org/r1693258
> Log:
> Fixes an issue crossed while checking OFBIZ-6504 - how to Create PDF with password Protected in Ofbiz
>
> There was still an issue in normal (not PDF) mode, I thought I had just to replace \' by void, but I got fooled, because \' already transformed in Unicode characters (&#x5c;&#x27;) at this stage. So I replaced "&#x5c;&#x27;" by "&#x27;"
>
> Modified:
>      ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
>
> Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1693258&r1=1693257&r2=1693258&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
> +++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Wed Jul 29 13:33:12 2015
> @@ -231,7 +231,7 @@ under the License.
>     <span class="ui-widget">
>       <select name="${name?default("")}<#rt/>" <@renderClass className alert /><#if id?has_content> id="${id}"</#if><#if multiple?has_content> multiple="multiple"</#if><#if otherFieldSize gt 0> onchange="process_choice(this,document.${formName}.${otherFieldName})"</#if><#if event?has_content> ${event}="${action}"</#if><#if size?has_content> size="${size}"</#if><#if tabindex?has_content> tabindex="${tabindex}"</#if><#rt/>>
>         <#if firstInList?has_content && currentValue?has_content && !multiple?has_content>
> -        <option selected="selected" value="${currentValue}">${explicitDescription}</option><#rt/>
> +        <option selected="selected" value="${currentValue}">${explicitDescription?replace("&#x5c;&#x27;","&#x27;")}</option><#rt/>
>           <option value="${currentValue}">---</option><#rt/>
>         </#if>
>         <#if allowEmpty?has_content || !options?has_content>
> @@ -239,9 +239,9 @@ under the License.
>         </#if>
>         <#list options as item>
>           <#if multiple?has_content>
> -          <option<#if currentValue?has_content && item.selected?has_content> selected="${item.selected}" <#elseif !currentValue?has_content && noCurrentSelectedKey?has_content && noCurrentSelectedKey == item.key> selected="selected" </#if> value="${item.key}">${item.description}</option><#rt/>
> +          <option<#if currentValue?has_content && item.selected?has_content> selected="${item.selected}" <#elseif !currentValue?has_content && noCurrentSelectedKey?has_content && noCurrentSelectedKey == item.key> selected="selected" </#if> value="${item.key}">${item.description?replace("&#x5c;&#x27;","&#x27;")}</option><#rt/>
>           <#else>
> -          <option<#if currentValue?has_content && currentValue == item.key && dDFCurrent?has_content && "selected" == dDFCurrent> selected="selected"<#elseif !currentValue?has_content && noCurrentSelectedKey?has_content && noCurrentSelectedKey == item.key> selected="selected"</#if> value="${item.key}">${item.description}</option><#rt/>
> +          <option<#if currentValue?has_content && currentValue == item.key && dDFCurrent?has_content && "selected" == dDFCurrent> selected="selected"<#elseif !currentValue?has_content && noCurrentSelectedKey?has_content && noCurrentSelectedKey == item.key> selected="selected"</#if> value="${item.key}">${item.description?replace("&#x5c;&#x27;","&#x27;")}</option><#rt/>
>           </#if>
>         </#list>
>       </select>
>
>