Permalink
Browse files

Release 6.3.1

  • Loading branch information...
1 parent 17402a8 commit 4811d338b8019c6be617afa3bcb14c13cc0c78c7 John Mertic committed Dec 19, 2011
Showing with 2,320 additions and 3,606 deletions.
  1. +35 −11 data/Link2.php
  2. +2 −4 data/Relationships/M2MRelationship.php
  3. +3 −1 data/Relationships/One2MBeanRelationship.php
  4. +21 −3 data/SugarBean.php
  5. +5 −3 download.php
  6. +111 −108 files.md5
  7. +0 −23 include/EditView/EditView2.php
  8. +4 −5 include/MVC/View/SugarView.php
  9. +68 −0 include/MVC/View/views/view.detail.config.php
  10. +48 −33 include/MVC/View/views/view.detail.php
  11. +10 −1 include/MVC/View/views/view.popup.php
  12. +47 −30 include/MassUpdate.php
  13. +6 −1 include/MySugar/tpls/MySugar.tpl
  14. +3 −2 include/Pear/HTML_Safe/Safe.php
  15. +1 −1 include/Popups/Popup_picker.php
  16. +1 −2 include/Popups/tpls/header.tpl
  17. +44 −31 include/SearchForm/SearchForm2.php
  18. +7 −0 include/Smarty/plugins/block.nocache.php
  19. +59 −0 include/Smarty/plugins/function.sugar_email_btn.php
  20. +2 −1 include/SugarCharts/Jit/js/sugarCharts.js
  21. +1 −1 include/SugarFields/Fields/Collection/SugarFieldCollection.js
  22. +1 −1 include/SugarFields/Fields/Parent/SearchView.tpl
  23. +1 −0 include/SugarObjects/templates/issue/vardefs.php
  24. +2 −2 include/TemplateHandler/TemplateHandler.php
  25. +1 −1 include/database/DBManager.php
  26. +2 −0 include/database/MssqlManager.php
  27. +2 −0 include/database/MysqlManager.php
  28. +11 −1 include/export_utils.php
  29. +1 −1 include/externalAPI/ExternalAPIFactory.php
  30. +13 −4 include/javascript/calendar.js
  31. +8 −1 include/javascript/overlibmws.js
  32. +1 −1 include/javascript/sugar_3.js
  33. +14 −5 include/javascript/sugar_grp1.js
  34. +74 −13 include/javascript/sugar_grp_emails.js
  35. +8 −1 include/javascript/sugar_grp_overlib.js
  36. +199 −13 include/javascript/sugar_grp_quickcomp.js
  37. +1 −1 include/javascript/sugarwidgets/SugarYUILoader.js
  38. +1 −2,888 include/timezone/timezones.php
  39. +46 −31 include/utils.php
  40. +16 −11 include/utils/layout_utils.php
  41. +1 −1 include/utils/mvc_utils.php
  42. +2 −0 jssource/JSGroupings.php
  43. +5 −0 jssource/src_files/include/SugarCharts/Jit/js/sugarCharts.js
  44. +2 −1 jssource/src_files/include/SugarFields/Fields/Collection/SugarFieldCollection.js
  45. +81 −18 jssource/src_files/include/javascript/calendar.js
  46. +19 −3 jssource/src_files/include/javascript/overlibmws.js
  47. +1 −1 jssource/src_files/include/javascript/sugar_3.js
  48. +8 −2 jssource/src_files/include/javascript/sugarwidgets/SugarYUILoader.js
  49. +3 −2 modules/ACLRoles/DetailViewBody.tpl
  50. +9 −8 modules/ACLRoles/views/view.list.php
  51. +28 −24 modules/Activities/Popup_picker.php
  52. +1 −1 modules/Administration/PasswordManager.tpl
  53. +1 −1 modules/Administration/Updater.php
  54. +1 −1 modules/Administration/metadata/adminpaneldefs.php
  55. +23 −1 modules/Administration/updater_utils.php
  56. +21 −8 modules/Calls/Call.php
  57. +6 −1 modules/Calls/tpls/footer.tpl
  58. +2 −3 modules/Calls/vardefs.php
  59. +2 −2 modules/Contacts/ContactFormBase.php
  60. +1 −1 modules/Contacts/Popup_picker.php
  61. +1 −0 modules/Contacts/language/en_us.lang.php
  62. +1 −1 modules/Contacts/tpls/QuickCreate.tpl
  63. +16 −17 modules/Contacts/vardefs.php
  64. +1 −1 modules/Currencies/Currency.php
  65. +1 −1 modules/Documents/views/view.extdoc.php
  66. +4 −4 modules/DynamicFields/templates/Fields/Forms/coreTop.tpl
  67. +2 −2 modules/DynamicFields/templates/Fields/TemplateDatetimecombo.php
  68. +14 −7 modules/EmailMan/tpls/config.tpl
  69. +3 −1 modules/EmailTemplates/DetailView.html
  70. +1 −1 modules/EmailTemplates/DetailView.php
  71. +1 −0 modules/EmailTemplates/EditView.php
  72. +9 −1 modules/EmailTemplates/EmailTemplate.php
  73. +1 −0 modules/Emails/DetailView.php
  74. +2 −2 modules/Emails/EditViewArchive.html
  75. +13 −11 modules/Emails/Email.php
  76. +3 −0 modules/Emails/EmailUIAjax.php
  77. +65 −10 modules/Emails/javascript/EmailUICompose.js
  78. +8 −2 modules/Emails/javascript/ajax.js
  79. +2 −2 modules/Home/SubpanelEdits.php
  80. +9 −0 modules/Import/Importer.php
  81. +1 −1 modules/Import/tpls/step2.tpl
  82. +2 −2 modules/InboundEmail/DetailView.html
  83. +2 −1 modules/InboundEmail/EditView.html
  84. +1 −1 modules/InboundEmail/InboundEmail.php
  85. +3 −1 modules/InboundEmail/language/en_us.lang.php
  86. +1 −0 modules/Leads/language/en_us.lang.php
  87. +12 −12 modules/Leads/vardefs.php
  88. +39 −24 modules/Leads/views/view.convertlead.php
  89. +2 −13 modules/Meetings/Meeting.php
  90. +2 −2 modules/Meetings/metadata/quickcreatedefs.php
  91. +6 −1 modules/Meetings/tpls/footer.tpl
  92. +2 −1 modules/ModuleBuilder/Module/StudioModule.php
  93. +1 −1 modules/ModuleBuilder/parsers/views/AbstractMetaDataParser.php
  94. +8 −0 modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php
  95. +1 −1 modules/ModuleBuilder/parsers/views/UndeployedMetaDataImplementation.php
  96. +1 −1 modules/ModuleBuilder/tpls/labels.tpl
  97. +21 −21 modules/Opportunities/vardefs.php
  98. +3 −3 modules/SavedSearch/SavedSearch.php
  99. +6 −6 modules/Studio/wizards/RenameModules.php
  100. +3 −15 modules/Tasks/Task.php
  101. +10 −21 modules/UserPreferences/UserPreference.php
  102. +16 −2 modules/Users/GeneratePassword.php
  103. +42 −32 modules/Users/User.php
  104. +1 −0 modules/Users/controller.php
  105. +1 −0 modules/Users/language/en_us.lang.php
  106. +8 −0 modules/Users/vardefs.php
  107. +10 −9 modules/Users/views/view.list.php
  108. +133 −5 soap/SoapHelperFunctions.php
  109. +62 −29 soap/SoapSugarUsers.php
  110. +4 −4 sugar_version.php
  111. +90 −0 tests/data/Bug47731Test.php
  112. +61 −0 tests/data/Bug49109Test.php
  113. +88 −0 tests/include/EditView/Bug48570Test.php
  114. +1 −2 tests/include/MVC/View/views/Bug47572Test.php
  115. +3 −1 tests/include/SearchForm/Bug45966Test.php
  116. +2 −1 tests/include/SugarCharts/{Bug43574.php → Bug43574Test.php}
  117. +4 −1 tests/include/database/Bug34547Test.php
  118. +8 −8 tests/include/utils/XssTest.php
  119. +66 −0 tests/modules/Administration/Bug46317Test.php
  120. +2 −0 tests/modules/Import/ImportFormsTest.php
  121. +1 −0 tests/modules/Import/ImporterTest.php
  122. +66 −0 tests/modules/ModuleBuilder/parsers/views/Bug41974Test.php
  123. +2 −6 tests/modules/Studio/RenameModulesTest.php
  124. +115 −0 tests/modules/Users/Bug48555Test.php
  125. +102 −0 tests/service/Bug47683Test.php
  126. +51 −0 themes/Sugar5/tpls/footer.tpl
View
@@ -60,6 +60,8 @@ class Link2 {
protected $rows; //any additional fields on the relationship
protected $loaded; //true if this link has been loaded from the database
protected $relationship_fields = array();
+ //Used to store unsaved beans on this relationship that will be combined with the ones pulled from the DB if getBeans() is called.
+ protected $tempBeans = array();
/**
* @param $linkName String name of a link field in the module's vardefs
@@ -355,11 +357,18 @@ function getBeans() {
{
$this->beans = array();
$rel_module = $this->getRelatedModuleName();
+ //First swap in the temp loaded beans
+ $this->beans = $this->tempBeans;
+ $this->tempBeans = array();
+ //now load from the rows
foreach ($this->rows as $id => $vals)
{
- $tmpBean = BeanFactory::getBean($rel_module, $id);
- if($tmpBean !== FALSE)
- $this->beans[$id] = $tmpBean;
+ if (empty($this->beans[$id]))
+ {
+ $tmpBean = BeanFactory::getBean($rel_module, $id);
+ if($tmpBean !== FALSE)
+ $this->beans[$id] = $tmpBean;
+ }
}
}
@@ -479,30 +488,45 @@ public function __set($name, $val)
}
/**
+ * Add a bean object to the list of beans currently loaded to this relationship.
+ * This for the most part should not need to be called except by the relatipnship implementation classes.
* @param SugarBean $bean
* @return void
*/
public function addBean($bean)
{
if (!is_array($this->beans))
- $this->getBeans();
- $this->beans[$bean->id] = $bean;
+ {
+ $this->tempBeans[$bean->id] = $bean;
+ }
+ else {
+ $this->beans[$bean->id] = $bean;
+ }
+
}
/**
+ * Remove a bean object from the list of beans currently loaded to this relationship.
+ * This for the most part should not need to be called except by the relatipnship implementation classes.
+ *
* @param SugarBean $bean
* @return void
*/
public function removeBean($bean)
{
- if (!is_array($this->beans))
- $this->getBeans();
- unset($this->beans[$bean->id]);
- unset($this->rows[$bean->id]);
+ if (!is_array($this->beans) && isset($this->tempBeans[$bean->id]))
+ {
+ unset($this->tempBeans[$bean->id]);
+ } else {
+ unset($this->beans[$bean->id]);
+ unset($this->rows[$bean->id]);
+ }
}
/**
+ * Directly queries the databse for set of values. The relationship classes and not link should handle this.
+ * @deprecated
* @param $table_name string relationship table
* @param $join_key_values array of key=>values to identify this relationship by
* @return bool true if the given join key set exists in the relationship table
@@ -570,7 +594,7 @@ public function _get_alternate_key_fields($table_name) {
}
/**
- * @depricated
+ * @deprecated
* Gets the vardef for the relationship of this link.
*/
public function _get_link_table_definition($table_name, $def_name) {
@@ -582,7 +606,7 @@ public function _get_link_table_definition($table_name, $def_name) {
}
/**
- * @depricated
+ * @deprecated
* Return the name of the role field for the passed many to many table.
* if there is no role filed : return false
* @param $table_name name of relationship table to inspect
@@ -148,10 +148,8 @@ public function add($lhs, $rhs, $additionalFields = array())
if ($this->self_referencing)
$this->addSelfReferencing($lhs, $rhs, $additionalFields);
- if ($lhs->$lhsLinkName->beansAreLoaded())
- $lhs->$lhsLinkName->addBean($rhs);
- if ($rhs->$rhsLinkName->beansAreLoaded())
- $rhs->$rhsLinkName->addBean($lhs);
+ $lhs->$lhsLinkName->addBean($rhs);
+ $rhs->$rhsLinkName->addBean($lhs);
$this->callAfterAdd($lhs, $rhs, $lhsLinkName);
$this->callAfterAdd($rhs, $lhs, $rhsLinkName);
@@ -76,7 +76,7 @@ public function add($lhs, $rhs, $additionalFields = array())
//Make sure we load the current relationship state to the LHS link
if ((isset($lhs->$lhsLinkName) && is_a($lhs->$lhsLinkName, "Link2")) || $lhs->load_relationship($lhsLinkName)) {
- $lhs->$lhsLinkName->getBeans();
+ $lhs->$lhsLinkName->load();
}
$this->updateFields($lhs, $rhs, $additionalFields);
@@ -267,6 +267,8 @@ public function getSubpanelQuery($link, $params = array(), $return_array = false
$query = '';
$alias = empty($params['join_table_alias']) ? "{$link->name}_rel": $params['join_table_alias'];
+ $alias = $GLOBALS['db']->getHelper()->getValidDBName($alias, 'alias');
+
//Set up any table aliases required
$targetTableWithAlias = "$targetTable $alias";
$targetTable = $alias;
View
@@ -640,7 +640,7 @@ function populateDefaultValues($force=false){
foreach($this->field_defs as $field=>$value){
if((isset($value['default']) || !empty($value['display_default'])) && ($force || empty($this->$field))){
$type = $value['type'];
-
+
switch($type){
case 'date':
if(!empty($value['display_default'])){
@@ -659,6 +659,10 @@ function populateDefaultValues($force=false){
else
$this->$field = $value['default'];
break;
+ case 'bool':
+ if(isset($this->$field)){
+ break;
+ }
default:
if ( isset($value['default']) && $value['default'] !== '' ) {
$this->$field = htmlentities($value['default'], ENT_QUOTES, 'UTF-8');
@@ -1025,7 +1029,8 @@ function get_importable_fields()
$fieldDefs= $this->getFieldDefinitions();
if (!empty($fieldDefs)) {
- foreach ($fieldDefs as $key=>$value_array) {
+ foreach ($fieldDefs as $key=>$value_array)
+ {
if ( (isset($value_array['importable'])
&& (is_string($value_array['importable']) && $value_array['importable'] == 'false'
|| is_bool($value_array['importable']) && $value_array['importable'] == false))
@@ -1039,7 +1044,20 @@ function get_importable_fields()
$importableFields[$key]=$value_array;
}
}
- else {
+ else
+ {
+ //Expose the cooresponding id field of a relate field if it is only defined as a link so that users can relate records by id during import
+ if( isset($value_array['type']) && ($value_array['type'] == 'relate') && isset($value_array['id_name']) )
+ {
+ $idField = $value_array['id_name'];
+ if( isset($fieldDefs[$idField]) && isset($fieldDefs[$idField]['type'] ) && $fieldDefs[$idField]['type'] == 'link' )
+ {
+ $tmpFieldDefs = $fieldDefs[$idField];
+ $tmpFieldDefs['vname'] = translate($value_array['vname'], $this->module_dir) . " " . $GLOBALS['app_strings']['LBL_ID'];
+ $importableFields[$idField]=$tmpFieldDefs;
+ }
+ }
+
$importableFields[$key]=$value_array;
}
}
View
@@ -43,6 +43,7 @@
}
else {
$file_type=''; // bug 45896
+ require_once("data/BeanFactory.php");
ini_set('zlib.output_compression','Off');//bug 27089, if use gzip here, the Content-Length in hearder may be incorrect.
// cn: bug 8753: current_user's preferred export charset not being honored
$GLOBALS['current_user']->retrieve($_SESSION['authenticated_user_id']);
@@ -65,11 +66,12 @@
if(!file_exists('modules/' . $module . '/' . $bean_name . '.php')) {
die($app_strings['ERROR_TYPE_NOT_VALID']);
}
- $focus = BeanFactory::getBean($module, $_REQUEST['id']);
- if(!$focus->ACLAccess('view')){
+
+ $focus = BeanFactory::newBean($module);
+ if(!empty($focus) && !$focus->ACLAccess('view')){
die($mod_strings['LBL_NO_ACCESS']);
} // if
-
+ $focus->retrieve($_REQUEST['id']);
// Pull up the document revision, if it's of type Document
if ( isset($focus->object_name) && $focus->object_name == 'Document' ) {
// It's a document, get the revision that really stores this file
Oops, something went wrong.

0 comments on commit 4811d33

Please sign in to comment.