Skip to content
This repository
Browse code

Release 6.2.2

  • Loading branch information...
commit 6c40867e742ca2392fbc14e1bcfd4ca412518695 1 parent 68b9a68
John Mertic jmertic authored

Showing 2,583 changed files with 26,823 additions and 2,951 deletions. Show diff stats Hide diff stats

  1. +0 1  README
  2. +3 1 cron.php
  3. +0 5 custom/.gitignore
  4. +9 4 data/SugarBean.php
  5. +2,497 1,294 files.md5
  6. +1 1  include/Dashlets/DashletGenericDisplay.tpl
  7. +0 44 include/JSON.js
  8. +10 15 include/JSON.php
  9. +1 1  include/ListView/ListViewDCMenu.tpl
  10. +1 1  include/ListView/ListViewGeneric.tpl
  11. +1 1  include/ListView/ListViewNoMassUpdate.tpl
  12. +1 1  include/MVC/SugarApplication.php
  13. +3 11 include/MVC/View/SugarView.php
  14. +1 0  include/MVC/View/views/view.popup.php
  15. +6 4 include/MySugar/javascript/MySugar.js
  16. +0 1  include/MySugar/tpls/MySugar.tpl
  17. +1 13 include/Popups/tpls/footer.tpl
  18. +2 4 include/Popups/tpls/header.tpl
  19. +31 3 include/QuickSearchDefaults.php
  20. +2 2 include/SearchForm/SearchForm.php
  21. +2 2 include/SearchForm/SearchForm2.php
  22. +3 3 include/Smarty/plugins/function.sugar_button.php
  23. +4 4 include/SubPanel/SubPanelDefinitions.php
  24. +1 1  include/SubPanel/SubPanelTiles.js
  25. +1 1  include/SugarCharts/Jit/FlashCanvas/canvas2png.js
  26. +1 1  include/SugarCharts/Jit/FlashCanvas/flashcanvas.js
  27. +82 82 include/SugarCharts/Jit/js/Jit/jit.js
  28. +1 1  include/SugarCharts/Jit/js/mySugarCharts.js
  29. +1 1  include/SugarCharts/Jit/js/sugarCharts.js
  30. +1 1  include/SugarDependentDropdown/javascript/SugarDependentDropdown.js
  31. +1 1  include/SugarEmailAddress/SugarEmailAddress.js
  32. +1 1  include/SugarFields/Fields/Address/SugarFieldAddress.js
  33. +0 1  include/SugarFields/Fields/Collection/CollectionEditView.tpl
  34. +0 1  include/SugarFields/Fields/Collection/DetailView.tpl
  35. +0 1  include/SugarFields/Fields/Collection/EditView.tpl
  36. +3 3 include/SugarFields/Fields/Collection/SugarFieldCollection.js
  37. +7 4 include/SugarFields/Fields/Collection/ViewSugarFieldCollection.php
  38. +1 1  include/SugarFields/Fields/Datetimecombo/Datetimecombo.js
  39. +2 2 include/SugarFields/Fields/File/SugarFieldFile.js
  40. +2 2 include/SugarFields/Fields/Relate/EditView.tpl
  41. +14 3 include/SugarFields/Fields/Relate/SugarFieldRelate.php
  42. +0 2  include/SugarObjects/templates/file/metadata/editviewdefs.php
  43. +0 2  include/SugarObjects/templates/file/metadata/quickcreatedefs.php
  44. +1 0  include/SugarObjects/templates/person/Person.php
  45. +8 1 include/SugarTinyMCE.php
  46. +38 8 include/Sugarpdf/Sugarpdf.php
  47. +21 14 include/TemplateHandler/TemplateHandler.php
  48. +69 69 include/VarDefHandler/vardef_meta_arrays.php
  49. +1 1  include/connectors/formatters/default/company_detail.js
  50. +5 2 include/database/MssqlManager.php
  51. +1 1  include/generic/SugarWidgets/SugarWidgetFieldcurrency.php
  52. +0 59 include/generic/SugarWidgets/SugarWidgetFielddatetimecombo.php
  53. +7 1 include/generic/SugarWidgets/SugarWidgetSubPanelTopButtonQuickCreate.php
  54. +1 3 include/generic/SugarWidgets/SugarWidgetSubPanelTopScheduleMeetingButton.php
  55. +4 3 include/javascript/calendar.js
  56. +1 1  include/javascript/cookie.js
  57. +1 1  include/javascript/dashlets.js
  58. +4 4 include/javascript/getYUIComboFile.php
  59. +1 1  include/javascript/include.js
  60. +8 8 include/javascript/iscroll.js
  61. +12 20 include/javascript/jsclass_async.js
  62. +14 102 include/javascript/jsclass_base.js
  63. +1 1  include/javascript/menu.js
  64. +2 2 include/javascript/overlibmws.js
  65. +1 1  include/javascript/overlibmws_iframe.js
  66. +2 1  include/javascript/popup_helper.js
  67. +1 1  include/javascript/popup_parent_helper.js
  68. +1 1  include/javascript/quickCompose.js
  69. +1 1  include/javascript/quicksearch.js
  70. +6 6 include/javascript/report_additionals.js
  71. +16 14 include/javascript/sugar_3.js
  72. +1 1  include/javascript/sugar_connection_event_listener.js
  73. +36 28 include/javascript/sugar_grp1.js
  74. +373 265 include/javascript/sugar_grp1_yui.js
  75. +631 594 include/javascript/sugar_grp_emails.js
  76. +5 3 include/javascript/sugar_grp_overlib.js
  77. +112 85 include/javascript/sugar_grp_quickcomp.js
  78. +23 23 include/javascript/sugar_grp_yui2.js
  79. +25 25 include/javascript/sugar_grp_yui_widgets.css
  80. +119 69 include/javascript/sugar_grp_yui_widgets.js
  81. +42 0 include/javascript/sugar_yui_overrides.js
  82. +1 1  include/javascript/sugarwidgets/SugarYUILoader.js
  83. +2 1  include/javascript/sugarwidgets/SugarYUIWidgets.js
  84. +1 1  include/javascript/swfobject.js
  85. +305 0 include/javascript/tiny_mce/classes/AddOnManager.js
  86. +519 0 include/javascript/tiny_mce/classes/ControlManager.js
  87. +3,295 0 include/javascript/tiny_mce/classes/Editor.js
  88. +573 0 include/javascript/tiny_mce/classes/EditorCommands.js
  89. +503 0 include/javascript/tiny_mce/classes/EditorManager.js
  90. +720 0 include/javascript/tiny_mce/classes/ForceBlocks.js
  91. +1,704 0 include/javascript/tiny_mce/classes/Formatter.js
  92. +66 0 include/javascript/tiny_mce/classes/LegacyInput.js
  93. +456 0 include/javascript/tiny_mce/classes/Popup.js
  94. +198 0 include/javascript/tiny_mce/classes/UndoManager.js
  95. +231 0 include/javascript/tiny_mce/classes/WindowManager.js
  96. +336 0 include/javascript/tiny_mce/classes/adapter/jquery/adapter.js
  97. +336 0 include/javascript/tiny_mce/classes/adapter/jquery/jquery.tinymce.js
  98. +39 0 include/javascript/tiny_mce/classes/adapter/prototype/adapter.js
  99. +1,864 0 include/javascript/tiny_mce/classes/dom/DOMUtils.js
  100. +195 0 include/javascript/tiny_mce/classes/dom/Element.js
  101. +381 0 include/javascript/tiny_mce/classes/dom/EventUtils.js
  102. +687 0 include/javascript/tiny_mce/classes/dom/Range.js
  103. +228 0 include/javascript/tiny_mce/classes/dom/RangeUtils.js
  104. +285 0 include/javascript/tiny_mce/classes/dom/ScriptLoader.js
  105. +1,003 0 include/javascript/tiny_mce/classes/dom/Selection.js
  106. +379 0 include/javascript/tiny_mce/classes/dom/Serializer.js
  107. +1,072 0 include/javascript/tiny_mce/classes/dom/Sizzle.js
  108. +64 0 include/javascript/tiny_mce/classes/dom/TreeWalker.js
  109. +240 0 include/javascript/tiny_mce/classes/dom/TridentSelection.js
  110. +30 0 include/javascript/tiny_mce/classes/firebug/FIREBUG.LICENSE
  111. +2,518 0 include/javascript/tiny_mce/classes/firebug/firebug-lite.js
  112. +537 0 include/javascript/tiny_mce/classes/html/DomParser.js
  113. +253 0 include/javascript/tiny_mce/classes/html/Entities.js
  114. +463 0 include/javascript/tiny_mce/classes/html/Node.js
  115. +335 0 include/javascript/tiny_mce/classes/html/SaxParser.js
  116. +639 0 include/javascript/tiny_mce/classes/html/Schema.js
  117. +152 0 include/javascript/tiny_mce/classes/html/Serializer.js
  118. +279 0 include/javascript/tiny_mce/classes/html/Styles.js
  119. +186 0 include/javascript/tiny_mce/classes/html/Writer.js
  120. +833 0 include/javascript/tiny_mce/classes/tinymce.js
  121. +74 0 include/javascript/tiny_mce/classes/ui/Button.js
  122. +284 0 include/javascript/tiny_mce/classes/ui/ColorSplitButton.js
  123. +66 0 include/javascript/tiny_mce/classes/ui/Container.js
  124. +198 0 include/javascript/tiny_mce/classes/ui/Control.js
Sorry, we could not display the entire diff because too many files (2,583) changed.
1  README
... ... @@ -1 +0,0 @@
1   -This repository represents the Sugar CE source code from the latest stable version of SugarCRM. Check out the SugarCRM Dev wiki at https://github.com/sugarcrm/sugarcrm_dev/wiki for more details on how to fork this repository and submit pull requests to SugarCRM.
4 cron.php
@@ -93,7 +93,9 @@
93 93 ///////////////////////////////////////////////////////////////////////////////
94 94 //// EXECUTE IF VALID TIME (NOT DDOS)
95 95
96   -if($timestamp[0] < strtotime(date('H:i'))) {
  96 +// mjamil | bug # 45229 - schedulers not able to run due to current time being equal to
  97 +// $timestamp[0]
  98 +if($timestamp[0] <= strtotime(date('H:i'))) {
97 99 if(is_writable($cachePath.'/'.$pid)) {
98 100 write_array_to_file('timestamp', array(strtotime(date('H:i'))) , $cachePath.'/'.$pid);
99 101 require('modules/Schedulers/Scheduler.php');
5 custom/.gitignore
... ... @@ -1,5 +0,0 @@
1   -*.ext.php
2   -*MetaData.php
3   -history/**
4   -modulebuilder/**
5   -working/**
13 data/SugarBean.php
@@ -1770,8 +1770,9 @@ function save_relationship_changes($is_update, $exclude=array())
1770 1770 {
1771 1771 $new_rel_id = false;
1772 1772 $new_rel_link = false;
  1773 +
1773 1774 //this allows us to dynamically relate modules without adding it to the relationship_fields array
1774   - if(!empty($_REQUEST['relate_id']) && !in_array($_REQUEST['relate_to'], $exclude) && $_REQUEST['relate_id'] != $this->id){
  1775 + if(!empty($_REQUEST['relate_id']) && !empty($_REQUEST['relate_to']) && !in_array($_REQUEST['relate_to'], $exclude) && $_REQUEST['relate_id'] != $this->id){
1775 1776 $new_rel_id = $_REQUEST['relate_id'];
1776 1777 $new_rel_relname = $_REQUEST['relate_to'];
1777 1778 if(!empty($this->in_workflow) && !empty($this->not_use_rel_in_req)) {
@@ -1787,6 +1788,7 @@ function save_relationship_changes($is_update, $exclude=array())
1787 1788 }
1788 1789 }
1789 1790 }
  1791 +
1790 1792
1791 1793 // First we handle the preset fields listed in the fixed relationship_fields array hardcoded into the OOB beans
1792 1794 // TODO: remove this mechanism and replace with mechanism exclusively based on the vardefs
@@ -3954,6 +3956,7 @@ function process_union_list_query($parent_bean, $query,
3954 3956 if(!empty($sugar_config['disable_count_query']) && !empty($limit))
3955 3957 {
3956 3958 $rows_found = $row_offset + count($list);
  3959 +
3957 3960 if(count($list) >= $limit)
3958 3961 {
3959 3962 array_pop($list);
@@ -4312,8 +4315,9 @@ function mark_deleted($id)
4312 4315 $this->modified_user_id = 1;
4313 4316 }
4314 4317 $query = "UPDATE $this->table_name set deleted=1 , date_modified = '$date_modified', modified_user_id = '$this->modified_user_id' where id='$id'";
4315   - } else
  4318 + } else {
4316 4319 $query = "UPDATE $this->table_name set deleted=1 , date_modified = '$date_modified' where id='$id'";
  4320 + }
4317 4321 $this->db->query($query, true,"Error marking record deleted: ");
4318 4322 $this->deleted = 1;
4319 4323 $this->mark_relationships_deleted($id);
@@ -5335,8 +5339,9 @@ private function _checkOptimisticLocking($action, $isUpdate){
5335 5339 * Send assignment notifications and invites for meetings and calls
5336 5340 */
5337 5341 private function _sendNotifications($check_notify){
5338   - if($check_notify || (isset($this->notify_inworkflow) && $this->notify_inworkflow == true)){ // cn: bug 5795 - no invites sent to Contacts, and also bug 25995, in workflow, it will set the notify_on_save=true.
5339   -
  5342 + if($check_notify || (isset($this->notify_inworkflow) && $this->notify_inworkflow == true) // cn: bug 5795 - no invites sent to Contacts, and also bug 25995, in workflow, it will set the notify_on_save=true.
  5343 + && !$this->isOwner($this->created_by) ) // cn: bug 42727 no need to send email to owner (within workflow)
  5344 + {
5340 5345 $admin = new Administration();
5341 5346 $admin->retrieveSettings();
5342 5347 $sendNotifications = false;
3,791 files.md5
2,497 additions, 1,294 deletions not shown
2  include/Dashlets/DashletGenericDisplay.tpl
@@ -173,7 +173,7 @@
173 173 {if !empty($quickViewLinks)}
174 174 <td width='1%' class='{$_rowColor}S1' bgcolor='{$_bgColor}' nowrap>
175 175 {if $pageData.access.edit}
176   - <a title='{$editLinkString}' href='index.php?action=EditView&module={$pageData.bean.moduleDir}&record={$rowData.ID}&offset={$pageData.offsets.current+$smarty.foreach.rowIteration.iteration}&stamp={$pageData.stamp}&return_module=Home&return_action=index'><img border="0" src="{sugar_getimagepath file="edit_inline.png"}"></a>
  176 + <a title='{$editLinkString}' id="dashedit-{$rowData.ID}" href='index.php?action=EditView&module={$pageData.bean.moduleDir}&record={$rowData.ID}&offset={$pageData.offsets.current+$smarty.foreach.rowIteration.iteration}&stamp={$pageData.stamp}&return_module=Home&return_action=index'><img border="0" src="{sugar_getimagepath file="edit_inline.png"}"></a>
177 177 {/if}
178 178 {if $pageData.access.view}
179 179 <a title='{$viewLinkString}' href='index.php?action=DetailView&module={$pageData.bean.moduleDir}&record={$rowData.ID}&offset={$pageData.offsets.current+$smarty.foreach.rowIteration.iteration}&stamp={$pageData.stamp}&return_module=Home&return_action=index'><img border="0" src="{sugar_getimagepath file="view_inline.png"}"></a>
44 include/JSON.js
... ... @@ -1,44 +0,0 @@
1   -/*
2   - Copyright (c) 2005 JSON.org
3   -
4   - Permission is hereby granted, free of charge, to any person obtaining a copy
5   - of this software and associated documentation files (the "Software"), to deal
6   - in the Software without restriction, including without limitation the rights
7   - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8   - copies of the Software, and to permit persons to whom the Software is
9   - furnished to do so, subject to the following conditions:
10   -
11   - The Software shall be used for Good, not Evil.
12   -
13   - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14   - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15   - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16   - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17   - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18   - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19   - SOFTWARE.
20   -
21   - json.js
22   -
23   - The global object JSON contains two methods.
24   -
25   - JSON.stringify(value) takes a JavaScript value and produces a JSON text.
26   - The value must not be cyclical.
27   -
28   - JSON.parse(text) takes a JSON text and produces a JavaScript value. It will
29   - return false if there is an error.
30   -
31   - 2008-10-10: New regular expressions copied in from the new json2.js file on http://json.org (released into the public domain), work better on Safari and IE for more complicated datasets
32   - */
33   -var JSON=function(){var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},s={array:function(x){var a=['['],b,f,i,l=x.length,v;for(i=0;i<l;i+=1){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=='string'){if(b){a[a.length]=',';}
34   -a[a.length]=v;b=true;}}}
35   -a[a.length]=']';return a.join('');},'boolean':function(x){return String(x);},'null':function(x){return"null";},number:function(x){return isFinite(x)?String(x):'null';},object:function(x){if(x){if(x instanceof Array){return s.array(x);}
36   -var a=['{'],b,f,i,v;for(i in x){if(!x.hasOwnProperty||x.hasOwnProperty(i)){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=='string'){if(b){a[a.length]=',';}
37   -a.push(s.string(i),':',v);b=true;}}}}
38   -a[a.length]='}';return a.join('');}
39   -return'null';},string:function(x){var unicode=new String;for(var i=0;i<x.length;i++){var temp=x.charCodeAt(i).toString(16);while(temp.length<4){temp="0"+temp;}
40   -unicode+='\\u'+temp;}
41   -return'"'+unicode+'"';}};return{stringify:function(v){var f=s[typeof v];if(f){v=f(v);if(typeof v==='string'){var securityEnvelope='{"asynchronous_key": "'+asynchronous_key+'", "jsonObject": '+v+'}';return securityEnvelope;}}
42   -return;},destringify:function(str){},stringifyNoSecurity:function(v){var f=s[typeof v];if(f){v=f(v);if(typeof v==='string'){return v;}}
43   -return;},destringify:function(str){},parse:function(text){text=text.replace(/^\s*|\s*$/,'');if(text.substr){if(text.substr(0,11)=="while(1);/*"){text=text.substr(11);text=text.substr(0,(text.length-2));}}
44   -try{if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){return eval('('+text+')');}else{return false;}}catch(e){return false;}},parseNoSecurity:function(text){try{if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){return eval('('+text+')');}else{return false;}}catch(e){return false;}}};}();
25 include/JSON.php
@@ -44,6 +44,14 @@
44 44 * Contributor(s): ______________________________________..
45 45 ********************************************************************************/
46 46
  47 +/**
  48 + * This class used to perform json encode / decode functions but has now been replaced by
  49 + * the built in php.
  50 + *
  51 + * Note: We no longer eval our json so there is no more need for security envelopes. The parameter
  52 + * has been left for backwards compatibility.
  53 + */
  54 +
47 55 class JSON
48 56 {
49 57
@@ -52,16 +60,12 @@ class JSON
52 60 *
53 61 * @param string $string
54 62 * @param bool $addSecurityEnvelope defaults to false
  63 + * @param bool $encodeSpecial
55 64 * @return string
56 65 */
57 66 public static function encode($string, $addSecurityEnvelope = false, $encodeSpecial = false)
58 67 {
59 68 $encodedString = json_encode($string);
60   -
61   - if($addSecurityEnvelope) {
62   - $encodedString = "while(1);/*" . $encodedString . "*/";
63   - }
64   -
65 69
66 70 if ($encodeSpecial)
67 71 {
@@ -80,20 +84,11 @@ public static function encode($string, $addSecurityEnvelope = false, $encodeSpec
80 84 *
81 85 * @param string $string
82 86 * @param bool $examineEnvelope Default false, true to extract and verify envelope
  87 + * @param bool $assoc
83 88 * @return string
84 89 */
85 90 public static function decode($string, $examineEnvelope=false, $assoc = true)
86 91 {
87   - if ($examineEnvelope) {
88   - $meta = json_decode($string,true);
89   - if($meta['asychronous_key'] != $_SESSION['asychronous_key']) {
90   - $GLOBALS['log']->fatal("*** SECURITY: received asynchronous call with invalid ['asychronous_key'] value. Possible CSRF attack.");
91   - return '';
92   - }
93   -
94   - return $meta['jsonObject'];
95   - }
96   -
97 92 return json_decode($string,$assoc);
98 93 }
99 94
2  include/ListView/ListViewDCMenu.tpl
@@ -154,7 +154,7 @@ YAHOO.util.Connect.asyncRequest('POST', 'index.php', callback, "module=Meetings&
154 154 <td>{$rowData.star}</td>
155 155 {/if}
156 156 {if !empty($quickViewLinks)}
157   - <td width='2%' nowrap>{if $pageData.access.edit}<a title='{$editLinkString}' href="index.php?action=EditView&module={if $params.dynamic_module}{$rowData[$params.dynamic_module]}{else}{$pageData.bean.moduleDir}{/if}&record={$rowData[$params.parent_id]|default:$rowData.ID}&offset={$pageData.offsets.current+$smarty.foreach.rowIteration.iteration}&stamp={$pageData.stamp}&return_module=Home&return_action=index"><img border=0 src='{sugar_getimagepath file='edit_inline.gif'}'></a>{/if}</td>
  157 + <td width='2%' nowrap>{if $pageData.access.edit}<a title='{$editLinkString}' id="dashedit-{$rowData.ID}" href="index.php?action=EditView&module={if $params.dynamic_module}{$rowData[$params.dynamic_module]}{else}{$pageData.bean.moduleDir}{/if}&record={$rowData[$params.parent_id]|default:$rowData.ID}&offset={$pageData.offsets.current+$smarty.foreach.rowIteration.iteration}&stamp={$pageData.stamp}&return_module=Home&return_action=index"><img border=0 src='{sugar_getimagepath file='edit_inline.gif'}'></a>{/if}</td>
158 158 {/if}
159 159 {counter start=0 name="colCounter" print=false assign="colCounter"}
160 160 {foreach from=$displayColumns key=col item=params}
2  include/ListView/ListViewGeneric.tpl
@@ -123,7 +123,7 @@
123 123 </td>
124 124 {/if}
125 125 {if !empty($quickViewLinks)}
126   - <td width='2%' nowrap>{if $pageData.rowAccess[$id].edit}<a title='{$editLinkString}' href="#" onMouseOver="javascript:lvg_nav('{if $params.dynamic_module}{$rowData[$params.dynamic_module]}{else}{$pageData.bean.moduleDir}{/if}', '{$rowData.ID}', {if $act}'{$act}'{else}'e'{/if}, {$offset}, this)" onFocus="javascript:lvg_nav('{if $params.dynamic_module}{$rowData[$params.dynamic_module]}{else}{$pageData.bean.moduleDir}{/if}', '{$rowData.ID}', {if $act}'{$act}'{else}'e'{/if}, {$offset}, this)"><img border=0 src='{sugar_getimagepath file='edit_inline.gif'}'></a>{/if}</td>
  126 + <td width='2%' nowrap>{if $pageData.rowAccess[$id].edit}<a title='{$editLinkString}' id="edit-{$rowData.ID}" href="#" onMouseOver="javascript:lvg_nav('{if $params.dynamic_module}{$rowData[$params.dynamic_module]}{else}{$pageData.bean.moduleDir}{/if}', '{$rowData.ID}', {if $act}'{$act}'{else}'e'{/if}, {$offset}, this)" onFocus="javascript:lvg_nav('{if $params.dynamic_module}{$rowData[$params.dynamic_module]}{else}{$pageData.bean.moduleDir}{/if}', '{$rowData.ID}', {if $act}'{$act}'{else}'e'{/if}, {$offset}, this)"><img border=0 src='{sugar_getimagepath file='edit_inline.gif'}'></a>{/if}</td>
127 127 {/if}
128 128 {counter start=0 name="colCounter" print=false assign="colCounter"}
129 129 {foreach from=$displayColumns key=col item=params}
2  include/ListView/ListViewNoMassUpdate.tpl
@@ -90,7 +90,7 @@
90 90 {if !empty($quickViewLinks)}
91 91 <td width='1%' nowrap>
92 92 {if $pageData.access.edit && $pageData.bean.moduleDir != "Employees"}
93   - <a title='{$editLinkString}' href='index.php?action=EditView&module={$pageData.bean.moduleDir}&record={$rowData.ID}&offset={$pageData.offsets.current+$smarty.foreach.rowIteration.iteration}&stamp={$pageData.stamp}&return_module={$pageData.bean.moduleDir}'><img border="0" src="{sugar_getimagepath file="edit_inline.gif"}"></a>
  93 + <a title='{$editLinkString}' id="edit-{$rowData.ID}" href='index.php?action=EditView&module={$pageData.bean.moduleDir}&record={$rowData.ID}&offset={$pageData.offsets.current+$smarty.foreach.rowIteration.iteration}&stamp={$pageData.stamp}&return_module={$pageData.bean.moduleDir}'><img border="0" src="{sugar_getimagepath file="edit_inline.gif"}"></a>
94 94 {/if}
95 95 </td>
96 96 {/if}
2  include/MVC/SugarApplication.php
@@ -510,7 +510,7 @@ protected function isModifyAction()
510 510 protected function checkHTTPReferer($dieIfInvalid = true)
511 511 {
512 512 global $sugar_config;
513   - $whiteListActions = (!empty($sugar_config['http_referer']['actions']))?$sugar_config['http_referer']['actions']:array('index', 'ListView', 'DetailView', 'EditView','oauth', 'Authenticate', 'Login');
  513 + $whiteListActions = (!empty($sugar_config['http_referer']['actions']))?$sugar_config['http_referer']['actions']:array('index', 'ListView', 'DetailView', 'EditView','oauth', 'Authenticate', 'Login', 'SupportPortal');
514 514
515 515 $strong = empty($sugar_config['http_referer']['weak']);
516 516
14 include/MVC/View/SugarView.php
@@ -717,13 +717,10 @@ protected function _displayJavascript()
717 717 if ( isset($sugar_config['quicksearch_querydelay']) ) {
718 718 echo "<script>SUGAR.config.quicksearch_querydelay = {$GLOBALS['sugar_config']['quicksearch_querydelay']};</script>";
719 719 }
720   - // cn: bug 12274 - prepare secret guid for asynchronous calls
721   - if (!isset($_SESSION['asynchronous_key']) || empty($_SESSION['asynchronous_key'])) {
722   - $_SESSION['asynchronous_key'] = create_guid();
723   - }
  720 +
724 721 $image_server = (defined('TEMPLATE_URL'))?TEMPLATE_URL . '/':'';
725   - echo '<script type="text/javascript">var asynchronous_key = "' . $_SESSION['asynchronous_key'] . '";SUGAR.themes.image_server="' . $image_server . '";</script>'; // cn: bug 12274 - create session-stored key to defend against CSRF
726   - echo '<script type="text/javascript"> var name_format = "' . $locale->getLocaleFormatMacro() . '";</script>';
  722 + echo '<script type="text/javascript">SUGAR.themes.image_server="' . $image_server . '";</script>'; // cn: bug 12274 - create session-stored key to defend against CSRF
  723 + echo '<script type="text/javascript">var name_format = "' . $locale->getLocaleFormatMacro() . '";</script>';
727 724 echo self::getJavascriptValidation();
728 725 if (!is_file($GLOBALS['sugar_config']['cache_dir'] . 'jsLanguage/' . $GLOBALS['current_language'] . '.js')) {
729 726 require_once ('include/language/jsLanguage.php');
@@ -737,12 +734,7 @@ protected function _displayJavascript()
737 734 echo '<script type="text/javascript" src="' . $GLOBALS['sugar_config']['cache_dir'] . 'jsLanguage/' . $this->module . '/' . $GLOBALS['current_language'] . '.js?s=' . $GLOBALS['js_version_key'] . '&c=' . $GLOBALS['sugar_config']['js_custom_version'] . '&j=' . $GLOBALS['sugar_config']['js_lang_version'] . '"></script>';
738 735 if(isset( $sugar_config['disc_client']) && $sugar_config['disc_client'])
739 736 echo '<script type="text/javascript" src="' . getJSPath('modules/Sync/headersync.js') . '"></script>';
740   - echo '<script src="' . getJSPath('include/javascript/yui3/build/yui/yui-min.js') . '" type="text/javascript"></script>';
741   - }
742 737
743   - if (isset($_REQUEST['popup']) && !empty($_REQUEST['popup'])) {
744   - // cn: bug 12274 - add security metadata envelope for async calls in popups
745   - echo '<script type="text/javascript">var asynchronous_key = "' . $_SESSION['asynchronous_key'] . '";</script>'; // cn: bug 12274 - create session-stored key to defend against CSRF
746 738 }
747 739 }
748 740
1  include/MVC/View/views/view.popup.php
@@ -47,6 +47,7 @@ function display(){
47 47 ACLController::displayNoAccess();
48 48 sugar_cleanup(true);
49 49 }
  50 +
50 51
51 52 if(isset($_REQUEST['metadata']) && strpos($_REQUEST['metadata'], "..") !== false)
52 53 die("Directory navigation attack denied.");
10 include/MySugar/javascript/MySugar.js
@@ -32,7 +32,7 @@
32 32 * technical reasons, the Appropriate Legal Notices must display the words
33 33 * "Powered by SugarCRM".
34 34 ********************************************************************************/
35   -SUGAR.mySugar=function(){var originalLayout=null;var configureDashletId=null;var currentDashlet=null;var leftColumnInnerHTML=null;var leftColObj=null;var maxCount;var warningLang;var activeTab=activePage;var current_user=current_user_id;var module=moduleName;var charts=new Object();if(module=='Dashboard'){cookiePageIndex=current_user+"_activeDashboardPage";}
  35 +SUGAR.mySugar=function(){var originalLayout=null;var configureDashletId=null;var currentDashlet=null;var leftColumnInnerHTML=null;var leftColObj=null;var maxCount;var warningLang;var closeDashletsDialogTimer=null;var activeTab=activePage;var current_user=current_user_id;var module=moduleName;var charts=new Object();if(module=='Dashboard'){cookiePageIndex=current_user+"_activeDashboardPage";}
36 36 else{cookiePageIndex=current_user+"_activePage";}
37 37 var homepage_dd;return{getLayout:function(asString){columns=new Array();for(je=0;je<3;je++){dashlets=document.getElementById('col_'+activeTab+'_'+je);if(dashlets!=null){dashletIds=new Array();for(wp=0;wp<dashlets.childNodes.length;wp++){if(typeof dashlets.childNodes[wp].id!='undefined'&&dashlets.childNodes[wp].id.match(/dashlet_[\w-]*/)){dashletIds.push(dashlets.childNodes[wp].id.replace(/dashlet_/,''));}}
38 38 if(asString)
@@ -63,12 +63,14 @@ if(type=='module'||type=='web'){url=null;type='module';}
63 63 else if(type=='predefined_chart'){url='predefined_chart';type='predefined_chart';}
64 64 else if(type=='chart'){url='chart';type='chart';}
65 65 SUGAR.mySugar.retrieveDashlet(data.responseText,url,finishRetrieve,true);}
66   -var cObj=YAHOO.util.Connect.asyncRequest('GET','index.php?to_pdf=1&module='+module+'&action=DynamicAction&DynamicAction=addDashlet&activeTab='+activeTab+'&id='+id+'&type='+type+'&type_module='+type_module,{success:success,failure:success},null);return false;},showDashletsDialog:function(){columns=SUGAR.mySugar.getLayout();var num_dashlets=0;var i=0;for(i=0;i<3;i++){if(typeof columns[i]!="undefined"){num_dashlets=num_dashlets+columns[i].length;}}
  66 +var cObj=YAHOO.util.Connect.asyncRequest('GET','index.php?to_pdf=1&module='+module+'&action=DynamicAction&DynamicAction=addDashlet&activeTab='+activeTab+'&id='+id+'&type='+type+'&type_module='+type_module,{success:success,failure:success},null);return false;},showDashletsDialog:function(){columns=SUGAR.mySugar.getLayout();if(this.closeDashletsDialogTimer!=null){window.clearTimeout(this.closeDashletsDialogTimer);}
  67 +var num_dashlets=0;var i=0;for(i=0;i<3;i++){if(typeof columns[i]!="undefined"){num_dashlets=num_dashlets+columns[i].length;}}
67 68 if((num_dashlets)>=SUGAR.mySugar.maxCount){alert(SUGAR.language.get('app_strings','LBL_MAX_DASHLETS_REACHED'));return;}
68 69 ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_LOADING'));var success=function(data){eval(data.responseText);dashletsListDiv=document.getElementById('dashletsList');dashletsListDiv.innerHTML=response['html'];document.getElementById('dashletsDialog_c').style.display='';SUGAR.mySugar.dashletsDialog.show();eval(response['script']);ajaxStatus.hideStatus();}
69   -var cObj=YAHOO.util.Connect.asyncRequest('GET','index.php?to_pdf=true&module='+module+'&action=DynamicAction&DynamicAction=dashletsDialog',{success:success,failure:success});return false;},closeDashletsDialog:function(){SUGAR.mySugar.dashletsDialog.hide();window.setTimeout("document.getElementById('dashletsDialog_c').style.display = 'none';",2000);},toggleDashletCategories:function(category){document.getElementById('search_string').value='';document.getElementById('searchResults').innerHTML='';var moduleTab=document.getElementById('moduleCategory');var moduleTabAnchor=document.getElementById('moduleCategoryAnchor');var moduleListDiv=document.getElementById('moduleDashlets');var chartTab=document.getElementById('chartCategory');var chartTabAnchor=document.getElementById('chartCategoryAnchor');var chartListDiv=document.getElementById('chartDashlets');var toolsTab=document.getElementById('toolsCategory');var toolsTabAnchor=document.getElementById('toolsCategoryAnchor');var toolsListDiv=document.getElementById('toolsDashlets');var webTab=document.getElementById('webCategory');var webTabAnchor=document.getElementById('webCategoryAnchor');var webListDiv=document.getElementById('webDashlets');switch(category){case'module':moduleTab.className='active';moduleTabAnchor.className='current';moduleListDiv.style.display='';chartTab.className='';chartTabAnchor.className='';chartListDiv.style.display='none';toolsTab.className='';toolsTabAnchor.className='';toolsListDiv.style.display='none';webTab.className='';webTabAnchor.className='';webListDiv.style.display='none';break;case'chart':moduleTab.className='';moduleTabAnchor.className='';moduleListDiv.style.display='none';chartTab.className='active';chartTabAnchor.className='current';chartListDiv.style.display='';toolsTab.className='';toolsTabAnchor.className='';toolsListDiv.style.display='none';webTab.className='';webTabAnchor.className='';webListDiv.style.display='none';break;case'tools':moduleTab.className='';moduleTabAnchor.className='';moduleListDiv.style.display='none';chartTab.className='';chartTabAnchor.className='';chartListDiv.style.display='none';toolsTab.className='active';toolsTabAnchor.className='current';toolsListDiv.style.display='';webTab.className='';webTabAnchor.className='';webListDiv.style.display='none';break;case'web':moduleTab.className='';moduleTabAnchor.className='';moduleListDiv.style.display='none';chartTab.className='';chartTabAnchor.className='';chartListDiv.style.display='none';toolsTab.className='';toolsTabAnchor.className='';toolsListDiv.style.display='none';webTab.className='active';webTabAnchor.className='current';webListDiv.style.display='';break;default:break;}
  70 +var cObj=YAHOO.util.Connect.asyncRequest('GET','index.php?to_pdf=true&module='+module+'&action=DynamicAction&DynamicAction=dashletsDialog',{success:success,failure:success});return false;},closeDashletsDialog:function(){SUGAR.mySugar.dashletsDialog.hide();if(this.closeDashletsDialogTimer!=null){window.clearTimeout(this.closeDashletsDialogTimer);}
  71 +this.closeDashletsDialogTimer=window.setTimeout("document.getElementById('dashletsDialog_c').style.display = 'none';",2000);},toggleDashletCategories:function(category){document.getElementById('search_string').value='';document.getElementById('searchResults').innerHTML='';var moduleTab=document.getElementById('moduleCategory');var moduleTabAnchor=document.getElementById('moduleCategoryAnchor');var moduleListDiv=document.getElementById('moduleDashlets');var chartTab=document.getElementById('chartCategory');var chartTabAnchor=document.getElementById('chartCategoryAnchor');var chartListDiv=document.getElementById('chartDashlets');var toolsTab=document.getElementById('toolsCategory');var toolsTabAnchor=document.getElementById('toolsCategoryAnchor');var toolsListDiv=document.getElementById('toolsDashlets');var webTab=document.getElementById('webCategory');var webTabAnchor=document.getElementById('webCategoryAnchor');var webListDiv=document.getElementById('webDashlets');switch(category){case'module':moduleTab.className='active';moduleTabAnchor.className='current';moduleListDiv.style.display='';chartTab.className='';chartTabAnchor.className='';chartListDiv.style.display='none';toolsTab.className='';toolsTabAnchor.className='';toolsListDiv.style.display='none';webTab.className='';webTabAnchor.className='';webListDiv.style.display='none';break;case'chart':moduleTab.className='';moduleTabAnchor.className='';moduleListDiv.style.display='none';chartTab.className='active';chartTabAnchor.className='current';chartListDiv.style.display='';toolsTab.className='';toolsTabAnchor.className='';toolsListDiv.style.display='none';webTab.className='';webTabAnchor.className='';webListDiv.style.display='none';break;case'tools':moduleTab.className='';moduleTabAnchor.className='';moduleListDiv.style.display='none';chartTab.className='';chartTabAnchor.className='';chartListDiv.style.display='none';toolsTab.className='active';toolsTabAnchor.className='current';toolsListDiv.style.display='';webTab.className='';webTabAnchor.className='';webListDiv.style.display='none';break;case'web':moduleTab.className='';moduleTabAnchor.className='';moduleListDiv.style.display='none';chartTab.className='';chartTabAnchor.className='';chartListDiv.style.display='none';toolsTab.className='';toolsTabAnchor.className='';toolsListDiv.style.display='none';webTab.className='active';webTabAnchor.className='current';webListDiv.style.display='';break;default:break;}
70 72 document.getElementById('search_category').value=category;},searchDashlets:function(searchStr,searchCategory){var moduleTab=document.getElementById('moduleCategory');var moduleTabAnchor=document.getElementById('moduleCategoryAnchor');var moduleListDiv=document.getElementById('moduleDashlets');var chartTab=document.getElementById('chartCategory');var chartTabAnchor=document.getElementById('chartCategoryAnchor');var chartListDiv=document.getElementById('chartDashlets');var toolsTab=document.getElementById('toolsCategory');var toolsTabAnchor=document.getElementById('toolsCategoryAnchor');var toolsListDiv=document.getElementById('toolsDashlets');if(moduleTab!=null&&chartTab!=null&&toolsTab!=null){moduleListDiv.style.display='none';chartListDiv.style.display='none';toolsListDiv.style.display='none';}
71 73 else{chartListDiv.style.display='none';}
72 74 var searchResultsDiv=document.getElementById('searchResults');searchResultsDiv.style.display='';var success=function(data){eval(data.responseText);searchResultsDiv.innerHTML=response['html'];}
73 75 var cObj=YAHOO.util.Connect.asyncRequest('GET','index.php?to_pdf=true&module='+module+'&action=DynamicAction&DynamicAction=searchDashlets&search='+searchStr+'&category='+searchCategory,{success:success,failure:success});return false;},collapseList:function(chartList){document.getElementById(chartList+'List').style.display='none';document.getElementById(chartList+'ExpCol').innerHTML='<a href="#" onClick="javascript:SUGAR.mySugar.expandList(\''+chartList+'\');"><img border="0" src="'+SUGAR.themes.image_server+'index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=advanced_search.gif" align="absmiddle" />';},expandList:function(chartList){document.getElementById(chartList+'List').style.display='';document.getElementById(chartList+'ExpCol').innerHTML='<a href="#" onClick="javascript:SUGAR.mySugar.collapseList(\''+chartList+'\');"><img border="0" src="'+SUGAR.themes.image_server+'index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=basic_search.gif" align="absmiddle" />';},collapseReportList:function(reportChartList){document.getElementById(reportChartList+'ReportsChartDashletsList').style.display='none';document.getElementById(reportChartList+'ExpCol').innerHTML='<a href="#" onClick="javascript:SUGAR.mySugar.expandReportList(\''+reportChartList+'\');"><img border="0" src="'+SUGAR.themes.image_server+'index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=ProjectPlus.gif" align="absmiddle" />';},expandReportList:function(reportChartList){document.getElementById(reportChartList+'ReportsChartDashletsList').style.display='';document.getElementById(reportChartList+'ExpCol').innerHTML='<a href="#" onClick="javascript:SUGAR.mySugar.collapseReportList(\''+reportChartList+'\');"><img border="0" src="'+SUGAR.themes.image_server+'index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=ProjectMinus.gif" align="absmiddle" />';},clearSearch:function(){document.getElementById('search_string').value='';var moduleTab=document.getElementById('moduleCategory');var moduleTabAnchor=document.getElementById('moduleCategoryAnchor');var moduleListDiv=document.getElementById('moduleDashlets');document.getElementById('searchResults').innerHTML='';if(moduleTab!=null){SUGAR.mySugar.toggleDashletCategories('module');}
74   -else{document.getElementById('searchResults').style.display='none';document.getElementById('chartDashlets').style.display='';}},doneAddDashlets:function(){SUGAR.mySugar.dashletsDialog.hide();return false;},renderDashletsDialog:function(){SUGAR.mySugar.dashletsDialog=new YAHOO.widget.Dialog("dashletsDialog",{width:"480px",height:"520px",fixedcenter:true,draggable:false,visible:false,modal:true,close:false});var listeners=new YAHOO.util.KeyListener(document,{keys:27},{fn:function(){SUGAR.mySugar.closeDashletsDialog();}});SUGAR.mySugar.dashletsDialog.cfg.queueProperty("keylisteners",listeners);document.getElementById('dashletsDialog').style.display='';SUGAR.mySugar.dashletsDialog.render();document.getElementById('dashletsDialog_c').style.display='none';}};}();
  76 +else{document.getElementById('searchResults').style.display='none';document.getElementById('chartDashlets').style.display='';}},doneAddDashlets:function(){SUGAR.mySugar.dashletsDialog.hide();return false;},renderDashletsDialog:function(){SUGAR.mySugar.dashletsDialog=new YAHOO.widget.Dialog("dashletsDialog",{width:"480px",height:"520px",fixedcenter:true,draggable:false,visible:false,modal:true,close:false});var listeners=new YAHOO.util.KeyListener(document,{keys:27},{fn:function(){SUGAR.mySugar.closeDashletsDialog();}});SUGAR.mySugar.dashletsDialog.cfg.queueProperty("keylisteners",listeners);document.getElementById('dashletsDialog').style.display='';SUGAR.mySugar.dashletsDialog.render();document.getElementById('dashletsDialog_c').style.display='none';}};}();
1  include/MySugar/tpls/MySugar.tpl
@@ -77,7 +77,6 @@ document.body.setAttribute("class", "yui-skin-sam");
77 77
78 78 <script type="text/javascript" src="{sugar_getjspath file='include/javascript/sugar_grp_yui_widgets.js'}"></script>
79 79 <script type="text/javascript" src="{sugar_getjspath file='include/javascript/dashlets.js'}"></script>
80   -<script type="text/javascript" src='{sugar_getjspath file='include/JSON.js'}'></script>
81 80 <script type='text/javascript' src='{sugar_getjspath file='include/MySugar/javascript/MySugar.js'}'></script>
82 81 <link rel='stylesheet' href='{sugar_getjspath file='include/ytree/TreeView/css/folders/tree.css'}'>
83 82
14 include/Popups/tpls/footer.tpl
@@ -37,16 +37,4 @@
6 include/Popups/tpls/header.tpl
@@ -36,8 +36,6 @@
36 36
37 37 *}
38 38 <script type="text/javascript" src="{sugar_getjspath file='include/javascript/sugar_3.js'}"></script>
39   -<script type="text/javascript" src="{sugar_getjspath file="jscalendar/lang/calendar-$lang.js"} . '"></script>
40   -<script type="text/javascript" src="{sugar_getjspath file='include/JSON.js'}"></script>
41 39 <script type="text/javascript" src="{sugar_getjspath file='include/javascript/popup_helper.js'}"></script>
42 40 <script type='text/javascript' src='{sugar_getjspath file='include/javascript/sugar_grp_overlib.js'}'></script>
43 41 <script type="text/javascript">
@@ -76,11 +74,11 @@ function clearAll() {
76 74 <input type="hidden" name="hide_clear_button" value="true" />
77 75 <input type="hidden" name="record_id" value="" />
78 76 {$MODE}
79   -<input type="submit" name="button" class="button"
  77 +<input type="submit" name="button" class="button" id="search_form_submit"
80 78 title="{$APP.LBL_SEARCH_BUTTON_TITLE}"
81 79 accessKey="{$APP.LBL_SEARCH_BUTTON_KEY}"
82 80 value="{$APP.LBL_SEARCH_BUTTON_LABEL}" />
83   -<input type="reset" onclick="SUGAR.searchForm.clear_form(this.form); return false;" class="button"
  81 +<input type="reset" onclick="SUGAR.searchForm.clear_form(this.form); return false;" class="button" id="search_form_clear"
84 82 title="{$APP.LBL_CLEAR_BUTTON_TITLE}"
85 83 accessKey="{$APP.LBL_CLEAR_BUTTON_KEY}"
86 84 value="{$APP.LBL_CLEAR_BUTTON_LABEL}"/>
34 include/QuickSearchDefaults.php
@@ -117,6 +117,35 @@ function getQSAccount($nameKey, $idKey, $billingKey = null, $shippingKey = null,
117 117 return $qsParent;
118 118 }
119 119
  120 + /**
  121 + * getQSContact
  122 + * This is a customized method to handle returning in JSON notation the QuickSearch formats
  123 + * for searching the Contacts module for a contact name. The method takes into account
  124 + * the locale settings (s = salutation, f = first name, l = last name) that are permissible.
  125 + * It should be noted though that any other characters present in the formatting will render
  126 + * this widget non-functional.
  127 + * @return The JSON format of a QuickSearch definition for the Contacts module
  128 + */
  129 + function getQSContact($name, $idName) {
  130 + global $app_strings, $locale;
  131 +
  132 + $qsContact = array('form' => $this->form_name,
  133 + 'method'=>'get_contact_array',
  134 + 'modules'=>array('Contacts'),
  135 + 'field_list' => array('salutation', 'first_name', 'last_name', 'id'),
  136 + 'populate_list' => array($name, $idName, $idName, $idName),
  137 + 'required_list' => array($idName),
  138 + 'group' => 'or',
  139 + 'conditions' => array(
  140 + array('name'=>'first_name', 'op'=>'like_custom','end'=>'%','value'=>''),
  141 + array('name'=>'last_name', 'op'=>'like_custom','end'=>'%','value'=>'')
  142 + ),
  143 + 'order'=>'last_name',
  144 + 'limit'=>'30',
  145 + 'no_match_text'=> $app_strings['ERR_SQS_NO_MATCH']);
  146 + return $qsContact;
  147 + }
  148 +
120 149 function getQSUser($p_name = 'assigned_user_name', $p_id ='assigned_user_id') {
121 150 global $app_strings;
122 151
@@ -150,8 +179,7 @@ function getQSCampaigns() {
150 179 // BEGIN QuickSearch functions for 4.5.x backwards compatibility support
151 180 function getQSScripts() {
152 181 global $sugar_version, $sugar_config, $theme;
153   - $qsScripts = '<script type="text/javascript" src="' . getJSPath('include/JSON.js') .'"></script>
154   - <script type="text/javascript">sqsWaitGif = "' . SugarThemeRegistry::current()->getImageURL('sqsWait.gif') . '";</script>
  182 + $qsScripts = '<script type="text/javascript">sqsWaitGif = "' . SugarThemeRegistry::current()->getImageURL('sqsWait.gif') . '";</script>
155 183 <script type="text/javascript" src="'. getJSPath('include/javascript/quicksearch.js') . '"></script>';
156 184 return $qsScripts;
157 185 }
@@ -168,4 +196,4 @@ function getQSScriptsJSONAlreadyDefined() {
168 196 // END QuickSearch functions for 4.5.x backwards compatibility support
169 197 }
170 198
171   -?>
  199 +?>
4 include/SearchForm/SearchForm.php
@@ -676,8 +676,8 @@ function getButtons() {
676 676 $SAVED_SEARCHES_OPTIONS = '';
677 677 $savedSearch = new SavedSearch();
678 678 $SAVED_SEARCHES_OPTIONS = $savedSearch->getSelect($this->module);
679   - $str = "<input tabindex='2' title='{$app_strings['LBL_SEARCH_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_SEARCH_BUTTON_KEY']}' onclick='SUGAR.savedViews.setChooser()' class='button' type='submit' name='button' value='{$app_strings['LBL_SEARCH_BUTTON_LABEL']}'/>&nbsp;";
680   - $str .= "<input tabindex='2' title='{$app_strings['LBL_CLEAR_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CLEAR_BUTTON_KEY']}' onclick='SUGAR.searchForm.clear_form(this.form); return false;' class='button' type='button' name='clear' value=' {$app_strings['LBL_CLEAR_BUTTON_LABEL']} '/>";
  679 + $str = "<input tabindex='2' title='{$app_strings['LBL_SEARCH_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_SEARCH_BUTTON_KEY']}' onclick='SUGAR.savedViews.setChooser()' class='button' type='submit' name='button' value='{$app_strings['LBL_SEARCH_BUTTON_LABEL']}' id='search_form_submit'/>&nbsp;";
  680 + $str .= "<input tabindex='2' title='{$app_strings['LBL_CLEAR_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CLEAR_BUTTON_KEY']}' onclick='SUGAR.searchForm.clear_form(this.form); return false;' class='button' type='button' name='clear' value=' {$app_strings['LBL_CLEAR_BUTTON_LABEL']} ' id='search_form_clear'/>";
681 681
682 682 if(!empty($SAVED_SEARCHES_OPTIONS) && $this->showSavedSearchOptions){
683 683 $str .= " <span class='white-space'>
4 include/SearchForm/SearchForm2.php
@@ -447,8 +447,8 @@ function populateFromArray(&$array, $switchVar = null, $addAllBeanFields = true)
447 447 }
448 448 }else if(!empty($array[$name]) && !$fromMergeRecords && !$this->isEmptyDropdownField($name, $array[$name])) { //basic
449 449 $this->searchFields[$name]['value'] = $array[$name];
450   - if(empty($this->fieldDefs[$name]['value'])) {
451   - $this->fieldDefs[$name]['value'] = $array[$name];
  450 + if(empty($this->fieldDefs[$long_name]['value'])) {
  451 + $this->fieldDefs[$long_name]['value'] = $array[$name];
452 452 }
453 453 }
454 454
6 include/Smarty/plugins/function.sugar_button.php
@@ -307,7 +307,7 @@ function smarty_function_sugar_button($params, &$smarty)
307 307 break;
308 308
309 309 case "DELETE":
310   - return '{if $bean->aclAccess("delete")}<input title="{$APP.LBL_DELETE_BUTTON_TITLE}" accessKey="{$APP.LBL_DELETE_BUTTON_KEY}" class="button" onclick="this.form.return_module.value=\'' . $module . '\'; this.form.return_action.value=\'ListView\'; this.form.action.value=\'Delete\'; return confirm(\'{$APP.NTC_DELETE_CONFIRMATION}\');" type="submit" name="Delete" value="{$APP.LBL_DELETE_BUTTON_LABEL}">{/if} ';
  310 + return '{if $bean->aclAccess("delete")}<input title="{$APP.LBL_DELETE_BUTTON_TITLE}" accessKey="{$APP.LBL_DELETE_BUTTON_KEY}" class="button" onclick="this.form.return_module.value=\'' . $module . '\'; this.form.return_action.value=\'ListView\'; this.form.action.value=\'Delete\'; return confirm(\'{$APP.NTC_DELETE_CONFIRMATION}\');" type="submit" name="Delete" value="{$APP.LBL_DELETE_BUTTON_LABEL}" id="delete_button">{/if} ';
311 311 break;
312 312
313 313 case "DUPLICATE":
@@ -319,7 +319,7 @@ function smarty_function_sugar_button($params, &$smarty)
319 319 break;
320 320
321 321 case "FIND_DUPLICATES":
322   - return '{if $bean->aclAccess("edit") && $bean->aclAccess("delete")}<input title="{$APP.LBL_DUP_MERGE}" accessKey="M" class="button" onclick="this.form.return_module.value=\'' . $module . '\'; this.form.return_action.value=\'DetailView\'; this.form.return_id.value=\'{$id}\'; this.form.action.value=\'Step1\'; this.form.module.value=\'MergeRecords\';" type="submit" name="Merge" value="{$APP.LBL_DUP_MERGE}">{/if} ';
  322 + return '{if $bean->aclAccess("edit") && $bean->aclAccess("delete")}<input title="{$APP.LBL_DUP_MERGE}" accessKey="M" class="button" onclick="this.form.return_module.value=\'' . $module . '\'; this.form.return_action.value=\'DetailView\'; this.form.return_id.value=\'{$id}\'; this.form.action.value=\'Step1\'; this.form.module.value=\'MergeRecords\';" type="submit" name="Merge" value="{$APP.LBL_DUP_MERGE}" id="merge_duplicate_button">{/if} ';
323 323 break;
324 324
325 325 case "SAVE":
@@ -369,7 +369,7 @@ function smarty_function_sugar_button($params, &$smarty)
369 369
370 370 require_once('include/SugarFields/Parsers/MetaParser.php');
371 371 $encoded_popup_request_data = MetaParser::parseDelimiters($json->encode($popup_request_data));
372   - $audit_link = '<input title="{$APP.LNK_VIEW_CHANGE_LOG}" class="button" onclick=\'open_popup("Audit", "600", "400", "&record={$fields.id.value}&module_name=' . $params['module'] . '", true, false, ' . $encoded_popup_request_data . '); return false;\' type="submit" value="{$APP.LNK_VIEW_CHANGE_LOG}">';
  372 + $audit_link = '<input id="btn_view_change_log" title="{$APP.LNK_VIEW_CHANGE_LOG}" class="button" onclick=\'open_popup("Audit", "600", "400", "&record={$fields.id.value}&module_name=' . $params['module'] . '", true, false, ' . $encoded_popup_request_data . '); return false;\' type="submit" value="{$APP.LNK_VIEW_CHANGE_LOG}">';
373 373 $view = '{if $bean->aclAccess("detail")}{if !empty($fields.id.value) && $isAuditEnabled}'.$audit_link.'{/if}{/if}';
374 374 return $view;
375 375
8 include/SubPanel/SubPanelDefinitions.php
@@ -163,7 +163,7 @@ function get_buttons ()
163 163 //only email is being tested becuase other submodules in activites/history such as notes, tasks, meetings and calls cannot be disabled.
164 164 //as of today these are the only 2 sub-panels that use the union clause.
165 165 $mod_name = $this->get_module_name () ;
166   - if ($mod_name == 'Activities' or $mod_name = 'History')
  166 + if ($mod_name == 'Activities' || $mod_name == 'History')
167 167 {
168 168 global $modListHeader ;
169 169 global $modules_exempt_from_availability_check ;
@@ -173,7 +173,7 @@ function get_buttons ()
173 173 {
174 174 foreach ( $button as $property => $value )
175 175 {
176   - if ($value == 'SubPanelTopComposeEmailButton' or $value == 'SubPanelTopArchiveEmailButton')
  176 + if ($value === 'SubPanelTopComposeEmailButton' || $value === 'SubPanelTopArchiveEmailButton')
177 177 {
178 178 //remove this button from the array.
179 179 unset ( $buttons [ $key ] ) ;
@@ -267,7 +267,7 @@ function load_sub_subpanels ()
267 267 {
268 268 $field = $def['name'];
269 269 $list_key = isset($listFieldMap[$key][$field]) ? $listFieldMap[$key][$field] : $field;
270   -
  270 +
271 271 if (isset($subpanel->panel_definition['list_fields'][$field]))
272 272 {
273 273 $list_fields[$field] = $subpanel->panel_definition['list_fields'][$field];
@@ -275,7 +275,7 @@ function load_sub_subpanels ()
275 275 else if ($list_key != $field && isset($subpanel->panel_definition['list_fields'][$list_key]))
276 276 {
277 277 $list_fields[$list_key] = $subpanel->panel_definition['list_fields'][$list_key];
278   -
  278 +
279 279 }
280 280 else {
281 281 $list_fields[$field] = $display_fields[$vname];
2  include/SubPanel/SubPanelTiles.js
@@ -121,4 +121,4 @@ SUGAR.subpanelUtils.menu.spPopupMenu(id,menu,top,left,leftOffset);},spPopupMenu:
121 121 left+=parseInt(leftOffset);}
122 122 if(top==""){var top=0;p=menuHandle;top+=p.offsetHeight;while(p&&p.tagName.toUpperCase()!='BODY'){top+=p.offsetTop;p=p.offsetParent;}}
123 123 if(left+menuWidth>bw){left=left-menuWidth+imgWidth;}
124   -setMenuVisible(menu,left,top,false);}}};}();
  124 +setMenuVisible(menu,left,top,false);}}};}();
2  include/SugarCharts/Jit/FlashCanvas/canvas2png.js
@@ -6,4 +6,4 @@
6 6 * http://flashcanvas.net/
7 7 */
8 8 (function(doc){var scripts=doc.getElementsByTagName("script");var script=scripts[scripts.length-1];var url=script.getAttribute("src").replace(/[^\/]+$/,"save.php");window.canvas2png=function(canvas){var tagName=canvas.tagName.toLowerCase();if(tagName!=="canvas"){return;}
9   -if(typeof FlashCanvas!=="undefined"){FlashCanvas.saveImage(canvas);}else{var form=doc.createElement("form");var input=doc.createElement("input");form.setAttribute("action",url);form.setAttribute("method","post");input.setAttribute("type","hidden");input.setAttribute("name","dataurl");input.setAttribute("value",canvas.toDataURL());doc.body.appendChild(form);form.appendChild(input);form.submit();form.removeChild(input);doc.body.removeChild(form);}}})(document);
  9 +if(typeof FlashCanvas!=="undefined"){FlashCanvas.saveImage(canvas);}else{var form=doc.createElement("form");var input=doc.createElement("input");form.setAttribute("action",url);form.setAttribute("method","post");input.setAttribute("type","hidden");input.setAttribute("name","dataurl");input.setAttribute("value",canvas.toDataURL());doc.body.appendChild(form);form.appendChild(input);form.submit();form.removeChild(input);doc.body.removeChild(form);}}})(document);
2  include/SugarCharts/Jit/FlashCanvas/flashcanvas.js
@@ -5,4 +5,4 @@
5 5 * Copyright (c) 2009-2011 FlashCanvas Project
6 6 * Released under the MIT/X License
7 7 */
8   -window.ActiveXObject&&!window.CanvasRenderingContext2D&&function(h,j){function D(a){this.code=a;this.message=T[a]}function U(a){this.width=a}function E(a){this.id=a.C++}function t(a){this.G=a;this.id=a.C++}function u(a,b){this.canvas=a;this.B=b;this.d=a.uniqueID;this.D();this.C=0;this.t="";var c=this;setInterval(function(){n[c.d]===0&&c.e()},30)}function A(){if(j.readyState==="complete"){j.detachEvent(F,A);for(var a=j.getElementsByTagName(r),b=0,c=a.length;b<c;++b)B.initElement(a[b])}}function G(){var a=event.srcElement,b=a.parentNode;a.blur();b.focus()}function H(){var a=event.propertyName;if(a==="width"||a==="height"){var b=event.srcElement,c=b[a],d=parseInt(c,10);if(isNaN(d)||d<0)d=a==="width"?300:150;if(c===d){b.style[a]=d+"px";b.getContext("2d").I(b.width,b.height)}else b[a]=d}}function I(){h.detachEvent(J,I);for(var a in s){var b=s[a],c=b.firstChild,d;for(d in c)if(typeof c[d]==="function")c[d]=k;for(d in b)if(typeof b[d]==="function")b[d]=k;c.detachEvent(K,G);b.detachEvent(L,H)}h[M]=k;h[N]=k;h[O]=k;h[C]=k;h[P]=k}function V(){var a=j.getElementsByTagName("script");a=a[a.length-1];return j.documentMode>=8?a.src:a.getAttribute("src",4)}function v(a){return(""+a).replace(/&/g,"&amp;").replace(/</g,"&lt;")}function W(a){return a.toLowerCase()}function i(a){throw new D(a);}function Q(a){var b=parseInt(a.width,10),c=parseInt(a.height,10);if(isNaN(b)||b<0)b=300;if(isNaN(c)||c<0)c=150;a.width=b;a.height=c}var k=null,r="canvas",M="CanvasRenderingContext2D",N="CanvasGradient",O="CanvasPattern",C="FlashCanvas",P="G_vmlCanvasManager",K="onfocus",L="onpropertychange",F="onreadystatechange",J="onunload",w=((h[C+"Options"]||{}).swfPath||V().replace(/[^\/]+$/,""))+"flashcanvas.swf",e=new function(a){for(var b=0,c=a.length;b<c;b++)this[a[b]]=b}(["toDataURL","save","restore","scale","rotate","translate","transform","setTransform","globalAlpha","globalCompositeOperation","strokeStyle","fillStyle","createLinearGradient","createRadialGradient","createPattern","lineWidth","lineCap","lineJoin","miterLimit","shadowOffsetX","shadowOffsetY","shadowBlur","shadowColor","clearRect","fillRect","strokeRect","beginPath","closePath","moveTo","lineTo","quadraticCurveTo","bezierCurveTo","arcTo","rect","arc","fill","stroke","clip","isPointInPath","font","textAlign","textBaseline","fillText","strokeText","measureText","drawImage","createImageData","getImageData","putImageData","addColorStop","direction","resize"]),x={},n={},s={},y={};u.prototype={save:function(){this.b();this.c();this.m();this.l();this.z();this.w();this.F.push([this.f,this.g,this.A,this.u,this.j,this.h,this.i,this.k,this.p,this.q,this.n,this.o,this.v,this.r,this.s]);this.a.push(e.save)},restore:function(){var a=this.F;if(a.length){a=a.pop();this.globalAlpha=a[0];this.globalCompositeOperation=a[1];this.strokeStyle=a[2];this.fillStyle=a[3];this.lineWidth=a[4];this.lineCap=a[5];this.lineJoin=a[6];this.miterLimit=a[7];this.shadowOffsetX=a[8];this.shadowOffsetY=a[9];this.shadowBlur=a[10];this.shadowColor=a[11];this.font=a[12];this.textAlign=a[13];this.textBaseline=a[14]}this.a.push(e.restore)},scale:function(a,b){this.a.push(e.scale,a,b)},rotate:function(a){this.a.push(e.rotate,a)},translate:function(a,b){this.a.push(e.translate,a,b)},transform:function(a,b,c,d,f,g){this.a.push(e.transform,a,b,c,d,f,g)},setTransform:function(a,b,c,d,f,g){this.a.push(e.setTransform,a,b,c,d,f,g)},b:function(){var a=this.a;if(this.f!==this.globalAlpha){this.f=this.globalAlpha;a.push(e.globalAlpha,this.f)}if(this.g!==this.globalCompositeOperation){this.g=this.globalCompositeOperation;a.push(e.globalCompositeOperation,this.g)}},m:function(){if(this.A!==this.strokeStyle){var a=this.A=this.strokeStyle;this.a.push(e.strokeStyle,typeof a==="object"?a.id:a)}},l:function(){if(this.u!==this.fillStyle){var a=this.u=this.fillStyle;this.a.push(e.fillStyle,typeof a==="object"?a.id:a)}},createLinearGradient:function(a,b,c,d){isFinite(a)&&isFinite(b)&&isFinite(c)&&isFinite(d)||i(9);this.a.push(e.createLinearGradient,a,b,c,d);return new t(this)},createRadialGradient:function(a,b,c,d,f,g){isFinite(a)&&isFinite(b)&&isFinite(c)&&isFinite(d)&&isFinite(f)&&isFinite(g)||i(9);if(c<0||g<0)i(1);this.a.push(e.createRadialGradient,a,b,c,d,f,g);return new t(this)},createPattern:function(a,b){a||i(17);var c=a.tagName,d,f=this.d;if(c){c=c.toLowerCase();if(c==="img")d=a.getAttribute("src",2);else if(c===r||c==="video")return;else i(17)}else if(a.src)d=a.src;else i(17);b==="repeat"||b==="no-repeat"||b==="repeat-x"||b==="repeat-y"||b===""||b===k||i(12);this.a.push(e.createPattern,v(d),b);if(x[f]){this.e();++n[f]}return new E(this)},z:function(){var a=this.a;if(this.j!==this.lineWidth){this.j=this.lineWidth;a.push(e.lineWidth,this.j)}if(this.h!==this.lineCap){this.h=this.lineCap;a.push(e.lineCap,this.h)}if(this.i!==this.lineJoin){this.i=this.lineJoin;a.push(e.lineJoin,this.i)}if(this.k!==this.miterLimit){this.k=this.miterLimit;a.push(e.miterLimit,this.k)}},c:function(){var a=this.a;if(this.p!==this.shadowOffsetX){this.p=this.shadowOffsetX;a.push(e.shadowOffsetX,this.p)}if(this.q!==this.shadowOffsetY){this.q=this.shadowOffsetY;a.push(e.shadowOffsetY,this.q)}if(this.n!==this.shadowBlur){this.n=this.shadowBlur;a.push(e.shadowBlur,this.n)}if(this.o!==this.shadowColor){this.o=this.shadowColor;a.push(e.shadowColor,this.o)}},clearRect:function(a,b,c,d){this.a.push(e.clearRect,a,b,c,d)},fillRect:function(a,b,c,d){this.b();this.c();this.l();this.a.push(e.fillRect,a,b,c,d)},strokeRect:function(a,b,c,d){this.b();this.c();this.m();this.z();this.a.push(e.strokeRect,a,b,c,d)},beginPath:function(){this.a.push(e.beginPath)},closePath:function(){this.a.push(e.closePath)},moveTo:function(a,b){this.a.push(e.moveTo,a,b)},lineTo:function(a,b){this.a.push(e.lineTo,a,b)},quadraticCurveTo:function(a,b,c,d){this.a.push(e.quadraticCurveTo,a,b,c,d)},bezierCurveTo:function(a,b,c,d,f,g){this.a.push(e.bezierCurveTo,a,b,c,d,f,g)},arcTo:function(a,b,c,d,f){f<0&&isFinite(f)&&i(1);this.a.push(e.arcTo,a,b,c,d,f)},rect:function(a,b,c,d){this.a.push(e.rect,a,b,c,d)},arc:function(a,b,c,d,f,g){c<0&&isFinite(c)&&i(1);this.a.push(e.arc,a,b,c,d,f,g?1:0)},fill:function(){this.b();this.c();this.l();this.a.push(e.fill)},stroke:function(){this.b();this.c();this.m();this.z();this.a.push(e.stroke)},clip:function(){this.a.push(e.clip)},w:function(){var a=this.a;if(this.v!==this.font)try{var b=y[this.d];b.style.font=this.v=this.font;var c=b.currentStyle;a.push(e.font,[c.fontStyle,c.fontWeight,b.offsetHeight,c.fontFamily].join(" "))}catch(d){}if(this.r!==this.textAlign){this.r=this.textAlign;a.push(e.textAlign,this.r)}if(this.s!==this.textBaseline){this.s=this.textBaseline;a.push(e.textBaseline,this.s)}if(this.t!==this.canvas.currentStyle.direction){this.t=this.canvas.currentStyle.direction;a.push(e.direction,this.t)}},fillText:function(a,b,c,d){this.b();this.l();this.c();this.w();this.a.push(e.fillText,v(a),b,c,d===void 0?Infinity:d)},strokeText:function(a,b,c,d){this.b();this.m();this.c();this.w();this.a.push(e.strokeText,v(a),b,c,d===void 0?Infinity:d)},measureText:function(a){var b=y[this.d];try{b.style.font=this.font}catch(c){}b.innerText=a.replace(/[ \n\f\r]/g,"\t");return new U(b.offsetWidth)},drawImage:function(a,b,c,d,f,g,o,l,z){a||i(17);var p=a.tagName,m,q=arguments.length,R=this.d;if(p){p=p.toLowerCase();if(p==="img")m=a.getAttribute("src",2);else if(p===r||p==="video")return;else i(17)}else if(a.src)m=a.src;else i(17);this.b();this.c();m=v(m);if(q===3)this.a.push(e.drawImage,q,m,b,c);else if(q===5)this.a.push(e.drawImage,q,m,b,c,d,f);else if(q===9){if(d===0||f===0)i(1);this.a.push(e.drawImage,q,m,b,c,d,f,g,o,l,z)}else return;if(x[R]){this.e();++n[R]}},D:function(){this.globalAlpha=this.f=1;this.globalCompositeOperation=this.g="source-over";this.fillStyle=this.u=this.strokeStyle=this.A="#000000";this.lineWidth=this.j=1;this.lineCap=this.h="butt";this.lineJoin=this.i="miter";this.miterLimit=this.k=10;this.shadowBlur=this.n=this.shadowOffsetY=this.q=this.shadowOffsetX=this.p=0;this.shadowColor=this.o="rgba(0, 0, 0, 0.0)";this.font=this.v="10px sans-serif";this.textAlign=this.r="start";this.textBaseline=this.s="alphabetic";this.a=[];this.F=[]},H:function(){var a=this.a;this.a=[];return a},e:function(){var a=this.H();if(a.length>0)return eval(this.B.CallFunction('<invoke name="executeCommand" returntype="javascript"><arguments><string>'+a.join("&#0;")+"</string></arguments></invoke>"))},I:function(a,b){this.e();this.D();if(a>0)this.B.width=a;if(b>0)this.B.height=b;this.a.push(e.resize,a,b)}};t.prototype={addColorStop:function(a,b){if(isNaN(a)||a<0||a>1)i(1);this.G.a.push(e.addColorStop,this.id,a,b)}};D.prototype=Error();var T={1:"INDEX_SIZE_ERR",9:"NOT_SUPPORTED_ERR",11:"INVALID_STATE_ERR",12:"SYNTAX_ERR",17:"TYPE_MISMATCH_ERR",18:"SECURITY_ERR"},B={initElement:function(a){if(a.getContext)return a;var b=a.uniqueID,c="external"+b;x[b]=false;n[b]=1;Q(a);a.innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+location.protocol+'//fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="100%" height="100%" id="'+c+'"><param name="allowScriptAccess" value="always"><param name="flashvars" value="id='+c+'"><param name="wmode" value="transparent"></object><span style="margin:0;padding:0;border:0;display:inline-block;position:static;height:1em;overflow:visible;white-space:nowrap"></span>';s[b]=a;var d=a.firstChild;y[b]=a.lastChild;var f=j.body.contains;if(f(a))d.movie=w;else var g=setInterval(function(){if(f(a)){clearInterval(g);d.movie=w}},0);if(j.compatMode==="BackCompat"||!h.XMLHttpRequest)y[b].style.overflow="hidden";var o=new u(a,d);a.getContext=function(l){return l==="2d"?o:k};a.toDataURL=function(l,z){(""+l).replace(/[A-Z]+/g,W)==="image/jpeg"?o.a.push(e.toDataURL,l,typeof z==="number"?z:""):o.a.push(e.toDataURL,l);return o.e()};d.attachEvent(K,G);return a},saveImage:function(a){a.firstChild.saveImage()},setOptions:function(){},trigger:function(a,b){s[a].fireEvent("on"+b)},unlock:function(a,b){n[a]&&--n[a];if(b){var c=s[a],d=c.firstChild,f,g;Q(c);f=c.width;g=c.height;c.style.width=f+"px";c.style.height=g+"px";if(f>0)d.width=f;if(g>0)d.height=g;d.resize(f,g);c.attachEvent(L,H);x[a]=true}}};j.createElement(r);j.createStyleSheet().cssText=r+"{display:inline-block;overflow:hidden;width:300px;height:150px}";j.readyState==="complete"?A():j.attachEvent(F,A);h.attachEvent(J,I);if(w.indexOf(location.protocol+"//"+location.host+"/")===0){var S=new ActiveXObject("Microsoft.XMLHTTP");S.open("GET",w,false);S.send(k)}h[M]=u;h[N]=t;h[O]=E;h[C]=B;h[P]={init:function(){},init_:function(){},initElement:B.initElement};keep=u.measureText}(window,document);
  8 +window.ActiveXObject&&!window.CanvasRenderingContext2D&&function(h,j){function D(a){this.code=a;this.message=T[a]}function U(a){this.width=a}function E(a){this.id=a.C++}function t(a){this.G=a;this.id=a.C++}function u(a,b){this.canvas=a;this.B=b;this.d=a.uniqueID;this.D();this.C=0;this.t="";var c=this;setInterval(function(){n[c.d]===0&&c.e()},30)}function A(){if(j.readyState==="complete"){j.detachEvent(F,A);for(var a=j.getElementsByTagName(r),b=0,c=a.length;b<c;++b)B.initElement(a[b])}}function G(){var a=event.srcElement,b=a.parentNode;a.blur();b.focus()}function H(){var a=event.propertyName;if(a==="width"||a==="height"){var b=event.srcElement,c=b[a],d=parseInt(c,10);if(isNaN(d)||d<0)d=a==="width"?300:150;if(c===d){b.style[a]=d+"px";b.getContext("2d").I(b.width,b.height)}else b[a]=d}}function I(){h.detachEvent(J,I);for(var a in s){var b=s[a],c=b.firstChild,d;for(d in c)if(typeof c[d]==="function")c[d]=k;for(d in b)if(typeof b[d]==="function")b[d]=k;c.detachEvent(K,G);b.detachEvent(L,H)}h[M]=k;h[N]=k;h[O]=k;h[C]=k;h[P]=k}function V(){var a=j.getElementsByTagName("script");a=a[a.length-1];return j.documentMode>=8?a.src:a.getAttribute("src",4)}function v(a){return(""+a).replace(/&/g,"&amp;").replace(/</g,"&lt;")}function W(a){return a.toLowerCase()}function i(a){throw new D(a);}function Q(a){var b=parseInt(a.width,10),c=parseInt(a.height,10);if(isNaN(b)||b<0)b=300;if(isNaN(c)||c<0)c=150;a.width=b;a.height=c}var k=null,r="canvas",M="CanvasRenderingContext2D",N="CanvasGradient",O="CanvasPattern",C="FlashCanvas",P="G_vmlCanvasManager",K="onfocus",L="onpropertychange",F="onreadystatechange",J="onunload",w=((h[C+"Options"]||{}).swfPath||V().replace(/[^\/]+$/,""))+"flashcanvas.swf",e=new function(a){for(var b=0,c=a.length;b<c;b++)this[a[b]]=b}(["toDataURL","save","restore","scale","rotate","translate","transform","setTransform","globalAlpha","globalCompositeOperation","strokeStyle","fillStyle","createLinearGradient","createRadialGradient","createPattern","lineWidth","lineCap","lineJoin","miterLimit","shadowOffsetX","shadowOffsetY","shadowBlur","shadowColor","clearRect","fillRect","strokeRect","beginPath","closePath","moveTo","lineTo","quadraticCurveTo","bezierCurveTo","arcTo","rect","arc","fill","stroke","clip","isPointInPath","font","textAlign","textBaseline","fillText","strokeText","measureText","drawImage","createImageData","getImageData","putImageData","addColorStop","direction","resize"]),x={},n={},s={},y={};u.prototype={save:function(){this.b();this.c();this.m();this.l();this.z();this.w();this.F.push([this.f,this.g,this.A,this.u,this.j,this.h,this.i,this.k,this.p,this.q,this.n,this.o,this.v,this.r,this.s]);this.a.push(e.save)},restore:function(){var a=this.F;if(a.length){a=a.pop();this.globalAlpha=a[0];this.globalCompositeOperation=a[1];this.strokeStyle=a[2];this.fillStyle=a[3];this.lineWidth=a[4];this.lineCap=a[5];this.lineJoin=a[6];this.miterLimit=a[7];this.shadowOffsetX=a[8];this.shadowOffsetY=a[9];this.shadowBlur=a[10];this.shadowColor=a[11];this.font=a[12];this.textAlign=a[13];this.textBaseline=a[14]}this.a.push(e.restore)},scale:function(a,b){this.a.push(e.scale,a,b)},rotate:function(a){this.a.push(e.rotate,a)},translate:function(a,b){this.a.push(e.translate,a,b)},transform:function(a,b,c,d,f,g){this.a.push(e.transform,a,b,c,d,f,g)},setTransform:function(a,b,c,d,f,g){this.a.push(e.setTransform,a,b,c,d,f,g)},b:function(){var a=this.a;if(this.f!==this.globalAlpha){this.f=this.globalAlpha;a.push(e.globalAlpha,this.f)}if(this.g!==this.globalCompositeOperation){this.g=this.globalCompositeOperation;a.push(e.globalCompositeOperation,this.g)}},m:function(){if(this.A!==this.strokeStyle){var a=this.A=this.strokeStyle;this.a.push(e.strokeStyle,typeof a==="object"?a.id:a)}},l:function(){if(this.u!==this.fillStyle){var a=this.u=this.fillStyle;this.a.push(e.fillStyle,typeof a==="object"?a.id:a)}},createLinearGradient:function(a,b,c,d){isFinite(a)&&isFinite(b)&&isFinite(c)&&isFinite(d)||i(9);this.a.push(e.createLinearGradient,a,b,c,d);return new t(this)},createRadialGradient:function(a,b,c,d,f,g){isFinite(a)&&isFinite(b)&&isFinite(c)&&isFinite(d)&&isFinite(f)&&isFinite(g)||i(9);if(c<0||g<0)i(1);this.a.push(e.createRadialGradient,a,b,c,d,f,g);return new t(this)},createPattern:function(a,b){a||i(17);var c=a.tagName,d,f=this.d;if(c){c=c.toLowerCase();if(c==="img")d=a.getAttribute("src",2);else if(c===r||c==="video")return;else i(17)}else if(a.src)d=a.src;else i(17);b==="repeat"||b==="no-repeat"||b==="repeat-x"||b==="repeat-y"||b===""||b===k||i(12);this.a.push(e.createPattern,v(d),b);if(x[f]){this.e();++n[f]}return new E(this)},z:function(){var a=this.a;if(this.j!==this.lineWidth){this.j=this.lineWidth;a.push(e.lineWidth,this.j)}if(this.h!==this.lineCap){this.h=this.lineCap;a.push(e.lineCap,this.h)}if(this.i!==this.lineJoin){this.i=this.lineJoin;a.push(e.lineJoin,this.i)}if(this.k!==this.miterLimit){this.k=this.miterLimit;a.push(e.miterLimit,this.k)}},c:function(){var a=this.a;if(this.p!==this.shadowOffsetX){this.p=this.shadowOffsetX;a.push(e.shadowOffsetX,this.p)}if(this.q!==this.shadowOffsetY){this.q=this.shadowOffsetY;a.push(e.shadowOffsetY,this.q)}if(this.n!==this.shadowBlur){this.n=this.shadowBlur;a.push(e.shadowBlur,this.n)}if(this.o!==this.shadowColor){this.o=this.shadowColor;a.push(e.shadowColor,this.o)}},clearRect:function(a,b,c,d){this.a.push(e.clearRect,a,b,c,d)},fillRect:function(a,b,c,d){this.b();this.c();this.l();this.a.push(e.fillRect,a,b,c,d)},strokeRect:function(a,b,c,d){this.b();this.c();this.m();this.z();this.a.push(e.strokeRect,a,b,c,d)},beginPath:function(){this.a.push(e.beginPath)},closePath:function(){this.a.push(e.closePath)},moveTo:function(a,b){this.a.push(e.moveTo,a,b)},lineTo:function(a,b){this.a.push(e.lineTo,a,b)},quadraticCurveTo:function(a,b,c,d){this.a.push(e.quadraticCurveTo,a,b,c,d)},bezierCurveTo:function(a,b,c,d,f,g){this.a.push(e.bezierCurveTo,a,b,c,d,f,g)},arcTo:function(a,b,c,d,f){f<0&&isFinite(f)&&i(1);this.a.push(e.arcTo,a,b,c,d,f)},rect:function(a,b,c,d){this.a.push(e.rect,a,b,c,d)},arc:function(a,b,c,d,f,g){c<0&&isFinite(c)&&i(1);this.a.push(e.arc,a,b,c,d,f,g?1:0)},fill:function(){this.b();this.c();this.l();this.a.push(e.fill)},stroke:function(){this.b();this.c();this.m();this.z();this.a.push(e.stroke)},clip:function(){this.a.push(e.clip)},w:function(){var a=this.a;if(this.v!==this.font)try{var b=y[this.d];b.style.font=this.v=this.font;var c=b.currentStyle;a.push(e.font,[c.fontStyle,c.fontWeight,b.offsetHeight,c.fontFamily].join(" "))}catch(d){}if(this.r!==this.textAlign){this.r=this.textAlign;a.push(e.textAlign,this.r)}if(this.s!==this.textBaseline){this.s=this.textBaseline;a.push(e.textBaseline,this.s)}if(this.t!==this.canvas.currentStyle.direction){this.t=this.canvas.currentStyle.direction;a.push(e.direction,this.t)}},fillText:function(a,b,c,d){this.b();this.l();this.c();this.w();this.a.push(e.fillText,v(a),b,c,d===void 0?Infinity:d)},strokeText:function(a,b,c,d){this.b();this.m();this.c();this.w();this.a.push(e.strokeText,v(a),b,c,d===void 0?Infinity:d)},measureText:function(a){var b=y[this.d];try{b.style.font=this.font}catch(c){}b.innerText=a.replace(/[ \n\f\r]/g,"\t");return new U(b.offsetWidth)},drawImage:function(a,b,c,d,f,g,o,l,z){a||i(17);var p=a.tagName,m,q=arguments.length,R=this.d;if(p){p=p.toLowerCase();if(p==="img")m=a.getAttribute("src",2);else if(p===r||p==="video")return;else i(17)}else if(a.src)m=a.src;else i(17);this.b();this.c();m=v(m);if(q===3)this.a.push(e.drawImage,q,m,b,c);else if(q===5)this.a.push(e.drawImage,q,m,b,c,d,f);else if(q===9){if(d===0||f===0)i(1);this.a.push(e.drawImage,q,m,b,c,d,f,g,o,l,z)}else return;if(x[R]){this.e();++n[R]}},D:function(){this.globalAlpha=this.f=1;this.globalCompositeOperation=this.g="source-over";this.fillStyle=this.u=this.strokeStyle=this.A="#000000";this.lineWidth=this.j=1;this.lineCap=this.h="butt";this.lineJoin=this.i="miter";this.miterLimit=this.k=10;this.shadowBlur=this.n=this.shadowOffsetY=this.q=this.shadowOffsetX=this.p=0;this.shadowColor=this.o="rgba(0, 0, 0, 0.0)";this.font=this.v="10px sans-serif";this.textAlign=this.r="start";this.textBaseline=this.s="alphabetic";this.a=[];this.F=[]},H:function(){var a=this.a;this.a=[];return a},e:function(){var a=this.H();if(a.length>0)return eval(this.B.CallFunction('<invoke name="executeCommand" returntype="javascript"><arguments><string>'+a.join("&#0;")+"</string></arguments></invoke>"))},I:function(a,b){this.e();this.D();if(a>0)this.B.width=a;if(b>0)this.B.height=b;this.a.push(e.resize,a,b)}};t.prototype={addColorStop:function(a,b){if(isNaN(a)||a<0||a>1)i(1);this.G.a.push(e.addColorStop,this.id,a,b)}};D.prototype=Error();var T={1:"INDEX_SIZE_ERR",9:"NOT_SUPPORTED_ERR",11:"INVALID_STATE_ERR",12:"SYNTAX_ERR",17:"TYPE_MISMATCH_ERR",18:"SECURITY_ERR"},B={initElement:function(a){if(a.getContext)return a;var b=a.uniqueID,c="external"+b;x[b]=false;n[b]=1;Q(a);a.innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+location.protocol+'//fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="100%" height="100%" id="'+c+'"><param name="allowScriptAccess" value="always"><param name="flashvars" value="id='+c+'"><param name="wmode" value="transparent"></object><span style="margin:0;padding:0;border:0;display:inline-block;position:static;height:1em;overflow:visible;white-space:nowrap"></span>';s[b]=a;var d=a.firstChild;y[b]=a.lastChild;var f=j.body.contains;if(f(a))d.movie=w;else var g=setInterval(function(){if(f(a)){clearInterval(g);d.movie=w}},0);if(j.compatMode==="BackCompat"||!h.XMLHttpRequest)y[b].style.overflow="hidden";var o=new u(a,d);a.getContext=function(l){return l==="2d"?o:k};a.toDataURL=function(l,z){(""+l).replace(/[A-Z]+/g,W)==="image/jpeg"?o.a.push(e.toDataURL,l,typeof z==="number"?z:""):o.a.push(e.toDataURL,l);return o.e()};d.attachEvent(K,G);return a},saveImage:function(a){a.firstChild.saveImage()},setOptions:function(){},trigger:function(a,b){s[a].fireEvent("on"+b)},unlock:function(a,b){n[a]&&--n[a];if(b){var c=s[a],d=c.firstChild,f,g;Q(c);f=c.width;g=c.height;c.style.width=f+"px";c.style.height=g+"px";if(f>0)d.width=f;if(g>0)d.height=g;d.resize(f,g);c.attachEvent(L,H);x[a]=true}}};j.createElement(r);j.createStyleSheet().cssText=r+"{display:inline-block;overflow:hidden;width:300px;height:150px}";j.readyState==="complete"?A():j.attachEvent(F,A);h.attachEvent(J,I);if(w.indexOf(location.protocol+"//"+location.host+"/")===0){var S=new ActiveXObject("Microsoft.XMLHTTP");S.open("GET",w,false);S.send(k)}h[M]=u;h[N]=t;h[O]=E;h[C]=B;h[P]={init:function(){},init_:function(){},initElement:B.initElement};keep=u.measureText}(window,document);
164 include/SugarCharts/Jit/js/Jit/jit.js
82 additions, 82 deletions not shown
2  include/SugarCharts/Jit/js/mySugarCharts.js
@@ -36,4 +36,4 @@ SUGAR.mySugar.sugarCharts=function(){var activeTab=activePage,charts=new Object(
36 36 {var numCols=2;}
37 37 for(id in charts[activeTab]){if(id!='undefined'){chartFound=true;loadSugarChart(charts[activeTab][id]['chartId'],charts[activeTab][id]['jsonFilename'],charts[activeTab][id]['css'],charts[activeTab][id]['chartConfig'],numCols);}}
38 38 charts=new Object();},addToChartsArrayJson:function(json,activeTab){for(id in json){if(json[id]['supported']=="true"){SUGAR.mySugar.sugarCharts.addToChartsArray(json[id]['chartId'],json[id]['filename'],json[id]['css'],json[id]['chartConfig'],activeTab);}}},addToChartsArray:function(chartId,jsonFilename,css,chartConfig,activeTab){if(charts[activeTab]==null){charts[activeTab]=new Object();}
39   -charts[activeTab][chartId]=new Object();charts[activeTab][chartId]['chartId']=chartId;charts[activeTab][chartId]['jsonFilename']=jsonFilename;charts[activeTab][chartId]['css']=css;charts[activeTab][chartId]['chartConfig']=chartConfig;}}}();
  39 +charts[activeTab][chartId]=new Object();charts[activeTab][chartId]['chartId']=chartId;charts[activeTab][chartId]['jsonFilename']=jsonFilename;charts[activeTab][chartId]['css']=css;charts[activeTab][chartId]['chartConfig']=chartConfig;}}}();
2  include/SugarCharts/Jit/js/sugarCharts.js
@@ -93,4 +93,4 @@ table+="</table>";list.innerHTML=table;$jit.util.saveImageTest(chartId,jsonFilen
93 93 firstLoad=false;}
94 94 var doRefresh=function(){setTimeout(function(){refreshGraph()},delay);}
95 95 YAHOO.util.Event.addListener(window,'resize',function(){doRefresh()});}}
96   -var callback={success:handleSuccess,failure:handleFailure,argument:{foo:'foo',bar:''}};var request=YAHOO.util.Connect.asyncRequest('GET',jsonFilename+"?r="+new Date().getTime(),callback);break;}}
  96 +var callback={success:handleSuccess,failure:handleFailure,argument:{foo:'foo',bar:''}};var request=YAHOO.util.Connect.asyncRequest('GET',jsonFilename+"?r="+new Date().getTime(),callback);break;}}
2  include/SugarDependentDropdown/javascript/SugarDependentDropdown.js
@@ -49,4 +49,4 @@ try{newElement.onchange();}catch(e){if(SUGAR.dependentDropdown.dropdowns.debugMo
49 49 SUGAR.dependentDropdown.utils={generateElementContainer:function(focusElement,elementRow,index,elementIndex){var oldElement=document.getElementById('elementContainer'+focusElement.grouping+"::"+index+":::"+elementIndex);if(oldElement){SUGAR.dependentDropdown.utils.removeChildren(oldElement);}
50 50 var tmp=YAHOO.ext.DomHelper.append(elementRow,{tag:'span',id:'elementContainer'+focusElement.grouping+"::"+index+":::"+elementIndex},true);return tmp.dom;},getPreselectKey:function(elementName){try{if(SUGAR.dependentDropdown.currentAction.action[elementName]){return SUGAR.dependentDropdown.currentAction.action[elementName];}else{return'';}}catch(e){if(SUGAR.dependentDropdown.dropdowns.debugMode){}
51 51 return'';}},debugStack:function(func){if(!SUGAR.dependentDropdown._stack){SUGAR.dependentDropdown._stack=new Array();}
52   -SUGAR.dependentDropdown._stack.push(func);},removeChildren:function(el){for(i=el.childNodes.length-1;i>=0;i--){if(el.childNodes[i]){el.removeChild(el.childNodes[i]);}}}}
  52 +SUGAR.dependentDropdown._stack.push(func);},removeChildren:function(el){for(i=el.childNodes.length-1;i>=0;i--){if(el.childNodes[i]){el.removeChild(el.childNodes[i]);}}}}
2  include/SugarEmailAddress/SugarEmailAddress.js
@@ -66,4 +66,4 @@ if(!primaryFound){Dom.get(this.id+'emailAddressPrimaryFlag0').checked=true;Dom.g
66 66 {var form=document.forms[this.emailView];if(!form){form=document.forms['editContactForm'];}
67 67 if(SUGAR.isIE){for(i=0;i<form.elements.length;i++){var id=new String(form.elements[i].id);if(id.match(/emailAddressInvalidFlag/gim)&&form.elements[i].type=='checkbox'&&id!=el.id){form.elements[i].checked=false;}}
68 68 el.checked=true;}},forceSubmit:function(){var theForm=Dom.get(this.emailView);if(theForm){theForm.action.value='Save';if(!check_form(this.emailView)){return false;}
69   -if(this.emailView=='EditView'){theForm.submit();}else if(this.emailView=='QuickCreate'){SUGAR.subpanelUtils.inlineSave(theForm.id,theForm.module.value.toLowerCase());}}}};emailAddressWidgetLoaded=true;})();
  69 +if(this.emailView=='EditView'){theForm.submit();}else if(this.emailView=='QuickCreate'){SUGAR.subpanelUtils.inlineSave(theForm.id,theForm.module.value.toLowerCase());}}}};emailAddressWidgetLoaded=true;})();
2  include/SugarFields/Fields/Address/SugarFieldAddress.js
@@ -40,4 +40,4 @@ originalBgColor=e1.style.backgroundColor;}}
40 40 if(tHasText&&syncAddressCheckbox)
41 41 {document.getElementById(this.id).checked=true;syncFields(fromKey,toKey);}}
42 42 function writeToSyncField(e){fromEl=YAHOO.util.Event.getTarget(e,true);if(typeof fromEl!="undefined"){toEl=document.getElementById(fromEl.id.replace(fromKey,toKey));toEl.value=fromEl.value;}}
43   -function syncFields(fromKey,toKey){for(x in elems){f=fromKey+"_"+elems[x];e2=document.getElementById(f);t=toKey+"_"+elems[x];e1=document.getElementById(t);if(e1!=null&&typeof e1!="undefined"&&e2!=null&&typeof e2!="undefined"){if(!document.getElementById(toKey+'_checkbox').checked){Dom.setStyle(e1,'backgroundColor',originalBgColor);e1.removeAttribute('readOnly');YAHOO.util.Event.removeListener(e2,'keyup');}else{e1.value=e2.value;Dom.setStyle(e1,'backgroundColor','#DCDCDC');e1.setAttribute('readOnly',true);YAHOO.util.Event.addListener(e2,'keyup',writeToSyncField);}}}}
  43 +function syncFields(fromKey,toKey){for(x in elems){f=fromKey+"_"+elems[x];e2=document.getElementById(f);t=toKey+"_"+elems[x];e1=document.getElementById(t);if(e1!=null&&typeof e1!="undefined"&&e2!=null&&typeof e2!="undefined"){if(!document.getElementById(toKey+'_checkbox').checked){Dom.setStyle(e1,'backgroundColor',originalBgColor);e1.removeAttribute('readOnly');YAHOO.util.Event.removeListener(e2,'keyup');}else{e1.value=e2.value;Dom.setStyle(e1,'backgroundColor','#DCDCDC');e1.setAttribute('readOnly',true);YAHOO.util.Event.addListener(e2,'keyup',writeToSyncField);}}}}
1  include/SugarFields/Fields/Collection/CollectionEditView.tpl
@@ -37,7 +37,6 @@
37 37 *}
38 38 <link rel="stylesheet" type="text/css" href="include/javascript/yui-old/assets/container.css" />
39 39 <script type="text/javascript" src='{sugar_getjspath file="include/SugarFields/Fields/Collection/SugarFieldCollection.js"}'></script>
40   -<script type="text/javascript" src='{sugar_getjspath file="include/JSON.js"}'></script>
41 40 <script type="text/javascript">
42 41 var collection = (typeof collection == 'undefined') ? new Array() : collection;
43 42 collection['{$displayParams.formName}_{$vardef.name}'] = new SUGAR.collection('{$displayParams.formName}', '{$vardef.name}', '{$module}', '{$displayParams.popupData}');
1  include/SugarFields/Fields/Collection/DetailView.tpl
@@ -36,7 +36,6 @@
36 36
37 37 *}
38 38 <script type="text/javascript" src='{sugar_getjspath file="include/SugarFields/Fields/Collection/SugarFieldCollection.js"}'></script>
39   -<script type="text/javascript" src='{sugar_getjspath file="include/JSON.js"}'></script>
40 39 <div id='{{sugarvar key='name'}}_div' name='{{sugarvar key='name'}}_div'><img src="{sugar_getimagepath file='sqsWait.gif'}" alt="loading..." id="{{sugarvar key="name"}}_loading_img" style="display:none"></div>
41 40 <script type="text/javascript">
42 41 //{literal}
1  include/SugarFields/Fields/Collection/EditView.tpl
@@ -37,7 +37,6 @@
37 37 *}
38 38 <link rel="stylesheet" type="text/css" href="include/javascript/yui-old/assets/container.css" />
39 39 <script type="text/javascript" src='{sugar_getjspath file="include/SugarFields/Fields/Collection/SugarFieldCollection.js"}'></script>
40   -<script type="text/javascript" src='{sugar_getjspath file="include/JSON.js"}'></script>
41 40 <div id='{{sugarvar key='name'}}_div' name='{{sugarvar key='name'}}_div'><img src="{sugar_getimagepath file='sqsWait.gif'}" alt="loading..." id="{{sugarvar key="name"}}_loading_img" style="display:none"></div>
42 41 <script type="text/javascript">
43 42 //{literal}
6 include/SugarFields/Fields/Collection/SugarFieldCollection.js
@@ -39,7 +39,7 @@ var primary_checked=document.forms[this.form].elements[this.field+"_allowed_to_c
39 39 if(/EditView/.test(this.form)&&!checked&&typeof radio_els[0]!='undefined'&&allowed_to_check){radio_els[0].checked=true;this.changePrimary(true);this.js_more();this.js_more();}
40 40 if(radio_els.length==1){this.more_status=false;if(document.getElementById('more_'+this.field_element_name)&&document.getElementById('more_'+this.field_element_name).style.display!='none'){document.getElementById('more_'+this.field_element_name).style.display='none';}
41 41 this.show_arrow_label(false);this.js_more();}else{this.js_more();this.js_more();}}},get_radios:function(){return YAHOO.util.Selector.query('input[name^=primary]',document.getElementById(this.field_element_name+'_table'));},add:function(values){this.fields_count++;var Field0=this.init_clone(values);this.cloneField[1].appendChild(Field0);enableQS(true);this.changePrimary(false);if(document.getElementById('more_'+this.field_element_name)&&document.getElementById('more_'+this.field_element_name).style.display=='none'){document.getElementById('more_'+this.field_element_name).style.display='';}
42   -if(!this.is_expanded()){this.js_more();this.show_arrow_label(true);}},add_secondaries:function(){clone_id=this.form+'_'+this.field+'_collection_0';if(typeof sqs_objects=='undefined'||typeof sqs_objects[clone_id]=='undefined'){setTimeout('collection["'+this.field_element_name+'"].add_secondaries();',1000);}else if(typeof document.getElementById(this.form+'_'+this.field+'_collection_0')=='undefined'){setTimeout('collection["'+this.field_element_name+'"].add_secondaries();',1000);}else{this.create_clone();enableQS();this.changePrimary(true);for(key in this.secondaries_values){if(isInteger(key)){this.add(this.secondaries_values[key]);}}
  42 +if(!this.is_expanded()){this.js_more();this.show_arrow_label(true);}},add_secondaries:function(){clone_id=this.form+'_'+this.field+'_collection_0';if(typeof sqs_objects=='undefined'||typeof sqs_objects[clone_id]=='undefined'){setTimeout('collection["'+this.field_element_name+'"].add_secondaries();',100);}else if(typeof document.getElementById(this.form+'_'+this.field+'_collection_0')=='undefined'){setTimeout('collection["'+this.field_element_name+'"].add_secondaries();',100);}else{this.create_clone();enableQS();this.changePrimary(true);for(key in this.secondaries_values){if(isInteger(key)){this.add(this.secondaries_values[key]);}}
43 43 this.js_more();this.js_more();}
44 44 initEditView(document.forms[this.form]);},init_clone:function(values){if(typeof this.cloneField[0]=='undefined'){return;}
45 45 if(typeof values=="undefined"){values=new Array();values['name']="";values['id']="";}
@@ -69,7 +69,7 @@ return false;}}
69 69 SUGAR.collection.safe_clone=function(e,recursive)
70 70 {if(e.nodeName=="#text")
71 71 {return document.createTextNode(e.data);}
72   -if(!e.tagName)return false;var newNode=document.createElement(e.tagName);if(!newNode)return false;if(SUGAR.isIE7&&e.tagName.toLowerCase()=='input')
  72 +if(!e.tagName)return false;var newNode=document.createElement(e.tagName);if(!newNode)return false;var properties=['class','style','name','type','valign','border','width','height','top','bottom','left','right','scope','row','columns','src','href','className','align','nowrap'];if(SUGAR.isIE7&&e.tagName.toLowerCase()=='input')
73 73 {var properties=['class','style','name','type','valign','border','width','top','bottom','left','right','scope','row','columns','src','href','className','align','nowrap'];}else{var properties=['class','style','name','type','valign','border','width','height','top','bottom','left','right','scope','row','columns','src','href','className','align','nowrap'];}
74 74 for(var i in properties)
75 75 {if(e[properties[i]])
@@ -79,4 +79,4 @@ if(recursive)
79 79 {for(var i in e.childNodes)
80 80 {if(e.childNodes[i].nodeName&&(!e.className||e.className!="yui-ac-container"))
81 81 {var child=SUGAR.collection.safe_clone(e.childNodes[i],true);if(child)newNode.appendChild(child);}}}
82   -return newNode;}}
  82 +return newNode;}}
11 include/SugarFields/Fields/Collection/ViewSugarFieldCollection.php
@@ -285,7 +285,7 @@ function process_editview(){
285 285 // If relate add the ID field to the array
286 286 $this->displayParams['collection_field_list'][$name]['field'] .= "collection['{$this->vardef['name']}'].update_fields.{$collection_field_vardef['id_name']}=true;";
287 287 }
288   - $this->displayParams['collection_field_list'][$name]['field'] .= "document.getElementById('update_fields_{$this->vardef['name']}_collection').value = JSON.stringifyNoSecurity(collection['{$this->vardef['name']}'].update_fields);\" + oldonchange + \"};\");</script>{/literal}";
  288 + $this->displayParams['collection_field_list'][$name]['field'] .= "document.getElementById('update_fields_{$this->vardef['name']}_collection').value = YAHOO.lang.JSON.stringify(collection['{$this->vardef['name']}'].update_fields);\" + oldonchange + \"};\");</script>{/literal}";
289 289 //we need to get rid of the old value;
290 290 unset($this->displayParams['collection_field_list'][$k]);
291 291 }
@@ -390,9 +390,12 @@ function createQuickSearchCode($returnAsJavascript = true){
390 390 $shippingKey = isset($this->displayParams['shippingKey']) ? $this->displayParams['shippingKey'] : null;
391 391 $additionalFields = isset($this->displayParams['additionalFields']) ? $this->displayParams['additionalFields'] : null;
392 392 $sqs_objects[$name1] = $qsd->getQSAccount($nameKey, $idKey, $billingKey, $shippingKey, $additionalFields);
393   - }
394   -
395   - $temp_array = array('field_list'=>array(),'populate_list'=>array());
  393 + } else if($matches[0] == 'Contacts'){
  394 + $sqs_objects[$name1] = $qsd->getQSContact($name1, "id_".$name1);
  395 + }
  396 +
  397 +
  398 + $temp_array = array('field_list'=>array(),'populate_list'=>array());
396 399 foreach($sqs_objects[$name1]['field_list'] as $k=>$v){
397 400 if(!in_array($v, array('name','id'))){
398 401 $sqs_objects[$name1]['primary_field_list'][]=$v;
2  include/SugarFields/Fields/Datetimecombo/Datetimecombo.js
@@ -51,4 +51,4 @@ updateListeners=true;var d=window.document.getElementById(this.fieldname+'_date'
51 51 var newdate=d.value+' '+h.value+this.timeseparator+m.value;if(this.hasMeridiem){ampm=document.getElementById(this.fieldname+"_meridiem").value;newdate+=ampm;}
52 52 if(trim(newdate)==""+this.timeseparator+""){newdate='';}
53 53 document.getElementById(this.fieldname).value=newdate;if(updateListeners)
54   -SUGAR.util.callOnChangeListers(this.fieldname);if(this.showCheckbox){flag=this.fieldname+'_flag';date=this.fieldname+'_date';hours=this.fieldname+'_hours';mins=this.fieldname+'_minutes';if(document.getElementById(flag).checked){document.getElementById(flag).value=1;document.getElementById(this.fieldname).value='';document.getElementById(date).disabled=true;document.getElementById(hours).disabled=true;document.getElementById(mins).disabled=true;}else{document.getElementById(flag).value=0;document.getElementById(date).disabled=false;document.getElementById(hours).disabled=false;document.getElementById(mins).disabled=false;}}};
  54 +SUGAR.util.callOnChangeListers(this.fieldname);if(this.showCheckbox){flag=this.fieldname+'_flag';date=this.fieldname+'_date';hours=this.fieldname+'_hours';mins=this.fieldname+'_minutes';if(document.getElementById(flag).checked){document.getElementById(flag).value=1;document.getElementById(this.fieldname).value='';document.getElementById(date).disabled=true;document.getElementById(hours).disabled=true;document.getElementById(mins).disabled=true;}else{document.getElementById(flag).value=0;document.getElementById(date).disabled=false;document.getElementById(hours).disabled=false;document.getElementById(mins).disabled=false;}}};
4 include/SugarFields/Fields/File/SugarFieldFile.js
@@ -35,7 +35,7 @@
35 35 if(typeof(SUGAR.field)=='undefined'){SUGAR.field=new Object();}
36 36 if(typeof(SUGAR.field.file)=='undefined'){SUGAR.field.file={deleteAttachment:function(elemBaseName,docTypeName,elem){ajaxStatus.showStatus(SUGAR.language.get("app_strings","LBL_REMOVING_ATTACHMENT"));elem.form.deleteAttachment.value=1;elem.form.action.value="EditView";var callback=SUGAR.field.file.deleteAttachmentCallbackGen(elemBaseName,docTypeName);var success=function(data){if(data){callback(data.responseText);}}
37 37 YAHOO.util.Connect.setForm(elem.form);var cObj=YAHOO.util.Connect.asyncRequest('POST','index.php',{success:success,failure:success});elem.form.deleteAttachment.value=0;elem.form.action.value="";},deleteAttachmentCallbackGen:function(elemBaseName,docTypeName){return function(text){if(text=='true'){document.getElementById(elemBaseName+'_new').style.display='';ajaxStatus.hideStatus();document.getElementById(elemBaseName+'_old').innerHTML='';if(docTypeName){document.getElementById(docTypeName).disabled=false;}
38   -document.getElementById(elemBaseName).value='';}else{document.getElementById(elemBaseName+'_new').style.display='none';ajaxStatus.flashStatus(SUGAR.language.get('app_strings','ERR_REMOVING_ATTACHMENT'),2000);}}},checkEapiLogin:function(res){var failedLogins=JSON.parse(res.responseText);if(failedLogins.length==0){return;}
  38 +document.getElementById(elemBaseName).value='';}else{document.getElementById(elemBaseName+'_new').style.display='none';ajaxStatus.flashStatus(SUGAR.language.get('app_strings','ERR_REMOVING_ATTACHMENT'),2000);}}},checkEapiLogin:function(res){var failedLogins=YAHOO.lang.JSON.parse(res.responseText);if(failedLogins.length==0){return;}
39 39 for(var idx in failedLogins){if(confirm(failedLogins[idx].label)){window.open(failedLogins[idx].checkURL,'EAPM_CHECK_'+idx);}else{document.getElementById(res.argument.docTypeName).value='Sugar';document.getElementById(res.argument.docTypeName).onchange();}}},setupEapiShowHide:function(elemBaseName,docTypeName,formName){var externalSearchToggle=function(){var moreElem=document.getElementById(elemBaseName+"_more");var hideMore=(moreElem.style.display=='none');if(hideMore){moreElem.style.display='';document.getElementById(elemBaseName+'_less').style.display='none';document.getElementById(elemBaseName+'_remoteNameSpan').style.display='none';document.getElementById(elemBaseName+'_file').disabled=false;}else{moreElem.style.display='none';document.getElementById(elemBaseName+'_less').style.display='';document.getElementById(elemBaseName+'_remoteNameSpan').style.display='';document.getElementById(elemBaseName+'_file').disabled=true;}}
40 40 var showHideFunc=function(){var docShowHideElem=document.getElementById(elemBaseName+"_externalApiSelector");var dropdownValue=document.getElementById(docTypeName).value;if(typeof(SUGAR.eapm)!='undefined'&&typeof(SUGAR.eapm[dropdownValue])!='undefined'&&typeof(SUGAR.eapm[dropdownValue].docSearch)!='undefined'&&SUGAR.eapm[dropdownValue].docSearch){docShowHideElem.style.display='';YAHOO.util.Connect.asyncRequest('GET','index.php?module=EAPM&action=CheckLogins&to_pdf=1&api='+dropdownValue,{success:SUGAR.field.file.checkEapiLogin,argument:{'elemBaseName':elemBaseName,'docTypeName':docTypeName}});YAHOO.util.Connect.asyncRequest('GET','index.php?module=EAPM&action=flushFileCache&to_pdf=1&api='+dropdownValue,{});}else{docShowHideElem.style.display='none';document.getElementById(elemBaseName+'_file').disabled=false;}
41 41 sqs_objects[formName+"_"+elemBaseName+"_remoteName"].api=dropdownValue;var secLevelBoxElem=document.getElementById(elemBaseName+'_securityLevelBox');var secLevelElem=document.getElementById(elemBaseName+'_securityLevel');secLevelElem.options.length=0;if(SUGAR.eapm[dropdownValue]&&SUGAR.eapm[dropdownValue].sharingOptions){var opts=SUGAR.eapm[dropdownValue].sharingOptions;var i=0;for(idx in opts){secLevelElem.options[i]=new Option(SUGAR.language.get('app_strings',opts[idx]),idx,false,false);i++;}
@@ -44,4 +44,4 @@ document.getElementById(docTypeName).onchange=showHideFunc;document.getElementBy
44 44 return'';else
45 45 return fileName.substr(++lastindex);},isFileExtensionValid:function(fileName){var docType=document.getElementById('doc_type').value;var fileExtension=this.getFileExtension(fileName);if(typeof(SUGAR.eapm[docType])=='undefined'||!SUGAR.eapm[docType].restrictUploadsByExtension){return true;}
46 46 var whiteSuffixlist=SUGAR.eapm[docType]['restrictUploadsByExtension'];if(whiteSuffixlist.constructor==Array){var results=false;for(var i=0;i<whiteSuffixlist.length;i++){if(fileExtension.toLowerCase()==whiteSuffixlist[i].toLowerCase()){return true;}}}
47   -return results;},checkFileExtension:function(e,obj){var sff=SUGAR.field.file;var fileEl=document.getElementById(obj.fileEl);var fileName=fileEl.value;var isValid=sff.isFileExtensionValid(fileName);if(!isValid&&fileName!=''){var errorPannel=new YAHOO.widget.SimpleDialog('sugarMsgWindow',{width:'240px',visible:true,fixedcenter:true,constraintoviewport:true,draggable:true,type:'alert',modal:true,id:'sugarMsgWindow',close:true});errorPannel.setBody(SUGAR.language.get("app_strings","LBL_INVALID_FILE_EXTENSION"));errorPannel.render(document.body);errorPannel.show();fileEl.value='';document.getElementById(obj.targEl).value='';}}}}
  47 +return results;},checkFileExtension:function(e,obj){var sff=SUGAR.field.file;var fileEl=document.getElementById(obj.fileEl);var fileName=fileEl.value;var isValid=sff.isFileExtensionValid(fileName);if(!isValid&&fileName!=''){var errorPannel=new YAHOO.widget.SimpleDialog('sugarMsgWindow',{width:'240px',visible:true,fixedcenter:true,constraintoviewport:true,draggable:true,type:'alert',modal:true,id:'sugarMsgWindow',close:true});errorPannel.setBody(SUGAR.language.get("app_strings","LBL_INVALID_FILE_EXTENSION"));errorPannel.render(document.body);errorPannel.show();fileEl.value='';document.getElementById(obj.targEl).value='';}}}}
4 include/SugarFields/Fields/Relate/EditView.tpl
@@ -40,8 +40,8 @@
40 40 {{assign var=idname value=$displayParams.idName}}
41 41 {{/if}}
42 42 <input type="text" name="{{$idname}}" class={{if empty($displayParams.class) }}"sqsEnabled"{{else}} "{{$displayParams.class}}" {{/if}} tabindex="{{$tabindex}}" id="{{$idname}}" size="{{$displayParams.size}}" value="{{sugarvar key='value'}}" title='{{$vardef.help}}' autocomplete="off" {{$displayParams.readOnly}} {{$displayParams.field}}>
43   -<input type="hidden" name="{{if !empty($displayParams.idName)}}{{$idname}}_{{/if}}{{sugarvar key='id_name'}}"
44   - id="{{if !empty($displayParams.idName)}}{{$idname}}_{{/if}}{{sugarvar key='id_name'}}"
  43 +<input type="hidden" name="{{if !empty($displayParams.idNameHidden)}}{{$displayParams.idNameHidden}}{{/if}}{{sugarvar key='id_name'}}"
  44 + id="{{if !empty($displayParams.idNameHidden)}}{{$displayParams.idNameHidden}}{{/if}}{{sugarvar key='id_name'}}"
45 45 {{if !empty($vardef.id_name)}}value="{{sugarvar memberName='vardef.id_name' key='value'}}"{{/if}}>
46 46 {{if empty($displayParams.hideButtons) }}
47 47 <span class="id-ff multiple">
17 include/SugarFields/Fields/Relate/SugarFieldRelate.php
@@ -49,7 +49,11 @@ function getDetailViewSmarty($parentFieldArray, $vardef, $displayParams, $tabind
49 49 return $this->fetch($this->findTemplate('DetailView'));
50 50 }
51 51
52   - function getEditViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex) {
  52 + /**
  53 + * @see SugarFieldBase::getEditViewSmarty()
  54 + */
  55 + public function getEditViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex)
  56 + {
53 57 if(!empty($vardef['function']['returns']) && $vardef['function']['returns'] == 'html'){
54 58 return parent::getEditViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex);
55 59 }
@@ -62,7 +66,12 @@ function getEditViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex
62 66 if(isset($displayParams['formName'])) {
63 67 $form_name = $displayParams['formName'];
64 68 }
65   -
  69 +
  70 + if (isset($displayParams['idName']))
  71 + {
  72 + $rpos = strrpos($displayParams['idName'], $vardef['name']);
  73 + $displayParams['idNameHidden'] = substr($displayParams['idName'], 0, $rpos);
  74 + }
66 75 //Special Case for accounts; use the displayParams array and retrieve
67 76 //the key and copy indexes. 'key' is the suffix of the field we are searching
68 77 //the Account's address with. 'copy' is the suffix we are copying the addresses
@@ -121,7 +130,9 @@ function getEditViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex
121 130 'call_back_function' => $call_back_function,
122 131 'form_name' => $form_name,
123 132 'field_to_name_array' => array(
124   - 'id' => (empty($displayParams['idName']) ? $vardef['id_name'] : ($displayParams['idName'] . '_' . $vardef['id_name'])) ,
  133 + //'id' => (empty($displayParams['idName']) ? $vardef['id_name'] : ($displayParams['idName'] . '_' . $vardef['id_name'])) ,
  134 + //bug 43770: Assigned to value could not be saved during lead conversion
  135 + 'id' => (empty($displayParams['idNameHidden']) ? $vardef['id_name'] : ($displayParams['idNameHidden'] . $vardef['id_name'])) ,
125 136 ((empty($vardef['rname'])) ? 'name' : $vardef['rname']) => (empty($displayParams['idName']) ? $vardef['name'] : $displayParams['idName']),
126 137 ),
127 138 );
2  include/SugarObjects/templates/file/metadata/editviewdefs.php
@@ -55,8 +55,6 @@
55 55 ),
56 56 'javascript' =>
57 57 '<script type="text/javascript" src="include/javascript/popup_parent_helper.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
58   - <script type="text/javascript" src="include/jsolait/init.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
59   - <script type="text/javascript" src="include/jsolait/lib/urllib.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
60 58 <script type="text/javascript" src="include/javascript/jsclass_base.js"></script>
61 59 <script type="text/javascript" src="include/javascript/jsclass_async.js"></script>
62 60 <script type="text/javascript" src="modules/Documents/documents.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>',
2  include/SugarObjects/templates/file/metadata/quickcreatedefs.php
@@ -55,8 +55,6 @@
55 55 ),
56 56 'javascript' =>
57 57 '<script type="text/javascript" src="include/javascript/popup_parent_helper.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
58   - <script type="text/javascript" src="include/jsolait/init.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
59   - <script type="text/javascript" src="include/jsolait/lib/urllib.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
60 58 <script type="text/javascript" src="include/javascript/jsclass_base.js"></script>
61 59 <script type="text/javascript" src="include/javascript/jsclass_async.js"></script>
62 60 <script type="text/javascript" src="modules/Documents/documents.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>',
1  include/SugarObjects/templates/person/Person.php
@@ -42,6 +42,7 @@
42 42 class Person extends Basic
43 43 {
44 44 var $picture;
  45 + //Variable to control whether or not to invoke the getLocalFormatttedName method with title and salutation
45 46 var $createLocaleFormattedName = true;
46 47
47 48 function Person(){
9 include/SugarTinyMCE.php
@@ -115,11 +115,18 @@ function getInstance($targets = "") {
115 115 }
116 116
117 117 $config = $this->defaultConfig;
  118 + //include tinymce lang file
  119 + $lang = substr($GLOBALS['current_language'], 0, 2);
  120 + if(file_exists('include/javascript/tiny_mce/langs/'.$lang.'.js'))
  121 + {
  122 + $config['language'] = $lang;
  123 + }
118 124 $config['directionality'] = SugarThemeRegistry::current()->directionality;
119 125 $config['elements'] = $targets;
120 126 $config['theme_advanced_buttons1'] = $this->buttonConfigs['default']['buttonConfig'];
121 127 $config['theme_advanced_buttons2'] = $this->buttonConfigs['default']['buttonConfig2'];
122   - $config['theme_advanced_buttons3'] = $this->buttonConfigs['default']['buttonConfig3'];
  128 + $config['theme_advanced_buttons3'] = $this->buttonConfigs['default']['buttonConfig3'];
  129 +
123 130 $jsConfig = $json->encode($config);
124 131
125 132 $instantiateCall = '';
46 include/Sugarpdf/Sugarpdf.php
@@ -48,6 +48,14 @@
48 48
49 49 class Sugarpdf extends TCPDF
50 50 {
  51 + /**
  52 + * Stretch options constants
  53 + */
  54 + const STRETCH_NONE = 0;
  55 + const STRETCH_SCALE = 1;
  56 + const STRETCH_SCALE_FORCED = 2;
  57 + const STRETCH_SPACING = 3;
  58 + const STRETCH_SPACING_FORCED = 4;
51 59
52 60 /**
53 61 * This array is meant to hold an objects/data that we would like to pass between
@@ -310,10 +318,11 @@ public function Ln1() {
310 318 * @param $item Array[line number (0 to x)][cell header] = Cell content OR
311 319 * Array[line number (0 to x)][cell header]['value'] = Cell content AND
312 320 * Array[line number (0 to x)][cell header]['options'] = Array[cell properties] = values
313   - * @param $options Array which can contain : width (array 'column name'=>'width value + % OR nothing'), isheader (bool), header (array), fill (string: HTML color), ishtml (bool) default: false, border (0: no border (defaul), 1: frame or all of the following characters: L ,T ,R ,B), align (L: left align, C: center, R: right align, J: justification)
  321 + * @param $options Array which can contain : width (array 'column name'=>'width value + % OR nothing'), isheader (bool), header (array), fill (string: HTML color), ishtml (bool) default: false, border (0: no border (defaul), 1: frame or all of the following characters: L ,T ,R ,B), align (L: left align, C: center, R: right align, J: justification), stretch (array 'column name'=>stretch type)
314 322 * @see MultiCell()
315 323 */
316   - public function writeCellTable($item, $options=NULL){
  324 + public function writeCellTable($item, $options=NULL)
  325 + {
317 326 // Save initial font values
318 327 $fontFamily = $this->getFontFamily();
319 328 $fontSize = $this->getFontSizePt();
@@ -332,9 +341,8 @@ public function writeCellTable($item, $options=NULL){
332 341 $header[$k]=$k;
333 342 }
334 343 $h = $this->getLineHeightFromArray($header, $options["width"]);
335   - foreach($header as $v){
336   - $this->MultiCell($options["width"][$v],$h,$v,$headerOptions['border'],$headerOptions['align'],$headerOptions['fillstate'],0,'','',true,0,$headerOptions['ishtml']);
337   - }
  344 + foreach ($header as $v)
  345 + $this->MultiCell($options["width"][$v],$h,$v,$headerOptions['border'],$headerOptions['align'],$headerOptions['fillstate'],0,'','',true, $options['stretch'][$v], $headerOptions['ishtml']);
338 346 $this->SetFillColorArray($this->convertHTMLColorToDec($options['fill']));
339 347 $this->Ln();
340 348 }
@@ -344,10 +352,18 @@ public function writeCellTable($item, $options=NULL){
344 352 $this->SetFont($fontFamily,$fontStyle,$fontSize);
345 353 $this->SetTextColor(0, 0, 0);
346 354 $even=true;
  355 + $firstrow = true;
347 356 // LINES
348 357 foreach($item as $k=>$line){
349 358 $even=!$even;
350 359 $h = $this->getLineHeightFromArray($line, $options["width"]);
  360 + // in the case when cell height is greater than page height
  361 + // need to adjust the current page number
  362 + // so the following output will not overlap the previous output
  363 + if ($this->getNumPages() != $this->getPage()) {
  364 + $this->setPage($this->getNumPages());
  365 + }
  366 + $firstcell = true;
351 367 //CELLS
352 368 foreach($line as $kk=>$cell){
353 369 $cellOptions = $options;
@@ -367,12 +383,23 @@ public function writeCellTable($item, $options=NULL){
367 383 $this->SetFillColorArray($this->convertHTMLColorToDec($options['oddcolor']));
368 384 $cellOptions['fillstate']=1;
369 385 }
370   -
371   - $this->MultiCell($options["width"][$kk],$h,$value,$cellOptions['border'],$cellOptions['align'],$cellOptions['fillstate'],0,'','',true,0,$cellOptions['ishtml']);
  386 +
  387 + if ($firstrow) {
  388 + $this->MultiCell($options["width"][$kk],$h,$value,$cellOptions['border'],$cellOptions['align'],$cellOptions['fillstate'],0,'','',true, $options['stretch'][$kk], $cellOptions['ishtml'], true, 0, false);
  389 + } else {
  390 + if ($firstcell) {
  391 + // add page only once (for the first cell)
  392 + $this->MultiCell($options["width"][$kk],$h,$value,$cellOptions['border'],$cellOptions['align'],$cellOptions['fillstate'],0,'','',true,0,$cellOptions['ishtml'], true, 0, true);
  393 + $firstcell = false;
  394 + } else {
  395 + $this->MultiCell($options["width"][$kk],$h,$value,$cellOptions['border'],$cellOptions['align'],$cellOptions['fillstate'],0,'','',true,0,$cellOptions['ishtml'], true, 0, false);
  396 + }
  397 + }
372 398
373 399 $this->SetFillColorArray($this->convertHTMLColorToDec($options['fill']));
374 400 }
375 401 $this->Ln();
  402 + $firstrow = false;
376 403 }
377 404 $this->SetFont($fontFamily,$fontStyle,$fontSize);
378 405 $this->SetTextColor(0, 0, 0);
@@ -522,7 +549,10 @@ private function initOptionsForWriteCellTable($options, $item){
522 549 if(empty($options['border'])){
523 550 $options['border'] = 0;
524 551 }
525   -
  552 + foreach($item[0] as $k => $v)
  553 + if (empty($options['stretch'][$k]))
  554 + $options['stretch'][$k] = self::STRETCH_NONE;
  555 +
526 556 if(!empty($options['fill'])){
527 557 $this->SetFillColorArray($this->convertHTMLColorToDec($options['fill']));
528 558 $options['fillstate']=1;
35 include/TemplateHandler/TemplateHandler.php
@@ -320,8 +320,9 @@ function createQuickSearchCode($defs, $defs2, $view = '', $module='') {
320 320 foreach($defs as $f) {
321 321 $field = $f;
322 322 $name = $qsd->form_name . '_' . $field['name'];
  323 +
323 324 if($field['type'] == 'relate' && isset($field['module']) && preg_match('/_name$|_c$/si',$name)) {
324   - if(preg_match('/^(Campaigns|Teams|Users|Accounts)$/si', $field['module'], $matches)) {
  325 + if(preg_match('/^(Campaigns|Teams|Users|Contacts|Accounts)$/si', $field['module'], $matches)) {
325 326
326 327 if($matches[0] == 'Campaigns') {
327 328 $sqs_objects[$name.'_'.$parsedView] = $qsd->getQSCampaigns();
@@ -348,6 +349,8 @@ function createQuickSearchCode($defs, $defs2, $view = '', $module='') {
348 349 $shippingKey = isset($f['displayParams']['shippingKey']) ? $f['displayParams']['shippingKey'] : null;
349 350 $additionalFields = isset($f['displayParams']['additionalFields']) ? $f['displayParams']['additionalFields'] : null;
350 351 $sqs_objects[$name.'_'.$parsedView] = $qsd->getQSAccount($nameKey, $idKey, $billingKey, $shippingKey, $additionalFields);
  352 + } else if($matches[0] == 'Contacts'){
  353 + $sqs_objects[$name.'_'.$parsedView] = $qsd->getQSContact($field['name'], $field['id_name']);
351 354 }
352 355 } else {
353 356 $sqs_objects[$name.'_'.$parsedView] = $qsd->getQSParent($field['module']);
@@ -380,26 +383,23 @@ function createQuickSearchCode($defs, $defs2, $view = '', $module='') {
380 383 $field['id_name'] = $field['name'] . "_" . $field['id_name'];
381 384 }
382 385 $name = $qsd->form_name . '_' . $field['name'];
383   -
  386 +
384 387
385 388
386 389 if($field['type'] == 'relate' && isset($field['module']) && (preg_match('/_name$|_c$/si',$name) || !empty($field['quicksearch']))) {
387   - if(!preg_match('/_c$/si',$name) && preg_match('/^(Campaigns|Teams|Users|Accounts)$/si', $field['module'], $matches)) {
  390 + if(!preg_match('/_c$/si',$name) && preg_match('/^(Campaigns|Teams|Users|Contacts|Accounts)$/si', $field['module'], $matches)) {
388 391
389 392 if($matches[0] == 'Campaigns') {
390 393 $sqs_objects[$name] = $qsd->getQSCampaigns();
391 394 } else if($matches[0] == 'Users'){
392   - if($field['name'] == 'reports_to_name') {
  395 + if($field['name'] == 'reports_to_name')
393 396 $sqs_objects[$name] = $qsd->getQSUser('reports_to_name','reports_to_id');
394   - }
395   - // Bug 34643 - Default what the options should be for the assigned_user_name field
396   - // and then pass thru the fields to be used in the fielddefs.
397   - elseif($field['name'] == 'assigned_user_name') {
398   - $sqs_objects[$name] = $qsd->getQSUser('assigned_user_name','assigned_user_id');
399   - }
400 397 else {
401   - $sqs_objects[$name] = $qsd->getQSUser($field['name'], $field['id_name']);
402   - }
  398 + if ($view == "ConvertLead")
  399 + $sqs_objects[$name] = $qsd->getQSUser($field['name'], $field['id_name']);
  400 + else
  401 + $sqs_objects[$name] = $qsd->getQSUser();
  402 + }
403 403 } else if($matches[0] == 'Campaigns') {
404 404 $sqs_objects[$name] = $qsd->getQSCampaigns();
405 405 } else if($matches[0] == 'Accounts') {
@@ -415,6 +415,11 @@ function createQuickSearchCode($defs, $defs2, $view = '', $module='') {
415 415 $shippingKey = SugarArray::staticGet($f, 'displayParams.shippingKey');
416 416 $additionalFields = SugarArray::staticGet($f, 'displayParams.additionalFields');
417 417 $sqs_objects[$name] = $qsd->getQSAccount($nameKey, $idKey, $billingKey, $shippingKey, $additionalFields);