From 937971c2366fb05b092644f10ec3355269488133 Mon Sep 17 00:00:00 2001 From: Paul Huang Date: Tue, 14 May 2013 16:38:43 -0700 Subject: [PATCH] Release 6.5.13 --- cache/include/javascript/sugar_grp1.js | 2 +- data/Relationships/One2MBeanRelationship.php | 3 +- data/Relationships/RelationshipFactory.php | 11 +- data/Relationships/SugarRelationship.php | 1 + data/SugarBean.php | 139 ++++++++-- files.md5 | 120 ++++---- include/Dashlets/Dashlet.php | 30 +- include/Dashlets/DashletGenericChart.php | 8 +- include/ListView/ListView.php | 35 ++- include/MVC/SugarApplication.php | 11 +- include/Popups/PopupSmarty.php | 1 - .../plugins/function.sugar_replace_vars.php | 9 +- include/SubPanel/SubPanelTiles.js | 10 +- include/SubPanel/SubPanelTiles.php | 34 ++- include/SugarCharts/Jit/JitReports.php | 2 +- include/SugarCharts/JsChart.php | 8 +- include/SugarCharts/SugarChart.php | 17 +- include/SugarLogger/LoggerManager.php | 2 +- include/database/DBManager.php | 21 +- .../SugarWidgets/SugarWidgetFielddatetime.php | 9 +- .../SugarWidgets/SugarWidgetFieldname.php | 1 + .../SugarWidgets/SugarWidgetFieldrelate.php | 20 +- include/javascript/jsAlerts.php | 25 +- include/javascript/sugar_3.js | 2 +- include/language/en_us.lang.php | 2 +- include/php-sql-parser.php | 8 +- .../include/SubPanel/SubPanelTiles.js | 76 +++-- .../src_files/include/javascript/sugar_3.js | 4 +- jssource/src_files/modules/Calendar/Cal.js | 2 +- modules/Calendar/Cal.js | 2 +- modules/Campaigns/WizardHome.php | 9 +- modules/Campaigns/WizardNewsletter.php | 3 +- modules/DynamicFields/DynamicField.php | 1 + modules/EAPM/language/en_us.lang.php | 2 +- modules/Emails/Compose.php | 39 ++- modules/Home/About.php | 2 +- .../Dashlets/ChartsDashlet/ChartsDashlet.php | 23 +- .../SugarNewsDashlet/SugarNewsDashlet.php | 76 +---- .../Dashlets/iFrameDashlet/iFrameDashlet.php | 36 ++- modules/Home/language/en_us.lang.php | 3 +- modules/Home/quicksearchQuery.php | 2 +- modules/Import/UsersLastImport.php | 2 + modules/MergeRecords/SaveMerge.php | 13 +- .../relationships/AbstractRelationship.php | 2 + .../relationships/ActivitiesRelationship.php | 2 + modules/Opportunities/vardefs.php | 1 + modules/Users/GeneratePassword.php | 2 +- modules/Users/User.php | 25 +- .../AuthenticationController.php | 33 ++- .../SAMLAuthenticate/SAMLAuthenticate.php | 26 +- .../SugarAuthenticate/SugarAuthenticate.php | 11 + service/core/SoapHelperWebService.php | 2 +- service/core/SugarWebServiceImpl.php | 2 +- service/v3/SugarWebServiceImplv3.php | 2 +- service/v3_1/SugarWebServiceImplv3_1.php | 6 +- service/v4/SugarWebServiceImplv4.php | 2 +- soap/SoapDeprecated.php | 2 +- soap/SoapSugarUsers.php | 16 +- sugar_version.php | 8 +- tests/data/Bug52438Tets.php | 95 +++++++ tests/data/Bug59095Test.php | 80 ++++++ tests/include/Bug62329Test.php | 59 ++++ .../Dashlets/DashletAutoRefreshTest.php | 34 ++- .../Expression/Generic/Bug61734Test.php | 148 ++++++++++ tests/include/PHPSQLParser/Bug61996Test.php | 57 ++++ tests/include/Smarty/plugins/Bug54203Test.php | 88 ++++++ tests/include/SugarCharts/Bug52901Test.php | 262 ++++++++++++++++++ tests/include/database/Bug61885Test.php | 140 ++++++++++ tests/modules/DynamicFields/Bug61859Test.php | 71 +++++ .../modules/DynamicFields/Bug61859_p2Test.php | 125 +++++++++ tests/modules/Import/UsersLastImportTest.php | 1 + tests/modules/Users/UserTest.php | 7 + tests/service/Bug62094Test.php | 91 ++++++ themes/Sugar5/tpls/_welcome.tpl | 2 +- 74 files changed, 1873 insertions(+), 355 deletions(-) create mode 100755 tests/data/Bug52438Tets.php create mode 100755 tests/data/Bug59095Test.php create mode 100755 tests/include/Bug62329Test.php create mode 100755 tests/include/Expressions/Expression/Generic/Bug61734Test.php create mode 100755 tests/include/PHPSQLParser/Bug61996Test.php create mode 100755 tests/include/Smarty/plugins/Bug54203Test.php create mode 100755 tests/include/SugarCharts/Bug52901Test.php create mode 100755 tests/include/database/Bug61885Test.php create mode 100755 tests/modules/DynamicFields/Bug61859Test.php create mode 100755 tests/modules/DynamicFields/Bug61859_p2Test.php create mode 100755 tests/service/Bug62094Test.php diff --git a/cache/include/javascript/sugar_grp1.js b/cache/include/javascript/sugar_grp1.js index f304994f..8fd1211c 100644 --- a/cache/include/javascript/sugar_grp1.js +++ b/cache/include/javascript/sugar_grp1.js @@ -6,7 +6,7 @@ function checkMinSupported(c,s){var current=c.split(".");var supported=s.split(" return true;} function checkMaxSupported(c,s){var current=c.split(".");var supported=s.split(".");for(var i in supported){if(current[i]&&parseInt(current[i])>parseInt(supported[i]))return false;else if(current[i]&&parseInt(current[i])getBeans(null); foreach($prevRelated as $oldLHS) { - $this->remove($oldLHS, $rhs, false); + if ($oldLHS->id != $lhs->id) + $this->remove($oldLHS, $rhs, false); } } diff --git a/data/Relationships/RelationshipFactory.php b/data/Relationships/RelationshipFactory.php index 8468c2a7..6fb872b8 100644 --- a/data/Relationships/RelationshipFactory.php +++ b/data/Relationships/RelationshipFactory.php @@ -168,7 +168,10 @@ class SugarRelationshipFactory { //Reload ALL the module vardefs.... foreach($beanList as $moduleName => $beanName) { - VardefManager::loadVardef($moduleName, BeanFactory::getObjectName($moduleName)); + VardefManager::loadVardef($moduleName, BeanFactory::getObjectName($moduleName), false, array( + //If relationships are not yet loaded, we can't figure out the rel_calc_fields. + "ignore_rel_calc_fields" => true, + )); } $relationships = array(); @@ -198,6 +201,12 @@ class SugarRelationshipFactory { sugar_file_put_contents_atomic($this->getCacheFile(), $out); $this->relationships = $relationships; + + //Now load all vardefs a second time populating the rel_calc_fields + foreach ($beanList as $moduleName => $beanName) { + VardefManager::loadVardef($moduleName, BeanFactory::getObjectName($moduleName)); + } + $buildingRelCache = false; } diff --git a/data/Relationships/SugarRelationship.php b/data/Relationships/SugarRelationship.php index 9650732b..50ca4b28 100644 --- a/data/Relationships/SugarRelationship.php +++ b/data/Relationships/SugarRelationship.php @@ -337,6 +337,7 @@ abstract class SugarRelationship $custom_logic_arguments['related_id'] = $related->id; $custom_logic_arguments['module'] = $focus->module_dir; $custom_logic_arguments['related_module'] = $related->module_dir; + $custom_logic_arguments['related_bean'] = $related; $custom_logic_arguments['link'] = $link_name; $custom_logic_arguments['relationship'] = $this->name; diff --git a/data/SugarBean.php b/data/SugarBean.php index c2659845..79d0869f 100644 --- a/data/SugarBean.php +++ b/data/SugarBean.php @@ -1697,6 +1697,8 @@ class SugarBean $this->handle_remaining_relate_fields($exclude); + $this->update_parent_relationships($exclude); + $this->handle_request_relate($new_rel_id, $new_rel_link); } @@ -1871,6 +1873,83 @@ class SugarBean return $modified_relationships; } + + /** + * Updates relationships based on changes to fields of type 'parent' which + * may or may not have links associated with them + * + * @param array $exclude + */ + protected function update_parent_relationships($exclude = array()) + { + foreach ($this->field_defs as $def) + { + if (!empty($def['type']) && $def['type'] == "parent") + { + if (empty($def['type_name']) || empty($def['id_name'])) + continue; + $typeField = $def['type_name']; + $idField = $def['id_name']; + if (in_array($idField, $exclude)) + continue; + //Determine if the parent field has changed. + if ( + //First check if the fetched row parent existed and now we no longer have one + (!empty($this->fetched_row[$typeField]) && !empty($this->fetched_row[$idField]) + && (empty($this->$typeField) || empty($this->$idField)) + ) || + //Next check if we have one now that doesn't match the fetch row + (!empty($this->$typeField) && !empty($this->$idField) && + (empty($this->fetched_row[$typeField]) || empty($this->fetched_row[$idField]) + || $this->fetched_row[$idField] != $this->$idField) + ) || + // Check if we are deleting the bean, should remove the bean from any relationships + $this->deleted == 1 + ) { + $parentLinks = array(); + //Correlate links to parent field module types + foreach ($this->field_defs as $ldef) + { + if (!empty($ldef['type']) && $ldef['type'] == "link" && !empty($ldef['relationship'])) + { + $relDef = SugarRelationshipFactory::getInstance()->getRelationshipDef($ldef['relationship']); + if (!empty($relDef['relationship_role_column']) && $relDef['relationship_role_column'] == $typeField) + { + $parentLinks[$relDef['lhs_module']] = $ldef; + } + } + } + + //If we used to have a parent, call remove on that relationship + if (!empty($this->fetched_row[$typeField]) && !empty($this->fetched_row[$idField]) + && !empty($parentLinks[$this->fetched_row[$typeField]]) + && ($this->fetched_row[$idField] != $this->$idField)) + { + $oldParentLink = $parentLinks[$this->fetched_row[$typeField]]['name']; + //Load the relationship + if ($this->load_relationship($oldParentLink)) + { + $this->$oldParentLink->delete($this->fetched_row[$idField]); + // Should resave the old parent + SugarRelationship::addToResaveList(BeanFactory::getBean($this->fetched_row[$typeField], $this->fetched_row[$idField])); + } + } + + // If both parent type and parent id are set, save it unless the bean is being deleted + if (!empty($this->$typeField) && !empty($this->$idField) && !empty($parentLinks[$this->$typeField]['name']) && $this->deleted != 1) + { + //Now add the new parent + $parentLink = $parentLinks[$this->$typeField]['name']; + if ($this->load_relationship($parentLink)) + { + $this->$parentLink->add($this->$idField); + } + } + } + } + } + } + /** * Finally, we update a field listed in the _REQUEST['%/relate_id']/_REQUEST['relate_to'] mechanism (if it has not already been updated) * @@ -2210,6 +2289,10 @@ class SugarBean $this->fetched_row=$row; $this->populateFromRow($row); + // fix defect #52438. implement the same logic as sugar_currency_format + // Smarty modifier does. + $this->populateCurrencyFields(); + global $module, $action; //Just to get optimistic locking working for this release if($this->optimistic_lock && $module == $this->module_dir && $action =='EditView' ) @@ -3295,6 +3378,9 @@ class SugarBean } if(isset($data['additionalFields'])){ foreach($data['additionalFields'] as $k=>$v){ + if (!empty($data['id_name']) && $data['id_name'] == $v && !empty($fields[$data['id_name']])) { + continue; + } $ret_array['select'] .= ' , ' . $params['join_table_alias'] . '.' . $k . ' ' . $v; } } @@ -3589,6 +3675,7 @@ class SugarBean //instantiate a new class each time. This is because php5 passes //by reference by default so if we continually update $this, we will //at the end have a list of all the same objects + /** @var SugarBean $temp */ $temp = new $class(); foreach($this->field_defs as $field=>$value) @@ -3620,29 +3707,7 @@ class SugarBean // fix defect #44206. implement the same logic as sugar_currency_format // Smarty modifier does. - if (property_exists($temp, 'currency_id') && -99 == $temp->currency_id) - { - // manually retrieve default currency object as long as it's - // not stored in database and thus cannot be joined in query - require_once 'modules/Currencies/Currency.php'; - $currency = new Currency(); - $currency->retrieve($temp->currency_id); - - // walk through all currency-related fields - foreach ($temp->field_defs as $temp_field) - { - if (isset($temp_field['type']) && 'relate' == $temp_field['type'] - && isset($temp_field['module']) && 'Currencies' == $temp_field['module'] - && isset($temp_field['id_name']) && 'currency_id' == $temp_field['id_name']) - { - // populate related properties manually - $temp_property = $temp_field['name']; - $currency_property = $temp_field['rname']; - $temp->$temp_property = $currency->$currency_property; - } - } - } - + $temp->populateCurrencyFields(); $list[] = $temp; $index++; @@ -3652,7 +3717,6 @@ class SugarBean $rows_found = $row_offset + count($list); - unset($list[$limit - 1]); if(!$toEnd) { $next_offset--; @@ -5598,4 +5662,31 @@ class SugarBean } return $result; } + + /** + * Populates currency fields in case of currency is default and it's + * attributes are not retrieved from database (bugs ##44206, 52438) + */ + protected function populateCurrencyFields() + { + if (property_exists($this, 'currency_id') && $this->currency_id == -99) { + // manually retrieve default currency object as long as it's + // not stored in database and thus cannot be joined in query + $currency = BeanFactory::getBean('Currencies', $this->currency_id); + + if ($currency) { + // walk through all currency-related fields + foreach ($this->field_defs as $this_field) { + if (isset($this_field['type']) && $this_field['type'] == 'relate' + && isset($this_field['module']) && $this_field['module'] == 'Currencies' + && isset($this_field['id_name']) && $this_field['id_name'] == 'currency_id') { + // populate related properties manually + $this_property = $this_field['name']; + $currency_property = $this_field['rname']; + $this->$this_property = $currency->$currency_property; + } + } + } + } + } } diff --git a/files.md5 b/files.md5 index 8e3902cb..350c91d2 100644 --- a/files.md5 +++ b/files.md5 @@ -1,5 +1,5 @@ 'd3f150e4a5bed444763ebe8a81742a95', './.htaccess' => 'd41d8cd98f00b204e9800998ecf8427e', @@ -272,12 +272,12 @@ $md5_string = array ( './include/HTMLPurifier/LICENSE' => 'a1b3d3e45e8422eed104489842a6f546', './include/HTMLPurifier/CREDITS' => 'a5f9ddecea015543001404c0a9bfd181', './include/SugarHtml/SugarHtml.php' => 'ac86d214d3f6b4d0a9dd72e0aa647b6f', - './include/SubPanel/SubPanelTiles.js' => 'e66d2c2c1a42608646fbdbf90ec99f91', + './include/SubPanel/SubPanelTiles.js' => 'f1a491bdd59cd7460209b6cc4538bbc1', './include/SubPanel/SugarTab.php' => '43d978b88d82d1257057924ed2a316ea', './include/SubPanel/SubPanelDynamic.html' => '719a36409ba810b2d8ee75ff261b5253', './include/SubPanel/tpls/singletabmenu.tpl' => '7a1c4c8d47e31cb40c99bcdd8eece6e2', './include/SubPanel/SubPanelDefinitions.php' => '14b2c6e1437266abf26a1b7447c8a83f', - './include/SubPanel/SubPanelTiles.php' => 'dadb7f55f8f51dbe1b1933c04f0679fc', + './include/SubPanel/SubPanelTiles.php' => 'eb6efd06fc051ba53e9913fada185050', './include/SubPanel/registered_layout_defs.php' => '25547e1f080d3613cff6899d6793276f', './include/SubPanel/SubPanelViewer.php' => '4df8664bef4db2f5e29dca5b61cde965', './include/SubPanel/SubPanel.php' => 'fc94246c071b9c25f4fe5899cec6d011', @@ -480,14 +480,14 @@ $md5_string = array ( './include/SugarCharts/swf/chart.swf' => 'afda6fe91342c4864d1991d3c1ccbfff', './include/SugarCharts/swf/groupByChart.swf' => '2eca03fe41128001349bacf997b1fedc', './include/SugarCharts/SugarChartFactory.php' => 'c83e0510ca458019dcc5fb2fa03cd50e', - './include/SugarCharts/JsChart.php' => '10989e0f93dff1b44f40396bea43e52e', - './include/SugarCharts/SugarChart.php' => '097cda2c1c8f16b47ffe1d3549d9ba0f', + './include/SugarCharts/JsChart.php' => '64c7f3ab27915056fb4583dd85348c15', + './include/SugarCharts/SugarChart.php' => '3d6118aa65d5287bfa324e6791d31d75', './include/SugarCharts/Jit/js/sugarCharts.js' => '767f9de9f53d68fcfafb01448e6d1303', './include/SugarCharts/Jit/js/mySugarCharts.js' => '82a8d27c17a34a3adc46fa887c1cbf3b', './include/SugarCharts/Jit/js/Jit/jit.js' => 'de9a71d630e97395d4bae316c5995fca', './include/SugarCharts/Jit/tpls/chart.tpl' => '338a00c4b18e676050f866b1ce836336', './include/SugarCharts/Jit/tpls/DashletGenericChartScript.tpl' => '81ec53a43eca08c5cb93fd0a5293bc90', - './include/SugarCharts/Jit/JitReports.php' => '2583a52a4bdb5891c653e150c9a4713e', + './include/SugarCharts/Jit/JitReports.php' => '4a84c631957991da42d4d803398b2d16', './include/SugarCharts/Jit/FlashCanvas/flashcanvas.js' => 'c2300996439f4a33c849f40afc5da8ae', './include/SugarCharts/Jit/FlashCanvas/canvas2png.js' => '71a23466955e17ab3094233fee8db708', './include/SugarCharts/Jit/FlashCanvas/flashcanvas.swf' => '528d82bb81799f23d4def3425badf913', @@ -615,8 +615,8 @@ $md5_string = array ( './include/phpmailer/language/phpmailer.lang-ca.php' => 'd62aa6dcbbf9922a0ff5b3157493d34f', './include/phpmailer/language/phpmailer.lang-br.php' => 'a1364ab381ebdf3f05999b31bada24bd', './include/phpmailer/class.phpmailer.php' => 'f5db91a4a2a3889d87bf62f05723cb6b', - './include/php-sql-parser.php' => '4fd316e1251bd1134a46134ad7ddaf57', - './include/database/DBManager.php' => 'f4325e203f70e6deb751aea31c4624ef', + './include/php-sql-parser.php' => '487a128614d4e02770080285a64131c4', + './include/database/DBManager.php' => '039262ca99dc8a1d6da18bc68521e8c9', './include/database/MysqlHelper.php' => '35eefb1723b8c6d45a2363db21bd1cc6', './include/database/DBHelper.php' => '3417b96005ef6bdc856281e27a946055', './include/database/MysqlManager.php' => '39c1a31df25aff638c4086107ee27761', @@ -651,7 +651,7 @@ $md5_string = array ( './include/Popups/tpls/footer.tpl' => '9384eec4814b86a9a646c69bb2f6b814', './include/Popups/tpls/header.tpl' => '132ca519775a21b7817837c2a2e4f199', './include/Popups/tpls/PopupGeneric.tpl' => '83b2f701ddda9f4573d9add0f5e33474', - './include/Popups/PopupSmarty.php' => 'f0fd6de41564c27a848ed2561d44559e', + './include/Popups/PopupSmarty.php' => '6384f04de1c79333fe63bc6480a234f5', './include/Popups/Popup_picker.php' => '92cc9c3a84d4ebbe76e7487605dd5da8', './include/templates/TemplateDragDropChooser.php' => '7ea8b4e854412716a49842e0ec20925b', './include/templates/Template.php' => 'e66cbf4c2a382db7a578224a398bbd8b', @@ -804,7 +804,7 @@ $md5_string = array ( './include/javascript/sugar_yui_overrides.js' => '8f58b85d735143b06883b06246e39170', './include/javascript/cookie.js' => 'fca904047ebf36d4eee53df902debb4f', './include/javascript/popup_parent_helper.js' => '2589c529444f256450a92957e38c3785', - './include/javascript/sugar_3.js' => '52d4297ff56283ae7d236d183bf2cf74', + './include/javascript/sugar_3.js' => '8b300b58c736b72df67bbf993c4f4a11', './include/javascript/jquery.js' => '819fb9d29c24f79d34343e9f182aaf24', './include/javascript/sugar_connection_event_listener.js' => '382b26c2895d7921378688996c93d090', './include/javascript/jsclass_async.js' => 'c09187c0aeaee9f7771b8d9dbde402c4', @@ -2233,7 +2233,7 @@ $md5_string = array ( './include/javascript/yui3/build/oop/oop-min.js' => '18d01168cdb05e6b8787e0274dd59568', './include/javascript/yui3/build/oop/oop.js' => '34bb70e9e4fc05e958234e52208a3f4f', './include/javascript/yui3/index.html' => '34db637b1b8f7789823bda3e0da02864', - './include/javascript/jsAlerts.php' => 'fdc75ea56415165481d5334b949a2188', + './include/javascript/jsAlerts.php' => '53b1c9341d57672511156ba6160797dc', './include/javascript/tiny_mce/tiny_mce_dev.js' => '1688bdfb91dfc0b32a59685cba03f715', './include/javascript/tiny_mce/tiny_mce_popup.js' => '9a9c125814b9715982d246a1ee78084f', './include/javascript/tiny_mce/tiny_mce.js' => '2192ee1b557660fe152f031cea4ff4c2', @@ -2587,7 +2587,7 @@ $md5_string = array ( './include/MVC/View/ViewFactory.php' => '3b8dee6e3ca11046d144fc676bd0bc8e', './include/MVC/View/SugarView.php' => 'c6e0b93e47fbb78b91efcc1e8866459e', './include/MVC/SugarModule.php' => 'd20c55c66b345634e9cfe1360998faf5', - './include/MVC/SugarApplication.php' => '843ffa5fcfe42bf420c1d53ce4dbc447', + './include/MVC/SugarApplication.php' => '97837bb4b3d2b2e9ad101b7925e66aa6', './include/MVC/Controller/file_access_control_map.php' => '973ffb0c666e5e252a7563a4dbfa0e60', './include/MVC/Controller/entry_point_registry.php' => '8f30e68f35d444a9fc110febdd7ae3dd', './include/MVC/Controller/SugarController.php' => '1d5e921063932a6c6220f0e9105f1e74', @@ -2609,8 +2609,8 @@ $md5_string = array ( './include/Dashlets/DashletGenericConfigure.tpl' => 'ceba10c6938ee0374075dd502918e872', './include/Dashlets/DashletGeneric.php' => '9195a87ef908f57901fa8e1f85e9b062', './include/Dashlets/DashletGenericDisplay.tpl' => 'ce701e32b929bd46239d1c8476f6d6be', - './include/Dashlets/DashletGenericChart.php' => 'a9bc81aecd3095b4d084fbeaf6391168', - './include/Dashlets/Dashlet.php' => '550b9c8a853aae6ac1f60e7244a179b5', + './include/Dashlets/DashletGenericChart.php' => '76c409ef79868a33b7f7384bad0442a3', + './include/Dashlets/Dashlet.php' => '91bd0e230138338d804a886180840426', './include/Dashlets/DashletGenericAutoRefresh.tpl' => '076b5009caaa5cd0efd8b79fa04d1d06', './include/Dashlets/DashletGenericChartConfigure.tpl' => '0c368b877a526abe873484da26f2383f', './include/MassUpdate.php' => '61ac29c8db346d29eec89e3e13a03853', @@ -2624,7 +2624,7 @@ $md5_string = array ( './include/ListView/ListViewSmarty.php' => '03c7294fc4d2339083e4b229cfd3c868', './include/ListView/ListViewData.php' => 'fa26469a4d9e5a2c51f2bd94afade8ec', './include/ListView/ListViewGeneric.tpl' => '53f9d79cd21bc746afe2bf11224bc3c9', - './include/ListView/ListView.php' => '2df6b8c274dd20abc21b1cbeceecdec9', + './include/ListView/ListView.php' => 'bcc4092ccded750250442a0943cd9f74', './include/ListView/ListViewFacade.php' => '564aa280b419dde1a8133570ab091a4d', './include/ListView/ListViewDCMenu.tpl' => 'b8fc691b5015320ea9ff8d56c26da377', './include/ListView/ListViewXTPL.php' => '13b61371300ea84868bfecd1625d5be1', @@ -2641,7 +2641,7 @@ $md5_string = array ( './include/resource/Observers/ResourceObserver.php' => '77d273ea39b8e2abe026f1f8c515408b', './include/resource/Observers/SoapResourceObserver.php' => '8966a226d081e396d109d1e13dd6e6e0', './include/language/jsLanguage.php' => 'c5d5b59aa6c5c5a52e96c8758fc5a14e', - './include/language/en_us.lang.php' => '17aeb03a0168572cdd126b936382e5e2', + './include/language/en_us.lang.php' => '7db44df4d14c2ce4e6c37a025c231dd0', './include/language/en_us.notify_template.html' => 'b885a3d87060bee2226369fa918e77f3', './include/pclzip/readme.txt' => '2265cad9ccb84cfcd4093ce26b22dc97', './include/pclzip/gnu-lgpl.txt' => '7fbc338309ac38fefcd64b04bb903e34', @@ -2767,7 +2767,7 @@ $md5_string = array ( './include/Smarty/plugins/function.mailto.php' => '5ba678549af1712ff9e64c244a8806c1', './include/Smarty/plugins/function.eval.php' => '21a9230b569490f28ea9d67b1741ca89', './include/Smarty/plugins/function.html_options.php' => 'a7903c34c86b166373946497fac2b7bb', - './include/Smarty/plugins/function.sugar_replace_vars.php' => '0d5489b730db3efb79e2d1731e28f4ad', + './include/Smarty/plugins/function.sugar_replace_vars.php' => '5b2713c5508042d5dd03df32aa8962ad', './include/Smarty/README' => '1a3fe37eed420a020489d1082ea150c8', './include/Smarty/Smarty_Compiler.class.php' => 'bfeedb6825aa028558e057fede645c58', './include/DetailView/footer.tpl' => '7ab79f09a95135548869efb6c7a4989e', @@ -2823,7 +2823,7 @@ $md5_string = array ( './include/generic/SugarWidgets/SugarWidgetFieldimage.php' => 'ccd8d814ab38f36040d5cb0ba9856b2a', './include/generic/SugarWidgets/SugarWidget.php' => 'c3632e0e49780aa154093ec1aa1fb352', './include/generic/SugarWidgets/SugarWidgetSubPanelDetailViewLink.php' => 'd46e466d0afedce826a2adcf432247cd', - './include/generic/SugarWidgets/SugarWidgetFieldname.php' => '9804aa9627c152261d535efcf4110edf', + './include/generic/SugarWidgets/SugarWidgetFieldname.php' => '1a2dfedea26c24fdfb31022bc2ede0bd', './include/generic/SugarWidgets/SugarWidgetFieldphone.php' => 'efbafe4fa8a6391a58f56e532bf99daa', './include/generic/SugarWidgets/SugarWidgetFielddouble.php' => 'd9c419a4d3a8340946b4fc696d2f138c', './include/generic/SugarWidgets/SugarWidgetSubPanelTopSummaryButton.php' => '8eb2ca8d37afe6eacd2491009be9fec1', @@ -2837,9 +2837,9 @@ $md5_string = array ( './include/generic/SugarWidgets/SugarWidgetSubPanelCloseButton.php' => 'dc4aeab45c4536d847d098096e606519', './include/generic/SugarWidgets/SugarWidgetSubPanelTopCreateNoteButton.php' => '737000e60b4f1d2089311ce1a49f7a50', './include/generic/SugarWidgets/SugarWidgetFieldnum.php' => 'a38a9d4090dd5e904dfaf450a89951ac', - './include/generic/SugarWidgets/SugarWidgetFieldrelate.php' => 'f9def77bd6b2653daf259d911791a4fb', + './include/generic/SugarWidgets/SugarWidgetFieldrelate.php' => '5b9659616ccb8890968bcbecbe9955e4', './include/generic/SugarWidgets/SugarWidgetSubPanelTopSelectAccountButton.php' => 'e7948f3a338cf8535134e4ad53335785', - './include/generic/SugarWidgets/SugarWidgetFielddatetime.php' => 'c75f73d354d4b65a718bbe0703b342e0', + './include/generic/SugarWidgets/SugarWidgetFielddatetime.php' => '6116ffb5351f6dc0acf98240b201d14f', './include/generic/SugarWidgets/SugarWidgetSubPanelEmailLink.php' => 'd6279c8abe809bc070309a8c71e9c4c0', './include/generic/SugarWidgets/SugarWidgetSubPanelRemoveButtonMeetings.php' => '877aa3f9a6283175aeaabd1d76be0b69', './include/generic/SugarWidgets/SugarWidgetFieldfloat.php' => 'aaff5e04fe77e6c303efc0cb5abd76eb', @@ -2850,7 +2850,7 @@ $md5_string = array ( './include/TimeDate.php' => '337d3f46d93fbb3ad2f66d83cb614c6c', './include/Localization/Localization.php' => '82bca3fff2970f0104b41d869fbbb4f5', './include/SugarLogger/SugarLogger.php' => '749c5daac2243ba4e236f63021682056', - './include/SugarLogger/LoggerManager.php' => '2af5d6d49a63056d0c18882027b7602b', + './include/SugarLogger/LoggerManager.php' => 'ca6ce3930f9c14d278e842508e7c2e3e', './include/SugarLogger/LoggerTemplate.php' => 'a26171e000dc96e41467315c146408af', './include/SugarCache/SugarCacheMemory.php' => 'a31af7167a2bcf06e1085b2334e9b3b9', './include/SugarCache/SugarCachesMash.php' => 'ea5ebc0764742c9ed26334beeb1860c3', @@ -3309,15 +3309,15 @@ $md5_string = array ( './SugarSecurity.php' => 'f49c2b65fbdc18e2e6d8c6d92a989c6e', './export.php' => 'f43c308ca088581660606fe23fd30ef7', './data/BeanFactory.php' => '66eb7cf0ed822114e12c7eee7ec3137b', - './data/SugarBean.php' => '634551bb885b7960916ffe539a325e24', + './data/SugarBean.php' => '026f875ab48ad9aac98c9a336e76760d', './data/Link.php' => '667ba00ff4e368a8de7c696729d6a5db', './data/Relationships/One2OneRelationship.php' => '31e10349d8cac5b63008a8f57dee70d6', './data/Relationships/EmailAddressRelationship.php' => '43154ff588da21f1d33af3d8c5cfb9fa', './data/Relationships/M2MRelationship.php' => '3ce3ad73ef2d45f01454b8ca19bc64d8', - './data/Relationships/RelationshipFactory.php' => 'e182936b4af95b33e73d87e7c63e7d26', - './data/Relationships/One2MBeanRelationship.php' => '4f32daac92d4e66d2de064c8af406296', + './data/Relationships/RelationshipFactory.php' => '36fd2a1f4109ade2d64a6b06e1f66a07', + './data/Relationships/One2MBeanRelationship.php' => '915b434966b7215d7e4a24d129ba2b75', './data/Relationships/One2OneBeanRelationship.php' => 'a2fb241e55fb0094f238e3c0d610baf9', - './data/Relationships/SugarRelationship.php' => 'cd1277d101263ba1f02749c2e3273981', + './data/Relationships/SugarRelationship.php' => '1c8f9b4194251585d2cd7d8b307c95a3', './data/Relationships/One2MRelationship.php' => 'd2354e0f95fafac40f18f24434817695', './data/Link2.php' => '7cad1e4141159c2e75c681ad4896da8e', './data/Tracker.php' => '52be33c3c665f3ab8190a7ad73673b3c', @@ -3327,8 +3327,8 @@ $md5_string = array ( './service/core/SugarSoapService.php' => 'f8935c2260dd22cbd7ad275d7ee41d5c', './service/core/SugarRestServiceImpl.php' => '906bb46e9df54528048c8e9c10ed415a', './service/core/WSDL.tpl' => 'd41d8cd98f00b204e9800998ecf8427e', - './service/core/SugarWebServiceImpl.php' => '78fe4527a6629f94bdb27017c3f55481', - './service/core/SoapHelperWebService.php' => '6e339f85c009207a3eb32d82eb8610fa', + './service/core/SugarWebServiceImpl.php' => '737e05b203043e1791d967c6b94c874c', + './service/core/SoapHelperWebService.php' => '1cd19525ad113afbc7fa06000ebbfa6d', './service/core/SugarWebService.php' => 'd9fa202bf8379ae984941bf28913dd50', './service/core/PHP5Soap.php' => '24fea66cb2f6c3dd4d273246ea9689c1', './service/core/REST/SugarRest.php' => 'f30d4e6bbf7c33d5724a5f82a1d06cec', @@ -3347,9 +3347,9 @@ $md5_string = array ( './service/v3/soap.php' => '7611e20e1e921da530c7b8b4320d0338', './service/v3/registry.php' => '8c18e43f4bc598e2b4b69205a7806f48', './service/v3/rest.php' => '07d5f3759bb959a40d40b25d44247d1a', - './service/v3/SugarWebServiceImplv3.php' => 'a43e677e5abc413a8af5e113c9193419', + './service/v3/SugarWebServiceImplv3.php' => '48f599e7e6cda57b94f8b81143ce34e3', './service/v3/SugarWebServiceUtilv3.php' => '7d880b1fd93b2f091706f2e7a554c7eb', - './service/v3_1/SugarWebServiceImplv3_1.php' => '46ff514f848c50b125e9420ecc014501', + './service/v3_1/SugarWebServiceImplv3_1.php' => '31dcb5c025fc43d42e4a7906e7cfe91b', './service/v3_1/soap.php' => '5d9e8526a68b0dcebb2436eee84c5392', './service/v3_1/registry.php' => '268c2b144ea972cffbd2aa6cb2890930', './service/v3_1/SugarWebServiceUtilv3_1.php' => 'ca1fd57fe7e780d9b65f3e696a210e2d', @@ -3366,7 +3366,7 @@ $md5_string = array ( './service/v4/soap.php' => '2f1116aa3dc77d20cc40d46f47d80198', './service/v4/registry.php' => '327b971392fb633d5c0615f2b1c6cc00', './service/v4/rest.php' => 'ea23fb4927de5f1ac981b392dfa3624e', - './service/v4/SugarWebServiceImplv4.php' => '2566d6877ae2a116fb6b1329c471c5e7', + './service/v4/SugarWebServiceImplv4.php' => 'b8c9c526ce1ce8cf05012841aeecf66d', './service/v4/SugarWebServiceUtilv4.php' => 'f057e46f87193f453a254d61fd3afa30', './custom/index.html' => '601a18f179c2ac55779c9bac46942525', './modules/EmailTemplates/EmailTemplate.js' => 'a40693190f3b6917751569ccce16f764', @@ -3548,7 +3548,7 @@ $md5_string = array ( './modules/Documents/DocumentSoap.php' => 'e5da1e11252f0281f7eda3843d465339', './modules/DynamicFields/Save.php' => 'e4eac740436ef3b2a1c8214ce6a6fb1e', './modules/DynamicFields/vardefs.php' => '015382d7643e81debffc8763e2f28a0e', - './modules/DynamicFields/DynamicField.php' => '5783dac022fed61c7a5558100c45bcc1', + './modules/DynamicFields/DynamicField.php' => 'cf04b34ed80dd29ac4602b255da46739', './modules/DynamicFields/FieldCases.php' => '43a6e7f7ec59e9deba48fa9ace0432f6', './modules/DynamicFields/templates/Fields/TemplateRelatedTextField.php' => '267ba7148c01164a931b92a79d1ce7f5', './modules/DynamicFields/templates/Fields/TemplateAddressCountry.php' => '6ab6ad4b696362620e88092a485813a3', @@ -3659,7 +3659,7 @@ $md5_string = array ( './modules/Charts/code/Chart_my_pipeline_by_sales_stage.php' => 'c41499f00ad4972d301860652534d092', './modules/Charts/code/Chart_pipeline_by_sales_stage.php' => '9340a4fbb70f21b8db3fff7597e07c77', './modules/Charts/code/Chart_pipeline_by_lead_source.php' => 'bd590e02517abdd01455e1ae75814768', - './modules/Calendar/Cal.js' => '3215fa8517fe34959593c9d444665e8e', + './modules/Calendar/Cal.js' => '9bae19ac9b613b52787416b1b52a549a', './modules/Calendar/CalendarGrid.php' => '403abd1f8949b0aaf1925a4d1f7a78ee', './modules/Calendar/Cal.css' => '7a99a6900f7e66b42d5a322030d7161d', './modules/Calendar/tpls/footer.tpl' => '1796c56cc9d34cb6b18a46b18ba1aea5', @@ -3749,7 +3749,7 @@ $md5_string = array ( './modules/Emails/views/view.quickcreate.php' => 'fadb1e4974df428b81f310beafe6d077', './modules/Emails/views/view.classic.config.php' => '44d16cdd5978dfc0760d37914d7656e0', './modules/Emails/views/view.modulelistmenu.php' => '235595b96d95a97e1a6191bd57da06ae', - './modules/Emails/Compose.php' => 'a247ef7d91e2eb9b1bb35c30caf0825a', + './modules/Emails/Compose.php' => 'a45501edabc5779c140a48ea32bb5cf3', './modules/Emails/DetailView.html' => '00d32a09de78855e4f7ba64e70fa077c', './modules/Emails/EditView.php' => '6eef36e1af5a7dd3034ca43c60cbd47f', './modules/Emails/ListViewGroup.php' => '73d1437831558ff8356021a7f8aa16a5', @@ -3909,7 +3909,7 @@ $md5_string = array ( './modules/EAPM/metadata/listviewdefs.php' => 'aafa1eff9a54fee0f222747e2f9ee732', './modules/EAPM/metadata/detailviewdefs.php' => '28ce149b128ac16d58110c2102520f33', './modules/EAPM/action_view_map.php' => '81f28f79584e24f5679777bfbecd4815', - './modules/EAPM/language/en_us.lang.php' => 'ae8c828316fc73ed1a0e22f41d9d6e0f', + './modules/EAPM/language/en_us.lang.php' => 'a70fd03b3f3a42f3e11cfe1e91a25a9e', './modules/EAPM/CheckLogins.php' => 'bcb28a4f425f0b2c0629e2997abf02d8', './modules/InboundEmail/InboundEmail.js' => '492eec32f42c0cdf0e0ab6e56e310d51', './modules/InboundEmail/EditGroupFolder.php' => '49ccf1269b4ce76b3b3d4e4ebb961486', @@ -3976,10 +3976,10 @@ $md5_string = array ( './modules/ModuleBuilder/parsers/relationships/RelationshipFactory.php' => 'd4e35f8db98bac236a0942a35760f933', './modules/ModuleBuilder/parsers/relationships/ManyToManyRelationship.php' => 'c66bc8bd15fa2ae0732761bc4fbcaec3', './modules/ModuleBuilder/parsers/relationships/UndeployedRelationships.php' => '727d10e3edc8bdeb986e7fa148696544', - './modules/ModuleBuilder/parsers/relationships/AbstractRelationship.php' => '1f0db9c7dec1eaa57d64988e0be54524', + './modules/ModuleBuilder/parsers/relationships/AbstractRelationship.php' => '81e4b13f80a039488592177fbbfec552', './modules/ModuleBuilder/parsers/relationships/RelationshipsInterface.php' => '5daa8a0d4631e0f111e820e68c188e57', './modules/ModuleBuilder/parsers/relationships/AbstractRelationships.php' => '4cea8980fde1bdc3dffe00698d5f4134', - './modules/ModuleBuilder/parsers/relationships/ActivitiesRelationship.php' => '5d27fcd9fa7f7a4df87a3435113a90a5', + './modules/ModuleBuilder/parsers/relationships/ActivitiesRelationship.php' => '59b448f471935519746ac6ee8a1f586d', './modules/ModuleBuilder/parsers/relationships/OneToOneRelationship.php' => '8aa9e6c0405285628c0f42f0922b9fb8', './modules/ModuleBuilder/parsers/relationships/ManyToOneRelationship.php' => '9ae3146fa4870932b5f56815fa56a392', './modules/ModuleBuilder/parsers/relationships/OneToManyRelationship.php' => 'd4a44d3f67d41dce9e575a9686896e24', @@ -4176,7 +4176,7 @@ $md5_string = array ( './modules/Opportunities/Save.php' => '7263848f9596b29a36f8e13b79a58088', './modules/Opportunities/tpls/QuickCreate.tpl' => '8d3f56efe132ba4c386188a1525e59ad', './modules/Opportunities/Menu.php' => '16be785c2a7cd4ca308d8e619822cb54', - './modules/Opportunities/vardefs.php' => 'a327591c75609df04f512304bbb30de5', + './modules/Opportunities/vardefs.php' => '6901b116c44608e1779dd58ce3ca39d7', './modules/Opportunities/views/view.edit.php' => '16937d232de625ae5b24d2fa5a5b52c3', './modules/Opportunities/views/view.detail.php' => 'c75a6de3b0d060180b6f608a1c463c3e', './modules/Opportunities/OpportunityFormBase.php' => '4e4490d502d18ee3b98db086fa0c8e79', @@ -4290,11 +4290,11 @@ $md5_string = array ( './modules/Users/PopupUsers.php' => 'c2fda3eceb24ebc8d52b4d9212d376bf', './modules/Users/ListRoles.php' => 'e7f514d57fee3427a208819a8b911aac', './modules/Users/authentication/SugarAuthenticate/SugarAuthenticateUser.php' => '1fd53bf09b404dfc44cb7ee0c251f1d8', - './modules/Users/authentication/SugarAuthenticate/SugarAuthenticate.php' => 'c01ce494ab1ec9211532bd8d95beb039', + './modules/Users/authentication/SugarAuthenticate/SugarAuthenticate.php' => 'cc0c692cdafcff493f07703670e0279a', './modules/Users/authentication/EmailAuthenticate/EmailAuthenticate.php' => 'dcb2393e1e3f8df433022c34b94ef125', './modules/Users/authentication/EmailAuthenticate/EmailAuthenticateUser.php' => '2e4bc38ede9a48f9d1d073d087355fc1', './modules/Users/authentication/SAMLAuthenticate/SAMLAuthenticateUser.php' => 'b4de0d81cff814b52f3b10691d2f82a9', - './modules/Users/authentication/SAMLAuthenticate/SAMLAuthenticate.php' => 'fa1dd1de873be40ce6d6d916bd279243', + './modules/Users/authentication/SAMLAuthenticate/SAMLAuthenticate.php' => '1bab62c2ca674666ac622832aa6b493f', './modules/Users/authentication/SAMLAuthenticate/settings.php' => 'ea1c15daa6961ce1aa44a86c8a709fb4', './modules/Users/authentication/SAMLAuthenticate/lib/xmlseclibs/CHANGELOG.txt' => '113d14ef4333039359236ffed624fb85', './modules/Users/authentication/SAMLAuthenticate/lib/xmlseclibs/xmlseclibs.php' => '8b832c004e559e701915bb57b661dda7', @@ -4304,7 +4304,7 @@ $md5_string = array ( './modules/Users/authentication/SAMLAuthenticate/lib/onelogin/saml/authrequest.php' => '96705df3ae615cdb2c75b2ca6bed6d05', './modules/Users/authentication/SAMLAuthenticate/lib/onelogin/saml/response.php' => 'fe50684dde6449668ec090969855ed59', './modules/Users/authentication/SAMLAuthenticate/index.php' => 'c576340598c48831d9f63bd10a650bf7', - './modules/Users/authentication/AuthenticationController.php' => 'c1e0fa8c48500833620965b6a126144e', + './modules/Users/authentication/AuthenticationController.php' => '6927215b40c1efc62775f5754a532c95', './modules/Users/authentication/LDAPAuthenticate/LDAPAuthenticateUser.php' => 'b124f77831a3c9c1e6b4c88df74e9791', './modules/Users/authentication/LDAPAuthenticate/LDAPConfigs/default.php' => '35b840464b0f18d1b3353184d3c02f0c', './modules/Users/authentication/LDAPAuthenticate/LDAPAuthenticate.php' => '6c1ed6d78d1f828d841f51c6328bfa80', @@ -4317,7 +4317,7 @@ $md5_string = array ( './modules/Users/views/view.detail.php' => '5a79a0bed6a7e1066b8dd2d0c183c7ff', './modules/Users/controller.php' => '0feea87ffe98d3254d02c15346518a2a', './modules/Users/SaveSignature.php' => '0dc93f44171b3a7ff29d363820f4ead7', - './modules/Users/User.php' => 'b0834205699ddb053f78eb94607c31de', + './modules/Users/User.php' => '1713fc308d5b7017a1f0403d47627ef4', './modules/Users/login.tpl' => '04ab214e72811e566efb5fddb3f7dc20', './modules/Users/LoggedOut.tpl' => '61fb28e18a396a2b4e7f7b73edf610d2', './modules/Users/SaveTimezone.php' => 'da6ea699f04af08645fb90561985da4f', @@ -4329,7 +4329,7 @@ $md5_string = array ( './modules/Users/UpdateTourStatus.php' => 'dbde916fd8adfbea831a98fe832295d9', './modules/Users/password_utils.php' => 'd4e65ec86148bfe5b5fbab608715c0a0', './modules/Users/SetTimezone.tpl' => 'a252887f7eed833a2e4175f46b95ed92', - './modules/Users/GeneratePassword.php' => '9526818e05ff9f82b4fa632dee430acd', + './modules/Users/GeneratePassword.php' => '7e30ca97433edcf1c6a18abfcf00b4a2', './modules/Users/ChangeGroupTab.php' => '66e01ff939fcac550959f4e15b3da1ae', './modules/Users/metadata/searchdefs.php' => 'ab6c8af1d67e4cb5a67faf6608c8c09d', './modules/Users/metadata/subpaneldefs.php' => '4bd11ed6f31516cbc7ededcbcfb2f5e1', @@ -4367,7 +4367,7 @@ $md5_string = array ( './modules/MergeRecords/vardefs.php' => 'b9a0b22130625cb644e4f96dfcf807fb', './modules/MergeRecords/Step1.php' => 'b63f5e96e7fdea8210f383e695f75216', './modules/MergeRecords/MergeRecord.php' => 'cd1a846223b7879238f35b3b2271c1e7', - './modules/MergeRecords/SaveMerge.php' => 'dfe21b28da3a10e65e2bd0e3cee03f1c', + './modules/MergeRecords/SaveMerge.php' => '4adf74909ff2813213de06dbfafee532', './modules/MergeRecords/SearchForm.html' => 'e75f805c886c24bab76825e1671a14fc', './modules/MergeRecords/Step1.html' => 'cffd07a87673c4892b14e28e3031a354', './modules/MergeRecords/controller.php' => '75144597a9f5e01e9e6b3069c1956828', @@ -4641,7 +4641,7 @@ $md5_string = array ( './modules/Campaigns/GenerateWebToLeadForm.php' => 'd5cafa7db25c447636e15ce120e725bf', './modules/Campaigns/WizardNewsletter.html' => '547321326eaf962629a059cf4a9bfce2', './modules/Campaigns/TrackDetailView.php' => 'f233d679f11da964979af3a55e55def7', - './modules/Campaigns/WizardNewsletter.php' => 'a3d919f4c35fb51d885d5f738983f54e', + './modules/Campaigns/WizardNewsletter.php' => '03127ce88fb69e4020c04697fa58c144', './modules/Campaigns/WebToLeadForm.html' => '046f71352ec5309ceeb8e9f03f1f5cfb', './modules/Campaigns/WizardMarketingSave.php' => '7f0775e7acdb930a406859077670d9eb', './modules/Campaigns/EmailQueue.php' => '16ab91c2d3d39013793d814115f9a680', @@ -4703,7 +4703,7 @@ $md5_string = array ( './modules/Campaigns/metadata/additionalDetails.php' => '5022597576fb0721c3b2601e5d0883b8', './modules/Campaigns/metadata/studio.php' => '9b179b455e6ef27424e0940af96c8c63', './modules/Campaigns/metadata/detailviewdefs.php' => 'bede3cfac8bdca31a0324ebe3347063c', - './modules/Campaigns/WizardHome.php' => '32b2fbff16251bf95089e1ca0e5dc929', + './modules/Campaigns/WizardHome.php' => '276de86d242efe835fb7fefd8a94054e', './modules/Campaigns/Dashlets/TopCampaignsDashlet/TopCampaignsDashlet.tpl' => '33c5b81daa7534db96e94d47718ddb5f', './modules/Campaigns/Dashlets/TopCampaignsDashlet/TopCampaignsDashlet.php' => '1dcc45f2ef35ab0821e02537d05ea309', './modules/Campaigns/Dashlets/TopCampaignsDashlet/TopCampaignsDashletConfigure.tpl' => '139ce68fd59bd063b918be9dd45d1de7', @@ -4945,7 +4945,7 @@ $md5_string = array ( './modules/Import/maps/ImportMapGoogle.php' => '3173641b33cb7aab34d1d8a303d61679', './modules/Import/maps/ImportMapAct.php' => '0f2a9c6e14f213810ce42d91aaeb6e11', './modules/Import/Forms.php' => '6d3487d288bf449a7e8af9817c5f0909', - './modules/Import/UsersLastImport.php' => '4f9f3179471394c73079a78192e26531', + './modules/Import/UsersLastImport.php' => 'cb80974f98680fb3fb7f0906c3ec7b48', './modules/DocumentRevisions/Menu.php' => '4f0a44b44afe851ec231bab60e487105', './modules/DocumentRevisions/vardefs.php' => '9e1f8040172eba2d599466ab0c40766a', './modules/DocumentRevisions/field_arrays.php' => 'f2822471f77fb4b3c49b65e90d824c2b', @@ -5223,21 +5223,21 @@ $md5_string = array ( './modules/Home/views/view.modulelistmenu.php' => '7ded5c69eb2f0ca1d3fabbdd48558724', './modules/Home/SubpanelCreates.php' => '79c5b5e303bc2c0b0d3175fda1c540bd', './modules/Home/PopupSugar.php' => '260363a8b5f91771989ec689f6a17ef7', - './modules/Home/About.php' => 'bb57d18391000bf5f98d9a2e1d0dc861', + './modules/Home/About.php' => 'fba8dbcbe192af1927defffed05c90b8', './modules/Home/UnifiedSearch.php' => '7835685ee31e0f1c764b92d3b914884c', './modules/Home/DynamicAction.php' => '1fc76db09da39b51eb26d7e50985e8a0', './modules/Home/UnifiedSearchAdvanced.tpl' => '5ace9d3df8a137025cb8305ec70d2691', './modules/Home/action_view_map.php' => '0df3bbc778c6dacd04a188b9df3078c5', './modules/Home/TrainingPortal.tpl' => 'cb5f3edf0ee2ec12328af0aa0fb564d8', - './modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.php' => 'd656e8db5cbbd59d340364714612e32c', + './modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.php' => 'd63ebf9acb35554f322045223943662a', './modules/Home/Dashlets/ChartsDashlet/ChartsDashletScript.tpl' => 'c3284ffafbe6c2676636e390abc90bc7', './modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.en_us.lang.php' => '0cbef92ff95eb5761e8e04a936ddac3d', './modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.meta.php' => 'f0cbbba3e293756e474b487b45dbcc99', - './modules/Home/Dashlets/SugarNewsDashlet/SugarNewsDashlet.php' => 'f3d037036957286b6761d9e6c320d98c', + './modules/Home/Dashlets/SugarNewsDashlet/SugarNewsDashlet.php' => '098c65c11f101102da642adc1f7bb501', './modules/Home/Dashlets/SugarNewsDashlet/configure.tpl' => '519b3ba0b9dd8711d403b1d2fa3a33ad', './modules/Home/Dashlets/SugarNewsDashlet/SugarNewsDashlet.meta.php' => '9a61596b453a136fd4cc2d28d4728ee8', './modules/Home/Dashlets/iFrameDashlet/iFrameDashlet.meta.php' => '125cd268f9fee6499d078dd4b2eddc8c', - './modules/Home/Dashlets/iFrameDashlet/iFrameDashlet.php' => '0eb343662eae0bc877f6638cdf69b48a', + './modules/Home/Dashlets/iFrameDashlet/iFrameDashlet.php' => 'f5909fb6b057d41bf11a12420bc6ccfb', './modules/Home/Dashlets/iFrameDashlet/configure.tpl' => '519b3ba0b9dd8711d403b1d2fa3a33ad', './modules/Home/Dashlets/RSSDashlet/RSSDashlet.en_us.lang.php' => 'a6354b36d924317489dc40a1df54018c', './modules/Home/Dashlets/RSSDashlet/RSSDashlet.icon.jpg' => '7b0cb2ec97ce8e71d74d60a0da81ba53', @@ -5264,11 +5264,11 @@ $md5_string = array ( './modules/Home/Dashlets/JotPadDashlet/JotPadDashletOptions.tpl' => '66bb697583e1f5c36c2258d2d45dfbd7', './modules/Home/dashlets.php' => '4d60591fdf4c2fb2aad780c1770940a0', './modules/Home/index.php' => 'c12a9b5dea8415166c887b94b57277dc', - './modules/Home/language/en_us.lang.php' => 'a9b8421b9e3e0a40316ea7aa76927897', + './modules/Home/language/en_us.lang.php' => '954339204c466974efc01875586d6965', './modules/Home/SaveSubpanelLayout.php' => '1e8830cbb0ef9cabf80fc2e4b66645a2', './modules/Home/UnifiedSearchAdvancedForm.tpl' => 'c8e060e0d120e52a80cdd60cbe08967e', './modules/Home/UnifiedSearchAdvanced.php' => 'c85e625c7e42df65ce61edd8653aef1d', - './modules/Home/quicksearchQuery.php' => '0a7ec7c7e550b5c17bb2c08644fc6152', + './modules/Home/quicksearchQuery.php' => '1bac2b2da82726f1165724779c385254', './modules/Home/sitemap.php' => '5211819bc7e2972f154595ea4ecdfd22', './modules/Home/UnifiedSearchAdvancedResults.tpl' => '6d981dab4ac5978a96ef4d858b6aff74', './modules/Home/LastViewed.php' => 'c560b62a3343fe67a86925ecc5f3cfd9', @@ -5283,7 +5283,7 @@ $md5_string = array ( './cache/include/javascript/sugar_grp1_yui.js' => 'c0fb7b39843ce10112da766a5c3fcdbd', './cache/include/javascript/sugar_field_grp.js' => '339b3b1d92f554dbac7fad410360c8f1', './cache/include/javascript/sugar_grp1_jquery.js' => '9c164fdc669d8af0c3e11559154a214c', - './cache/include/javascript/sugar_grp1.js' => 'e3cfdc5083a5daf9755b34219257ee12', + './cache/include/javascript/sugar_grp1.js' => '0b0479c1dbd867c4f8fb791dbdecb7fc', './cache/layout/index.html' => '9cd784063d39b18d308932c28c385853', './cache/images/index.html' => '9cd784063d39b18d308932c28c385853', './cache/xml/index.html' => '9cd784063d39b18d308932c28c385853', @@ -5354,7 +5354,7 @@ $md5_string = array ( './metadata/prospect_lists_prospectsMetaData.php' => '7e3faa998b4fab3e2235775744413cc9', './metadata/inboundEmail_autoreplyMetaData.php' => 'a48873b7d72942a2ce8c75519e210ebd', './metadata/acl_roles_actionsMetaData.php' => '4d6ecdbf5b06104a468ec955616121e3', - './sugar_version.php' => '9fdb5e816c50f7c674f1b4ec0e2c5fef', + './sugar_version.php' => '51824d53c776dae3ede31a60ec75fd1e', './cron.php' => '06bf0cf2c00fb23553772c1db40c1a73', './log4php/LoggerManager.php' => 'fa34194306cd50c01b71d8d5060ee362', './TreeData.php' => '261ed723f457b1fabd1c33ae230120e4', @@ -6011,7 +6011,7 @@ $md5_string = array ( './themes/Sugar5/tpls/footer.tpl' => '84af222a783492a848bef7f05e574c28', './themes/Sugar5/tpls/header.tpl' => '5321099ef9e5e42a77b0f67135b96bf8', './themes/Sugar5/tpls/_head.tpl' => 'b54b030371856fd39d372672e7f93b96', - './themes/Sugar5/tpls/_welcome.tpl' => '798351207ed374cc9244ebe025ed7f35', + './themes/Sugar5/tpls/_welcome.tpl' => '1e25134fc79d2cd5813345f1b3d9ca2f', './themes/Sugar5/tpls/_headerModuleList.tpl' => 'af13d1b8e1f44d7655e96b1d2d3ce5cc', './themes/Sugar5/tpls/_headerLastViewed.tpl' => 'cc5f8a1208c17c9e7df760465a4f3ce9', './themes/Sugar5/tpls/_headerSearch.tpl' => '78a00a4232aa72ac2eb87ec568faa4bd', @@ -6649,7 +6649,7 @@ $md5_string = array ( './jssource/src_files/modules/EAPM/EAPMEdit.js' => '634ef9f3449f30c3379b6e5f60d8ccbe', './jssource/src_files/modules/Schedulers/Schedulers.js' => '3cf8fba1f50507bd73ed0bbb72deaf7f', './jssource/src_files/modules/ACLRoles/ACLRoles.js' => '633afbfc272c21700e864c02050f6caf', - './jssource/src_files/modules/Calendar/Cal.js' => '05975a291a74461dbd70ed6989017be8', + './jssource/src_files/modules/Calendar/Cal.js' => '340c2e9c5270d0d65b8549eef53ea3f1', './jssource/src_files/modules/Documents/documents.js' => '09e3e765469577ea70d74258d8efa33d', './jssource/src_files/modules/Leads/Lead.js' => '2eb973b88cad0caccf251e6585c6fa1f', './jssource/src_files/modules/EmailTemplates/EmailTemplate.js' => '8b9c432c57dfdba2aa41bdd5c3e3284d', @@ -7432,7 +7432,7 @@ $md5_string = array ( './jssource/src_files/include/javascript/sugar_yui_overrides.js' => '0de3b58c8897f035f1f577234f9f8c57', './jssource/src_files/include/javascript/cookie.js' => '98c35f5fdf24e9af504b83f99560f610', './jssource/src_files/include/javascript/popup_parent_helper.js' => '9ab9a2b26a22cdd4ead193b54e223063', - './jssource/src_files/include/javascript/sugar_3.js' => '9557984f3358657b3711c75bccc4e901', + './jssource/src_files/include/javascript/sugar_3.js' => '81ac236205fb9e57944f95b79a50a832', './jssource/src_files/include/javascript/jquery.js' => '219073097031d9c1a95a1291d66f3a10', './jssource/src_files/include/javascript/sugar_connection_event_listener.js' => 'a4b04fb7d5aabfd45de233ce4ba7459d', './jssource/src_files/include/javascript/jsclass_async.js' => 'da4b79bcd6fcc9eb3bb1c694707d9e09', @@ -7467,7 +7467,7 @@ $md5_string = array ( './jssource/src_files/include/SugarFields/Fields/Collection/SugarFieldCollection.js' => '0193eba94d4fbf43f9f8f94c37f4c517', './jssource/src_files/include/SugarFields/Fields/Time/Time.js' => '76e0238ad91ad30b402a242dfdbdf254', './jssource/src_files/include/SugarFields/Fields/Datetimecombo/Datetimecombo.js' => 'e71ad9b60c4ee5ec2cbfe6d6202306e8', - './jssource/src_files/include/SubPanel/SubPanelTiles.js' => '49192a260ef46586cd198a2e82026a82', + './jssource/src_files/include/SubPanel/SubPanelTiles.js' => 'e192ce28cc01389bdefd8597a3b78748', './jssource/src_files/include/HTMLPurifier/standalone/HTMLPurifier/Printer/ConfigForm.js' => 'ee5990d6bb62017463a7a8d72c8288b5', './jssource/minify.php' => '0af28efb7b3fb17907385d14b30672a3', './jssource/minify_utils.php' => 'd227d8019884682e1a7c7d628bff4ff3', @@ -7518,11 +7518,11 @@ $md5_string = array ( './download.php' => '3dd971a12234b8bdb129cb058924f30d', './campaign_trackerv2.php' => '1522033bfca05941607274251c557f88', './install.php' => '306206a8fb3c31df5ddc127228518b2c', - './soap/SoapDeprecated.php' => '86f3389296647c7ef722e02c48b610aa', + './soap/SoapDeprecated.php' => 'f48e5bf4aeed3e14b058e60fbddb0171', './soap/SoapError.php' => '07510ab768a147717e69512ec92d183e', './soap/SoapHelperFunctions.php' => '3495757d1de85f705593ae5a71d2a11b', './soap/SoapPortalHelper.php' => 'a49b70deba464a81beaccdccb70e336e', - './soap/SoapSugarUsers.php' => '6a65ae67130d4c8d2a389e35ac2c15c1', + './soap/SoapSugarUsers.php' => '393a4a3fc8c568c71b81c744c76ff720', './soap/SoapStudio.php' => 'a526d5ff3a9c0f32b1c37a909c4c52e1', './soap/SoapRelationshipHelper.php' => 'beaed29f3137e134a0529dbfd813f391', './soap/SoapErrorDefinitions.php' => 'd51e20c60a042417cf16547915a3ee68', diff --git a/include/Dashlets/Dashlet.php b/include/Dashlets/Dashlet.php index b48963e2..b6c4eff2 100644 --- a/include/Dashlets/Dashlet.php +++ b/include/Dashlets/Dashlet.php @@ -253,13 +253,7 @@ class Dashlet $autoRefreshSS->assign('dashletOffset', $dashletOffset); $autoRefreshSS->assign('dashletId', $this->id); $autoRefreshSS->assign('strippedDashletId', str_replace("-","",$this->id)); //javascript doesn't like "-" in function names - if ( empty($this->autoRefresh) ) { - $this->autoRefresh = 0; - } - elseif ( !empty($sugar_config['dashlet_auto_refresh_min']) && $sugar_config['dashlet_auto_refresh_min'] > $this->autoRefresh ) { - $this->autoRefresh = $sugar_config['dashlet_auto_refresh_min']; - } - $autoRefreshSS->assign('dashletRefreshInterval', $this->autoRefresh * 1000); + $autoRefreshSS->assign('dashletRefreshInterval', $this->getAutoRefresh()); $tpl = 'include/Dashlets/DashletGenericAutoRefresh.tpl'; if ( $_REQUEST['action'] == "DynamicAction" ) { $tpl = 'include/Dashlets/DashletGenericAutoRefreshDynamic.tpl'; @@ -268,6 +262,28 @@ class Dashlet return $autoRefreshSS->fetch($tpl); } + protected function getAutoRefresh() + { + global $sugar_config; + + if (empty($this->autoRefresh) || $this->autoRefresh == -1) + { + $autoRefresh = 0; + } + elseif (!empty($sugar_config['dashlet_auto_refresh_min']) + && $this->autoRefresh > 0 + && $sugar_config['dashlet_auto_refresh_min'] > $this->autoRefresh) + { + $autoRefresh = $sugar_config['dashlet_auto_refresh_min']; + } + else + { + $autoRefresh = $this->autoRefresh; + } + + return $autoRefresh * 1000; + } + /** * Override this if your dashlet is configurable (this is called when the the configureDashlet form is shown) * Filters the array for only the parameters it needs to save diff --git a/include/Dashlets/DashletGenericChart.php b/include/Dashlets/DashletGenericChart.php index dd645214..e7eb86b7 100644 --- a/include/Dashlets/DashletGenericChart.php +++ b/include/Dashlets/DashletGenericChart.php @@ -348,13 +348,7 @@ abstract class DashletGenericChart extends Dashlet $autoRefreshSS->assign('dashletOffset', $dashletOffset); $autoRefreshSS->assign('dashletId', $this->id); $autoRefreshSS->assign('strippedDashletId', str_replace("-","",$this->id)); //javascript doesn't like "-" in function names - if ( empty($this->autoRefresh) ) { - $this->autoRefresh = 0; - } - elseif ( !empty($sugar_config['dashlet_auto_refresh_min']) && $sugar_config['dashlet_auto_refresh_min'] > $this->autoRefresh ) { - $this->autoRefresh = $sugar_config['dashlet_auto_refresh_min']; - } - $autoRefreshSS->assign('dashletRefreshInterval', $this->autoRefresh * 1000); + $autoRefreshSS->assign('dashletRefreshInterval', $this->getAutoRefresh()); $autoRefreshSS->assign('url', "predefined_chart"); $tpl = 'include/Dashlets/DashletGenericAutoRefresh.tpl'; if ( $_REQUEST['action'] == "DynamicAction" ) { diff --git a/include/ListView/ListView.php b/include/ListView/ListView.php index c63150f4..e2113c2d 100644 --- a/include/ListView/ListView.php +++ b/include/ListView/ListView.php @@ -473,6 +473,10 @@ function process_dynamic_listview($source_module, $sugarbean,$subpanel_def) $button_contents[] = $_content; unset($_content); } + else + { + $button_contents[] = ''; + } } else { $count++; $this->xTemplate->assign('CLASS', ""); @@ -490,23 +494,32 @@ function process_dynamic_listview($source_module, $sugarbean,$subpanel_def) // Make sure we have at least one button before rendering a column for // the action buttons in a list view. Relevant bugs: #51647 and #51640. - if(isset($button_contents[0])) { + if(!empty($button_contents)) + { + $button_contents = array_filter($button_contents); + if (!empty($button_contents)) + { // this is for inline buttons on listviews // bug#51275: smarty widget to help provide the action menu functionality as it is currently sprinkled throughout the app with html - require_once('include/Smarty/plugins/function.sugar_action_menu.php'); - $tempid = create_guid(); - $button_contents[0] = "
".$button_contents[0]."
"; - $action_button = smarty_function_sugar_action_menu(array( - 'id' => $tempid, - 'buttons' => $button_contents, - 'class' => 'clickMenu subpanel records fancymenu button', - 'flat' => false //assign flat value as false to display dropdown menu at any other preferences. - ), $this->xTemplate); + require_once('include/Smarty/plugins/function.sugar_action_menu.php'); + $tempid = create_guid(); + array_unshift($button_contents, "
" . array_shift($button_contents) . "
"); + $action_button = smarty_function_sugar_action_menu(array( + 'id' => $tempid, + 'buttons' => $button_contents, + 'class' => 'clickMenu subpanel records fancymenu button', + 'flat' => false //assign flat value as false to display dropdown menu at any other preferences. + ), $this->xTemplate); + } + else + { + $action_button = ''; + } $this->xTemplate->assign('CLASS', "inlineButtons"); $this->xTemplate->assign('CELL_COUNT', ++$count); //Bug#51275 for beta3 pre_script is not required any more $this->xTemplate->assign('CELL', $action_button); - $this->xTemplate->parse($xtemplateSection.".row.cell"); + $this->xTemplate->parse($xtemplateSection . ".row.cell"); } diff --git a/include/MVC/SugarApplication.php b/include/MVC/SugarApplication.php index c944d0aa..2283f54c 100644 --- a/include/MVC/SugarApplication.php +++ b/include/MVC/SugarApplication.php @@ -100,6 +100,8 @@ class SugarApplication $server_unique_key = (isset($sugar_config['unique_key'])) ? $sugar_config['unique_key'] : ''; $allowed_actions = (!empty($this->controller->allowed_actions)) ? $this->controller->allowed_actions : $allowed_actions = array('Authenticate', 'Login', 'LoggedOut'); + $authController = new AuthenticationController(); + if(($user_unique_key != $server_unique_key) && (!in_array($this->controller->action, $allowed_actions)) && (!isset($_SESSION['login_error']))) { @@ -118,13 +120,16 @@ class SugarApplication $this->controller->action = 'index'; elseif($this->isModifyAction()) $this->controller->action = 'index'; + elseif ($this->controller->action == $this->default_action + && $this->controller->module == $this->default_module) { + $this->controller->action = ''; + $this->controller->module = ''; + } } - header('Location: index.php?action=Login&module=Users'.$this->createLoginVars()); - exit (); + $authController->authController->redirectToLogin($this); } - $authController = new AuthenticationController((!empty($GLOBALS['sugar_config']['authenticationClass'])? $GLOBALS['sugar_config']['authenticationClass'] : 'SugarAuthenticate')); $GLOBALS['current_user'] = new User(); if(isset($_SESSION['authenticated_user_id'])){ // set in modules/Users/Authenticate.php diff --git a/include/Popups/PopupSmarty.php b/include/Popups/PopupSmarty.php index 74e86cd9..88ba9bec 100644 --- a/include/Popups/PopupSmarty.php +++ b/include/Popups/PopupSmarty.php @@ -289,7 +289,6 @@ class PopupSmarty extends ListViewSmarty{ $params = array(); if(!empty($this->_popupMeta['orderBy'])){ $params['orderBy'] = $this->_popupMeta['orderBy']; - $params['overrideOrder'] = true; } if(file_exists('custom/modules/'.$this->module.'/metadata/metafiles.php')){ diff --git a/include/Smarty/plugins/function.sugar_replace_vars.php b/include/Smarty/plugins/function.sugar_replace_vars.php index dfa07c3e..4bc59df7 100644 --- a/include/Smarty/plugins/function.sugar_replace_vars.php +++ b/include/Smarty/plugins/function.sugar_replace_vars.php @@ -63,8 +63,15 @@ function smarty_function_sugar_replace_vars($params, &$smarty) $value = isset($fields[$match]) ? $fields[$match] : null; if (!is_null($value)) { - if (is_array($value) && isset($value['value'])) + if (isset($value['function']['returns']) && $value['function']['returns'] == 'html') + { + $bean = $smarty->get_template_vars('bean'); + $value = $bean->$match; + } + else if (is_array($value) && isset($value['value'])) + { $value = $value['value']; + } if (isset($fields[$match]['type']) && $fields[$match]['type']=='enum' && isset($fields[$match]['options']) && isset($fields[$match]['options'][$value])) diff --git a/include/SubPanel/SubPanelTiles.js b/include/SubPanel/SubPanelTiles.js index a9847924..9486fe22 100644 --- a/include/SubPanel/SubPanelTiles.js +++ b/include/SubPanel/SubPanelTiles.js @@ -103,9 +103,13 @@ SUGAR.subpanelUtils=function(){var originalLayout=null,subpanelContents={},subpa if(asString)return subpanelIds.join(',');else return subpanelIds;},onDrag:function(e,id){originalLayout=SUGAR.subpanelUtils.getLayout(true,true);},onDrop:function(e,id){newLayout=SUGAR.subpanelUtils.getLayout(true,true);if(originalLayout!=newLayout){SUGAR.subpanelUtils.saveLayout(newLayout);}},saveLayout:function(order){ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_SAVING_LAYOUT'));if(typeof SUGAR.subpanelUtils.currentSubpanelGroup!='undefined'){var orderList=SUGAR.subpanelUtils.getLayout(false,true);var currentGroup=SUGAR.subpanelUtils.currentSubpanelGroup;} var success=function(data){ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_SAVED_LAYOUT'));window.setTimeout('ajaxStatus.hideStatus()',2000);if(typeof SUGAR.subpanelUtils.currentSubpanelGroup!='undefined'){SUGAR.subpanelUtils.reorderSubpanelSubtabs(currentGroup,orderList);}} url='index.php?module=Home&action=SaveSubpanelLayout&layout='+order+'&layoutModule='+currentModule;if(typeof SUGAR.subpanelUtils.currentSubpanelGroup!='undefined'){url=url+'&layoutGroup='+encodeURI(SUGAR.subpanelUtils.currentSubpanelGroup);} -var cObj=YAHOO.util.Connect.asyncRequest('GET',url,{success:success,failure:success});},inlineSave:function(theForm,buttonName){ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_SAVING'));var success=function(data){var element=document.getElementById(buttonName);do{element=element.parentNode;}while(element.className!='quickcreate'&&element.parentNode);if(element.className=='quickcreate'){var subpanel=element.id.slice(9,-7);var module=get_module_name();var id=get_record_id();var layout_def_key=get_layout_def_key();try{eval('result = '+data.responseText);}catch(err){} -if(typeof(result)!='undefined'&&result!=null&&result['status']=='dupe'){document.location.href="index.php?"+result['get'].replace(/&/gi,'&').replace(/</gi,'<').replace(/>/gi,'>').replace(/'/gi,'\'').replace(/"/gi,'"').replace(/\r\n/gi,'\n');return;}else{SUGAR.subpanelUtils.cancelCreate(buttonName);showSubPanel(subpanel,null,true);ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_SAVED'));window.setTimeout('ajaxStatus.hideStatus()',1000);if(reloadpage)window.location.reload(false);}}} -var reloadpage=false;reloadpage=reloadpage||((buttonName=='Meetings_subpanel_save_button'||buttonName=='Calls_subpanel_save_button')&&typeof(theForm)!='undefined'&&typeof(document.getElementById(theForm))!='undefined'&&typeof(document.getElementById(theForm).status)!='undefined'&&document.getElementById(theForm).status[document.getElementById(theForm).status.selectedIndex].value=='Held');reloadpage=reloadpage||(buttonName=='Tasks_subpanel_save_button'&&typeof(theForm)!='undefined'&&typeof(document.getElementById(theForm))!='undefined'&&typeof(document.getElementById(theForm).status)!='undefined'&&document.getElementById(theForm).status[document.getElementById(theForm).status.selectedIndex].value=='Completed');YAHOO.util.Connect.setForm(theForm,true,true);var cObj=YAHOO.util.Connect.asyncRequest('POST','index.php',{success:success,failure:success,upload:success});return false;},sendAndRetrieve:function(theForm,theDiv,loadingStr){var quickCreateDiv=YAHOO.util.Selector.query("div.quickcreate",null,true);if(quickCreateDiv) +var cObj=YAHOO.util.Connect.asyncRequest('GET',url,{success:success,failure:success});},inlineSave:function(theForm,buttonName){ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_SAVING'));var success=function(data){var module=get_module_name();var id=get_record_id();var layout_def_key=get_layout_def_key();try{eval('result = '+data.responseText);}catch(err){} +if(typeof(result)!='undefined'&&result!=null&&result['status']=='dupe'){document.location.href="index.php?"+result['get'].replace(/&/gi,'&').replace(/</gi,'<').replace(/>/gi,'>').replace(/'/gi,'\'').replace(/"/gi,'"').replace(/\r\n/gi,'\n');return;}else{SUGAR.subpanelUtils.cancelCreate(buttonName);var parts=theForm.split('_');var savedModule='';var subPanels=[];for(var i=parts.length-1;i>=0;i--){if(parts[i]==''){continue;} +if(savedModule!=''){savedModule='_'+savedModule;} +savedModule=parts[i]+savedModule;if(window.ModuleSubPanels&&window.ModuleSubPanels[savedModule]){subPanels=subPanels.concat(window.ModuleSubPanels[savedModule]);}} +for(var i=0;iload_relationship_meta(); } + // this array will store names of sub-panels that can contain items + // of each module + $module_sub_panels = array(); + foreach ($tabs as $tab) { //load meta definition of the sub-panel. @@ -291,6 +295,23 @@ if(document.DetailView != null && } } + if ($thisPanel->isCollection()) { + // collect names of sub-panels that may contain items of each module + $collection_list = $thisPanel->get_inst_prop_value('collection_list'); + if (is_array($collection_list)) { + foreach ($collection_list as $data) { + if (!empty($data['module'])) { + $module_sub_panels[$data['module']][$tab] = true; + } + } + } + } else { + $module = $thisPanel->get_module_name(); + if (!empty($module)) { + $module_sub_panels[$module][$tab] = true; + } + } + echo '
  • '; $display= 'none'; @@ -419,6 +440,14 @@ EOQ; EOQ; } + $module_sub_panels = array_map('array_keys', $module_sub_panels); + $module_sub_panels = json_encode($module_sub_panels); + echo << +var ModuleSubPanels = $module_sub_panels; + +EOQ; + $ob_contents = ob_get_contents(); ob_end_clean(); return $ob_contents; @@ -458,7 +487,10 @@ EOQ; } else { - $buttons[] = $layout_manager->widgetDisplay($widget_data); + $button = $layout_manager->widgetDisplay($widget_data); + if ($button) { + $buttons[] = $button; + } } } diff --git a/include/SugarCharts/Jit/JitReports.php b/include/SugarCharts/Jit/JitReports.php index fb457384..1f6ff8c3 100644 --- a/include/SugarCharts/Jit/JitReports.php +++ b/include/SugarCharts/Jit/JitReports.php @@ -184,7 +184,7 @@ class JitReports extends Jit { $data .= $this->tab('', 3); - if ((isset($dataset[$total]) && $total != $dataset[$total]['numerical_value']) || !array_key_exists($key, $dataset)){ + if (count($this->group_by) > 1){ $data .= $this->processReportData($dataset, 4, $first); } else if(count($this->data_set) == 1 && $first){ diff --git a/include/SugarCharts/JsChart.php b/include/SugarCharts/JsChart.php index d73e727f..f6aab28c 100644 --- a/include/SugarCharts/JsChart.php +++ b/include/SugarCharts/JsChart.php @@ -134,7 +134,7 @@ class JsChart extends SugarChart { global $sugar_config, $current_user, $current_language; $this->id = $id; $this->chartId = $id; - $this->xmlFile = (!$xmlFile) ? sugar_cached("xml/{$current_user->id}_{$this->id}.xml") : $xmlFile; + $this->xmlFile = (!$xmlFile) ? sugar_cached("xml/".$current_user->getUserPrivGuid()."_{$this->id}.xml") : $xmlFile; $style = array(); @@ -150,7 +150,7 @@ class JsChart extends SugarChart { foreach($this->getChartConfigParams($xmlStr) as $key => $value) { $chartConfig[$key] = $value; } - + $chartConfig['imageExportType'] = $this->image_export_type; $this->ss->assign("config", $chartConfig); @@ -685,11 +685,11 @@ class JsChart extends SugarChart { } return $props; } - + function processSpecialChars($str) { return addslashes(html_entity_decode($str,ENT_QUOTES)); } - + function processXML($xmlFile) { if(!file_exists($xmlFile)) { diff --git a/include/SugarCharts/SugarChart.php b/include/SugarCharts/SugarChart.php index 1c52a564..be76e826 100644 --- a/include/SugarCharts/SugarChart.php +++ b/include/SugarCharts/SugarChart.php @@ -644,20 +644,11 @@ class SugarChart { * * @param string $file_id - unique id to make part of the file name */ - public static function getXMLFileName( - $file_id - ) + public static function getXMLFileName($file_id) { - global $sugar_config, $current_user; + create_cache_directory("xml/".$GLOBALS['current_user']->getUserPrivGuid() . "_{$file_id}.xml"); - $filename = sugar_cached("xml/"). $current_user->id . '_' . $file_id . '.xml'; - - $filename_temp = "xml/". $current_user->id . '_' . $file_id . '.xml'; - if ( !is_dir(dirname($filename)) ) { - create_cache_directory($filename_temp); - } - - return $filename; + return sugar_cached("xml/"). $GLOBALS['current_user']->getUserPrivGuid() . "_" . $file_id . ".xml"; } public function processXmlData(){ @@ -719,7 +710,7 @@ class SugarChart { { sugar_mkdir($dir, null, true); } - + // open file if (!$fh = sugar_fopen($xmlFilename, 'w')) { $GLOBALS['log']->debug("Cannot open file ($xmlFilename)"); diff --git a/include/SugarLogger/LoggerManager.php b/include/SugarLogger/LoggerManager.php index 18037671..6be22a76 100644 --- a/include/SugarLogger/LoggerManager.php +++ b/include/SugarLogger/LoggerManager.php @@ -45,7 +45,7 @@ class LoggerManager private $_level = 'fatal'; //this is a list of different loggers that have been loaded - private static $_loggers = array(); + protected static $_loggers = array(); //this is the instance of the LoggerManager private static $_instance = NULL; diff --git a/include/database/DBManager.php b/include/database/DBManager.php index 66173ae2..1e6c8dbb 100644 --- a/include/database/DBManager.php +++ b/include/database/DBManager.php @@ -968,10 +968,25 @@ protected function checkQuery($sql, $object_name = false) public function compareVarDefs($fielddef1, $fielddef2, $ignoreName = false) { foreach ( $fielddef1 as $key => $value ) { - if ( $key == 'name' && ( strtolower($fielddef1[$key]) == strtolower($fielddef2[$key]) || $ignoreName) ) - continue; - if ( isset($fielddef2[$key]) && $fielddef1[$key] == $fielddef2[$key] ) + if ($key == 'name' && $ignoreName) continue; + if (isset($fielddef2[$key])) + { + if (!is_array($fielddef1[$key]) && !is_array($fielddef2[$key])) + { + if (strtolower($fielddef1[$key]) == strtolower($fielddef2[$key])) + { + continue; + } + } + else + { + if (array_map('strtolower', $fielddef1[$key]) == array_map('strtolower',$fielddef2[$key])) + { + continue; + } + } + } //Ignore len if its not set in the vardef if ($key == 'len' && empty($fielddef2[$key])) continue; diff --git a/include/generic/SugarWidgets/SugarWidgetFielddatetime.php b/include/generic/SugarWidgets/SugarWidgetFielddatetime.php index 3315e5d5..f24c3a8d 100644 --- a/include/generic/SugarWidgets/SugarWidgetFielddatetime.php +++ b/include/generic/SugarWidgets/SugarWidgetFielddatetime.php @@ -336,7 +336,14 @@ class SugarWidgetFieldDateTime extends SugarWidgetReportField function queryFilterTP_this_month($layout_def) { global $timedate; - return $this->queryMonth($layout_def, $this->now()->get_day_by_index_this_month(0)); + + //Bug 62414 - take timezone into account when determining current month + $now = $this->now(); + $timezoneOffset = $timedate->getUserUTCOffset(); + $timezoneOffset = "$timezoneOffset minutes"; + $now->modify($timezoneOffset); + + return $this->queryMonth($layout_def, $now->get_day_by_index_this_month(0)); } function queryFilterTP_next_month($layout_def) diff --git a/include/generic/SugarWidgets/SugarWidgetFieldname.php b/include/generic/SugarWidgets/SugarWidgetFieldname.php index e3fde11e..e33e697c 100644 --- a/include/generic/SugarWidgets/SugarWidgetFieldname.php +++ b/include/generic/SugarWidgets/SugarWidgetFieldname.php @@ -42,6 +42,7 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); class SugarWidgetFieldName extends SugarWidgetFieldVarchar { + protected static $moduleSavePermissions = array(); function SugarWidgetFieldName(&$layout_manager) { parent::SugarWidgetFieldVarchar($layout_manager); diff --git a/include/generic/SugarWidgets/SugarWidgetFieldrelate.php b/include/generic/SugarWidgets/SugarWidgetFieldrelate.php index cda44742..259ca420 100644 --- a/include/generic/SugarWidgets/SugarWidgetFieldrelate.php +++ b/include/generic/SugarWidgets/SugarWidgetFieldrelate.php @@ -82,21 +82,23 @@ class SugarWidgetFieldRelate extends SugarWidgetReportField private function displayInputQuery($layout_def) { $title = $layout_def['rname']; - if (isset($layout_def['custom_module']) || isset($layout_def['ext2'])) { - $bean = BeanFactory::getBean($layout_def['module']); - $layout_def['table'] = $bean->table_name; - if (isset($bean->field_defs[$title]['db_concat_fields'])){ - $layout_def['db_concat_fields'] = $bean->field_defs[$title]['db_concat_fields']; - } + $bean = isset($layout_def['module']) ? BeanFactory::getBean($layout_def['module']) : NULL; + $table = empty($bean) ? $layout_def['table'] : $bean->table_name; + $concat_fields = isset($layout_def['db_concat_fields']) ? $layout_def['db_concat_fields'] : ''; + + if (empty($concat_fields) && !empty($bean) && isset($bean->field_defs[$title]['db_concat_fields'])) + { + $concat_fields = $bean->field_defs[$title]['db_concat_fields']; } - if (isset($layout_def['db_concat_fields'])) { - $title = $this->reporter->db->concat($layout_def['table'], $layout_def['db_concat_fields']); + if (!empty($concat_fields)) + { + $title = $this->reporter->db->concat($table, $concat_fields); } $query = "SELECT id, $title title - FROM {$layout_def['table']} + FROM $table WHERE deleted = 0 ORDER BY title ASC"; return $query; diff --git a/include/javascript/jsAlerts.php b/include/javascript/jsAlerts.php index 2fbef0a4..98b580db 100644 --- a/include/javascript/jsAlerts.php +++ b/include/javascript/jsAlerts.php @@ -55,8 +55,9 @@ EOQ; $this->addAlert($app_strings['ERROR_JS_ALERT_SYSTEM_CLASS'], $app_strings['ERROR_JS_ALERT_TIMEOUT_TITLE'],'', $app_strings['ERROR_JS_ALERT_TIMEOUT_MSG_2'], (session_cache_expire()) * 60 , 'index.php'); } } - function addAlert($type, $name, $subtitle, $description, $countdown, $redirect=''){ - $this->script .= 'addAlert("' . addslashes($type) .'", "' . addslashes($name). '","' . addslashes($subtitle). '", "'. addslashes(str_replace(array("\r", "\n"), array('','
    '),$description)) . '",' . $countdown . ',"'.addslashes($redirect).'")' . "\n"; + function addAlert($type, $name, $subtitle, $description, $countdown, $redirect='') + { + $this->script .= 'addAlert(' . json_encode($type) .',' . json_encode($name). ',' . json_encode($subtitle). ','. json_encode(str_replace(array("\r", "\n"), array('','
    '),$description)) . ',' . $countdown . ','.json_encode($redirect).')' . "\n"; } function getScript() @@ -145,21 +146,9 @@ EOQ; //// END MEETING INTEGRATION /////////////////////////////////////////////////////////////////// - // sanitize topic - $meetingName = ''; - if(!empty($row['name'])) { - $meetingName = from_html($row['name']); - // addAlert() uses double-quotes to pass to popup - escape double-quotes - //$meetingName = str_replace('"', '\"', $meetingName); - } - - // sanitize agenda - $desc1 = ''; - if(!empty($row['description'])) { - $desc1 = from_html($row['description']); - // addAlert() uses double-quotes to pass to popup - escape double-quotes - //$desc = str_replace('"', '\"', $desc); - } + $meetingName = from_html($row['name']); + $desc1 = from_html($row['description']); + $location = from_html($row['location']); $relatedToMeeting = $this->getRelatedName($row['parent_type'], $row['parent_id']); @@ -170,7 +159,7 @@ EOQ; // standard functionality $this->addAlert($app_strings['MSG_JS_ALERT_MTG_REMINDER_MEETING'], $meetingName, $app_strings['MSG_JS_ALERT_MTG_REMINDER_TIME'].$timedate->to_display_date_time($db->fromConvert($row['date_start'], 'datetime')), - $app_strings['MSG_JS_ALERT_MTG_REMINDER_LOC'].$row['location']. + $app_strings['MSG_JS_ALERT_MTG_REMINDER_LOC'].$location. $description. $instructions, $timeStart - strtotime($alertDateTimeNow), diff --git a/include/javascript/sugar_3.js b/include/javascript/sugar_3.js index 92ab3e5a..e5bd1503 100644 --- a/include/javascript/sugar_3.js +++ b/include/javascript/sugar_3.js @@ -39,7 +39,7 @@ function checkMinSupported(c,s){var current=c.split(".");var supported=s.split(" return true;} function checkMaxSupported(c,s){var current=c.split(".");var supported=s.split(".");for(var i in supported){if(current[i]&&parseInt(current[i])>parseInt(supported[i]))return false;else if(current[i]&&parseInt(current[i]) "Your company's license for SugarCRM has expired for more than 7 days and needs to be brought up to date. Only admins may login.", 'ERROR_LICENSE_EXPIRED'=> "Your company's license for SugarCRM needs to be updated. Only admins may login", 'ERROR_LICENSE_VALIDATION'=> "Your company's license for SugarCRM needs to be validated. Only admins may login", - 'WARN_BROWSER_VERSION_WARNING' => "Warning: Your browser version is no longer supported or you are using an unsupported browser.

    The following browser versions are recommended:

    • Internet Explorer 8 (compatibility view not supported)
    • Firefox 19
    • Safari 5.1
    • Chrome 25
    ", + 'WARN_BROWSER_VERSION_WARNING' => "Warning: Your browser version is no longer supported or you are using an unsupported browser.

    The following browser versions are recommended:

    • Internet Explorer 8 (compatibility view not supported)
    • Firefox 20.0
    • Safari 5.1
    • Chrome 26
    ", 'WARN_BROWSER_IE_COMPATIBILITY_MODE_WARNING' => "Warning: Your browser is in IE compatibility view which is not supported.", 'WARN_LICENSE_SEATS'=> "Warning: The number of active users is already the maximum number of licenses allowed.", 'WARN_LICENSE_SEATS_MAXED'=> "Warning: The number of active users exceeds the maximum number of licenses allowed.", diff --git a/include/php-sql-parser.php b/include/php-sql-parser.php index 85f66934..e83b19d2 100644 --- a/include/php-sql-parser.php +++ b/include/php-sql-parser.php @@ -662,7 +662,8 @@ EOREGEX $expression .= $token ; } } - if($expression) $expr[] = $this->process_select_expr(trim($expression)); + $expression = trim($expression); + if($expression) $expr[] = $this->process_select_expr($expression); return $expr; } @@ -670,6 +671,11 @@ EOREGEX is provided, and we set the type of expression. */ private function process_select_expr($expression) { + + if (empty($expression)){ + return ''; + } + $capture = false; $alias = ""; $base_expression = $expression; diff --git a/jssource/src_files/include/SubPanel/SubPanelTiles.js b/jssource/src_files/include/SubPanel/SubPanelTiles.js index 56e48cfb..28289be9 100644 --- a/jssource/src_files/include/SubPanel/SubPanelTiles.js +++ b/jssource/src_files/include/SubPanel/SubPanelTiles.js @@ -419,47 +419,43 @@ SUGAR.subpanelUtils = function() { inlineSave: function(theForm, buttonName) { ajaxStatus.showStatus(SUGAR.language.get('app_strings', 'LBL_SAVING')); var success = function(data) { - var element = document.getElementById(buttonName); - do { - element = element.parentNode; - } while ( element.className != 'quickcreate' && element.parentNode ) ; - - if (element.className == 'quickcreate') { - var subpanel = element.id.slice(9,-7) ; // retrieve the subpanel name from the div id - the name is encoded as 'subpanel__newdiv' - - var module = get_module_name(); - var id = get_record_id(); - var layout_def_key = get_layout_def_key(); - try { - eval('result = ' + data.responseText); - } catch (err) { - - } - - if (typeof(result) != 'undefined' && result != null && result['status'] == 'dupe') { - document.location.href = "index.php?" + result['get'].replace(/&/gi,'&').replace(/</gi,'<').replace(/>/gi,'>').replace(/'/gi,'\'').replace(/"/gi,'"').replace(/\r\n/gi,'\n'); - return; - } else { - SUGAR.subpanelUtils.cancelCreate(buttonName); - showSubPanel(subpanel, null, true); - ajaxStatus.showStatus(SUGAR.language.get('app_strings', 'LBL_SAVED')); - window.setTimeout('ajaxStatus.hideStatus()', 1000); - if(reloadpage) window.location.reload(false); - } - } + var module = get_module_name(); + var id = get_record_id(); + var layout_def_key = get_layout_def_key(); + try { + eval('result = ' + data.responseText); + } catch (err) { + } + if (typeof(result) != 'undefined' && result != null && result['status'] == 'dupe') { + document.location.href = "index.php?" + result['get'].replace(/&/gi,'&').replace(/</gi,'<').replace(/>/gi,'>').replace(/'/gi,'\'').replace(/"/gi,'"').replace(/\r\n/gi,'\n'); + return; + } else { + SUGAR.subpanelUtils.cancelCreate(buttonName); + // parse edit form name in order to get the name of + // module which saved item belongs to + var parts = theForm.split('_'); + var savedModule = ''; + var subPanels = []; + for (var i = parts.length - 1; i >= 0; i --) { + if (parts[i] == '') { + continue; + } + if (savedModule != '') { + savedModule = '_' + savedModule; + } + savedModule = parts[i] + savedModule; + if (window.ModuleSubPanels && window.ModuleSubPanels[savedModule]) { + subPanels = subPanels.concat(window.ModuleSubPanels[savedModule]); + } + } + for (var i = 0; i < subPanels.length; i++) { + showSubPanel(subPanels[i], null, true); + } + ajaxStatus.showStatus(SUGAR.language.get('app_strings', 'LBL_SAVED')); + window.setTimeout('ajaxStatus.hideStatus()', 1000); + } } - // reload page if we are setting status to Held - var reloadpage = false; - // Bug #51388 - Captivea (qch) - reloadpage = reloadpage || ((buttonName == 'Meetings_subpanel_save_button' || buttonName == 'Calls_subpanel_save_button' ) - && typeof(theForm) !='undefined' && typeof(document.getElementById(theForm)) != 'undefined' - && typeof(document.getElementById(theForm).status) != 'undefined' - && document.getElementById(theForm).status[document.getElementById(theForm).status.selectedIndex].value == 'Held'); - reloadpage = reloadpage || (buttonName == 'Tasks_subpanel_save_button' - && typeof(theForm) !='undefined' && typeof(document.getElementById(theForm)) != 'undefined' - && typeof(document.getElementById(theForm).status) != 'undefined' - && document.getElementById(theForm).status[document.getElementById(theForm).status.selectedIndex].value == 'Completed'); - + YAHOO.util.Connect.setForm(theForm, true, true); var cObj = YAHOO.util.Connect.asyncRequest('POST', 'index.php', {success: success, failure: success, upload:success}); return false; diff --git a/jssource/src_files/include/javascript/sugar_3.js b/jssource/src_files/include/javascript/sugar_3.js index 13cf7c0b..ee01efce 100644 --- a/jssource/src_files/include/javascript/sugar_3.js +++ b/jssource/src_files/include/javascript/sugar_3.js @@ -186,8 +186,8 @@ SUGAR.isSupportedBrowser = function(){ var supportedBrowsers = { msie : {min:8, max:10}, // IE 8, 9, 10 safari : {min:534}, // Safari 5.1 - mozilla : {min:19}, // Firefox 19 - chrome : {min:537.22} // Chrome 25 + mozilla : {min:20.0}, // Firefox 20.0 + chrome : {min:537.31} // Chrome 26 }; var current = String($.browser.version); var supported; diff --git a/jssource/src_files/modules/Calendar/Cal.js b/jssource/src_files/modules/Calendar/Cal.js index a65b2310..89938d55 100644 --- a/jssource/src_files/modules/Calendar/Cal.js +++ b/jssource/src_files/modules/Calendar/Cal.js @@ -881,7 +881,7 @@ } CAL.get_header_text = function (type,time_start,text,record){ - var start_text = text; + var start_text = (CAL.view=='month')?("" + time_start + " " + text) : text; return start_text; } diff --git a/modules/Calendar/Cal.js b/modules/Calendar/Cal.js index dea702e5..e220899c 100644 --- a/modules/Calendar/Cal.js +++ b/modules/Calendar/Cal.js @@ -132,7 +132,7 @@ CAL.make_draggable(elm_id,"advanced");if(item.module_name!="Tasks"&&CAL.items_re CAL.make_resizable(elm_id,slot);} CAL.cut_record(item.record+id_suffix);if(CAL.view=="shared"){var end_time=$("#"+slot.id).parents("div:first").children("div:last").attr("time");var end_time_id=$("#"+slot.id).parents("div:first").children("div:last").attr("id");if(end_time&&end_time_id){var end_timestamp=parseInt(end_time_id.match(/t_([0-9]+)_.*/)[1])+1800;var share_coef=(end_timestamp-parseInt(item.timestamp))/ 1800;if(share_coef"+time_start+" "+text):text;return start_text;} CAL.cut_record=function(id){var el=CAL.get(id);if(!el) return;var duration_coef=el.getAttribute("duration_coef");real_celcount=CAL.cells_per_day;var celpos=0;var s=el.parentNode;while(s.previousSibling){celpos++;s=s.previousSibling;} celpos=celpos+1;if(real_celcount-celpos-duration_coef<0) diff --git a/modules/Campaigns/WizardHome.php b/modules/Campaigns/WizardHome.php index 7ee76059..6b52be5b 100644 --- a/modules/Campaigns/WizardHome.php +++ b/modules/Campaigns/WizardHome.php @@ -105,9 +105,9 @@ global $currentModule; $ss->assign("CAMPAIGN_TBL", create_campaign_summary ($focus)); $ss->assign("TARGETS_TBL", create_target_summary ($focus)); - $ss->assign("TRACKERS_TBL", create_tracker_summary ($focus)); if($focus->campaign_type =='NewsLetter' || $focus->campaign_type =='Email'){ $ss->assign("MARKETING_TBL", create_marketing_summary ($focus)); + $ss->assign("TRACKERS_TBL", create_tracker_summary ($focus)); } $camp_url = "index.php?action=WizardNewsletter&module=Campaigns&return_module=Campaigns&return_action=WizardHome"; @@ -461,7 +461,12 @@ function create_wiz_menu_items($type,$mrkt_string,$camp_url,$summ_url){ $steps[$mod_strings['LBL_NAVIGATION_MENU_GEN1']] = file_exists('custom/modules/Campaigns/tpls/WizardCampaignHeader.tpl') ? 'custom/modules/Campaigns/tpls/WizardCampaignHeader.tpl' : 'modules/Campaigns/tpls/WizardCampaignHeader.tpl'; $steps[$mod_strings['LBL_NAVIGATION_MENU_GEN2']] = file_exists('custom/modules/Campaigns/tpls/WizardCampaignBudget.tpl') ? 'custom/modules/Campaigns/tpls/WizardCampaignBudget.tpl' : 'modules/Campaigns/tpls/WizardCampaignBudget.tpl'; - $steps[$mod_strings['LBL_NAVIGATION_MENU_TRACKERS']] = file_exists('custom/modules/Campaigns/tpls/WizardCampaignTracker.tpl') ? 'custom/modules/Campaigns/tpls/WizardCampaignTracker.tpl' : 'modules/Campaigns/tpls/WizardCampaignTracker.tpl'; + + //do not show tracker step for general campaigns (only for newsletter/email) + if($type != 'general'){ + $steps[$mod_strings['LBL_NAVIGATION_MENU_TRACKERS']] = file_exists('custom/modules/Campaigns/tpls/WizardCampaignTracker.tpl') ? 'custom/modules/Campaigns/tpls/WizardCampaignTracker.tpl' : 'modules/Campaigns/tpls/WizardCampaignTracker.tpl'; + } + if($type == 'newsletter'){ $steps[$mod_strings['LBL_NAVIGATION_MENU_SUBSCRIPTIONS']] = file_exists('custom/modules/Campaigns/tpls/WizardCampaignTargetList.tpl') ? 'custom/modules/Campaigns/tpls/WizardCampaignTargetList.tpl' : 'modules/Campaigns/tpls/WizardCampaignTargetList.tpl'; }else{ diff --git a/modules/Campaigns/WizardNewsletter.php b/modules/Campaigns/WizardNewsletter.php index 54d18b3b..992e137c 100644 --- a/modules/Campaigns/WizardNewsletter.php +++ b/modules/Campaigns/WizardNewsletter.php @@ -442,7 +442,7 @@ if(count($prospect_lists)>0){ $trgt_html .= "".$app_list_strings['prospect_list_type_dom'][$pl_focus->list_type]; $trgt_html .= ""; $trgt_html .= "id."'); \" > "; - $trgt_html .= SugarThemeRegistry::current()->getImage('delete_inline', "border='0' align='absmiddle'", 12, 12, ".gif", $mod_string['LBL_DELETE']).""; + $trgt_html .= SugarThemeRegistry::current()->getImage('delete_inline', "border='0' align='absmiddle'", 12, 12, ".gif", $mod_strings['LBL_DELETE']).""; @@ -559,7 +559,6 @@ function create_campaign_steps(){ global $mod_strings; $steps[$mod_strings['LBL_NAVIGATION_MENU_GEN1']] = file_exists('custom/modules/Campaigns/tpls/WizardCampaignHeader.tpl') ? 'custom/modules/Campaigns/tpls/WizardCampaignHeader.tpl' : 'modules/Campaigns/tpls/WizardCampaignHeader.tpl'; $steps[$mod_strings['LBL_NAVIGATION_MENU_GEN2']] = file_exists('custom/modules/Campaigns/tpls/WizardCampaignBudget.tpl') ? 'custom/modules/Campaigns/tpls/WizardCampaignBudget.tpl' : 'modules/Campaigns/tpls/WizardCampaignBudget.tpl'; - $steps[$mod_strings['LBL_NAVIGATION_MENU_TRACKERS']] = file_exists('custom/modules/Campaigns/tpls/WizardCampaignTracker.tpl') ? 'custom/modules/Campaigns/tpls/WizardCampaignTracker.tpl' : 'modules/Campaigns/tpls/WizardCampaignTracker.tpl'; $steps[$mod_strings['LBL_TARGET_LISTS']] = file_exists('custom/modules/Campaigns/tpls/WizardCampaignTargetListForNonNewsLetter.tpl') ? 'custom/modules/Campaigns/tpls/WizardCampaignTargetListForNonNewsLetter.tpl' : 'modules/Campaigns/tpls/WizardCampaignTargetListForNonNewsLetter.tpl'; return $steps; } diff --git a/modules/DynamicFields/DynamicField.php b/modules/DynamicFields/DynamicField.php index e5aface1..1c286629 100644 --- a/modules/DynamicFields/DynamicField.php +++ b/modules/DynamicFields/DynamicField.php @@ -496,6 +496,7 @@ class DynamicField { function fieldExists($name = '', $type = ''){ // must get the vardefs from the GLOBAL array as $bean->field_defs does not contain the values from the cache at this point // TODO: fix this - saveToVardefs() updates GLOBAL['dictionary'] correctly, obtaining its information directly from the fields_meta_data table via buildCache()... + $name = $this->getDBName($name); $vardefs = $GLOBALS['dictionary'][$this->bean->object_name]['fields']; if(!empty($vardefs)){ if(empty($type) && empty($name)) diff --git a/modules/EAPM/language/en_us.lang.php b/modules/EAPM/language/en_us.lang.php index d7bd9821..68aa1eaf 100644 --- a/modules/EAPM/language/en_us.lang.php +++ b/modules/EAPM/language/en_us.lang.php @@ -105,7 +105,7 @@ $mod_strings = array ( 'LBL_OAUTH_SAVE_NOTICE' => 'Click Connect to be directed to a page to provide your account information and to authorize access to the account by Sugar. After connecting, you will be directed back to Sugar.', 'LBL_BASIC_SAVE_NOTICE' => 'Click Connect to connect this account to Sugar.', 'LBL_ERR_FACEBOOK' => 'Facebook returned an error, and the feed cannot be displayed.', - 'LBL_ERR_OAUTH_FACEBOOK_1' => 'Facebook session is expired. To get stream, please', + 'LBL_ERR_OAUTH_FACEBOOK_1' => 'Facebook authentication was not successful. To attempt authentication, please', 'LBL_ERR_OAUTH_FACEBOOK_2' => 'login to Facebook again', 'LBL_ERR_NO_RESPONSE' => 'An error occurred when trying to connect to this account.', 'LBL_ERR_TWITTER' => 'Twitter returned an error, and the feed cannot be displayed.', diff --git a/modules/Emails/Compose.php b/modules/Emails/Compose.php index 5b0a3c8b..28101718 100644 --- a/modules/Emails/Compose.php +++ b/modules/Emails/Compose.php @@ -240,7 +240,44 @@ function generateComposeDataPackage($data,$forFullCompose = TRUE, $bean = null) // If it's a 'Reply All' action, append the CC addresses if ($data['reply'] == 'replyAll') { - $ret['cc_addrs'] = from_html($ie->email->to_addrs); + global $current_user; + + $ccEmails = $ie->email->to_addrs; + + if (!empty($ie->email->cc_addrs)) + { + $ccEmails .= ", " . $ie->email->cc_addrs; + } + + $myEmailAddresses = array(); + foreach ($current_user->emailAddress->addresses as $p) + { + array_push($myEmailAddresses, $p['email_address']); + } + + //remove current user's email address (if contained in To/CC) + $ccEmailsArr = explode(", ", $ccEmails); + + foreach ($ccEmailsArr as $p=>$q) + { + preg_match('/<(.*?)>/', $q, $email); + if (isset($email[1])) + { + $checkemail = $email[1]; + } + else + { + $checkemail = $q; + } + if (in_array($checkemail, $myEmailAddresses)) + { + unset($ccEmailsArr[$p]); + } + } + + $ccEmails = implode(", ", $ccEmailsArr); + + $ret['cc_addrs'] = from_html($ccEmails); } } else { diff --git a/modules/Home/About.php b/modules/Home/About.php index bc2d17b8..04343791 100644 --- a/modules/Home/About.php +++ b/modules/Home/About.php @@ -186,7 +186,7 @@ echo $theProductName."™ ".$mod_strings['LBL_AND']." Sugar™ ".$mod_st
  • (http://htmlpurifier.org/)
  • (https://github.com/facebook/xhprof)
  • (https://github.com/ruflin/Elastica)
  • -
  • (https://developers.facebook.com/web/)
  • +
  • (https://github.com/facebook/facebook-php-sdk)
  • (http://jquery.com)
  • (http://jqueryui.com)
  • (http://www.macridesweb.com/oltest)
  • diff --git a/modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.php b/modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.php index 679514ea..87893636 100644 --- a/modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.php +++ b/modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.php @@ -170,18 +170,23 @@ class ChartsDashlet extends Dashlet { return $additionalTitle; } - function setRefreshIcon(){ - - + function setRefreshIcon(){ + + $additionalTitle = ''; if($this->isRefreshable) - $additionalTitle .= '' . translate('LBL_DASHLET_REFRESH', 'Home') . ''; + $additionalTitle .= '' + . SugarThemeRegistry::current()->getImage( + 'dashlet-header-refresh', + 'border="0" align="absmiddle" title="'. translate('LBL_DASHLET_REFRESH', 'Home') . '"', + null, + null, + '.gif', + translate('LBL_DASHLET_REFRESH', 'Home') + ) .''; return $additionalTitle; - } - + } } ?> diff --git a/modules/Home/Dashlets/SugarNewsDashlet/SugarNewsDashlet.php b/modules/Home/Dashlets/SugarNewsDashlet/SugarNewsDashlet.php index c44ec8e0..e358abc0 100644 --- a/modules/Home/Dashlets/SugarNewsDashlet/SugarNewsDashlet.php +++ b/modules/Home/Dashlets/SugarNewsDashlet/SugarNewsDashlet.php @@ -36,85 +36,17 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); ********************************************************************************/ -require_once('include/Dashlets/Dashlet.php'); +require_once('modules/Home/Dashlets/iFrameDashlet/iFrameDashlet.php'); -class SugarNewsDashlet extends Dashlet { +class SugarNewsDashlet extends iFrameDashlet { var $displayTpl = 'modules/Home/Dashlets/SugarNewsDashlet/display.tpl'; var $configureTpl = 'modules/Home/Dashlets/SugarNewsDashlet/configure.tpl'; var $defaultURL = 'http://apps.sugarcrm.com/dashlet/sugarcrm-news-dashlet.html?lang=@@LANG@@&edition=@@EDITION@@&ver=@@VER@@'; var $url; function SugarNewsDashlet($id, $options = null) { - parent::Dashlet($id); - $this->isConfigurable = true; - - if(empty($options['title'])) { - $this->title = translate('LBL_DASHLET_SUGAR_NEWS', 'Home'); - } else { - $this->title = $options['title']; - } - if(empty($options['url'])) { - $this->url = $this->defaultURL; - } else { - $this->url = $options['url']; - } - - if(empty($options['height']) || (int)$options['height'] < 1 ) { - $this->height = 315; - } else { - $this->height = (int)$options['height']; - } - - if(isset($options['autoRefresh'])) $this->autoRefresh = $options['autoRefresh']; - } - - function displayOptions() { - global $app_strings; - $ss = new Sugar_Smarty(); - $ss->assign('titleLBL', translate('LBL_DASHLET_OPT_TITLE', 'Home')); - $ss->assign('urlLBL', translate('LBL_DASHLET_OPT_URL', 'Home')); - $ss->assign('heightLBL', translate('LBL_DASHLET_OPT_HEIGHT', 'Home')); - $ss->assign('title', $this->title); - $ss->assign('url', $this->url); - $ss->assign('id', $this->id); - $ss->assign('height', $this->height); - $ss->assign('saveLBL', $app_strings['LBL_SAVE_BUTTON_LABEL']); - $ss->assign('clearLBL', $app_strings['LBL_CLEAR_BUTTON_LABEL']); - if($this->isAutoRefreshable()) { - $ss->assign('isRefreshable', true); - $ss->assign('autoRefresh', $GLOBALS['app_strings']['LBL_DASHLET_CONFIGURE_AUTOREFRESH']); - $ss->assign('autoRefreshOptions', $this->getAutoRefreshOptions()); - $ss->assign('autoRefreshSelect', $this->autoRefresh); - } - - return $ss->fetch('modules/Home/Dashlets/SugarNewsDashlet/configure.tpl'); - } - - function saveOptions($req) { - $options = array(); - - if ( isset($req['title']) ) { - $options['title'] = $req['title']; - } - if ( isset($req['url']) ) { - $options['url'] = $req['url']; - } - if ( isset($req['height']) ) { - $options['height'] = (int)$req['height']; - } - $options['autoRefresh'] = empty($req['autoRefresh']) ? '0' : $req['autoRefresh']; - - return $options; - } - - function display(){ - $sugar_edition = 'COM'; - - $out_url = str_replace( - array('@@LANG@@','@@VER@@','@@EDITION@@'), - array($GLOBALS['current_language'],$GLOBALS['sugar_config']['sugar_version'],$sugar_edition), - $this->url); - return parent::display() . ""; + $this->title = translate('LBL_DASHLET_SUGAR_NEWS', 'Home'); + parent::iFrameDashlet($id, $options); } } diff --git a/modules/Home/Dashlets/iFrameDashlet/iFrameDashlet.php b/modules/Home/Dashlets/iFrameDashlet/iFrameDashlet.php index c480d6f2..c4cf0199 100644 --- a/modules/Home/Dashlets/iFrameDashlet/iFrameDashlet.php +++ b/modules/Home/Dashlets/iFrameDashlet/iFrameDashlet.php @@ -50,16 +50,17 @@ class iFrameDashlet extends Dashlet { parent::Dashlet($id); $this->isConfigurable = true; - if(!empty($options['titleLabel'])) { - $this->title = translate($options['titleLabel'], 'Home'); - } else { - if(empty($options['title'])) { - $this->title = translate('LBL_DASHLET_TITLE', 'Home'); - $this->title = translate('LBL_DASHLET_DISCOVER_SUGAR_PRO', 'Home'); - } else { - $this->title = $options['title']; - } + if (empty($this->title)) { + $this->title = translate('LBL_DASHLET_TITLE', 'Home'); + $this->title = translate('LBL_DASHLET_DISCOVER_SUGAR_PRO', 'Home'); + } + + if (!empty($options['titleLabel'])) { + $this->title = translate($options['titleLabel'], 'Home'); + } elseif (!empty($options['title'])) { + $this->title = $options['title']; } + if(empty($options['url'])) { $this->url = $this->defaultURL; $this->url = 'http://apps.sugarcrm.com/dashlet/go-pro.html?lang=@@LANG@@&edition=@@EDITION@@&ver=@@VER@@'; @@ -67,8 +68,6 @@ class iFrameDashlet extends Dashlet { $this->url = $options['url']; } - $this->checkURL(); - if(empty($options['height']) || (int)$options['height'] < 1 ) { $this->height = 315; } else { @@ -83,7 +82,9 @@ class iFrameDashlet extends Dashlet { $scheme = parse_url($this->url, PHP_URL_SCHEME); if(!in_array($scheme, $this->allowed_schemes)) { $this->url = 'about:blank'; + return false; } + return true; } function displayOptions() { @@ -104,8 +105,8 @@ class iFrameDashlet extends Dashlet { $ss->assign('autoRefreshOptions', $this->getAutoRefreshOptions()); $ss->assign('autoRefreshSelect', $this->autoRefresh); } - - return $ss->fetch('modules/Home/Dashlets/iFrameDashlet/configure.tpl'); + + return $ss->fetch($this->configureTpl); } function saveOptions($req) { @@ -138,6 +139,13 @@ class iFrameDashlet extends Dashlet { if(empty($title)){ $title = 'empty'; } - return parent::display() . ""; + + $result = parent::display(); + if ($this->checkURL()) { + $result .= ""; + } else { + $result .= '
    ' . translate('LBL_DASHLET_INCORRECT_URL', 'Home') . '
    '; + } + return $result; } } diff --git a/modules/Home/language/en_us.lang.php b/modules/Home/language/en_us.lang.php index cea54605..09b4be08 100644 --- a/modules/Home/language/en_us.lang.php +++ b/modules/Home/language/en_us.lang.php @@ -235,13 +235,14 @@ $mod_strings = array ( 'LBL_SOURCE_HTMLPURIFIER' => 'HTML Purifier - A standards-compliant HTML filtering library.', 'LBL_SOURCE_XHPROF' => 'XHProf - A function-level hierarchical profiler for PHP.', 'LBL_SOURCE_ELASTICA' => 'Elastica - PHP client for the distributed search engine elasticsearch ', - 'LBL_SOURCE_FACEBOOK' => 'FacebookLib - Provides access to the Facebook Platform.', + 'LBL_SOURCE_FACEBOOKSDK' => 'Facebook PHP SDK', 'LBL_SOURCE_JQUERY' => 'jQuery - jQuery is a fast, small, and feature-rich JavaScript library.', 'LBL_SOURCE_JQUERY_UI' => 'jQuery UI - jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.', 'LBL_SOURCE_OVERLIB' => 'OverlibMWS - The overlibmws library uses javascript for DHTML popups that serve as informational and navigational aids for websites.', 'LBL_DASHLET_TITLE' => 'My Sites', 'LBL_DASHLET_OPT_TITLE' => 'Title', + 'LBL_DASHLET_INCORRECT_URL' => 'Incorrect website location is specified', 'LBL_DASHLET_OPT_URL' => 'Website Location', 'LBL_DASHLET_OPT_HEIGHT' => 'Dashlet Height (in pixels)', 'LBL_DASHLET_SUGAR_NEWS' => 'Sugar News', diff --git a/modules/Home/quicksearchQuery.php b/modules/Home/quicksearchQuery.php index df58a482..33d72691 100644 --- a/modules/Home/quicksearchQuery.php +++ b/modules/Home/quicksearchQuery.php @@ -54,7 +54,7 @@ if(isset($_REQUEST['query']) && !empty($_REQUEST['query'])){ foreach($data['conditions'] as $k=>$v){ if (empty($data['conditions'][$k]['value']) && ($data['conditions'][$k]['op'] != quicksearchQuery::CONDITION_EQUAL)) { - $data['conditions'][$k]['value']=$_REQUEST['query']; + $data['conditions'][$k]['value']=urldecode($_REQUEST['query']); } } } diff --git a/modules/Import/UsersLastImport.php b/modules/Import/UsersLastImport.php index a59490b1..85bfb4dd 100644 --- a/modules/Import/UsersLastImport.php +++ b/modules/Import/UsersLastImport.php @@ -172,6 +172,8 @@ class UsersLastImport extends SugarBean $focus = new $module; } + $focus->mark_relationships_deleted($bean_id); + $result = $this->db->query( "DELETE FROM {$focus->table_name} WHERE id = '{$bean_id}'" diff --git a/modules/MergeRecords/SaveMerge.php b/modules/MergeRecords/SaveMerge.php index e24f85ae..c06d9ba8 100644 --- a/modules/MergeRecords/SaveMerge.php +++ b/modules/MergeRecords/SaveMerge.php @@ -101,8 +101,11 @@ $exclude = explode(',', $_REQUEST['merged_links']); if (is_array($_POST['merged_ids'])) { foreach ($_POST['merged_ids'] as $id) { require_once ($focus->merge_bean_file_path); - $mergesource = new $focus->merge_bean_class(); - $mergesource->retrieve($id); + $mergesource = new $focus->merge_bean_class(); + if (!$mergesource->retrieve($id)) + { + continue; + } //kbrill Bug #13826 foreach ($linked_fields as $name => $properties) { if ($properties['name']=='modified_user_link' || in_array($properties['name'], $exclude)) @@ -146,8 +149,10 @@ if (is_array($_POST['merged_ids'])) { } $GLOBALS['log']->debug("Merged record with id of ".$return_id); -header("Location: index.php?action=$return_action&module=$return_module&record=$return_id"); - +//do not redirect if noRedirect flag is set. This is mostly used by Unit tests +if(empty($_REQUEST['noRedirect'])){ + header("Location: index.php?action=$return_action&module=$return_module&record=$return_id"); +} //This function will compare the email addresses to be merged and only add the email id's //of the email addresses that are not duplicates. diff --git a/modules/ModuleBuilder/parsers/relationships/AbstractRelationship.php b/modules/ModuleBuilder/parsers/relationships/AbstractRelationship.php index c56c3e98..bb23f175 100644 --- a/modules/ModuleBuilder/parsers/relationships/AbstractRelationship.php +++ b/modules/ModuleBuilder/parsers/relationships/AbstractRelationship.php @@ -333,6 +333,8 @@ class AbstractRelationship $vardef [ 'type' ] = 'link' ; $vardef [ 'relationship' ] = $relationshipName ; $vardef [ 'source' ] = 'non-db' ; + $vardef [ 'module' ] = $sourceModule ; + $vardef [ 'bean_name' ] = BeanFactory::getObjectName($sourceModule) ; if ($right_side) $vardef [ 'side' ] = 'right' ; if (!empty($vname)) diff --git a/modules/ModuleBuilder/parsers/relationships/ActivitiesRelationship.php b/modules/ModuleBuilder/parsers/relationships/ActivitiesRelationship.php index c96d6a1a..1f1a8893 100644 --- a/modules/ModuleBuilder/parsers/relationships/ActivitiesRelationship.php +++ b/modules/ModuleBuilder/parsers/relationships/ActivitiesRelationship.php @@ -158,6 +158,8 @@ class ActivitiesRelationship extends OneToManyRelationship $vardef [ 'type' ] = 'link' ; $vardef [ 'relationship' ] = $relationshipName ; $vardef [ 'source' ] = 'non-db' ; + $vardef [ 'module' ] = $sourceModule ; + $vardef [ 'bean_name' ] = BeanFactory::getObjectName($sourceModule) ; $vardef [ 'vname' ] = strtoupper("LBL_{$relationshipName}_FROM_{$sourceModule}_TITLE"); return $vardef ; } diff --git a/modules/Opportunities/vardefs.php b/modules/Opportunities/vardefs.php index f1353e6a..0683ded5 100644 --- a/modules/Opportunities/vardefs.php +++ b/modules/Opportunities/vardefs.php @@ -120,6 +120,7 @@ $dictionary['Opportunity'] = array('table' => 'opportunities','audited'=>true, ' 'table' => 'campaigns', 'module'=>'Campaigns', 'source' => 'non-db', + 'additionalFields' => array('id' => 'campaign_id') ), 'campaign_opportunities' => array ( diff --git a/modules/Users/GeneratePassword.php b/modules/Users/GeneratePassword.php index edaf4bcb..9053a982 100644 --- a/modules/Users/GeneratePassword.php +++ b/modules/Users/GeneratePassword.php @@ -77,7 +77,7 @@ if(isset( $_POST['Users0emailAddress0'])){ if ($username != '' && $useremail != ''){ $usr_id=$usr->retrieve_user_id($username); $usr->retrieve($usr_id); - if ($usr->email1 != $useremail){ + if (!$usr->isPrimaryEmail($useremail)) { echo $mod_strings['LBL_PROVIDE_USERNAME_AND_EMAIL']; return; } diff --git a/modules/Users/User.php b/modules/Users/User.php index 2242b210..395b9e1f 100644 --- a/modules/Users/User.php +++ b/modules/Users/User.php @@ -461,7 +461,15 @@ class User extends Person { $query = "SELECT count(id) as total from users WHERE ".self::getLicensedUsersWhere(); - // wp: do not save user_preferences in this table, see user_preferences module + // is_group & portal should be set to 0 by default + if (!isset($this->is_group)) { + $this->is_group = 0; + } + if (!isset($this->portal_only)) { + $this->portal_only = 0; + } + + // wp: do not save user_preferences in this table, see user_preferences module $this->user_preferences = ''; // if this is an admin user, do not allow is_group or portal_only flag to be set. @@ -1830,4 +1838,19 @@ EOQ; return $result == true; } } + + /** + * Checks if the passed email is primary. + * + * @param string $email + * @return bool Returns TRUE if the passed email is primary. + */ + public function isPrimaryEmail($email) + { + if (!empty($this->email1) && !empty($email) && strcasecmp($this->email1, $email) == 0) { + return true; + } else { + return false; + } + } } diff --git a/modules/Users/authentication/AuthenticationController.php b/modules/Users/authentication/AuthenticationController.php index a4bd1b5c..b779e76a 100644 --- a/modules/Users/authentication/AuthenticationController.php +++ b/modules/Users/authentication/AuthenticationController.php @@ -53,13 +53,28 @@ class AuthenticationController /** * Creates an instance of the authentication controller and loads it * - * @param STRING $type - the authentication Controller - default to SugarAuthenticate + * @param STRING $type - the authentication Controller * @return AuthenticationController - */ - public function __construct($type = 'SugarAuthenticate') + public function __construct($type = null) { - if ($type == 'SugarAuthenticate' && !empty($GLOBALS['system_config']->settings['system_ldap_enabled']) && empty($_SESSION['sugar_user'])){ - $type = 'LDAPAuthenticate'; + $this->authController = $this->getAuthController($type); + } + + /** + * Get auth controller object + * @param string $type + * @return SugarAuthenticate + */ + protected function getAuthController($type) + { + if (!$type) { + $type = !empty($GLOBALS['sugar_config']['authenticationClass']) + ? $GLOBALS['sugar_config']['authenticationClass'] : 'SugarAuthenticate'; + } + + if ($type == 'SugarAuthenticate' && !empty($GLOBALS['system_config']->settings['system_ldap_enabled']) && empty($_SESSION['sugar_user'])) { + $type = 'LDAPAuthenticate'; } // check in custom dir first, in case someone want's to override an auth controller @@ -72,9 +87,13 @@ class AuthenticationController $type = 'SugarAuthenticate'; } - $this->authController = new $type(); - } + if (!empty($_REQUEST['no_saml']) + && (is_subclass_of($type, 'SAMLAuthenticate') || 'SAMLAuthenticate' == $type)) { + $type = 'SugarAuthenticate'; + } + return new $type(); + } /** * Returns an instance of the authentication controller @@ -82,7 +101,7 @@ class AuthenticationController * @param string $type this is the type of authetnication you want to use default is SugarAuthenticate * @return an instance of the authetnciation controller */ - public static function getInstance($type = 'SugarAuthenticate') + public static function getInstance($type = null) { if (empty(self::$authcontrollerinstance)) { self::$authcontrollerinstance = new AuthenticationController($type); diff --git a/modules/Users/authentication/SAMLAuthenticate/SAMLAuthenticate.php b/modules/Users/authentication/SAMLAuthenticate/SAMLAuthenticate.php index 40a655dd..16a8a187 100644 --- a/modules/Users/authentication/SAMLAuthenticate/SAMLAuthenticate.php +++ b/modules/Users/authentication/SAMLAuthenticate/SAMLAuthenticate.php @@ -47,6 +47,7 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); require_once('modules/Users/authentication/SugarAuthenticate/SugarAuthenticate.php'); +require_once('modules/Users/authentication/SAMLAuthenticate/lib/onelogin/saml.php'); class SAMLAuthenticate extends SugarAuthenticate { var $userAuthenticateClass = 'SAMLAuthenticateUser'; var $authenticationDir = 'SAMLAuthenticate'; @@ -70,10 +71,7 @@ class SAMLAuthenticate extends SugarAuthenticate { { parent::pre_login(); - if (empty($_REQUEST['no_saml'])) - { - SugarApplication::redirect('?entryPoint=SAML'); - } + $this->redirectToLogin($GLOBALS['app']); } /** @@ -88,4 +86,24 @@ class SAMLAuthenticate extends SugarAuthenticate { header('Location: index.php?module=Users&action=LoggedOut'); sugar_cleanup(true); } + + /** + * Redirect to login page + * + * @param SugarApplication $app + */ + public function redirectToLogin(SugarApplication $app) + { + require(get_custom_file_if_exists('modules/Users/authentication/SAMLAuthenticate/settings.php')); + + $loginVars = $app->createLoginVars(); + + // $settings - variable from modules/Users/authentication/SAMLAuthenticate/settings.php + $settings->assertion_consumer_service_url .= htmlspecialchars($loginVars); + + $authRequest = new SamlAuthRequest($settings); + $url = $authRequest->create(); + + $app->redirect($url); + } } diff --git a/modules/Users/authentication/SugarAuthenticate/SugarAuthenticate.php b/modules/Users/authentication/SugarAuthenticate/SugarAuthenticate.php index e57c78fb..8fd082ca 100644 --- a/modules/Users/authentication/SugarAuthenticate/SugarAuthenticate.php +++ b/modules/Users/authentication/SugarAuthenticate/SugarAuthenticate.php @@ -363,4 +363,15 @@ class SugarAuthenticate{ sugar_cleanup(true); } } + + /** + * Redirect to login page + * + * @param SugarApplication $app + */ + public function redirectToLogin(SugarApplication $app) + { + $loginVars = $app->createLoginVars(); + $app->redirect('index.php?action=Login&module=Users' . $loginVars); + } } diff --git a/service/core/SoapHelperWebService.php b/service/core/SoapHelperWebService.php index 199f95fa..0ece42a7 100644 --- a/service/core/SoapHelperWebService.php +++ b/service/core/SoapHelperWebService.php @@ -161,7 +161,7 @@ function validate_user($user_name, $password){ $user->user_name = $user_name; $system_config = new Administration(); $system_config->retrieveSettings('system'); - $authController = new AuthenticationController((!empty($sugar_config['authenticationClass'])? $sugar_config['authenticationClass'] : 'SugarAuthenticate')); + $authController = new AuthenticationController(); // Check to see if the user name and password are consistent. if($user->authenticate_user($password)){ // we also need to set the current_user. diff --git a/service/core/SugarWebServiceImpl.php b/service/core/SugarWebServiceImpl.php index c2080641..93c7923a 100644 --- a/service/core/SugarWebServiceImpl.php +++ b/service/core/SugarWebServiceImpl.php @@ -533,7 +533,7 @@ public function login($user_auth, $application, $name_value_list){ //rrs $system_config = new Administration(); $system_config->retrieveSettings('system'); - $authController = new AuthenticationController((!empty($sugar_config['authenticationClass'])? $sugar_config['authenticationClass'] : 'SugarAuthenticate')); + $authController = new AuthenticationController(); //rrs $isLoginSuccess = $authController->login($user_auth['user_name'], $user_auth['password'], array('passwordEncrypted' => true)); $usr_id=$user->retrieve_user_id($user_auth['user_name']); diff --git a/service/v3/SugarWebServiceImplv3.php b/service/v3/SugarWebServiceImplv3.php index fde1cde2..a7085153 100644 --- a/service/v3/SugarWebServiceImplv3.php +++ b/service/v3/SugarWebServiceImplv3.php @@ -78,7 +78,7 @@ class SugarWebServiceImplv3 extends SugarWebServiceImpl { //rrs $system_config = new Administration(); $system_config->retrieveSettings('system'); - $authController = new AuthenticationController((!empty($sugar_config['authenticationClass'])? $sugar_config['authenticationClass'] : 'SugarAuthenticate')); + $authController = new AuthenticationController(); //rrs $isLoginSuccess = $authController->login($user_auth['user_name'], $user_auth['password'], array('passwordEncrypted' => true)); $usr_id=$user->retrieve_user_id($user_auth['user_name']); diff --git a/service/v3_1/SugarWebServiceImplv3_1.php b/service/v3_1/SugarWebServiceImplv3_1.php index 0ec26614..412d1646 100644 --- a/service/v3_1/SugarWebServiceImplv3_1.php +++ b/service/v3_1/SugarWebServiceImplv3_1.php @@ -289,7 +289,7 @@ class SugarWebServiceImplv3_1 extends SugarWebServiceImplv3 { //rrs $system_config = new Administration(); $system_config->retrieveSettings('system'); - $authController = new AuthenticationController((!empty($sugar_config['authenticationClass'])? $sugar_config['authenticationClass'] : 'SugarAuthenticate')); + $authController = new AuthenticationController(); //rrs if(!empty($user_auth['encryption']) && $user_auth['encryption'] === 'PLAIN' && $authController->authController->userAuthenticateClass != "LDAPAuthenticateUser") { @@ -737,6 +737,7 @@ class SugarWebServiceImplv3_1 extends SugarWebServiceImplv3 { } // if } + $selectOnlyQueryFields = array(); if ($beanName != "User" && $beanName != "ProjectTask" ) { @@ -776,7 +777,6 @@ class SugarWebServiceImplv3_1 extends SugarWebServiceImplv3 { } //Pull in any db fields used for the unified search query so the correct joins will be added - $selectOnlyQueryFields = array(); foreach ($unifiedSearchFields[$name] as $field => $def){ if( isset($def['db_field']) && !in_array($field,$filterFields) ){ $filterFields[] = $field; @@ -806,7 +806,7 @@ class SugarWebServiceImplv3_1 extends SugarWebServiceImplv3 { if ($beanName == "User") { $filterFields = array('id', 'user_name', 'first_name', 'last_name', 'email_address'); $main_query = "select users.id, ea.email_address, users.user_name, first_name, last_name from users "; - $main_query = $main_query . " LEFT JOIN email_addr_bean_rel eabl ON eabl.bean_module = '{$seed->module_dir}' + $main_query = $main_query . " LEFT JOIN email_addr_bean_rel eabl ON (users.id = eabl.bean_id and eabl.bean_module = '{$seed->module_dir}') LEFT JOIN email_addresses ea ON (ea.id = eabl.email_address_id) "; $main_query = $main_query . "where ((users.first_name like '{$search_string}') or (users.last_name like '{$search_string}') or (users.user_name like '{$search_string}') or (ea.email_address like '{$search_string}')) and users.deleted = 0 and users.is_group = 0 and users.employee_status = 'Active'"; } // if diff --git a/service/v4/SugarWebServiceImplv4.php b/service/v4/SugarWebServiceImplv4.php index cba03f52..5fed18f0 100644 --- a/service/v4/SugarWebServiceImplv4.php +++ b/service/v4/SugarWebServiceImplv4.php @@ -73,7 +73,7 @@ class SugarWebServiceImplv4 extends SugarWebServiceImplv3_1 { //rrs $system_config = new Administration(); $system_config->retrieveSettings('system'); - $authController = new AuthenticationController((!empty($sugar_config['authenticationClass'])? $sugar_config['authenticationClass'] : 'SugarAuthenticate')); + $authController = new AuthenticationController(); //rrs if(!empty($user_auth['encryption']) && $user_auth['encryption'] === 'PLAIN' && $authController->authController->userAuthenticateClass != "LDAPAuthenticateUser") { diff --git a/soap/SoapDeprecated.php b/soap/SoapDeprecated.php index c4b7168a..46055962 100644 --- a/soap/SoapDeprecated.php +++ b/soap/SoapDeprecated.php @@ -214,7 +214,7 @@ function validate_user($user_name, $password){ $user->user_name = $user_name; $system_config = new Administration(); $system_config->retrieveSettings('system'); - $authController = new AuthenticationController((!empty($sugar_config['authenticationClass'])? $sugar_config['authenticationClass'] : 'SugarAuthenticate')); + $authController = new AuthenticationController(); // Check to see if the user name and password are consistent. if($user->authenticate_user($password)){ // we also need to set the current_user. diff --git a/soap/SoapSugarUsers.php b/soap/SoapSugarUsers.php index 1d8f4143..14142000 100644 --- a/soap/SoapSugarUsers.php +++ b/soap/SoapSugarUsers.php @@ -94,7 +94,7 @@ function login($user_auth, $application){ //rrs $system_config = new Administration(); $system_config->retrieveSettings('system'); - $authController = new AuthenticationController((!empty($sugar_config['authenticationClass'])? $sugar_config['authenticationClass'] : 'SugarAuthenticate')); + $authController = new AuthenticationController(); //rrs $isLoginSuccess = $authController->login($user_auth['user_name'], $user_auth['password'], array('passwordEncrypted' => true)); $usr_id=$user->retrieve_user_id($user_auth['user_name']); @@ -123,7 +123,7 @@ function login($user_auth, $application){ return array('id'=>-1, 'error'=>$error); } else if(function_exists('mcrypt_cbc')){ $password = decrypt_string($user_auth['password']); - $authController = new AuthenticationController((!empty($sugar_config['authenticationClass'])? $sugar_config['authenticationClass'] : 'SugarAuthenticate')); + $authController = new AuthenticationController(); if($authController->login($user_auth['user_name'], $password) && isset($_SESSION['authenticated_user_id'])){ $success = true; } // if @@ -1510,6 +1510,18 @@ function search_by_module($user_name, $password, $search_string, $modules, $offs 'Users'=>array('where'=>array('EmailAddresses' => array(0 => "ea.email_address like '{0}%'")),'fields'=>"users.id, users.user_name, users.first_name, ea.email_address"), ); + $more_query_array = array(); + foreach($modules as $module) { + if (!array_key_exists($module, $query_array)) { + $lc_module = strtolower($module); + $more_query_array[$module] = array('where'=>array($module => array(0 => "$lc_module.name like '{0}%'")), 'fields'=>"$lc_module.id, $lc_module.name"); + } + } + + if (!empty($more_query_array)) { + $query_array = array_merge($query_array, $more_query_array); + } + if(!empty($search_string) && isset($search_string)){ foreach($modules as $module_name){ $class_name = $beanList[$module_name]; diff --git a/sugar_version.php b/sugar_version.php index 34a9ce75..5b1ba5b4 100644 --- a/sugar_version.php +++ b/sugar_version.php @@ -38,10 +38,10 @@ -$sugar_version = '6.5.12'; -$sugar_db_version = '6.5.12'; +$sugar_version = '6.5.13'; +$sugar_db_version = '6.5.13'; $sugar_flavor = 'CE'; -$sugar_build = '1046'; -$sugar_timestamp = '2013-04-02 11:00pm'; +$sugar_build = '1041'; +$sugar_timestamp = '2013-05-08 02:24pm'; ?> diff --git a/tests/data/Bug52438Tets.php b/tests/data/Bug52438Tets.php new file mode 100755 index 00000000..caf6659b --- /dev/null +++ b/tests/data/Bug52438Tets.php @@ -0,0 +1,95 @@ +opportunity = new Opportunity(); + $this->opportunity->currency_id = -99; + $this->opportunity->save(); + } + + /** + * Tears down the fixture, for example, close a network connection. + * This method is called after a test is executed. + * + * Removes temporary opportunity + */ + public function tearDown() + { + if (!empty($this->opportunity)) { + $this->opportunity->mark_deleted($this->opportunity->id); + } + SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); + unset($GLOBALS['current_user']); + } + + /** + * Tests that currency-related properties are filled in at model layer + * even when opportunity currency is the default one. + */ + public function testDefaultCurrencyFieldsArePopulated() + { + $opportunity = new Opportunity(); + + // disable row level security just to simplify the test + $opportunity->disable_row_level_security = true; + $opportunity->retrieve($this->opportunity->id); + + $this->assertNotEmpty($opportunity->currency_name); + $this->assertNotEmpty($opportunity->currency_symbol); + } +} diff --git a/tests/data/Bug59095Test.php b/tests/data/Bug59095Test.php new file mode 100755 index 00000000..c71cf145 --- /dev/null +++ b/tests/data/Bug59095Test.php @@ -0,0 +1,80 @@ +query = "SELECT accounts.* FROM accounts WHERE 1=1"; + } + + public function tearDown() + { + global $sugar_config; + unset($sugar_config['disable_count_query']); + SugarTestAccountUtilities::removeAllCreatedAccounts(); + } + + /** + * Quick Search field not returning defined limit results. + * @group 59095 + */ + public function testShouldReturnDefinedLimit() + { + $sb = BeanFactory::getBean('Accounts'); + $res = $sb->process_list_query($this->query, 0, 2); + $this->assertEquals(2, count($res['list'])); + } +} diff --git a/tests/include/Bug62329Test.php b/tests/include/Bug62329Test.php new file mode 100755 index 00000000..77aace23 --- /dev/null +++ b/tests/include/Bug62329Test.php @@ -0,0 +1,59 @@ +parse($sql); + + // assert an array was returned. If an error occurred a php fatal error will bubble up and nothing will be returned + $this->assertInternalType('array', $sqlARR, "there was an error while parsing the sql string: ".$sql); + + } +} diff --git a/tests/include/Dashlets/DashletAutoRefreshTest.php b/tests/include/Dashlets/DashletAutoRefreshTest.php index 306be502..aa20ac6d 100755 --- a/tests/include/Dashlets/DashletAutoRefreshTest.php +++ b/tests/include/Dashlets/DashletAutoRefreshTest.php @@ -161,7 +161,7 @@ class DashletAutoRefreshTest extends Sugar_PHPUnit_Framework_TestCase $this->assertEmpty($dashlet->processAutoRefresh()); } - public function testProcessAutoRefreshReturnsNothingIfAutoRefreshingIsDisabled() + public function testProcessAutoRefreshReturnsNothingIfSystemLevelAutoRefreshingIsDisabled() { $dashlet = new DashletAutoRefreshTestMock('unit_test_run'); $GLOBALS['sugar_config']['dashlet_auto_refresh_min'] = -1; @@ -172,6 +172,33 @@ class DashletAutoRefreshTest extends Sugar_PHPUnit_Framework_TestCase $this->assertEmpty($dashlet->processAutoRefresh()); } + + /** + * Tests whether dashlet ignores system settings if user disables auto refresh. + * @bug 52331 + * @dataProvider refreshCases + * @param int $systemValue + * @param int $dashletValue + * @param int $forceSystemValue + */ + public function testAllowAutoRefresh($systemValue, $dashletValue, $forceSystemValue) + { + $dashlet = new DashletAutoRefreshTestMock('unit_test_run'); + $GLOBALS['sugar_config']['dashlet_auto_refresh_min'] = $systemValue; + $dashlet->autoRefresh = $dashletValue; + + $this->assertEquals($forceSystemValue, $dashlet->getAutoRefresh()); + } + + public function refreshCases() + { + return array( + array(20, null, 0), + array(20, 10, 20000), + array(10, 20, 20000), + array(20, -1, 0) + ); + } } class DashletAutoRefreshTestMock extends Dashlet @@ -190,4 +217,9 @@ class DashletAutoRefreshTestMock extends Dashlet { return parent::processAutoRefresh(); } + + public function getAutoRefresh() + { + return parent::getAutoRefresh(); + } } diff --git a/tests/include/Expressions/Expression/Generic/Bug61734Test.php b/tests/include/Expressions/Expression/Generic/Bug61734Test.php new file mode 100755 index 00000000..6ebf2e6e --- /dev/null +++ b/tests/include/Expressions/Expression/Generic/Bug61734Test.php @@ -0,0 +1,148 @@ +createCustom(); + + $this->acc = SugarTestAccountUtilities::createAccount(); + $this->acc2 = SugarTestAccountUtilities::createAccount(); + + + } + + public function tearDown() + { + $this->custField->delete($this->df); + $_REQUEST['repair_silent']=1; + $rc = new RepairAndClear(); + $rc->repairAndClearAll(array("clearAll", "rebuildExtensions"), array("Accounts"), false, false); + SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); + SugarTestAccountUtilities::removeAllCreatedAccounts(); + SugarTestHelper::tearDown(); + $GLOBALS['reload_vardefs'] = true; + $o = new Account(); + $GLOBALS['reload_vardefs'] = false; + } + + public function createCustom(){ + //create new varchar widget and associate with Accounts + $this->custField = get_widget('varchar'); + $this->custField->id = 'Accounts'.$this->custFieldName; + $this->custField->name = $this->custFieldName; + $this->custField->type = 'varchar'; + $this->custField->label = 'LBL_' . strtoupper($this->custFieldName); + $this->custField->vname = 'LBL_' . strtoupper($this->custFieldName); + $this->custField->len = 255; + $this->custField->custom_module = 'Accounts'; + $this->custField->required = 0; + $this->custField->default = 'goofy'; + + $this->acc = new Account(); + $this->df = new DynamicField('Accounts'); + $this->df->setup($this->acc); + + $this->df->addFieldObject($this->custField); + $this->df->buildCache('Accounts'); + $this->custField->save($this->df); + + VardefManager::clearVardef(); + VardefManager::refreshVardefs('Accounts', 'Account'); + + //Now create the meta files to make this a Calculated Field. + $fn = $this->custFieldName; + $extensionContent = <<custFileDirPath = create_custom_directory($this->custFileDirPath); + $fileLoc = $this->custFileDirPath.'sugarfield_'.$this->custFieldName.'.php'; + file_put_contents($fileLoc, $extensionContent); + + //run repair and clear to make sure the meta gets picked up + $_REQUEST['repair_silent']=1; + $rc = new RepairAndClear(); + $rc->repairAndClearAll(array("clearAll", "rebuildExtensions"), array("Accounts"), false, false); + $fn = $this->custFieldName; + } + + public function testMergeWithCalculatedField() + { + //recreate expected request and post superglobals for savemerge.php + $_REQUEST = $_POST = array( + 'module' => 'MergeRecords', + 'record' => $this->acc->id, + 'merge_module' => 'Accounts', + 'action' => 'SaveMerge', + 'return_module' => 'Accounts', + 'return_action' => 'index', + 'change_parent' => 0, + 'remove' => 0, + 'merged_links' => 'assigned_user_link,member_of', + 'merged_ids' => array + ($this->acc2->id), + + 'button' => 'Save Merge', + 'name' => 'SugarAccount1091847479', + 'date_entered' => '04/08/2013 03:18pm', + 'date_modified' => '04/08/2013 03:18pm', + 'team_name' => 'team_name', + 'team_name_field' => 'team_name_table', + 'team_name_collection_0' => 'Global', + 'id_team_name_collection_0' => 1, + 'primary_team_name_collection' => 0, + 'noRedirect' => 1, + ); + //call SaveMerge so the account beans can be merged + require_once('modules/MergeRecords/SaveMerge.php'); + + //make sure fatal error is not being output + $this->expectOutputNotRegex('/fatal/i', 'Failure message is appearing during merge'); + + + } +} diff --git a/tests/include/PHPSQLParser/Bug61996Test.php b/tests/include/PHPSQLParser/Bug61996Test.php new file mode 100755 index 00000000..81108551 --- /dev/null +++ b/tests/include/PHPSQLParser/Bug61996Test.php @@ -0,0 +1,57 @@ +parse($sql); + + $this->assertInternalType('array', $result); + } +} diff --git a/tests/include/Smarty/plugins/Bug54203Test.php b/tests/include/Smarty/plugins/Bug54203Test.php new file mode 100755 index 00000000..d1b12a38 --- /dev/null +++ b/tests/include/Smarty/plugins/Bug54203Test.php @@ -0,0 +1,88 @@ + 'http://example.com/[email1]', + 'use_curly' => false, + 'fields' => array( + 'email1' => array( + 'function' => array( + 'name' => 'getEmailAddressWidget', + 'returns' => 'html', + ), + 'value' => '', + ), + ), + ); + + $bean = new Account(); + $bean->email1 = 'sugar.test54203@example.com'; + + $smarty = new Sugar_Smarty(); + $smarty->assign('bean', $bean); + + $output = smarty_function_sugar_replace_vars($params, $smarty); + + $this->assertContains($bean->email1, $output, 'Rendered string contains html markup.'); + } + +} diff --git a/tests/include/SugarCharts/Bug52901Test.php b/tests/include/SugarCharts/Bug52901Test.php new file mode 100755 index 00000000..da89ef28 --- /dev/null +++ b/tests/include/SugarCharts/Bug52901Test.php @@ -0,0 +1,262 @@ + array( + array( + '' => + array( + '' => + array( + 'numerical_value' => 1, + 'group_text' => '', + 'group_key' => 'self:account_type', + 'count' => '', + 'group_label' => 'someHtml', + 'numerical_label' => 'someHtml', + 'numerical_key' => 'count', + 'module' => 'Accounts', + 'group_base_text' => '', + ), + ), + 'Bar' => + array( + 'Foo' => + array( + 'numerical_value' => 1, + 'group_text' => 'Bar', + 'group_key' => 'self:account_type', + 'count' => '', + 'group_label' => 'someHtml', + 'numerical_label' => 'someHtml', + 'numerical_key' => 'count', + 'module' => 'Accounts', + 'group_base_text' => 'Foo', + ), + ), + ), + array('', 'Foo'), + array('type', 'industry'), + array('', 'Foo', '', 'Foo'), + ), + // Accounts: + // 1. type = 'Foo', industry = 'Bar'; + // 2. type = 'Bar', industry = 'Foo' + 'bothDifferentTypeAndIndustry' => array( + array( + 'Foo' => + array( + 'Bar' => + array( + 'numerical_value' => 1, + 'group_text' => 'Foo', + 'group_key' => 'self:account_type', + 'count' => '', + 'group_label' => 'someHtml', + 'numerical_label' => 'someHtml', + 'numerical_key' => 'count', + 'module' => 'Accounts', + 'group_base_text' => 'Bar', + ), + ), + 'Bar' => + array( + 'Foo' => + array( + 'numerical_value' => 1, + 'group_text' => 'Bar', + 'group_key' => 'self:account_type', + 'count' => '', + 'group_label' => 'someHtml', + 'numerical_label' => 'someHtml', + 'numerical_key' => 'count', + 'module' => 'Accounts', + 'group_base_text' => 'Foo', + ), + ), + ), + array('Foo', 'Bar'), + array('type', 'industry'), + array('Foo', 'Bar', 'Foo', 'Bar'), + ), + // Accounts: + // 1. type = 'Foo', industry = 'Foo'; + // 2. type = 'Bar', industry = 'Bar' + 'bothEqualTypeAndIndustry' => array( + array( + 'Bar' => + array( + 'Bar' => + array( + 'numerical_value' => 1, + 'group_text' => 'Bar', + 'group_key' => 'self:account_type', + 'count' => '', + 'group_label' => 'someHtml', + 'numerical_label' => 'someHtml', + 'numerical_key' => 'count', + 'module' => 'Accounts', + 'group_base_text' => 'Bar', + ), + ), + 'Foo' => + array( + 'Foo' => + array( + 'numerical_value' => 1, + 'group_text' => 'Foo', + 'group_key' => 'self:account_type', + 'count' => '', + 'group_label' => 'someHtml', + 'numerical_label' => 'someHtml', + 'numerical_key' => 'count', + 'module' => 'Accounts', + 'group_base_text' => 'Foo', + ), + ), + ), + array('Foo', 'Bar'), + array('type', 'industry'), + array('Foo', 'Bar', 'Foo', 'Bar'), + ), + // Accounts: Single group by. only by type + // 1. type = 'Foo' + // 2. type = 'Bar' + 'onlyByType' => array( + array( + 'Bar' => + array( + 'Bar' => + array( + 'numerical_value' => 1, + 'group_text' => 'Bar', + 'group_key' => 'self:account_type', + 'count' => '', + 'group_label' => 'someHtml', + 'numerical_label' => 'someHtml', + 'numerical_key' => 'count', + 'module' => 'Accounts', + 'group_base_text' => 'Bar', + ), + ), + 'Foo' => + array( + 'Foo' => + array( + 'numerical_value' => 1, + 'group_text' => 'Foo', + 'group_key' => 'self:account_type', + 'count' => '', + 'group_label' => 'someHtml', + 'numerical_label' => 'someHtml', + 'numerical_key' => 'count', + 'module' => 'Accounts', + 'group_base_text' => 'Foo', + ), + ), + ), + array('Foo', 'Bar'), + array('type'), + array(), + ), + ); + + return $dataSeed; + } + + /** + * Test that is filled properly + * + * @param $dataSet array dataSet for JitReports + * @param $superSet array super_set for JitReports + * @param $groupBy array array of group_by levels + * @param $expectedSubgroupNodesTitles array expected list of values of node in each node <subgroups> + * + * @dataProvider dataFeed + * @group 52901 + */ + public function testXMLIsGeneratedProperly($dataSet, $superSet, $groupBy, $expectedSubgroupNodesTitles) + { + $JR = new JitReports(); + $JR->setData($dataSet); + $JR->super_set = $superSet; + $JR->setDisplayProperty('thousands', false); + $JR->group_by = $groupBy; + + // We do this because the function which is under the test (xmlDataReportChart()) returns XML without root node and thus causes XML parse error + $actualXML = '<data>' . $JR->xmlDataReportChart() . '</data>'; + + // Get the list of <title> node value elements of each <subgroup> + $dom = new DomDocument(); + $dom->loadXML($actualXML); + $xpath = new DomXPath($dom); + $nodes = $xpath->query('group/subgroups/group/title'); + $actualSubgroupNodesTitlesArray = array(); + foreach ($nodes as $node) + { + $actualSubgroupNodesTitlesArray[] = $node->nodeValue; + } + + $this->assertEquals($expectedSubgroupNodesTitles, $actualSubgroupNodesTitlesArray); + } + +} \ No newline at end of file diff --git a/tests/include/database/Bug61885Test.php b/tests/include/database/Bug61885Test.php new file mode 100755 index 00000000..a70339ef --- /dev/null +++ b/tests/include/database/Bug61885Test.php @@ -0,0 +1,140 @@ +<?php +/********************************************************************************* + * By installing or using this file, you are confirming on behalf of the entity + * subscribed to the SugarCRM Inc. product ("Company") that Company is bound by + * the SugarCRM Inc. Master Subscription Agreement (“MSA”), which is viewable at: + * http://www.sugarcrm.com/master-subscription-agreement + * + * If Company is not bound by the MSA, then by installing or using this file + * you are agreeing unconditionally that Company will be bound by the MSA and + * certifying that you have authority to bind Company accordingly. + * + * Copyright (C) 2004-2013 SugarCRM Inc. All rights reserved. + ********************************************************************************/ + +require_once 'include/database/DBManagerFactory.php'; + +class Bug61885Test extends Sugar_PHPUnit_Framework_TestCase +{ + /** + * DataProvider function for test + * @static + * @return array + */ + public static function provideVarDefs() + { + $returnArray = array( + array( + array( + 'name' => 'FOO', + 'type' => 'VARCHAR', + 'len' => '255', + ), + array( + 'name' => 'foo', + 'type' => 'varchar', + 'len' => '255', + ), + true, + ), + array( + array( + 'name' => 'foo', + 'type' => 'varchar', + 'len' => '255', + ), + array( + 'name' => 'FOO', + 'type' => 'VARCHAR', + 'len' => '255', + ), + true, + ), + array( + array( + 'name' => 'idx_ACCNT_id_del', + 'type' => 'index', + 'fields' => array('ID', 'deleted'), + ), + array( + 'name' => 'idx_accnt_id_del', + 'type' => 'index', + 'fields' => array('id', 'deleted'), + ), + true, + ), + array( + array( + 'name' => 'idx_ACCNT_id_del', + 'type' => 'index', + 'fields' => array('ID', 'DELETED'), + ), + array( + 'name' => 'idx_accnt_id_del', + 'type' => 'index', + 'fields' => array('id', 'deleted'), + ), + true, + ), + array( + array( + 'name' => 'idx_ACCNT_id_del', + 'type' => 'index', + 'fields' => array('IDxxx', 'DELETED'), + ), + array( + 'name' => 'idx_accnt_id_del', + 'type' => 'index', + 'fields' => array('id', 'deleted'), + ), + false, + ), + array( + array( + 'name' => 'idx_ACCNT_id_del', + 'type' => 'index', + 'fields' => array('IDxxx', 'deletedxxx'), + ), + array( + 'name' => 'idx_accnt_id_del', + 'type' => 'index', + 'fields' => array('id', 'deleted'), + ), + false, + ), + array( + array( + 'name' => 'idx_accnt_id_del', + 'type' => 'index', + 'fields' => array('id', 'deleted'), + ), + array( + 'name' => 'idx_ACCNT_id_del', + 'type' => 'index', + 'fields' => array('ID', 'DELETED'), + ), + true, + ), + ); + + return $returnArray; + } + + /** + * @dataProvider provideVarDefs + * @group 61885 + */ + public function testCompareVarDefsNotCaseSensitive($fieldDef1, $fieldDef2, $expectedResult) + { + $DBManager = DBManagerFactory::getInstance(); + + if ($expectedResult) + { + $this->assertTrue($DBManager->compareVarDefs($fieldDef1, $fieldDef2)); + } + else + { + $this->assertFalse($DBManager->compareVarDefs($fieldDef1, $fieldDef2)); + } + } +} diff --git a/tests/modules/DynamicFields/Bug61859Test.php b/tests/modules/DynamicFields/Bug61859Test.php new file mode 100755 index 00000000..7c32e331 --- /dev/null +++ b/tests/modules/DynamicFields/Bug61859Test.php @@ -0,0 +1,71 @@ +<?php +/********************************************************************************* + * SugarCRM Community Edition is a customer relationship management program developed by + * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License version 3 as published by the + * Free Software Foundation with the addition of the following permission added + * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK + * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY + * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more + * details. + * + * You should have received a copy of the GNU Affero General Public License along with + * this program; if not, see http://www.gnu.org/licenses or write to the Free + * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA. + * + * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, + * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com. + * + * The interactive user interfaces in modified source and object code versions + * of this program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU Affero General Public License version 3. + * + * In accordance with Section 7(b) of the GNU Affero General Public License version 3, + * these Appropriate Legal Notices must retain the display of the "Powered by + * SugarCRM" logo. If the display of the logo is not reasonably feasible for + * technical reasons, the Appropriate Legal Notices must display the words + * "Powered by SugarCRM". + ********************************************************************************/ + + +require_once('modules/DynamicFields/DynamicField.php'); + +class Bug61859Test extends Sugar_PHPUnit_Framework_TestCase +{ + + private $dynamicFields; + + /** + * @group 61859 + */ + public function testFieldExists() + { + $this->assertFalse($this->dynamicFields->fieldExists('contact')); + } + + public function setUp() + { + SugarTestHelper::setUp('current_user'); + SugarTestHelper::setUp('dictionary'); + + $leadBean = $bean = BeanFactory::getBean('Leads'); + $this->dynamicFields = new DynamicField('Leads'); + $this->dynamicFields->setup($leadBean); + + parent::setUp(); + } + + public function tearDown() + { + SugarTestHelper::tearDown(); + parent::tearDown(); + } + +} diff --git a/tests/modules/DynamicFields/Bug61859_p2Test.php b/tests/modules/DynamicFields/Bug61859_p2Test.php new file mode 100755 index 00000000..2af0a30d --- /dev/null +++ b/tests/modules/DynamicFields/Bug61859_p2Test.php @@ -0,0 +1,125 @@ +<?php +/********************************************************************************* + * SugarCRM Community Edition is a customer relationship management program developed by + * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License version 3 as published by the + * Free Software Foundation with the addition of the following permission added + * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK + * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY + * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more + * details. + * + * You should have received a copy of the GNU Affero General Public License along with + * this program; if not, see http://www.gnu.org/licenses or write to the Free + * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA. + * + * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, + * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com. + * + * The interactive user interfaces in modified source and object code versions + * of this program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU Affero General Public License version 3. + * + * In accordance with Section 7(b) of the GNU Affero General Public License version 3, + * these Appropriate Legal Notices must retain the display of the "Powered by + * SugarCRM" logo. If the display of the logo is not reasonably feasible for + * technical reasons, the Appropriate Legal Notices must display the words + * "Powered by SugarCRM". + ********************************************************************************/ + + +require_once('modules/DynamicFields/DynamicField.php'); + +class Bug61859_p2Test extends Sugar_PHPUnit_Framework_TestCase +{ + + static private $module = 'Leads'; + private $object = 'Lead'; + private $relatedModule = 'Contacts'; + + static private $field; + static private $dynamicField; + + /** + * @group 61859 + */ + public function testAddField() + { + $this->addField('testfieldbug61859'); + SugarTestHelper::setUp('dictionary'); + + $idName = $GLOBALS['dictionary'][$this->object]['fields'][self::$field->name]['id_name']; + + $this->assertArrayHasKey(self::$field->name, $GLOBALS['dictionary'][$this->object]['fields']); + $this->assertArrayHasKey($idName, $GLOBALS['dictionary'][$this->object]['fields']); + + return $idName; + } + + /** + * @depends testAddField + * @group 61859 + */ + public function testUpdateField($idName) + { + + self::$field->label_value = 'UpdatedLabel'; + self::$field->save(self::$dynamicField); + + SugarTestHelper::setUp('dictionary'); + + $this->assertEquals($idName, self::$field->ext3); + + } + + private function addField($name) + { + $labelName = 'LBL_' . strtoupper($name); + $field = get_widget('relate'); + $field->audited = 0; + $field->view = 'edit'; + $field->name = $name; + $field->vname = $labelName; + $field->label = $labelName; + + $field->ext2 = $this->relatedModule; + $field->label_value = $name; + $field->save(self::$dynamicField); + + self::$field = $field; + } + + static public function setUpBeforeClass() + { + parent::setUpBeforeClass(); + + SugarTestHelper::setUp('app_list_strings'); + SugarTestHelper::setUp('mod_strings', array(self::$module)); + SugarTestHelper::setUp('mod_strings', array('ModuleBuilder')); + + SugarTestHelper::setUp('beanList'); + SugarTestHelper::setUp('beanFiles'); + SugarTestHelper::setUp('dictionary'); + SugarTestHelper::setUp('current_user'); + + self::$dynamicField = new DynamicField(self::$module); + self::$dynamicField->setup(BeanFactory::getBean(self::$module)); + + } + + static public function tearDownAfterClass() + { + self::$field->delete(self::$dynamicField); + + SugarTestHelper::tearDown(); + parent::tearDownAfterClass(); + } + +} diff --git a/tests/modules/Import/UsersLastImportTest.php b/tests/modules/Import/UsersLastImportTest.php index 5050cdd6..377b4514 100755 --- a/tests/modules/Import/UsersLastImportTest.php +++ b/tests/modules/Import/UsersLastImportTest.php @@ -142,6 +142,7 @@ class UsersLastImportTest extends Sugar_PHPUnit_Framework_TestCase $focus = new Account(); $focus->id = "Account_".$unid; + $focus->save(); $last_import = new UsersLastImport(); $last_import->assigned_user_id = $GLOBALS['current_user']->id; diff --git a/tests/modules/Users/UserTest.php b/tests/modules/Users/UserTest.php index 1b3fecc2..5598dcc5 100755 --- a/tests/modules/Users/UserTest.php +++ b/tests/modules/Users/UserTest.php @@ -139,5 +139,12 @@ class UserTest extends Sugar_PHPUnit_Framework_TestCase $GLOBALS['db']->getOne("SELECT category FROM user_preferences WHERE assigned_user_id = '{$this->_user->id}' AND category = 'cat2'") ); } + + public function testPrimaryEmailShouldBeCaseInsensitive() + { + $this->_user->email1 = 'example@example.com'; + $this->assertTrue($this->_user->isPrimaryEmail('EXAMPLE@example.com')); + } + } diff --git a/tests/service/Bug62094Test.php b/tests/service/Bug62094Test.php new file mode 100755 index 00000000..bc53193f --- /dev/null +++ b/tests/service/Bug62094Test.php @@ -0,0 +1,91 @@ +<?php +/********************************************************************************* + * By installing or using this file, you are confirming on behalf of the entity + * subscribed to the SugarCRM Inc. product ("Company") that Company is bound by + * the SugarCRM Inc. Master Subscription Agreement (“MSA”), which is viewable at: + * http://www.sugarcrm.com/master-subscription-agreement + * + * If Company is not bound by the MSA, then by installing or using this file + * you are agreeing unconditionally that Company will be bound by the MSA and + * certifying that you have authority to bind Company accordingly. + * + * Copyright (C) 2004-2013 SugarCRM Inc. All rights reserved. + ********************************************************************************/ + + +require_once 'tests/service/SOAPTestCase.php'; +require_once 'modules/ModuleBuilder/parsers/relationships/AbstractRelationship.php'; +require_once 'modules/ModuleBuilder/parsers/relationships/ActivitiesRelationship.php'; + +class Bug62094Test extends SOAPTestCase +{ + protected $definition; + + public function setUp() + { + $this->definition = Array( + 'id' => 'a3468352-8fd0-ec13-708a-517087f79ada', + 'relationship_name' => 'accounts_meetings_1', + 'lhs_module' => 'Accounts', + 'lhs_table' => 'accounts', + 'lhs_key' => 'id', + 'rhs_module' => 'Meetings', + 'rhs_table' => 'meetings', + 'rhs_key' => 'id', + 'join_table' => 'accounts_meetings_1_c', + 'join_key_lhs' => 'accounts_meetings_1accounts_ida', + 'join_key_rhs' => 'accounts_meetings_1meetings_idb', + 'relationship_type' => 'one-to-many', + 'relationship_role_column' => '', + 'relationship_role_column_value' =>'', + 'reverse' => 0, + 'deleted' => 0, + 'readonly' => 1, + 'rhs_subpanel' => '', + 'lhs_subpanel' => '', + 'from_studio' => 1, + 'is_custom' => 1 + ); + + parent::setUp(); + + } + + public function tearDown() + { + parent::tearDown(); + } + + public function testGetModuleFields() + { + $relationship = new AbstractRelationship62094($this->definition); + $vardef = $relationship->getLinkFieldDefinition('Meetings', 'accounts_meetings_1'); + + $this->assertNotEmpty($vardef['module'], 'get_module_fields failed: empty module returned'); + $this->assertNotEmpty($vardef['bean_name'], 'get_module_fields failed: empty bean_name returned'); + + $relationship = new ActivitiesRelationship62094($this->definition); + $vardef = $relationship->getLinkFieldDefinition('Meetings', 'accounts_meetings_1'); + + $this->assertNotEmpty($vardef['module'], 'get_module_fields failed: empty module returned'); + $this->assertNotEmpty($vardef['bean_name'], 'get_module_fields failed: empty bean_name returned'); + } +} + +class AbstractRelationship62094 extends AbstractRelationship { + + public function getLinkFieldDefinition ($sourceModule , $relationshipName) + { + return parent::getLinkFieldDefinition($sourceModule , $relationshipName); + } + +} + +class ActivitiesRelationship62094 extends ActivitiesRelationship { + + public function getLinkFieldDefinition ($sourceModule , $relationshipName) + { + return parent::getLinkFieldDefinition($sourceModule , $relationshipName); + } + +} diff --git a/themes/Sugar5/tpls/_welcome.tpl b/themes/Sugar5/tpls/_welcome.tpl index 39532861..207dce18 100644 --- a/themes/Sugar5/tpls/_welcome.tpl +++ b/themes/Sugar5/tpls/_welcome.tpl @@ -37,6 +37,6 @@ *} {if $AUTHENTICATED} <div id="welcome"> - {$APP.NTC_WELCOME}, <strong><a id="welcome_link" href='index.php?module=Users&action=EditView&record={$CURRENT_USER_ID}'>{$CURRENT_USER}</a></strong> [ <a id="logout_link" href='{$LOGOUT_LINK}' class='utilsLink'>{$LOGOUT_LABEL}</a> ] + {$APP.NTC_WELCOME}, <strong><a id="welcome_link" href='index.php?module=Users&action=EditView&record={$CURRENT_USER_ID}'>{$CURRENT_USER}</a></strong>{if !empty($LOGOUT_LINK) && !empty($LOGOUT_LABEL)} [ <a id="logout_link" href='{$LOGOUT_LINK}' class='utilsLink'>{$LOGOUT_LABEL}</a> ]{/if} </div> {/if} -- 2.45.0