Permalink
Browse files

Release 6.5.5

  • Loading branch information...
1 parent 96886c2 commit a89681482bc318253006d4437bc071e4f62b7140 @tsuoying tsuoying committed Sep 20, 2012
Showing with 2,513 additions and 980 deletions.
  1. +1 −1 ModuleInstall/ModuleInstaller.php
  2. +3 −3 ModuleInstall/ModuleScanner.php
  3. +1 −1 cache/include/javascript/sugar_grp1_jquery.js
  4. +6 −6 cache/include/javascript/sugar_grp_emails.js
  5. +19 −7 data/Link2.php
  6. +4 −0 data/Relationships/EmailAddressRelationship.php
  7. +4 −0 data/Relationships/M2MRelationship.php
  8. +24 −23 data/Relationships/One2MBeanRelationship.php
  9. +1 −1 data/Relationships/One2OneBeanRelationship.php
  10. +4 −1 data/Relationships/One2OneRelationship.php
  11. +4 −4 data/Relationships/RelationshipFactory.php
  12. +8 −6 data/Relationships/SugarRelationship.php
  13. +151 −77 data/SugarBean.php
  14. +100 −98 files.md5
  15. +63 −0 get_url.php
  16. +1 −1 include/Dashlets/DashletGenericChart.php
  17. +6 −4 include/DetailView/header.tpl
  18. +16 −9 include/ListView/ListViewData.php
  19. +1 −0 include/MVC/Controller/entry_point_registry.php
  20. +14 −6 include/MVC/SugarApplication.php
  21. +24 −6 include/MVC/View/SugarView.php
  22. +2 −2 include/MySugar/MySugar.php
  23. +31 −22 include/SearchForm/SearchForm2.php
  24. +1 −1 include/Smarty/plugins/function.sugar_button.php
  25. +1 −1 include/SubPanel/SubPanelTiles.js
  26. +2 −2 include/SugarCharts/JsChart.php
  27. +6 −6 include/SugarEmailAddress/SugarEmailAddress.js
  28. +99 −34 include/SugarEmailAddress/SugarEmailAddress.php
  29. +18 −0 include/SugarFields/Fields/Currency/SugarFieldCurrency.php
  30. +10 −1 include/SugarFields/Fields/File/SearchView.tpl
  31. +6 −2 include/SugarFields/Fields/File/SugarFieldFile.php
  32. +2 −1 include/SugarFields/Fields/Text/DetailView.tpl
  33. +1 −1 include/SugarObjects/VardefManager.php
  34. +4 −0 include/SugarObjects/templates/person/Person.php
  35. +6 −2 include/SugarTheme/SugarTheme.php
  36. +16 −24 include/connectors/utils/ConnectorHtmlHelper.php
  37. +10 −4 include/database/DBManager.php
  38. +1 −1 include/database/MssqlManager.php
  39. +75 −36 include/generic/Save2.php
  40. +0 −1 include/generic/SugarWidgets/SugarWidgetFieldbool.php
  41. +43 −26 include/generic/SugarWidgets/SugarWidgetFieldcurrency.php
  42. +56 −0 include/generic/SugarWidgets/SugarWidgetFieldlong.php
  43. +14 −36 include/generic/SugarWidgets/SugarWidgetFieldmultienum.php
  44. +6 −4 include/generic/SugarWidgets/SugarWidgetReportField.php
  45. +1 −1 include/generic/SugarWidgets/SugarWidgetSubPanelTopSelectContactsButton.php
  46. +1 −1 include/generic/SugarWidgets/SugarWidgetSubPanelTopSelectUsersButton.php
  47. +2 −2 include/globalControlLinks.php
  48. +1 −1 include/javascript/getYUIComboFile.php
  49. +1 −1 include/javascript/jquery/jquery.hoverIntent.js
  50. +1 −0 include/language/en_us.lang.php
  51. +0 −2 include/language/en_us.notify_template.html
  52. +1 −1 include/phpmailer/class.phpmailer.php
  53. +15 −47 include/utils.php
  54. +4 −0 jssource/src_files/include/SubPanel/SubPanelTiles.js
  55. +21 −14 jssource/src_files/include/SugarEmailAddress/SugarEmailAddress.js
  56. +58 −38 jssource/src_files/modules/Calendar/Cal.js
  57. +10 −2 modules/Administration/Administration.php
  58. +4 −1 modules/Administration/RebuildConfig.php
  59. +6 −1 modules/Audit/Audit.php
  60. +4 −6 modules/Bugs/Bug.php
  61. +0 −1 modules/Calendar/Cal.css
  62. +12 −9 modules/Calendar/Cal.js
  63. +1 −1 modules/Calendar/Calendar.php
  64. +18 −4 modules/Calendar/CalendarGrid.php
  65. +3 −0 modules/Calls/language/en_us.lang.php
  66. +8 −0 modules/Calls/metadata/additionalDetails.php
  67. +1 −1 modules/Calls/metadata/editviewdefs.php
  68. +1 −1 modules/Cases/Case.php
  69. +2 −2 modules/Configurator/Configurator.php
  70. +7 −5 modules/Configurator/UploadFileCheck.php
  71. +1 −0 modules/Configurator/language/en_us.lang.php
  72. +1 −1 modules/Configurator/tpls/EditView.tpl
  73. +1 −1 modules/Configurator/tpls/adminwizard.tpl
  74. +2 −3 modules/Connectors/connectors/formatters/ext/rest/linkedin/tpls/default.tpl
  75. +8 −0 modules/Documents/metadata/SearchFields.php
  76. +2 −0 modules/Documents/vardefs.php
  77. +0 −3 modules/DynamicFields/templates/Fields/TemplateField.php
  78. +16 −7 modules/DynamicFields/templates/Fields/TemplateInt.php
  79. +6 −2 modules/EmailMan/tpls/config.tpl
  80. +82 −50 modules/EmailTemplates/EmailTemplate.php
  81. +1 −1 modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.php
  82. +5 −3 modules/Home/tour.css
  83. +10 −3 modules/Import/views/view.last.php
  84. +4 −4 modules/InboundEmail/InboundEmail.php
  85. +0 −2 modules/Leads/vardefs.php
  86. +2 −0 modules/Meetings/language/en_us.lang.php
  87. +8 −1 modules/Meetings/metadata/additionalDetails.php
  88. +3 −3 modules/Meetings/tpls/reminders.tpl
  89. +5 −2 modules/ModuleBuilder/Module/DropDownBrowser.php
  90. +3 −3 modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php
  91. +5 −3 modules/ModuleBuilder/tpls/layoutView.tpl
  92. +8 −4 modules/MySettings/TabController.php
  93. +0 −2 modules/Prospects/vardefs.php
  94. +5 −8 modules/Relationships/Relationship.php
  95. +1 −1 modules/Tasks/metadata/SearchFields.php
  96. +1 −0 modules/Users/language/en_us.lang.php
  97. +4 −1 modules/Users/reassignUserRecords.php
  98. +7 −7 modules/Users/tpls/EditViewHeader.tpl
  99. +38 −1 soap/SoapSugarUsers.php
  100. +4 −4 sugar_version.php
  101. +128 −2 tests/SugarTestHelper.php
  102. +141 −0 tests/SugarTestOpportunityUtilities.php
  103. +65 −0 tests/SugarTestProspectListsUtilities.php
  104. +146 −0 tests/SugarTestRelationshipUtilities.php
  105. +86 −0 tests/data/Bug33036Test.php
  106. +0 −212 tests/data/Bug45896Test.php
  107. +285 −0 tests/data/SaveRelationshipChangesTest.php
  108. +33 −16 tests/include/SearchForm/{Bug45709Test.php → Bug45709_53785_Test.php}
  109. +77 −0 tests/include/SugarFields/Fields/Currency/Bug55733Test.php
  110. +2 −3 tests/include/connectors/Bug50800Test.php
  111. +1 −0 tests/include/generic/Bug53288Test.php
  112. +81 −0 tests/include/utils/Bug55650Test.php
  113. +1 −2 tests/modules/Calls/CallTest.php
  114. +145 −0 tests/modules/EmailTemplates/Bug46984Test.php
  115. +1 −2 tests/modules/Home/Bug43395Test.php
  116. +6 −4 tests/modules/Home/QuickSearchTests.php
  117. +9 −2 tests/modules/ModuleBuilder/Bug47406Test.php
  118. +1 −0 tests/modules/ModuleBuilder/Bug52063Test.php
  119. +23 −13 tests/modules/UpgradeWizard/Bug42490Test.php
  120. +1 −1 tests/service/RESTAPI3Test.php
@@ -267,7 +267,7 @@ function post_uninstall(){
function install_copy(){
if(isset($this->installdefs['copy'])){
/* BEGIN - RESTORE POINT - by MR. MILK August 31, 2005 02:22:11 PM */
- $backup_path = clean_path( remove_file_extension(urldecode(hashToFile($_REQUEST['install_file'])))."-restore" );
+ $backup_path = clean_path( remove_file_extension(urldecode($_REQUEST['install_file']))."-restore" );
/* END - RESTORE POINT - by MR. MILK August 31, 2005 02:22:18 PM */
foreach($this->installdefs['copy'] as $cp){
$GLOBALS['log']->debug("Copying ..." . $cp['from']. " to " .$cp['to'] );
@@ -85,11 +85,8 @@ class ModuleScanner{
'proc_close',
'proc_get_status',
'proc_nice',
- 'basename',
'passthru',
'clearstatcache',
- 'delete',
- 'dirname',
'disk_free_space',
'disk_total_space',
'diskfreespace',
@@ -161,8 +158,10 @@ class ModuleScanner{
'linkinfo',
'lstat',
'mkdir',
+ 'mkdir_recursive',
'parse_ini_file',
'rmdir',
+ 'rmdir_recursive',
'stat',
'tempnam',
'touch',
@@ -175,6 +174,7 @@ class ModuleScanner{
//mutliple files per function call
'copy',
+ 'copy_recursive',
'link',
'rename',
'symlink',
@@ -828,7 +828,7 @@ b.dequeue()})})}})(jQuery);
})( jQuery );
/* End of File include/javascript/jquery/jquery.json-2.3.js */
-/*******************************************************************************
+/*******************************************************************************
jquery.mb.components
Copyright (c) 2001-2010. Matteo Bicocchi (Pupunzi); Open lab srl, Firenze - Italy
email: info@pupunzi.com
Oops, something went wrong.
View
@@ -466,12 +466,14 @@ public function beansAreLoaded() {
* @param array $rel_keys array of ids or SugarBean objects. If you have the bean in memory, pass it in.
* @param array $additional_values the values should be passed as key value pairs with column name as the key name and column value as key value.
*
- * @return void
+ * @return boolean|array Return true if all relationships were added. Return an array with the failed keys if any of them failed.
*/
function add($rel_keys,$additional_values=array()) {
if (!is_array($rel_keys))
$rel_keys = array($rel_keys);
+ $failures = array();
+
foreach($rel_keys as $key)
{
//We must use beans for LogicHooks and other business logic to fire correctly
@@ -487,12 +489,22 @@ function add($rel_keys,$additional_values=array()) {
return false;
if ($this->getSide() == REL_LHS) {
- $this->relationship->add($this->focus, $key, $additional_values);
+ $success = $this->relationship->add($this->focus, $key, $additional_values);
}
else {
- $this->relationship->add($key, $this->focus, $additional_values);
+ $success = $this->relationship->add($key, $this->focus, $additional_values);
+ }
+
+ if($success == false) {
+ $failures[] = $key->id;
}
}
+
+ if(!empty($failures)) {
+ return $failures;
+ }
+
+ return true;
}
@@ -501,7 +513,7 @@ function add($rel_keys,$additional_values=array()) {
* Marks the relationship delted for this given record pair.
* @param $id id of the Parent/Focus SugarBean
* @param string $related_id id or SugarBean to unrelate. Pass a SugarBean if you have it.
- * @return void
+ * @return boolean true if delete was successful or false if it was not
*/
function delete($id, $related_id='') {
if (empty($this->focus->id))
@@ -512,15 +524,15 @@ function delete($id, $related_id='') {
$related_id = $this->getRelatedBean($related_id);
}
if ($this->getSide() == REL_LHS) {
- $this->relationship->remove($this->focus, $related_id);
+ return $this->relationship->remove($this->focus, $related_id);
}
else {
- $this->relationship->remove($related_id, $this->focus);
+ return $this->relationship->remove($related_id, $this->focus);
}
}
else
{
- $this->relationship->removeAll($this);
+ return $this->relationship->removeAll($this);
}
}
@@ -79,6 +79,8 @@ public function add($lhs, $rhs, $additionalFields = array())
$lhs->$lhsLinkName->addBean($rhs);
$this->callAfterAdd($lhs, $rhs, $lhsLinkName);
+
+ return true;
}
public function remove($lhs, $rhs)
@@ -126,5 +128,7 @@ public function remove($lhs, $rhs)
$this->callAfterDelete($lhs, $rhs, $lhsLinkName);
}
}
+
+ return true;
}
}
@@ -160,6 +160,8 @@ public function add($lhs, $rhs, $additionalFields = array())
$this->callAfterAdd($lhs, $rhs, $lhsLinkName);
$this->callAfterAdd($rhs, $lhs, $rhsLinkName);
+
+ return true;
}
protected function getRowToInsert($lhs, $rhs, $additionalFields = array())
@@ -279,6 +281,8 @@ public function remove($lhs, $rhs)
$this->callAfterDelete($rhs, $lhs, $rhsLinkName);
}
}
+
+ return true;
}
/**
@@ -109,6 +109,8 @@ public function add($lhs, $rhs, $additionalFields = array())
//If we aren't already in a relationship save, intitiate a save now.
if (empty($GLOBALS['resavingRelatedBeans']))
SugarRelationship::resaveRelatedBeans();
+
+ return true;
}
protected function updateLinks($lhs, $lhsLinkName, $rhs, $rhsLinkName)
@@ -143,7 +145,7 @@ public function remove($lhs, $rhs, $save = true)
//If this relationship has already been removed, we can just return
if ($rhs->$rhsID != $lhs->id)
- return;
+ return false;
$rhs->$rhsID = '';
@@ -164,6 +166,8 @@ public function remove($lhs, $rhs, $save = true)
$this->callAfterDelete($lhs, $rhs);
$this->callAfterDelete($rhs, $lhs);
}
+
+ return true;
}
/**
@@ -315,28 +319,25 @@ public function getSubpanelQuery($link, $params = array(), $return_array = false
$alias = $GLOBALS['db']->getValidDBName($alias, false, 'alias');
$tableInRoleFilter = "";
- if (($targetTable == "meetings" ||
- $targetTable == "notes" ||
- $targetTable == "tasks" ||
- $targetTable == "calls") && $linkIsLHS == false) {
- if (substr($alias, -25) == "activities_1_meetings_rel" ||
- substr($alias, -22) == "activities_1_tasks_rel" ||
- substr($alias, -22) == "activities_1_calls_rel" ||
- substr($alias, -23) == "activities_1_emails_rel" ||
- substr($alias, -22) == "activities_1_notes_rel")
- $tableInRoleFilter = $alias;
- }
- else if (($startingTable == "meetings" ||
- $startingTable == "notes" ||
- $startingTable == "tasks" ||
- $startingTable == "calls" ||
- $startingTable == "emails") && empty($linkIsLHS)) {
- if (substr($alias, -23) == "activities_meetings_rel" ||
- substr($alias, -20) == "activities_tasks_rel" ||
- substr($alias, -20) == "activities_calls_rel" ||
- substr($alias, -21) == "activities_emails_rel" ||
- substr($alias, -20) == "activities_notes_rel")
- $tableInRoleFilter = $startingTable;
+ if (
+ (
+ $startingTable == "meetings"
+ || $startingTable == "notes"
+ || $startingTable == "tasks"
+ || $startingTable == "calls"
+ || $startingTable == "emails"
+ )
+ &&
+ (
+ $targetTable == "meetings"
+ || $targetTable == "notes"
+ || $targetTable == "tasks"
+ || $targetTable == "calls"
+ )
+ && substr($alias, 0, 12 + strlen($targetTable)) == $targetTable . "_activities_"
+ )
+ {
+ $tableInRoleFilter = $linkIsLHS ? $alias : $startingTable;
}
//Set up any table aliases required
@@ -63,7 +63,7 @@ public function add($lhs, $rhs, $additionalFields = array())
$lhs->load_relationship($lhsLinkName);
$this->removeAll($lhs->$lhsLinkName);
- parent::add($lhs, $rhs, $additionalFields);
+ return parent::add($lhs, $rhs, $additionalFields);
}
protected function updateLinks($lhs, $lhsLinkName, $rhs, $rhsLinkName)
@@ -71,8 +71,11 @@ public function add($lhs, $rhs, $additionalFields = array())
$rhs->load_relationship($rhsLinkName);
$this->removeAll($rhs->$rhsLinkName);
- parent::add($lhs, $rhs, $additionalFields);
+ return parent::add($lhs, $rhs, $additionalFields);
}
+
+ // data matched what was there so return false, since nothing happened
+ return false;
}
@@ -161,7 +161,7 @@ protected function buildRelationshipCache()
if ($buildingRelCache)
return;
$buildingRelCache = true;
- include_once("modules/TableDictionary.php");
+ include("modules/TableDictionary.php");
if (empty($beanList))
include("include/modules.php");
@@ -194,8 +194,8 @@ protected function buildRelationshipCache()
}
//Save it out
sugar_mkdir(dirname($this->getCacheFile()), null, true);
- $out="<?php \n \$relationships=" . var_export($relationships, true) .";";
- sugar_file_put_contents($this->getCacheFile(), $out);
+ $out = "<?php \n \$relationships = " . var_export($relationships, true) . ";";
+ sugar_file_put_contents_atomic($this->getCacheFile(), $out);
$this->relationships = $relationships;
$buildingRelCache = false;
@@ -207,4 +207,4 @@ protected function getCacheFile() {
-}
+}
@@ -71,7 +71,7 @@
* @abstract
* @param $lhs SugarBean
* @param $rhs SugarBean
- * @return void
+ * @return boolean
*/
public abstract function remove($lhs, $rhs);
@@ -115,7 +115,7 @@
/**
* @param $link Link2 removes all the beans associated with this link from the relationship
- * @return void
+ * @return boolean true if it was successful, false if it was not
*/
public function removeAll($link)
{
@@ -128,10 +128,12 @@ public function removeAll($link)
}
if ($link->getSide() == REL_LHS)
- $this->remove($focus, $relBean);
+ return $this->remove($focus, $relBean);
else
- $this->remove($relBean, $focus);
+ return $this->remove($relBean, $focus);
}
+
+ return false;
}
/**
@@ -184,7 +186,7 @@ public function getFields()
/**
* @param array $row values to be inserted into the relationship
- * @return bool|void null if new row was inserted and true if an exesting row was updated
+ * @return bool|void null if new row was inserted and true if an existing row was updated
*/
protected function addRow($row)
{
@@ -483,4 +485,4 @@ public function __get($name)
return null;
}
-}
+}
Oops, something went wrong.

0 comments on commit a896814

Please sign in to comment.