Commit Graph
91 Commits
Author SHA1 Message Date
James Yong 162506d372 Fixed: Display last-visited-time popup after login (OFBIZ-12148)
Empty popup occurs when showjGrowl is run later than the javascript from unsafe message. Delay running of showjGrowl function from 10 to 100 milliseconds.

Thanks Jacques for reporting.
2021-02-24 16:54:39 +07:00
Nicolas Malin 5229d572df Implemented: Element link can update partial area
(OFBIZ-11810)

   Currently when you want to display an information easily on sub-screen
dynamically (example as related element) is currently not possible without
write specific js code.
   To simplify it, we introduce a new link type: update-area, to indicate
to the theme that we want to refresh  a local area with the call result.

   Example :
       <link target="ListCategoryProductMembers" link-type="update-area" target-window="detail">
           <parameter param-name="productCategoryId"/>
       </link>

For this example we indicate that the display result of target 'ListCategoryProductMembers' is going
on the area identify by 'detail'. Pleasure to the theme to manage it.
2021-02-17 18:11:19 +01:00
Benjamin Jugl 7bca526c10 Fixed: StringOutOfBounds Exception while checking available Languages
(OFBIZ-10707)
2021-02-03 11:24:10 +01:00
James Yong d7d424fafd Fixed: Issue in rendering Comparitive balance sheet pdf (OFBIZ-12151), and Exporting the PDF for Cash Flow Statement displays the macro code for the date fields (OFBIZ-12155)
Bug introduced when fixing OFBIZ-12097

Thanks: Lalit for reporting OFBIZ-12151; Ankit, OFBIZ-12155. Jacques for linking the issues.
2021-01-24 10:27:42 +08:00
James Yong 6a08920606 Improved: Allow Unsafe Event Message (OFBIZ-12147)
Only delay jgrowl message when there is _UNSAFE_EVENT_MESSAGE_

Thanks Michael for feedback.
2021-01-21 22:53:57 +08:00
James Yong 1bfd3c5fb0 Improved: Allow Unsafe Event Message (OFBIZ-12147)
Allow application to define event messages that contain javascripts, via request attribute "_UNSAFE_EVENT_MESSAGE_"

Thanks Jacques for review
2021-01-21 20:46:06 +08:00
Nicolas Malin e0a840a0c4 Implemented: Access to the current screen from any widget element
(OFBIZ-11809)

During the rendering process, an element have no information about the screen which is dependent from. This not really help to automate some refresh treatment and force the developer to know the screen structure where is the element.

To solve this situation we implement a new class, ScreenStack that allow anytime for any element to identify its direct dependency. This help to resolve the unique Id that the screen take and can be used by the theme.

At any time a developer can retrieve the screen reference with uel function screen:id(screenStack)

example:
     <container id="${screen:id(screenStack)}">

The object screenStack is always present during a rendering process.
2021-01-12 17:48:00 +01:00
James Yong a66f0a9be8 Improved: Change inline style to js for multiple select field (OFBIZ-12115)
Test pages at /ordermgr/control/FindRequest and /ordermgr/control/findorders
2021-01-01 13:13:46 +08:00
James Yong 451f42a21c Improved: Do not limit form width if asm_formSize is not defined (OFBIZ-12102)
Extend the same behavior to SetMultipleSelectJs.ftl.
2020-12-26 17:08:22 +08:00
James Yong f561c41ea0 Improved: Do not limit form width if asm_formSize is not defined (OFBIZ-12102)
Changed at SetMultipleSelectJsList.ftl.
Tested page at /ordermgr/control/FindRequest
2020-12-26 13:14:07 +08:00
James Yong 483e77ea83 Fixed: Date picker not initialised in ajax-called form (OFBIZ-12097)
Use inline script when request is ajax
2020-12-20 08:46:52 +08:00
James Yong e405d35c08 Improved: Move page-specific script links to html template (OFBIZ-11799)
Use importLibrary js function to load locale-specific datepicker js.
Corrected locale naming in macro to use '.locale'.
Tested page at /ordermgr/control/findreturn and /ordermgr/control/orderentry.
2020-12-05 23:23:04 +08:00
James Yong cfabbc9b74 Fixed: jquery.ui.datepicker-en.js does not exist (OFBIZ-12071)
Fixed for Jquery DatePicker
2020-12-05 19:24:09 +08:00
James Yong a3fbb66479 Improved: Move page-specific script links to html template (OFBIZ-11799)
Use importLibrary js function to load time-related js and css for date time picker.
Tested page at /ordermgr/control/findreturn and /ordermgr/control/orderentry
2020-11-30 10:29:08 +08:00
James Yong 283752fd26 Fixed: jquery.ui.datepicker-en.js does not exist (OFBIZ-12071)
Default language file specified for DateTime doesn't exist in the project i.e.
/common/js/jquery/ui/i18n/jquery.ui.datepicker-en.js

Changed to /common/js/jquery/plugins/datetimepicker/i18n/jquery-ui-timepicker-en.js
2020-11-28 21:26:47 +08:00
James Yong bc5b0d595c Improved: Load language js for date.js only when required (OFBIZ-12064)
Tested on
1) date time field at /ordermgr/control/orderentry and
2) date find field at /ordermgr/control/findreturn
2020-11-27 21:51:35 +08:00
James Yong 0987c11ca7 Improved: Remove date.format-1.2.3-min.js (OFBIZ-12040)
This Javascript library is not use in the project.
2020-10-10 19:36:24 +08:00
Jacques Le Roux 96be0c62a3 Improved: Checkstyle: Variable name must match pattern (OFBIZ-11926)
All final data members of the class must match this naming pattern
'^[A-Z][A-Z0-9](_[A-Z0-9]+)$'

I added the changes in CommonScreens.xml and kept the
private static Map<String, String> localeFiles = new HashMap<>();
expression, instead of
private static Map<String, String> localeFiles = new HashMap<String, String>();
in JsLanguageFilesMapping.ftl

I note that we use JQuery instead of Java conventional Jquery but that sounds OK
with me

Thanks: Suraj for the patch
2020-08-27 19:10:08 +02:00
James Yong 2eb3282988 Reverted: Error when rendering renderSubmitField macro (OFBIZ-11968)
No issue after new checkout.

Thanks Jacques and Dennis for the check
2020-08-22 14:43:00 +08:00
James Yong c3c41b28b4 Improved: multi-block attribute for html-template tag (OFBIZ-11686)
Moved <@scriptTagsFooter/> within the body tag.
2020-08-21 17:59:00 +08:00
James Yong 796e0d94ee Fixed: Error when rendering renderSubmitField macro (OFBIZ-11968)
Fixed error rendering renderSubmitField when accessing /humanres/control/FindPartySkills page
2020-08-21 15:44:39 +08:00
James Yong b480426e10 Improved: Move page-specific script links to html template (OFBIZ-11799)
use importLibrary js function to load impersonate.css
2020-08-21 15:13:35 +08:00
Jacques Le Roux 3c687a757c Improved: Form-Fields of certain types won't render IDs (OFBIZ-11957)
While implementing some OFBiz-Forms, I noticed, that certain types of
form-fields will not render the set ID.

Field-Types that won't work for sure are {{submit}} and {{hyperlink}} where the
set name for the parameter {{id-name}} simply will not be rendered in the
HTML-Code that is generated by OFBiz.

Thanks: Dennis Balkir
2020-08-20 15:17:21 +02:00
James Yong ede5aa1550 Improved: Move page-specific script links to html template (OFBIZ-11799)
ensure select2 lang js is loaded after the main js.
2020-08-17 21:52:19 +08:00
James Yong 7322abbcbe Improved: Move page-specific script links to html template (OFBIZ-11799)
refactoring
2020-08-17 20:45:47 +08:00
James Yong 39c1e280f9 Improved: Move page-specific script links to html template (OFBIZ-11799)
refactoring +
importLibrary function to use crossDomain = true to allow js file to be shown under browser's sources folder
2020-08-16 18:05:32 +08:00
James Yong dd5c7b715a Improved: Move page-specific script links to html template (OFBIZ-11799)
Use importLibrary js function to load select2 js and css
Tested on
https://localhost:8443/example/control/FormWidgetExamples

https://localhost:8443/ordermgr/control/FindRequest
2020-08-15 20:25:34 +08:00
James Yong eb4f082fef Fixed: Error in log when running renderDropDownField macro (OFBIZ-11959)
Fixed unable to render the disable attribute.
2020-08-15 20:01:29 +08:00
James Yong c4b5407eb2 Improved: Move page-specific script links to html template (OFBIZ-11799)
Created new importLibrary js function to load OpenLayer js and css
Tested on
https://localhost:8443/example/control/ExampleGeoLocationPointSet4
https://localhost:8443/example/control/ExampleOsmGeoLocationPointSet4
2020-08-15 11:57:58 +08:00
James Yong aaa5d9e9a5 Improved: Move page-specific script links to html template (OFBIZ-11799)
Moved OpenLayer js and css to html template
Tested on https://localhost:8443/partymgr/control/PartyGeoLocation?partyId=DemoCustomer
2020-08-13 22:16:33 +08:00
James Yong d5140ca65d Improved: Move page-specific script links to html template (OFBIZ-11799)
Moved select2 script and link tags to html template when multi-block=true.
select2 language js will be auto added by MultiBlockHtmlTemplateUtil#addLinksToLayoutSettings

Tested on
https://localhost:8443/example/control/FormWidgetExamples

https://localhost:8443/ordermgr/control/FindRequest
2020-08-06 22:39:59 +08:00
James Yong c0e527efb2 Improved: Headerize external script in multi-block html template (OFBIZ-11741)
Allow external scripts within the multi-block html template, to be rendered
within the html head tag, when a new attribute data-import is set to “head”

Thanks: Jacques for review
2020-05-30 12:00:21 +08:00
James Yong e46c7b9724 Fixed: showjGrowl called twice (OFBIZ-11720)
showjGrowl function is called twice,
even when there is no message to show.
2020-05-21 21:38:08 +08:00
James Yong ac541342ae Improved: Apply multi-block attr to each application (OFBIZ-11706)
Revert regression for showHelp.
2020-05-21 00:07:36 +08:00
Pawan Verma bc0afa36ee Fixed: Entering manually date in date-time field become unworkable
(OFBIZ-10432)

Thanks, Olivier for the report.
2020-05-20 14:26:52 +05:30
Pawan Verma 3b7e63744c Improved: Expansion of form widget field disabled atrribute with xsd improvement (#141)
(OFBIZ-10432)

1. Added disabled attribute support in ModelFormField with xs:boolean type
2. Removed specific field level disabled attribute support for CheckField and TextField
3. Modified existing usage of disabled attribute as per new implementation.

Thanks: Rishi for the report and Taher, Gil and Jacques for the feedback
2020-05-19 17:37:24 +05:30
James Yong b5729d77fb Improved: Apply multi-block attr to each application (OFBIZ-11706)
Fix regression
2020-05-16 19:38:01 +08:00
Jacques Le Roux 645d419574 Merge branch 'trunk' into POC-for-CSRF-Token-OFBIZ-11306 2020-04-04 17:52:06 +02:00
Ulrich Heidfeld 8ee522e42e Improved: Decodes AjaxAutocompleteOptions return value
(OFBIZ-11475)
2020-04-02 09:15:45 +02:00
Jacques Le Roux f3bd6a14b7 Improved: no functional change
Adds "Content-Security-Policy" frame-ancestors="self" in ErrorPage.ftl
Because this page is used as a HTTP 500 error it's more susceptible to
clickjacking

Quoting OWASP ZAP:
This problem still applies to error-type pages (401, 403, 500, etc.), as these
pages are still often affected by injection problems, in which case it is still
possible that browsers may interpret pages differently from their actual content
type.

I tried to work on other file types that were also reported but it's complicated
adn I believe it's not worth it
2020-03-21 11:31:56 +01:00
Dennis Balkir 54a429e8cc Implemented: _WARNING_MESSAGE_
(OFBIZ-10587)

Added warning message as a message type, by adding it in the
messages.ftl and the request-handler

Thanks to Niklas Fallik for reporting
2020-03-21 11:31:54 +01:00
Michael Brohl d3907529c3 Implemented: Remove the user login security question.
(OFBIZ-11244)

Thanks Wiebke Pätzold for providing the patch.
2020-03-21 11:31:47 +01:00
Dennis Balkir d0f5a838e8 Fixed: Potential Nullpointer in ErrorPage.ftl
(OFBIZ-11448)

Inserted nullcheck for request-attribute
2020-03-21 11:31:47 +01:00
Jacques Le Roux b6a796cbdf Improved: no functional change
Adds "Content-Security-Policy" frame-ancestors="self" in ErrorPage.ftl
Because this page is used as a HTTP 500 error it's more susceptible to
clickjacking

Quoting OWASP ZAP:
This problem still applies to error-type pages (401, 403, 500, etc.), as these
pages are still often affected by injection problems, in which case it is still
possible that browsers may interpret pages differently from their actual content
type.

I tried to work on other file types that were also reported but it's complicated
adn I believe it's not worth it
2020-03-20 10:51:49 +01:00
Dennis Balkir 2895da2220 Implemented: _WARNING_MESSAGE_
(OFBIZ-10587)

Added warning message as a message type, by adding it in the
messages.ftl and the request-handler

Thanks to Niklas Fallik for reporting
2020-03-15 11:23:33 +01:00
Michael Brohl bb698b9b96 Implemented: Remove the user login security question.
(OFBIZ-11244)

Thanks Wiebke Pätzold for providing the patch.
2020-03-13 17:31:49 +01:00
Dennis Balkir d83bec22d8 Fixed: Potential Nullpointer in ErrorPage.ftl
(OFBIZ-11448)

Inserted nullcheck for request-attribute
2020-03-10 15:59:57 +01:00
Jacques Le Roux c34491892a Improved:
Implemented:
Documented:
Completed:
Reverted:
Fixed:
Improved: no functional change
(OFBIZ-)
Explanation
Thanks:
2020-02-27 14:36:26 +01:00
Nicolas Malin d8641bce8c Fixed: Correct FoFormMacro to support form list with non separate fields
(OFBIZ-11335)

Related to issue OFBIZ-11335 when a form list haven't the attribute separate-column to true,
the screen engine failed to rendering it through screen-fop due to a block present on table-row without table-cell.

We have in log some line like :
    ScreenFopViewHandler |E| Unable to transform FO file: org.apache.fop.apps.FOPException: javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: null:150:2: "fo:block" is not a valid child of "fo:table-row"!

Simple fix is to open and close a table-cell when renderFormatHeaderRowFormCell[Open/Close] and renderFormatItemRowFormCell[Open/Close] are called.
2020-02-20 14:13:57 +01:00
Jacques Le Roux 7d7a441715 Fixed: Any ecommerce user has the ability to reset anothers password
(including admin) via "Forget Your Password"
(OFBIZ-4361)

Currently, any user (via ecommerce "Forget Your Password") has the ability to 
reset another users password, including "admin" without permission.  
By simply entering "admin" and clicking "Email Password", the following is 
displayed:

The following occurred:
A new password has been created and sent to you. Please check your Email.

This now forces the user of the ERP to change their password.  
It is also possible to generate a dictionary attack against ofbiz because there 
is no capta code required.  This is serious security risk.

I have modified the patch following comments I made in the Jira, notably
  Removed unused Java variables
  Removed a check in LoginEvents::forgotPassword which prevented to show error
    messages
  Changed fr and en SecurityExtPasswordSentToYou 
    + SecurityExtThisEmailIsInResponseToYourRequestToHave labels 
    + template PasswordEmail.ftl
    + loginservices.token_incorrect labels
  Added fr and en SecurityExtIgnoreEmail + SecurityExtLinkOnce labels
  Removed changes in general.properties
  I did not remove the 2 GetSecurityQuestion.ftl files (webpos one was still in)

There is still room for improvement. I'll discuss them on the Jira and dev
ML. But this version is already strong enough to not wait that the patch is 
inapplicable!

Thanks: mz4wheeler (Mike Z) for the Jira, Nicolas Malin for the patch, I guess 
with some Gil's help, and all others for comments and ideas

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866478 13f79535-47bb-0310-9956-ffa450edef68
2019-09-05 15:56:46 +00:00