While attempting to help someone using the Spanish language pack, I came across an interesting situation.
The matter at hand is that "closed" opportunities continue to display in the Opportunities listing. Upon inspection of the code in ListView.php and ListViewTop.php, I noticed that the where clause of the SQL select statement specifically omits Opportunities with the English terms 'Closed Won' and 'Closed Lost.' This works fine as long as you are using those terms for 'Closed' opportunities, but you wouldn't be if you were using a different language.
Unless I've overlooked something (please help point me in the right direction if so), it seems as though I would need to modify the WHERE clause code in ListView.php and ListViewTop.php to the 'Closed' equivalent in Spanish in order to get it to behave properly.
This, however, seems rather restrictive, since now users utilizing the English lang pack against the same Sugar database will malfunction.
I would propose that rather than using the literal terms for determining if an opportunity is closed, Sugar's internals should be modified so as to include a value of 1 or 0 for each opportunity which in turn translates to whether or not the opportunity is open. Secondly, an array of values that would equal to 1 (closed) should be defined within the lang.php file. Lastly, the ListView.php and ListViewTop.php WHERE clauses should exclude those with a value of '0.'
If I overlooked something that would solve the problem, I'd appreciate some input, in which case, disregard my proposal above.


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks