SetLocaleFromBrowser.groovy

Clone Tools
  • last updated a few minutes ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Fixed: setUserTimeZone should ran only once based on error (OFBIZ-11329)

This will be notably useful when committing CSRF solution as explained in

OFBIZ-11306:

SetTimeZoneFromBrowser when starting gives a RequestHandlerException:

Invalid or missing CSRF token for AJAX call to path '/SetTimeZoneFromBrowser'.

Also not only when starting.

Thanks: James Yong for review

(cherry picked from commit 350c71f4df45cbe5671b54e61f74f9a352d78e05)

# Conflicts:

# framework/common/groovyScripts/SetLocaleFromBrowser.groovy

# themes/common-theme/webapp/common/js/util/setUserTimeZone.js replaced

by setUserLocale.js modified by hand

I can compile locally but I can see a reason why and certainly not related to

these changes

  1. … 1 more file in changeset.
Improved: Rename the misnamed setUserLocale.js to setUserTimeZone.js (OFBIZ-10472)

At the same time renames setLocaleFromBrowser to SetTimeZoneFromBrowser

everywhere it's needed

And adds a documentation about the auth mismatch as suggested by Mathieu

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835628 13f79535-47bb-0310-9956-ffa450edef68

  1. … 6 more files in changeset.
Improved: Replace all delegator findByAnd and findOne method calling by EntityQuery methods (OFBIZ-10029) Applied slightly modified patch, rearrange import properly, Thanks Suraj Khurana for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818003 13f79535-47bb-0310-9956-ffa450edef68

  1. … 45 more files in changeset.
Reverted r#1817989, workign fine locally, reverted for now will check and commit again

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817998 13f79535-47bb-0310-9956-ffa450edef68

  1. … 45 more files in changeset.
Improved: Replace all delegator findByAnd and findOne method calling by EntityQuery methods (OFBIZ-10029) Applied slightly modified patch, rearrange import properly, Thanks Suraj Khurana for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817989 13f79535-47bb-0310-9956-ffa450edef68

  1. … 45 more files in changeset.
Improved: Inconsistent String Comparisons, Applied framework groovy patch from jira issue. (OFBIZ-9254)

I found an inconsistency in the code for string comparison statusId.equals("PRUN_COMPLETED") whereas it should be written as "PRUN_COMPLETED".equals(statusId) cause the former can throw NullPointerException if the variable found to be NULL.

Thanks Devanshu Vyas for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1795342 13f79535-47bb-0310-9956-ffa450edef68

  1. … 2 more files in changeset.
Implemented: Make sure the local date time uses the time zone from the local browser. (OFBIZ-9264)

If a time zone is already set for a user, this new feature won't override it.

The user still can set it's own time zone, but if it isn't set,

this avoids the time zone set to the default of the server.

jelroux: the momentjs license is MIT

Thanks: Francis Douet

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1788256 13f79535-47bb-0310-9956-ffa450edef68

    • -0
    • +34
    ./SetLocaleFromBrowser.groovy
  1. … 6 more files in changeset.