Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0027065
TypeCategorySeverityReproducibilityDate SubmittedLast Update
feature request[Openbravo ERP] A. Platformminoralways2014-07-14 14:402014-08-08 18:53
ReporterdbazView Statuspublic 
Assigned Todbaz 
PriorityhighResolutionfixedFixed in Version3.0PR14Q4
StatusclosedFix in branchFixed in SCM revisiona0de2cc4d7b5
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0027065: new Function('return isc.' ...)() could be simplified

DescriptionThere are so many times where we want the Smartclient property of a canvas item, but we don't have the canvas object but the string of its name.

In these cases things like this:

  new Function('return isc.' + this.editorType + '.getPrototype().showTime')()

or

  new Function('return isc.' + this.editorType + '.getInstanceProperty("showTime")')()

are performed to obtain a particular attribute value. This is done to avoid the "eval" function.


It is not intended to use the new function in all places where getProperty or getInstanceProperty be called, just in those places where the "new Function(...)()" is needed.
Steps To Reproduce.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0068619)
dbaz (developer)
2014-07-14 14:42

OB.Utilities.getCanvasProp(this.editorType, 'showTime');

will be the new function. It also will check that the canvas exists before trying to obtain the attribute value.
(0068620)
hgbot (developer)
2014-07-14 14:53

Repository: erp/devel/pi
Changeset: a0de2cc4d7b50e4e5f4f737751358fd2f1e3e9d9
Author: David Baz Fayos <david.baz <at> openbravo.com>
Date: Mon Jul 14 14:53:07 2014 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a0de2cc4d7b50e4e5f4f737751358fd2f1e3e9d9 [^]

Fixed issue 27065: Added 'OB.Utilities.getCanvasProp' function
to avoid new Function('return isc....getPrototype()....')() solutions

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-grid.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
---
(0068766)
alostale (manager)
2014-07-21 15:03

code reviewed + tested
(0069156)
hudsonbot (developer)
2014-08-08 18:53

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/4450016dee64 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2014-07-14 14:40 dbaz New Issue
2014-07-14 14:40 dbaz Assigned To => dbaz
2014-07-14 14:40 dbaz Modules => Core
2014-07-14 14:40 dbaz Triggers an Emergency Pack => No
2014-07-14 14:41 dbaz Review Assigned To => alostale
2014-07-14 14:42 dbaz Note Added: 0068619
2014-07-14 14:53 hgbot Checkin
2014-07-14 14:53 hgbot Note Added: 0068620
2014-07-14 14:53 hgbot Status new => resolved
2014-07-14 14:53 hgbot Resolution open => fixed
2014-07-14 14:53 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/a0de2cc4d7b50e4e5f4f737751358fd2f1e3e9d9 [^]
2014-07-21 15:03 alostale Note Added: 0068766
2014-07-21 15:03 alostale Status resolved => closed
2014-07-21 15:03 alostale Fixed in Version => 3.0PR14Q4
2014-08-08 18:53 hudsonbot Checkin
2014-08-08 18:53 hudsonbot Note Added: 0069156


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker