svn commit: r1821001 [1/7] - in /ofbiz/ofbiz-framework/trunk: applications/content/template/content/ applications/content/template/website/ applications/product/config/ applications/product/groovyScripts/facility/facility/ applications/product/widget/f...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1821001 [1/7] - in /ofbiz/ofbiz-framework/trunk: applications/content/template/content/ applications/content/template/website/ applications/product/config/ applications/product/groovyScripts/facility/facility/ applications/product/widget/f...

jleroux@apache.org
Author: jleroux
Date: Fri Jan 12 15:47:47 2018
New Revision: 1821001

URL: http://svn.apache.org/viewvc?rev=1821001&view=rev
Log:
Improved: Replace Asm select plugin with Select2.
(OFBIZ-10113)

Current Asm Select Plugin
http://www.ryancramer.com/journal/entries/asmselect_v104/
can be replaced with Select2 (https://select2.org/).

* Select2 has much better community support on GitHub with 386 contributors
  while Asm Select Plugin is handled by Ryan Cramer on http://www.ryancramer.com/.
* Select2 has 37 releases while Asm select has very few releases yet.
* Both the plugin has MIT license.

Refer https://select2.org/ and  
https://github.com/select2/select2 for more features and other information.

Added i18n support so added logic in JsLanguageFileMappingCreator and
JsLanguageFilesMapping accordingly.
Added some custom CSS as the Select2 seems to be too fancy in accordance
with the current OFBiz themes

Verify:
Multiple drop-downs field in FormWidgetExamples.
https://localhost:8443/example/control/FormWidgetExamples

Find Request page with StatusId , CustRequestId
https://localhost:8443/ordermgr/control/FindRequest

I have replaced the plugins though I feel the implementation of select multiple
js code is to be reviewed & refactored. I will pick when I am done with all my
current tasks if I get some consensus.

Thanks: Aditya

Added:
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/css/
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/css/select2-4.0.6.css   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/css/select2-4.0.6.min.css   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/af.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/ar.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/az.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/bg.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/bs.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/ca.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/cs.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/da.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/de.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/dsb.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/el.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/en.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/es.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/et.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/eu.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/fa.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/fi.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/fr.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/gl.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/he.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/hi.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/hr.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/hsb.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/hu.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/hy.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/id.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/is.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/it.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/ja.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/km.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/ko.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/lt.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/lv.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/mk.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/ms.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/nb.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/nl.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/pl.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/ps.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/pt-BR.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/pt.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/ro.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/ru.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/sk.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/sl.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/sr-Cyrl.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/sr.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/sv.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/th.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/tk.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/tr.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/uk.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/vi.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/zh-CN.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/i18n/zh-TW.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/select2-4.0.6.js   (with props)
    ofbiz/ofbiz-framework/trunk/themes/common/webapp/common/js/jquery/plugins/select2/js/select2-4.0.6.min.js   (with props)
Modified:
    ofbiz/ofbiz-framework/trunk/applications/content/template/content/ContentSearchOptions.ftl
    ofbiz/ofbiz-framework/trunk/applications/content/template/website/WebSiteCMSContent.ftl
    ofbiz/ofbiz-framework/trunk/applications/product/config/ProductUiLabels.xml
    ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/facility/FindFacility.groovy
    ofbiz/ofbiz-framework/trunk/applications/product/widget/facility/FacilityScreens.xml
    ofbiz/ofbiz-framework/trunk/applications/workeffort/minilang/workeffort/WorkEffortSimpleServices.xml
    ofbiz/ofbiz-framework/trunk/applications/workeffort/servicedef/services.xml
    ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/JsLanguageFileMappingCreator.java
    ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/JsLanguageFilesMapping.java
    ofbiz/ofbiz-framework/trunk/themes/bluelight/webapp/bluelight/style.css
    ofbiz/ofbiz-framework/trunk/themes/common/template/JsLanguageFilesMapping.ftl
    ofbiz/ofbiz-framework/trunk/themes/common/template/includes/SetMultipleSelectJs.ftl
    ofbiz/ofbiz-framework/trunk/themes/common/template/includes/SetMultipleSelectJsList.ftl
    ofbiz/ofbiz-framework/trunk/themes/common/widget/CommonScreens.xml
    ofbiz/ofbiz-framework/trunk/themes/common/widget/Theme.xml
    ofbiz/ofbiz-framework/trunk/themes/flatgrey/webapp/flatgrey/style.css
    ofbiz/ofbiz-framework/trunk/themes/rainbowstone/webapp/rainbowstone/style.css
    ofbiz/ofbiz-framework/trunk/themes/tomahawk/webapp/tomahawk/css/style.css

Modified: ofbiz/ofbiz-framework/trunk/applications/content/template/content/ContentSearchOptions.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/template/content/ContentSearchOptions.ftl?rev=1821001&r1=1821000&r2=1821001&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/template/content/ContentSearchOptions.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/template/content/ContentSearchOptions.ftl Fri Jan 12 15:47:47 2018
@@ -38,7 +38,7 @@ under the License.
           <td align="right" valign="middle" class="label">${uiLabelMap.FormFieldTitle_contentId}</td>
           <td valign="middle">
             <div>
-              <@htmlTemplate.lookupField value="${requestParameters.SEARCH_CONTENT_ID!}" formName="advToKeyWordSearchForm" name="SEARCH_CONTENT_ID" id="SEARCH_CONTENT_ID" fieldFormName="LookupContent"/>
+              <@htmlTemplate.lookupField value="${requestParameters.SEARCH_CONTENT_ID!}" name="SEARCH_CONTENT_ID" id="SEARCH_CONTENT_ID" fieldFormName="LookupContent"/>
             </div>
           </td>
         </tr>

Modified: ofbiz/ofbiz-framework/trunk/applications/content/template/website/WebSiteCMSContent.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/template/website/WebSiteCMSContent.ftl?rev=1821001&r1=1821000&r2=1821001&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/template/website/WebSiteCMSContent.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/template/website/WebSiteCMSContent.ftl Fri Jan 12 15:47:47 2018
@@ -154,11 +154,14 @@
     <form name="cmsform" enctype="multipart/form-data" method="post" action="<@ofbizUrl>${formAction}</@ofbizUrl>" style="margin: 0;">
         <#if (content?has_content)>
             <input type="hidden" name="dataResourceId" value="${(dataResource.dataResourceId)!}"/>
-            <input type="hidden" name="contentId" value="${content.contentId}"/>
+            <input type="hidden" name="contentIdTo" value="${content.contentId}"/>
 
             <#list requestParameters.keySet() as paramName>
-                <#if (paramName == 'contentIdFrom' || paramName == 'contentAssocTypeId' || paramName == 'fromDate')>
-                    <input type="hidden" name="${paramName}" value="${requestParameters.get(paramName)}"/>
+                <#if paramName == 'contentIdFrom'>
+                  <input type="hidden" name="contentId" value="${requestParameters.get(paramName)}"/>
+                </#if>
+                <#if (paramName == 'contentAssocTypeId' || paramName == 'fromDate')>
+                  <input type="hidden" name="${paramName}" value="${requestParameters.get(paramName)}"/>
                 </#if>
             </#list>
         <#else>