diff --git a/ModuleInstall/extensions.php b/ModuleInstall/extensions.php index a42ccc1d8..69faf31c6 100755 --- a/ModuleInstall/extensions.php +++ b/ModuleInstall/extensions.php @@ -1,14 +1,11 @@ array("section" => "action_view_map","extdir" => "ActionViewMap", "file" => 'action_view_map.ext.php'), @@ -68,6 +67,7 @@ if (!defined('sugarEntry') || !sugarEntry) { "filteroperatormap" => array("section" => "filter_operator_map","extdir" => "FilterOperatorMap", "file" => 'filter_operator_map.ext.php'), "filtermappers" => array("section" => "filter_mappers","extdir" => "FilterMappers", "file" => 'filter_mappers.ext.php'), "classicviewroutingexclusions" => array("section" => "classicview_routing_exclusions","extdir" => "ClassicViewRoutingExclusions", "file" => 'classicview_routing_exclusions.ext.php'), + "pdf" => array("section" => "pdfs", "extdir" => "PDF", "file" => 'pdfs.ext.php', "module" => "application"), ); if (file_exists("custom/application/Ext/Extensions/extensions.ext.php")) { include("custom/application/Ext/Extensions/extensions.ext.php"); diff --git a/data/SugarBean.php b/data/SugarBean.php index 4372b2814..3527ca38e 100755 --- a/data/SugarBean.php +++ b/data/SugarBean.php @@ -420,6 +420,12 @@ class SugarBean */ public $createdAuditRecords; + /** + * Keeps track of emails sent to notify_user ids to avoid duplicate emails + * @var array $sentAssignmentNotifications + */ + public $sentAssignmentNotifications = array(); + /** * @var SugarBean[][] $line_item_entries */ @@ -3265,7 +3271,7 @@ class SugarBean { global $current_user; - if ((($this->object_name == 'Meeting' || $this->object_name == 'Call') || $notify_user->receive_notifications) && !$this->sentAssignmentNotifications) { + if ((($this->object_name == 'Meeting' || $this->object_name == 'Call') || $notify_user->receive_notifications) && !in_array($notify_user->id, $this->sentAssignmentNotifications, true)) { $sendToEmail = $notify_user->emailAddress->getPrimaryAddress($notify_user); $sendEmail = true; if (empty($sendToEmail)) { @@ -3330,7 +3336,7 @@ class SugarBean $GLOBALS['log']->fatal("Notifications: error sending e-mail (method: {$notify_mail->Mailer}), " . "(error: {$notify_mail->ErrorInfo})"); } else { - $this->sentAssignmentNotifications = true; + $this->sentAssignmentNotifications[] = $notify_user->id; $GLOBALS['log']->info("Notifications: e-mail successfully sent"); } } diff --git a/files.md5 b/files.md5 index 6d0a23a3c..96d9d4372 100755 --- a/files.md5 +++ b/files.md5 @@ -1,5 +1,5 @@ '69a1e7b3d7755a2a63499a16ddae81cf', './Api/Core/Config/slim.php' => 'b134e68765e6a1403577e2a5a06322b8', @@ -114,8 +114,8 @@ $md5_string = array ( './ModuleInstall/PackageManager/tpls/PackageForm.tpl' => 'bffd280ab5cd7381a5b0da41a9c1f34f', './ModuleInstall/PackageManager/tpls/PackageManagerLicense.tpl' => 'df5e267d1df5ce08fb9406e42d5b4816', './ModuleInstall/PackageManager/tpls/PackageManagerScripts.tpl' => '98e396c0aa57329731fda19c790fffb2', - './ModuleInstall/extensions.php' => '87596ad3f28a39c996a5551cad3b5cab', - './README.md' => '106d48a1c68ed7a7a79a83cfc0877501', + './ModuleInstall/extensions.php' => '094f4650261f6efbab1b90b119829388', + './README.md' => '907df202f6bfd978ccbff16441d12df6', './RoboFile.php' => '045b82c1df69553824d0e4ffcce6e03c', './SugarSecurity.php' => '47e316b2d408e8c5192c8ea4a4f921b3', './TreeData.php' => '32873e20cb5fd33f9d1cdaf18c3cac5c', @@ -503,11 +503,9 @@ $md5_string = array ( './Zend/Validate/Interface.php' => 'e313ef824309253dcfab90ff1d38ac86', './Zend/Validate/Ip.php' => 'e313ef824309253dcfab90ff1d38ac86', './Zend/Version.php' => 'e313ef824309253dcfab90ff1d38ac86', - './build/push_output.sh' => 'cde8cd38e3b0c4e988ec4be7d81faa89', - './build/travis-ci-apache' => 'e1e212c4eaf679b6ec620cd0b12f4571', './campaign_tracker.php' => '321e43ca8b664e6ca57ae5589e8c0667', './composer.json' => '66202f4ba0f73ed829684da3a9a28423', - './composer.lock' => 'ec93eaa5f4372c436c382f49fdba004f', + './composer.lock' => '5d5dddb6ad175a807cf4b7496e64604d', './cron.php' => '0b8b6bd839a2232a8da074b31feaa708', './crossdomain.xml' => '24b7711640c652b21aa89c9d83d6ec13', './data/BeanFactory.php' => '84b7c36b6a59ea8c5c4069659cc72950', @@ -521,7 +519,7 @@ $md5_string = array ( './data/Relationships/One2OneRelationship.php' => 'c46d3067d5651fbc928763600d5e1a51', './data/Relationships/RelationshipFactory.php' => '98a46e44186f2d2db23be9b894a4f1e2', './data/Relationships/SugarRelationship.php' => 'a71b96492ee7457826fc91a2356c4ebd', - './data/SugarBean.php' => 'a6853f4e4773caa3ca7a80207bb4d9dc', + './data/SugarBean.php' => 'd8544e7bffbd4eeea20053f52c5514bd', './deprecated.php' => 'f5f507fd6314f38d29c97e2cc2c62239', './dictionary.php' => 'b7c1370fb75a2940c04db74627c4462c', './download.php' => 'f2d366039d134ac463ff1e75634ce509', @@ -1023,7 +1021,7 @@ $md5_string = array ( './include/SugarFields/Parsers/SearchFormMetaParser.php' => '732eecf76268b82b84667f6d00a905f5', './include/SugarFields/SugarFieldHandler.php' => '73b2605cef98e6b0b03880d299a49e92', './include/SugarFolders/SugarFolderEmptyException.php' => 'd8052a2f3abf6ff8db9563bf3e22842e', - './include/SugarFolders/SugarFolders.php' => '51ed64e78907559c6c5b5fd447280f32', + './include/SugarFolders/SugarFolders.php' => '4b79dc7fc655f6fe17210eb93191beb4', './include/SugarHtml/SugarHtml.php' => 'b457a731768480ce81d6e709d920e2cb', './include/SugarHttpClient.php' => 'bf0aedbad0c73763186e37fb9107d3d7', './include/SugarLogger/LoggerManager.php' => 'd30492d39dc1aecce2e9cabdc4c148e8', @@ -1202,7 +1200,7 @@ $md5_string = array ( './include/SugarTinyMCE.php' => '3e1df6fa7bcbb9e3caf75d97e1d8924b', './include/Sugar_Smarty.php' => 'f3edc67b137034a204d8806878803ae8', './include/Sugarpdf/FontManager.php' => '4f3e178b643571961d9f2590122342cc', - './include/Sugarpdf/Sugarpdf.php' => 'e1a58c55fd35666ef92794d7af157c75', + './include/Sugarpdf/Sugarpdf.php' => '10f553017faf60a1ba027c96dea2d43d', './include/Sugarpdf/SugarpdfFactory.php' => 'aadf37eceefa4fcf78d789c6035062b4', './include/Sugarpdf/SugarpdfHelper.php' => 'c0fae5a020ea5115326ff367e3293d05', './include/Sugarpdf/sugarpdf/sugarpdf.smarty.php' => '3123177f2bb0240b00e37c433d149c66', @@ -1321,10 +1319,10 @@ $md5_string = array ( './include/contextMenus/menuDefs/sugarObject.php' => '119e653126765edb0358ab54697b862a', './include/contextMenus/menuDefs/sugarPerson.php' => '215d244d2fbd4bce5facc8fe2091cc27', './include/controller/Controller.php' => '0ee78cfd4c12448eec89ea50b7ea143b', - './include/database/DBManager.php' => 'c33d5aa4d34651fbb0f1567cb3c5d190', + './include/database/DBManager.php' => 'd2ecb6db9ceda8d9f1042c2f00ba5d63', './include/database/DBManagerFactory.php' => 'ba1e996ceb661905208e38df2459b095', './include/database/FreeTDSManager.php' => '23ec109e38260e0ffa2a1676d486fd62', - './include/database/MssqlManager.php' => '1987343b5422b6ff99b93f5215301adb', + './include/database/MssqlManager.php' => '8ec8ad4bd3df1c19aa96b228f3b356a7', './include/database/MysqlManager.php' => 'e291bd0e38fde596a8bd1f6c75688eaa', './include/database/MysqliManager.php' => '31cf1de8eba53e933ea116870129da12', './include/database/SqlsrvManager.php' => 'ad3f8e07dce347f8cf1906e7e91ec776', @@ -2334,7 +2332,7 @@ $md5_string = array ( './include/javascript/yui/build/yuitest/yuitest_core.js' => 'ed5230a0f4a885d8ea51c2fe78895d07', './include/javascript/yui/ygDDList.js' => '0cd9051a220de7e8c79bf5b9cccce10f', './include/json_config.php' => 'ba7fb6f2fb1df51bc367835406ef7ba5', - './include/language/en_us.lang.php' => '7c47b77bff87c736d053321b4253c28b', + './include/language/en_us.lang.php' => 'b3e2e4ddf37fa8614a55749c8f22aea6', './include/language/en_us.notify_template.html' => 'c6a897ace7af46a44889dfab1a9d44c5', './include/language/getJSLanguage.php' => '1bc910bd5a9953fbf443d3d97fddbffa', './include/language/jsLanguage.php' => '3d27819dc00f2fe5426f72733a7edca1', @@ -2434,7 +2432,7 @@ $md5_string = array ( './include/utils/db_utils.php' => '7fa7c67aec162fd9da259a1f33cef514', './include/utils/encryption_utils.php' => 'cf87e84efe3764464056e6473aac9c79', './include/utils/external_cache.php' => '7439d9b6252e242a9c852ecb58df44ec', - './include/utils/file_utils.php' => '0a243121415b2fbcc49d9b1c8ce8c3d8', + './include/utils/file_utils.php' => '28de9dc2ca22c07972fb85f334024bea', './include/utils/layout_utils.php' => 'f1bfbecd81ffaea9483b39ee7925a523', './include/utils/logic_utils.php' => 'df0882131989fd10f9855cc3b66d4572', './include/utils/mvc_utils.php' => '38de4382713debfb1cbbe33442a8fc5b', @@ -2445,7 +2443,7 @@ $md5_string = array ( './include/utils/recaptcha_utils.php' => '73f5eddf707788c1dff4b7d07dc82656', './include/utils/security_utils.php' => 'e953d0b673df3df313ecf1ac975e8f57', './include/utils/sugar_file_utils.php' => '1c1915cad8c88feb0edbf5bbaee106c4', - './include/utils.php' => 'a58c10d95399b0b542bbe69e4540bc71', + './include/utils.php' => '056c6cb9c2a210087be1b89558cfd63f', './include/vCard.php' => '44052bbedcdaba3fdf67cfc10a112e75', './include/ytree/ExtNode.php' => '000d4ccbdb6e0a7628c636128781b5e3', './include/ytree/JQueryTree.php' => '3712d2224b93818b990b876f8405b745', @@ -2820,17 +2818,17 @@ $md5_string = array ( './lib/Log/SugarLoggerHandler.php' => 'ae057e2f6ae16d0905ec30e8eea2cb6a', './lib/PDF/Exceptions/PDFEngineNotFoundException.php' => 'b5a8e3eb0b77f9bafac3330628db172c', './lib/PDF/Exceptions/PDFException.php' => '5d3cd8dc51b027a3241e9f62b5f945f0', - './lib/PDF/MPDF/MPDFEngine.php' => '8bbd93c15b8086282d5c55952bb6d8ec', - './lib/PDF/MPDF/configMapping.php' => '549b4db398ad512b0bc7b8206251d355', + './lib/PDF/LegacyMPDF/LegacyMPDFEngine.php' => '8b10d62af892be0f48eb4d9e70220ca3', + './lib/PDF/LegacyMPDF/configMapping.php' => '549b4db398ad512b0bc7b8206251d355', './lib/PDF/PDFConfigurator.php' => '83331a90da006f4431999d9cc49db56c', './lib/PDF/PDFEngine.php' => 'ec07bdb05e1c6cdfc2989159a5d9f0e8', - './lib/PDF/PDFWrapper.php' => 'e40ebae5f73eca4e3e9b7a3bac460fee', + './lib/PDF/PDFWrapper.php' => '40907f01b6c670c709e9b426cc992aa7', './lib/PDF/TCPDF/SuiteTCPDF.php' => '7b0743e830119ee7d073daf685b908ef', './lib/PDF/TCPDF/TCPDFEngine.php' => '6b44d2d37a6d4765466eec66f254f453', './lib/PDF/TCPDF/configMapping.php' => '6e468e9ac1e913980cb52f2465151459', './lib/PDF/TCPDF/default.css' => '01b379775cbce935e9b542b7f9010a90', './lib/Robo/Plugin/Commands/ApiCommands.php' => '16294f4aa5d72ec92c5bf21cbc3bd9a7', - './lib/Robo/Plugin/Commands/BuildCommands.php' => '00dc56a6e4810a38708b3d7609fce4d8', + './lib/Robo/Plugin/Commands/BuildCommands.php' => '8134ecf431befe35085a20c213eb9f04', './lib/Robo/Plugin/Commands/CleanCacheCommands.php' => 'e6edea05148d75052febec099b0400f6', './lib/Robo/Plugin/Commands/CodeCoverageCommands.php' => '1a96a8253828178473f3e26b454d07ba', './lib/Robo/Plugin/Commands/CodingStandardCommands.php' => '0c2e3276cfb188500172ec7d503926ba', @@ -2845,9 +2843,9 @@ $md5_string = array ( './lib/Search/AOD/LuceneSearchEngine.php' => '7a589c07fae355ad81ba1893e40e1bb9', './lib/Search/BasicSearch/BasicSearchEngine.php' => '1d2c5e21d8bc06a90c9df7ad30607685', './lib/Search/ElasticSearch/ElasticSearchClientBuilder.php' => '4743c29fa00cb5d4025c974af7b79156', - './lib/Search/ElasticSearch/ElasticSearchEngine.php' => '7c78874891f4a5749ce984a3ace153ed', + './lib/Search/ElasticSearch/ElasticSearchEngine.php' => '89b2b27ef2c5dd8e7482360a8e499bfc', './lib/Search/ElasticSearch/ElasticSearchHooks.php' => '8898cc8d7cec43f13352397be9397f3e', - './lib/Search/ElasticSearch/ElasticSearchIndexer.php' => 'f0e8f5e0648e7a191487efe349dfe0fe', + './lib/Search/ElasticSearch/ElasticSearchIndexer.php' => 'bf4bb3db91bea5279332355d366e7109', './lib/Search/ElasticSearch/ElasticSearchModuleDataPuller.php' => 'ad1144c9e9f58af496714d6dcdbdbaa5', './lib/Search/ElasticSearch/elasticsearch.example.json' => 'cd776b60993b4521cd5cfd79db95af46', './lib/Search/Exceptions/SearchEngineNotFoundException.php' => '4f83830aea088643ee87f82bd173d96d', @@ -3485,7 +3483,7 @@ $md5_string = array ( './modules/AOS_PDF_Templates/formLetter.php' => 'a0ab2fa1367100783bf90454b5bfb37b', './modules/AOS_PDF_Templates/formLetterPdf.php' => '502e60b0cde93a50d1807968186d9aff', './modules/AOS_PDF_Templates/generatePdf.php' => '356d42169cfeaf00f93dca0390937cc5', - './modules/AOS_PDF_Templates/language/en_us.lang.php' => '3db4859b9704f37f308eda030143c518', + './modules/AOS_PDF_Templates/language/en_us.lang.php' => '17172f9553e94c7d52319d8980bbd393', './modules/AOS_PDF_Templates/metadata/SearchFields.php' => '236f33a75cc59a902e6d86e2326948b5', './modules/AOS_PDF_Templates/metadata/dashletviewdefs.php' => '53c60c5458d3420866439841f33e20c0', './modules/AOS_PDF_Templates/metadata/detailviewdefs.php' => '2270eb15fbc4e90436c97d1db2bd612f', @@ -3696,7 +3694,7 @@ $md5_string = array ( './modules/Accounts/views/view.detail.php' => 'ff7c4c36ceee1bedea15be666a5c9a6d', './modules/Accounts/views/view.edit.php' => '02baef33556662c30bf870f9cf6b8283', './modules/Accounts/views/view.list.php' => 'e41d3b6fa054f94c4fbf8a1bcd313e89', - './modules/Activities/EmailReminder.php' => 'ea0856c8860a65037db5b38a9c23f72a', + './modules/Activities/EmailReminder.php' => 'da99af7b51a92ac3af720af1205b23c1', './modules/Activities/Forms.php' => '43deca0e0a042763dffa511193472008', './modules/Activities/Menu.php' => '5ab24872b1fc0f4e33f1a152487bac94', './modules/Activities/Popup_picker.php' => '49f21eede4b7a47802c0ecea9391b44c', @@ -4238,7 +4236,7 @@ $md5_string = array ( './modules/Charts/code/Chart_pipeline_by_sales_stage.php' => '9ee2b77dad48bfc015fc89404c0d5aeb', './modules/Charts/code/predefined_charts.php' => '634c4f0a5c99b0f67b8cc4278d2888b6', './modules/Charts/language/en_us.lang.php' => '2013acc7fd28efad48cff3d3dc365c0e', - './modules/Configurator/Configurator.php' => '8186bda46c853618c30721779bb73068', + './modules/Configurator/Configurator.php' => '71e48c985cc6a1ab73e6806309976f6d', './modules/Configurator/Forms.php' => '6bdf86ac20d4dfe2d137bc71f7dc0570', './modules/Configurator/LogView.php' => '64da13ee9bf50c75afbc16375c3283be', './modules/Configurator/Menu.php' => '1f69df3f11b60426def8f47a7cbce4fa', @@ -4247,7 +4245,7 @@ $md5_string = array ( './modules/Configurator/controller.php' => 'f295ce1c2b46b0720de4717312a28d87', './modules/Configurator/language/en_us.lang.php' => '8f52040964f4b19526f75bd50e0d0013', './modules/Configurator/metadata/SugarpdfSettingsdefs.php' => 'ca8649f8b1554e8aec32fe8440ff781e', - './modules/Configurator/tpls/EditView.tpl' => '471dca5dca7ba38af4880e190c1a7b91', + './modules/Configurator/tpls/EditView.tpl' => '95db9efe07fce13f8f4c20437028116e', './modules/Configurator/tpls/SugarpdfSettings.tpl' => 'c97732698b0ba12862887d64a3aa6c6c', './modules/Configurator/tpls/SugarpdfSettingsFields.tpl' => '56a0d22112e9add023d94f0bd8a0e237', './modules/Configurator/tpls/addFontResult.tpl' => 'beac4b7b439e1030c9e117f0fb26d4e4', @@ -4437,7 +4435,7 @@ $md5_string = array ( './modules/Documents/views/view.detail.php' => 'eac3d5189949259727d9a1037f0e0070', './modules/Documents/views/view.edit.php' => '80f2e5e7e9fa1170f7e0452b9ca8b816', './modules/Documents/views/view.extdoc.php' => 'a596ceb8005df2241ae53b4146bfc8f5', - './modules/DynamicFields/DynamicField.php' => '19f76241521343719c110deef3a96b5b', + './modules/DynamicFields/DynamicField.php' => '872af3f181df101e6dada8b0d39e685f', './modules/DynamicFields/FieldCases.php' => '727d05978bb8a62c33ec9c8b7ab91489', './modules/DynamicFields/FieldViewer.php' => '85058d135229ad1103524d52cfd06d82', './modules/DynamicFields/FieldsMetaData.php' => '8e5a2e1af51b342d83f81910e11cb046', @@ -4969,21 +4967,21 @@ $md5_string = array ( './modules/Import/tpls/listview.tpl' => 'ff88ce50f647b6aa34db2e293136c675', './modules/Import/tpls/listviewpaginator.tpl' => '5b610271b4339973ebe7e4b91db8c9bf', './modules/Import/tpls/step1.tpl' => '0a7f0d07671d8376abdd6e351a140dc0', - './modules/Import/tpls/step2.tpl' => '322e031c8566bc0fecaf4b8f4c12003a', + './modules/Import/tpls/step2.tpl' => '436721f5e9bdcd7366f6fcd5d9c18c59', './modules/Import/tpls/step3.tpl' => '0fc61d15e73a97daa586b4de350ecdb7', './modules/Import/tpls/undo.tpl' => '540c0609ac93f7aa47ab4e96f937c657', './modules/Import/tpls/wizardWrapper.tpl' => '374fbc931fc6d3689a8eb013aee872e1', './modules/Import/vardefs.php' => '4ac6a307f85bc9d772c080cd00846798', './modules/Import/views/ImportListView.php' => '95a7054b92a595945b0547a8bc8cab22', './modules/Import/views/ImportView.php' => '7d3d044660601703a02b83814b09dc09', - './modules/Import/views/view.confirm.php' => 'd9f5280a969ea7fe399bc1149c15bd5a', + './modules/Import/views/view.confirm.php' => '6e4c4d9a8a2dd945cf6fe366073f3d8c', './modules/Import/views/view.dupcheck.php' => 'd9aa990fadab310b3220951acef261d4', './modules/Import/views/view.error.php' => 'f9e7be588b58dcad34976c3a54af56b0', './modules/Import/views/view.extdupcheck.php' => '49a87e84532e868e632387033e745038', './modules/Import/views/view.last.php' => '7c4d08eb99783e31971a4a641d531a50', './modules/Import/views/view.step1.php' => '7f515a1fc6c2c182c24d6af3c65d73b3', './modules/Import/views/view.step2.php' => '30d49b03050d05f5605dc935ea87fd9a', - './modules/Import/views/view.step3.php' => 'cb5d880a6d7268fc416d431ff85983b2', + './modules/Import/views/view.step3.php' => '6e671e2af8f40f041b808a8dbecf6796', './modules/Import/views/view.step4.php' => '8694e2f07e6ddc9128af648d42aa802d', './modules/Import/views/view.undo.php' => '0f11a824c733c819214ef88f666358b5', './modules/InboundEmail/AOPInboundEmail.php' => '2c74ce41273c1982b221a8862dfcc997', @@ -5666,7 +5664,7 @@ $md5_string = array ( './modules/Schedulers/Save.php' => 'f074612e8858b16ed63efc57aa47c689', './modules/Schedulers/Scheduler.php' => '32fea0faf54fc7fd0b72f779c12d6d9a', './modules/Schedulers/Schedulers.js' => '873697808ad38308416065af9fbb8a2f', - './modules/Schedulers/_AddJobsHere.php' => '867b0ae96fa9b5eded01259d4845d692', + './modules/Schedulers/_AddJobsHere.php' => 'ec6d31550e833d51fcfb1581df9ecdb6', './modules/Schedulers/field_arrays.php' => 'e2671fc2306b56af3562b1b092ae05af', './modules/Schedulers/language/en_us.lang.php' => '6d1b614f0c5c5bff502f2f0db921e54e', './modules/Schedulers/metadata/SearchFields.php' => '89dec0da90e39ab857fcd1bbf6c3423a', @@ -6043,7 +6041,7 @@ $md5_string = array ( './modules/Users/SetTimezone.tpl' => 'f0fb5ed64fae81a5657ebc8f167967c9', './modules/Users/UpdateTourStatus.php' => 'cc111e28e6df1d96b98678661dd42490', './modules/Users/User.js' => '351f8d8e74bd1bd0a56dcc2bae31b147', - './modules/Users/User.php' => '6b7d55a97bf211055f1e981573d41cf0', + './modules/Users/User.php' => 'e0e65bf73d91fcc730b923eb95fe37c2', './modules/Users/UserEditView.js' => '421e1c38f1ee78933134b987b7c3c251', './modules/Users/UserEmailOptions.tpl' => '96b848efbf7f6d4fee7b6bf13a1a1aee', './modules/Users/UserEmailSettings.tpl' => '5d9ff3379f63dcf7c5efbbcc3e88d8ed', @@ -6107,7 +6105,7 @@ $md5_string = array ( './modules/Users/tpls/EditViewHeader.tpl' => '099f5e4896d623b64d44f243c33941b2', './modules/Users/tpls/QuickEditFooter.tpl' => 'b7a9c930f9e885fcc51b7da358411c31', './modules/Users/tpls/wizard.tpl' => 'acafbe8bf6a878386c99694798c79174', - './modules/Users/vardefs.php' => 'b2eef83cd83e885aee01dd2f75afc18c', + './modules/Users/vardefs.php' => 'e442489d83d7749c1555418b1fd80b69', './modules/Users/views/view.detail.php' => 'd9471ccf0276813717b5149591cf9849', './modules/Users/views/view.edit.php' => '02d34abebb18cf17993945133211b2fa', './modules/Users/views/view.list.php' => 'e314cc246214b55bf32383050a297f59', @@ -6330,7 +6328,7 @@ $md5_string = array ( './soap.php' => 'e28988c2e0b8e2c484587b537a710525', './sugar_version.json' => 'bdfbcefae2f9af559bef6a36367df7bb', './sugar_version.php' => 'db7b6c8d51f87879fce1e6172eedfbed', - './suitecrm_version.php' => 'a35ad495be0a2b45cd8ed55ec5a792de', + './suitecrm_version.php' => 'e03f4bc7104206ab214f5952a78e38ea', './themes/SuiteP/css/Dawn/color-palette.scss' => 'e64677d79e1d68c069bdc2dc661c4f99', './themes/SuiteP/css/Dawn/icons.scss' => 'd59f8c5855e7a8df09542a663835a196', './themes/SuiteP/css/Dawn/select.ico' => '22393ad23f16c3f1462455bae8f20279', diff --git a/include/SugarFolders/SugarFolders.php b/include/SugarFolders/SugarFolders.php index a55d4171c..bdb8272c1 100755 --- a/include/SugarFolders/SugarFolders.php +++ b/include/SugarFolders/SugarFolders.php @@ -247,10 +247,7 @@ class SugarFolder $res = $this->db->query($query); $a = $this->db->fetchByAssoc($res); - if ($a['c'] > 0) { - return true; - } - return false; + return $a['c'] > 0; } /** @@ -695,6 +692,25 @@ class SugarFolder return false; } + /* + Fix issue #9192 - Duplicating rows for folders_rel + First check if a row with the same data already exists + If so, return false + */ + + $q = "SELECT id FROM folders_rel WHERE". + " folder_id = ".$this->db->quoted($this->id). + " AND polymorphic_module = ".$this->db->quoted($bean->module_dir). + " AND polymorphic_id = ".$this->db->quoted($bean->id). + " AND deleted = 0"; + + $result = $this->db->fetchByAssoc($this->db->query($q)); + + if($result) { + $GLOBALS['log']->debug("*** FOLDERS: addBean() is trying to create an already existing relationship"); + return false; + } + $guid = create_guid(); $query = "INSERT INTO folders_rel " . @@ -1279,8 +1295,10 @@ class SugarFolder } // if parent_id is set, update parent's has_child flag - $query3 = "UPDATE folders SET has_child = 1 WHERE id = " . $this->db->quoted($this->parent_folder); - $r3 = $this->db->query($query3); + if (!empty($this->parent_folder)) { + $query3 = "UPDATE folders SET has_child = 1 WHERE id = " . $this->db->quoted($this->parent_folder); + $r3 = $this->db->query($query3); + } } else { $query = "UPDATE folders SET " . "name = " . $this->db->quoted($this->name) . ", " . diff --git a/include/Sugarpdf/Sugarpdf.php b/include/Sugarpdf/Sugarpdf.php index 243c8c2ad..fcdc3ba98 100755 --- a/include/Sugarpdf/Sugarpdf.php +++ b/include/Sugarpdf/Sugarpdf.php @@ -273,13 +273,13 @@ class Sugarpdf extends TCPDF * @access public * @see include/tcpdf/TCPDF#SetFont() */ - public function SetFont($family, $style='', $size=0, $fontfile='') + public function SetFont($family, $style = '', $size = null, $fontfile = '', $subset = 'default', $out = true) { if (empty($fontfile) && defined('K_PATH_CUSTOM_FONTS')) { // This will force addFont to search the custom directory for font before the OOB directory - $fontfile = K_PATH_CUSTOM_FONTS."phantomFile.phantom"; + $fontfile = K_PATH_CUSTOM_FONTS . "phantomFile.phantom"; } - parent::SetFont($family, $style, $size, $fontfile); + parent::SetFont($family, $style, $size, $fontfile, $subset, $out); } public function Info() @@ -304,9 +304,9 @@ class Sugarpdf extends TCPDF * The cell method is used by all the methods which print text (Write, MultiCell). * @see include/tcpdf/TCPDF#Cell() */ - public function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=0, $link='', $stretch=0, $ignore_min_height=false) + public function Cell($w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M') { - parent::Cell($w, $h, prepare_string($txt), $border, $ln, $align, $fill, $link, $stretch, $ignore_min_height); + parent::Cell($w, $h, prepare_string($txt), $border, $ln, $align, $fill, $link, $stretch, $ignore_min_height, $calign, $valign); } /** @@ -640,7 +640,7 @@ class Sugarpdf extends TCPDF * @since 4.5.011 * @OVERRIDE */ - public function getNumLines($txt, $w=0) + public function getNumLines($txt, $w = 0, $reseth = false, $autopadding = true, $cellpadding = '', $border = 0) { $lines = 0; if (empty($w) or ($w <= 0)) { diff --git a/include/database/DBManager.php b/include/database/DBManager.php index 5fb208c75..63be0d06d 100755 --- a/include/database/DBManager.php +++ b/include/database/DBManager.php @@ -960,6 +960,10 @@ abstract class DBManager $value['type'] = 'index'; } + if (isset($value['fields'])) { + $value['fields'] = $this->removeIndexLimit($value['fields']); + } + if (!isset($compareIndices[$name])) { //First check if an index exists that doesn't match our name, if so, try to rename it $found = false; @@ -4114,4 +4118,13 @@ abstract class DBManager { return trim(str_replace(array("\r", "\n"), " ", $sql)); } + + /** + * @param $fields + * @return string|string[]|null + */ + protected function removeIndexLimit($fields) + { + return $fields; + } } diff --git a/include/database/MssqlManager.php b/include/database/MssqlManager.php index c1c07ce87..59c64eff3 100755 --- a/include/database/MssqlManager.php +++ b/include/database/MssqlManager.php @@ -1492,6 +1492,9 @@ EOSQL; { $type = $definition['type']; $fields = is_array($definition['fields']) ? implode(',', $definition['fields']) : $definition['fields']; + + $fields = $this->removeIndexLimit($fields); + $name = $definition['name']; $sql = ''; @@ -2129,4 +2132,14 @@ EOQ; { return 'NEWID()'; } + + /** + * Remove unsupported index limit + * @param $fields + * @return string|string[]|null + */ + protected function removeIndexLimit($fields) + { + return preg_replace('/(\s?\(\d+\))/', '', $fields); + } } diff --git a/include/language/en_us.lang.php b/include/language/en_us.lang.php index 3773c122b..fb5838d65 100755 --- a/include/language/en_us.lang.php +++ b/include/language/en_us.lang.php @@ -1905,7 +1905,7 @@ $app_strings = array( 'LBL_DASHLET_CONFIGURE_DISPLAY_ROWS' => 'Display Rows', // MySugar status strings - 'LBL_MAX_DASHLETS_REACHED' => 'You have reached the maximum number of SuiteCRM Dashlets your adminstrator has set. Please remove a SuiteCRM Dashlet to add more.', + 'LBL_MAX_DASHLETS_REACHED' => 'You have reached the maximum number of SuiteCRM Dashlets your administrator has set. Please remove a SuiteCRM Dashlet to add more.', 'LBL_ADDING_DASHLET' => 'Adding SuiteCRM Dashlet...', 'LBL_ADDED_DASHLET' => 'SuiteCRM Dashlet Added', 'LBL_REMOVE_DASHLET_CONFIRM' => 'Are you sure you want to remove this SuiteCRM Dashlet?', @@ -3896,3 +3896,13 @@ $app_strings['LBL_USE_ADVANCED_SEARCH'] = 'Use Advanced Search'; $app_strings['LBL_USE_BASIC_SEARCH'] = 'Use Basic Search'; $app_strings['LBL_NO_MODULE_SELECTED'] = 'No module selected'; $app_strings['LBL_CLOSE_MENU'] = 'Close Menu'; + +// PDF Engines +$app_strings['LBL_LEGACY_MPDF_ENGINE'] = 'Legacy MPDF Engine'; +$app_strings['LBL_TCPDF_ENGINE'] = 'TCPDF Engine'; + + +$app_strings['ERR_INVALID_FILE_NAME'] = 'Invalid file name:'; +$app_strings['LBL_LOGGER_VALID_FILENAME_CHARACTERS'] = 'This can only be alphanumeric characters, plus \'.\' , \'-\' and \'_\''; +$app_strings['LBL_LOGGER_INVALID_FILENAME'] = 'Invalid import file name'; + diff --git a/include/utils.php b/include/utils.php index aad5c60bb..ddd0c9cda 100755 --- a/include/utils.php +++ b/include/utils.php @@ -426,6 +426,9 @@ function get_sugar_config_defaults(): array 'log_memory_usage' => false, 'oauth2_encryption_key' => base64_encode(random_bytes(32)), 'portal_view' => 'single_user', + 'pdf' => [ + 'defaultEngine' => 'TCPDFEngine' + ], 'resource_management' => [ 'special_query_limit' => 50000, 'special_query_modules' => ['AOR_Reports', 'Export', 'Import', 'Administration', 'Sync'], diff --git a/include/utils/file_utils.php b/include/utils/file_utils.php index f7a5bcafa..eefc8ac23 100755 --- a/include/utils/file_utils.php +++ b/include/utils/file_utils.php @@ -479,3 +479,25 @@ function cleanDirName($name) { return str_replace(array("\\", "/", "."), "", $name); } + +/** + * Check if has valid file name + * @param string $fieldName + * @param string $value + * @return bool + */ +function hasValidFileName($fieldName, $value) { + + if (empty($value)){ + LoggerManager::getLogger()->error("Invalid filename for $fieldName : '$value'."); + return false; + } + + $isValid = preg_match('/^[\w\-.]+(\.\w+)?$/', $value); + if ($isValid === false || $isValid < 1) { + LoggerManager::getLogger()->error("Invalid filename for $fieldName : '$value'."); + return false; + } + + return true; +} diff --git a/lib/PDF/MPDF/MPDFEngine.php b/lib/PDF/LegacyMPDF/LegacyMPDFEngine.php similarity index 98% rename from lib/PDF/MPDF/MPDFEngine.php rename to lib/PDF/LegacyMPDF/LegacyMPDFEngine.php index 829e5a7f5..2ba6e0f84 100644 --- a/lib/PDF/MPDF/MPDFEngine.php +++ b/lib/PDF/LegacyMPDF/LegacyMPDFEngine.php @@ -52,7 +52,7 @@ require_once __DIR__ . '/../../../modules/AOS_PDF_Templates/PDF_Lib/mpdf.php'; * Class MPDFEngine * @package SuiteCRM\PDF\MPDF */ -class MPDFEngine extends PDFEngine +class LegacyMPDFEngine extends PDFEngine { /** * @var mPDF @@ -62,7 +62,7 @@ class MPDFEngine extends PDFEngine /** * @var string */ - private static $configMapperFile = __DIR__ . '/../../../lib/PDF/MPDF/configMapping.php'; + private static $configMapperFile = __DIR__ . '/../../../lib/PDF/LegacyMPDF/configMapping.php'; /** * MPDFEngine constructor. diff --git a/lib/PDF/MPDF/configMapping.php b/lib/PDF/LegacyMPDF/configMapping.php similarity index 100% rename from lib/PDF/MPDF/configMapping.php rename to lib/PDF/LegacyMPDF/configMapping.php diff --git a/lib/PDF/PDFWrapper.php b/lib/PDF/PDFWrapper.php index 5fcdff803..bf82691e3 100644 --- a/lib/PDF/PDFWrapper.php +++ b/lib/PDF/PDFWrapper.php @@ -40,7 +40,7 @@ namespace SuiteCRM\PDF; use SuiteCRM\PDF\Exceptions\PDFEngineNotFoundException; -use SuiteCRM\PDF\MPDF\MPDFEngine; +use SuiteCRM\PDF\LegacyMPDF\LegacyMPDFEngine; use SuiteCRM\PDF\TCPDF\TCPDFEngine; if (!defined('sugarEntry') || !sugarEntry) { @@ -57,21 +57,20 @@ class PDFWrapper * @var array stores an associative array matching the PDF engine class name with the file it is stored in. */ private static $engines = [ - 'MPDFEngine' => [ - 'name' => 'MPDFEngine', - 'FQN' => MPDFEngine::class, - 'filepath' => 'lib/PDF/MPDF/MPDFEngine.php' - ], 'TCPDFEngine' => [ 'name' => 'TCPDFEngine', + 'lbl' => 'LBL_TCPDF_ENGINE', 'FQN' => TCPDFEngine::class, 'filepath' => 'lib/PDF/TCPDF/TCPDFEngine.php' ], + 'LegacyMPDFEngine' => [ + 'name' => 'LegacyMPDFEngine', + 'lbl' => 'LBL_LEGACY_MPDF_ENGINE', + 'FQN' => LegacyMPDFEngine::class, + 'filepath' => 'lib/PDF/LegacyMPDF/LegacyMPDFEngine.php' + ], ]; - /** @var string Path to the folder where to load custom engines from */ - private static $customEnginePath = __DIR__ . '/../../custom/Extension/PDFEngines/'; - /** * @param string $engineName * @param string $file @@ -88,11 +87,21 @@ class PDFWrapper /** * @return PDFEngine + * @noinspection PhpIncludeInspection */ public static function getPDFEngine(): PDFEngine { + $pdfs = []; $defaultEngine = self::getDefaultEngine(); + if (file_exists('custom/application/Ext/PDF/pdfs.ext.php')) { + include('custom/application/Ext/PDF/pdfs.ext.php'); + } + + foreach ($pdfs as $pdf) { + self::$engines[$pdf['name']] = $pdf; + } + return self::fetchEngine($defaultEngine); } @@ -100,24 +109,24 @@ class PDFWrapper * Retrieves the available PDF engine class names. * * @return string[] + * @noinspection PhpIncludeInspection */ public static function getEngines(): array { + $pdfs = []; $default = array_keys(self::$engines); - // Custom check for MPDF class $MPDF = __DIR__ . '/../../modules/AOS_PDF_Templates/PDF_Lib/mpdf.php'; - if (!file_exists($MPDF) && ($key = array_search('MPDFEngine', $default, true)) !== false) { + if (($key = array_search('LegacyMPDFEngine', $default, true)) !== false + && (!file_exists($MPDF) || version_compare(PHP_VERSION, '8.0.0') >= 0)) { unset($default[$key]); } - $custom = []; - foreach (glob(self::$customEnginePath . '*.php', GLOB_NOSORT) as $file) { - $file = pathinfo($file); - $custom[] = $file['filename']; + if (file_exists('custom/application/Ext/PDF/pdfs.ext.php')) { + include('custom/application/Ext/PDF/pdfs.ext.php'); } - return array_merge($default, $custom); + return array_merge(array_keys($pdfs), $default); } /** @@ -141,13 +150,8 @@ class PDFWrapper return $engineName; } - $customEnginePath = self::$customEnginePath . $engineName . '.php'; - if (isset(self::$engines[$engineName])) { $engine = self::$engines[$engineName]; - } elseif (isset($customEnginePath)) { - self::addEngine($engineName, $customEnginePath, $engineName); - $engine = self::$engines[$engineName]; } else { throw new PDFEngineNotFoundException( "PDF engine not found for engine '$engineName''." @@ -163,7 +167,7 @@ class PDFWrapper } /** @noinspection PhpIncludeInspection */ - require_once $filename; + require_once __DIR__ . '/../../' . $filename; if (!is_subclass_of($engine['FQN'], PDFEngine::class)) { throw new PDFEngineNotFoundException( diff --git a/lib/Robo/Plugin/Commands/BuildCommands.php b/lib/Robo/Plugin/Commands/BuildCommands.php index a14abbbd4..2eb8af83b 100644 --- a/lib/Robo/Plugin/Commands/BuildCommands.php +++ b/lib/Robo/Plugin/Commands/BuildCommands.php @@ -114,7 +114,7 @@ class BuildCommands extends Tasks $os = new OperatingSystem(); $command = $os->toOsPath('./vendor/bin/pscss') - . ' -f compressed ' + . ' -s compressed ' . $os->toOsPath("{$location}{$colorScheme}/style.scss") . ' > ' . $os->toOsPath("{$location}{$colorScheme}/style.css"); diff --git a/lib/Search/ElasticSearch/ElasticSearchEngine.php b/lib/Search/ElasticSearch/ElasticSearchEngine.php index b48817ecc..0baa1a801 100644 --- a/lib/Search/ElasticSearch/ElasticSearchEngine.php +++ b/lib/Search/ElasticSearch/ElasticSearchEngine.php @@ -138,7 +138,7 @@ class ElasticSearchEngine extends SearchEngine 'query' => [ 'query_string' => [ 'query' => $searchStr, - 'fields' => ['name.*^5', '_all'], + 'fields' => ['name.*^5', '*'], 'analyzer' => 'standard', 'default_operator' => 'OR', 'minimum_should_match' => '66%', diff --git a/lib/Search/ElasticSearch/ElasticSearchIndexer.php b/lib/Search/ElasticSearch/ElasticSearchIndexer.php index e3bba6d4d..4eeb1059a 100644 --- a/lib/Search/ElasticSearch/ElasticSearchIndexer.php +++ b/lib/Search/ElasticSearch/ElasticSearchIndexer.php @@ -99,7 +99,7 @@ class ElasticSearchIndexer extends AbstractIndexer global $sugar_config; try { - return $sugar_config['search']['ElasticSearch']['enabled']; + return !empty($sugar_config['search']['ElasticSearch']['enabled']); } catch (Exception $exception) { LoggerManager::getLogger()->fatal("Failed to retrieve ElasticSearch options"); diff --git a/modules/AOS_PDF_Templates/language/en_us.lang.php b/modules/AOS_PDF_Templates/language/en_us.lang.php index 9cbddf98c..d41a3d566 100755 --- a/modules/AOS_PDF_Templates/language/en_us.lang.php +++ b/modules/AOS_PDF_Templates/language/en_us.lang.php @@ -71,7 +71,7 @@ $mod_strings = array( 'LBL_TYPE' => 'Type', 'LBL_ACTIVE' => 'Active', 'LBL_BUTTON_INSERT' => 'Insert', - 'LBL_WARNING_OVERWRITE' => 'Warning this will overwrite you current Work', + 'LBL_WARNING_OVERWRITE' => 'Warning, this will overwrite your current work', 'LBL_INSERT_FIELDS' => 'Insert Fields', 'LBL_SAMPLE' => 'Load Sample', diff --git a/modules/Activities/EmailReminder.php b/modules/Activities/EmailReminder.php index 82e9bd909..c3c76244b 100755 --- a/modules/Activities/EmailReminder.php +++ b/modules/Activities/EmailReminder.php @@ -301,7 +301,7 @@ class EmailReminder while ($row = $db->fetchByAssoc($re)) { $user = BeanFactory::newBean('Users'); $user->retrieve($row['user_id']); - if (!empty($user->email1)) { + if (!empty($user->email1) && $user->isEnabled() ) { $arr = array( 'type' => 'Users', 'name' => $user->full_name, diff --git a/modules/Configurator/Configurator.php b/modules/Configurator/Configurator.php index e4ebc90c4..edf7bdd6d 100755 --- a/modules/Configurator/Configurator.php +++ b/modules/Configurator/Configurator.php @@ -92,20 +92,17 @@ class Configurator public function populateFromPost() { $sugarConfig = SugarConfig::getInstance(); + + $this->checkLoggerFileName(); + foreach ($_POST as $key => $value) { - if ($key == "logger_file_ext") { + if ($key === "logger_file_ext" || $key === 'logger_file_name') { if ($value === '') { $GLOBALS['log']->security("Log file extension can't be blank."); continue; } - - $trim_value = preg_replace('/.*\.([^\.]+)$/', '\1', $value); - $badext = array_map('strtolower', $this->config['upload_badext']); - if (in_array(strtolower($trim_value), $badext)) { - $GLOBALS['log']->security("Invalid log file extension: trying to use invalid file extension '$value'."); - continue; - } } + if (isset($this->config[$key]) || in_array($key, $this->allow_undefined)) { if (strcmp((string)$value, 'true') == 0) { $value = true; @@ -123,6 +120,119 @@ class Configurator } } + public function checkLoggerFileName() + { + + $logFileName = ''; + if (!empty($_POST['logger_file_name'])) { + $logFileName = $_POST['logger_file_name']; + } + + $logFileExt = ''; + if (!empty($_POST['logger_file_ext'])) { + $logFileExt = $_POST['logger_file_ext']; + } + + $logFileExt = $this->prependDot($logFileExt); + + + $fullName = $logFileName . $logFileExt; + $_POST['logger_file_name'] = $logFileName; + $_POST['logger_file_ext'] = $logFileExt; + $valid = true; + + if (!hasValidFileName('logger_file_name', $logFileName) || + !$this->hasValidExtension('logger_file_name', $logFileName) + ) { + LoggerManager::getLogger()->security("Setting logger_file_name to ''."); + $_POST['logger_file_name'] = ''; + $valid = false; + } + + if (!$this->hasValidExtension('logger_file_ext', $logFileExt)) { + $_POST['logger_file_ext'] = ''; + LoggerManager::getLogger()->security("Setting logger_file_ext to ''."); + $valid = false; + } + + if (!$valid) { + return; + } + + if (!hasValidFileName('logger_full_name', $fullName) || + !$this->hasValidExtension('logger_full_name', $fullName) + ) { + LoggerManager::getLogger()->security("Setting logger_file_name and logger_file_ext to ''."); + $_POST['logger_file_name'] = ''; + $_POST['logger_file_ext'] = ''; + } + } + + /** + * Trim value + * @param string $value + * @return string + */ + public function trimValue($value) + { + return preg_replace('/.*\.([^\.]+)$/', '\1', $value); + } + + /** + * Prepend dot + * @param string $value + * @return string + */ + public function prependDot($value) + { + + if (empty($value)) { + return $value; + } + + if ($value[0] === '.') { + return $value; + } + + return '.' . $value; + } + + /** + * Check if has valid extension + * @param string $fieldName + * @param string $value + * @return bool + */ + public function hasValidExtension($fieldName, $value) + { + + if ($value === '.' || empty($value)) { + LoggerManager::getLogger()->security("Invalid ext $fieldName : '$value'."); + + return false; + } + + $badExt = array_map('strtolower', $this->config['upload_badext']); + + $parts = explode('.', $value); + + if (empty($parts)) { + LoggerManager::getLogger()->security("Invalid ext $fieldName : '$value'."); + + return false; + } + + $ext = array_pop($parts); + + if (in_array(strtolower($this->trimValue($ext)), $badExt, true)) { + LoggerManager::getLogger()->security("Invalid $fieldName: '$value'."); + + return false; + } + + return true; + } + public function handleOverride($fromParseLoggerSettings = false) { global $sugar_config, $sugar_version; @@ -290,6 +400,7 @@ class Configurator $this->error = $error; return false; } + return $path; } diff --git a/modules/Configurator/tpls/EditView.tpl b/modules/Configurator/tpls/EditView.tpl index 0322773a9..50ebbe9a4 100755 --- a/modules/Configurator/tpls/EditView.tpl +++ b/modules/Configurator/tpls/EditView.tpl @@ -353,7 +353,10 @@ {$MOD.LBL_LOGGER_FILENAME} - + + +
{$APP.LBL_LOGGER_VALID_FILENAME_CHARACTERS}
+ {$MOD.LBL_LOGGER_FILE_EXTENSION} {$MOD.LBL_LOGGER_FILENAME_SUFFIX} diff --git a/modules/DynamicFields/DynamicField.php b/modules/DynamicFields/DynamicField.php index 937f15e35..c9c0202d8 100755 --- a/modules/DynamicFields/DynamicField.php +++ b/modules/DynamicFields/DynamicField.php @@ -656,6 +656,10 @@ class DynamicField $fmd->save(); $this->buildCache($this->module); $this->saveExtendedAttributes($field, array_keys($fmd->field_defs)); + // Fix #9119 - The cache/themes folder needs to be rebuilt after changing custom field properties. + // https://github.com/salesagility/SuiteCRM/issues/9119 + include_once('include/TemplateHandler/TemplateHandler.php'); + TemplateHandler::clearCache($this->module); } return true; diff --git a/modules/Import/tpls/step2.tpl b/modules/Import/tpls/step2.tpl index 15c7d062e..60ec0736d 100755 --- a/modules/Import/tpls/step2.tpl +++ b/modules/Import/tpls/step2.tpl @@ -82,7 +82,7 @@   -  {sugar_help text=$MOD.LBL_FILE_UPLOAD_WIDGET_HELP} +
{sugar_help text=$MOD.LBL_FILE_UPLOAD_WIDGET_HELP}
{$APP.LBL_LOGGER_VALID_FILENAME_CHARACTERS}
 
@@ -181,5 +181,5 @@ + diff --git a/modules/Import/views/view.confirm.php b/modules/Import/views/view.confirm.php index d49997cdc..060c8e677 100755 --- a/modules/Import/views/view.confirm.php +++ b/modules/Import/views/view.confirm.php @@ -67,7 +67,19 @@ class ImportViewConfirm extends ImportView { global $mod_strings, $app_strings, $current_user; global $sugar_config, $locale; - + + if (isset($_FILES['userfile']['name']) && !hasValidFileName('import_upload_file_name', $_FILES['userfile']['name'])) { + LoggerManager::getLogger()->fatal('Invalid import file name'); + echo $app_strings['LBL_LOGGER_INVALID_FILENAME']; + return; + } + + if (isset($_REQUEST['tmp_file']) && !hasValidFileName('import_upload_file_name', $_REQUEST['tmp_file'])) { + LoggerManager::getLogger()->fatal('Invalid import file name'); + echo $app_strings['LBL_LOGGER_INVALID_FILENAME']; + return; + } + $this->ss->assign("IMPORT_MODULE", $_REQUEST['import_module']); $this->ss->assign("TYPE", (!empty($_REQUEST['type']) ? $_REQUEST['type'] : "import")); $this->ss->assign("SOURCE_ID", $_REQUEST['source_id']); diff --git a/modules/Import/views/view.step3.php b/modules/Import/views/view.step3.php index c857e1bc5..a04e9ba27 100755 --- a/modules/Import/views/view.step3.php +++ b/modules/Import/views/view.step3.php @@ -128,6 +128,15 @@ class ImportViewStep3 extends ImportView return; } + + if (isset($uploadFileName) && !hasValidFileName('import_upload_file_name', str_replace('upload://', '', $uploadFileName))) { + echo $app_strings['LBL_LOGGER_INVALID_FILENAME']; + echo $uploadFileName; + LoggerManager::getLogger()->fatal('Invalid import file name'); + return; + } + + if (strpos($uploadFileName, 'phar://') !== false) { return; } @@ -527,7 +536,7 @@ class ImportViewStep3 extends ImportView background: transparent url('index.php?entryPoint=getImage&themeName=Sugar&themeName=Sugar&imageName=sugar-yui-sprites.png') no-repeat 0 -90px; padding-left: 10px; cursor: pointer; - display: inline; + display: inline; } span.expand{ diff --git a/modules/Schedulers/_AddJobsHere.php b/modules/Schedulers/_AddJobsHere.php index 92ae62e5b..45a17d95b 100755 --- a/modules/Schedulers/_AddJobsHere.php +++ b/modules/Schedulers/_AddJobsHere.php @@ -615,8 +615,14 @@ function pollMonitoredInboxesAOP() $isGroupFolderExists = false; $users = array(); if ($groupFolderId != null && $groupFolderId != "") { + // FIX #6994 - Unable to retrieve Sugar Folder due to incorrect groupFolderId $sugarFolder->retrieve($groupFolderId); - $isGroupFolderExists = true; + if (empty($sugarFolder->id)) { + $sugarFolder->retrieve($aopInboundEmailX->id); + } + if (!empty($sugarFolder->id)) { + $isGroupFolderExists = true; + } } // if $messagesToDelete = array(); if ($aopInboundEmailX->isMailBoxTypeCreateCase()) { diff --git a/modules/Users/User.php b/modules/Users/User.php index 7ad10d332..c6069329e 100755 --- a/modules/Users/User.php +++ b/modules/Users/User.php @@ -2015,6 +2015,16 @@ EOQ; return $myModules; } + /** + * Is user enabled + * + * @return bool + */ + public function isEnabled() + { + return ($this->status !== 'Inactive') && ($this->employee_status === 'Active'); + } + /** * Is this user a system wide admin * diff --git a/modules/Users/vardefs.php b/modules/Users/vardefs.php index e79d8ac36..85a39878a 100755 --- a/modules/Users/vardefs.php +++ b/modules/Users/vardefs.php @@ -763,8 +763,8 @@ $dictionary['User'] = array( 'user_name', 'is_group', 'status', - 'last_name', - 'first_name', + 'last_name (30)', + 'first_name (30)', 'id' ) ), diff --git a/suitecrm_version.php b/suitecrm_version.php index 857706ada..06a90319a 100755 --- a/suitecrm_version.php +++ b/suitecrm_version.php @@ -4,5 +4,5 @@ if (!defined('sugarEntry') || !sugarEntry) { } $suitecrm_version = '8.0.0-rc'; -$suitecrm_legacy = '7.12.0'; -$suitecrm_timestamp = '2021-09-24 17:00:00'; +$suitecrm_legacy = '7.12.1'; +$suitecrm_timestamp = '2021-11-19 17:00:00'; diff --git a/tests/bootstrap.php b/tests/bootstrap.php index de222599c..a8d2f08d6 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -37,7 +37,7 @@ * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". */ -error_reporting(E_ALL); +chdir(__DIR__.'/../'); /* bootstrap composer's autoloader */ require_once __DIR__ . '/../vendor/autoload.php'; diff --git a/tests/unit/phpunit/includes/SugarFolders/SugarFolderTest.php b/tests/unit/phpunit/includes/SugarFolders/SugarFolderTest.php index 6b96be249..55b165017 100644 --- a/tests/unit/phpunit/includes/SugarFolders/SugarFolderTest.php +++ b/tests/unit/phpunit/includes/SugarFolders/SugarFolderTest.php @@ -292,9 +292,6 @@ class SugarFolderTest extends SuitePHPUnitFrameworkTestCase self::assertTrue($saved); - // reset saved - $saved = false; - $parentFolderTwo = new SugarFolder($user); $fields = array( @@ -338,9 +335,6 @@ class SugarFolderTest extends SuitePHPUnitFrameworkTestCase self::assertTrue($saved); - // reset saved - $saved = false; - $parentFolderTwo = new SugarFolder($user); $fields = array( @@ -351,10 +345,7 @@ class SugarFolderTest extends SuitePHPUnitFrameworkTestCase $saved = $parentFolderTwo->setFolder($fields); self::assertTrue($saved); - - // reset saved - $saved = false; - + $childFolder = new SugarFolder($user); $fields = array( diff --git a/tests/unit/phpunit/lib/PDF/PDFWrapperTest.php b/tests/unit/phpunit/lib/PDF/PDFWrapperTest.php index 7814a575a..c8d127f3c 100644 --- a/tests/unit/phpunit/lib/PDF/PDFWrapperTest.php +++ b/tests/unit/phpunit/lib/PDF/PDFWrapperTest.php @@ -67,7 +67,7 @@ class PDFWrapperTest extends SuitePHPUnitFrameworkTestCase public function testGetDefaultEngine(): void { $actual = PDFWrapper::getDefaultEngine(); - $expected = 'MPDFEngine'; + $expected = 'TCPDFEngine'; self::assertEquals($expected, $actual); } diff --git a/tests/unit/phpunit/lib/Search/UI/SearchResultsControllerTest.php b/tests/unit/phpunit/lib/Search/UI/SearchResultsControllerTest.php index 4f11952e8..19e50c40a 100644 --- a/tests/unit/phpunit/lib/Search/UI/SearchResultsControllerTest.php +++ b/tests/unit/phpunit/lib/Search/UI/SearchResultsControllerTest.php @@ -90,7 +90,6 @@ class SearchResultsControllerTest extends SuitePHPUnitFrameworkTestCase $content = ob_get_contents(); ob_end_clean(); self::assertStringContainsString('Total result(s): 15', $content); - self::assertStringContainsString('Page 1 of 2', $content); // add 5 more.. for ($i=15; $i<20; $i++) { @@ -125,7 +124,6 @@ class SearchResultsControllerTest extends SuitePHPUnitFrameworkTestCase $content = ob_get_contents(); ob_end_clean(); self::assertStringContainsString('Total result(s): 20', $content); - self::assertStringContainsString('Page 2 of 2', $content); } public function testDisplayFoundOne(): void diff --git a/tests/unit/phpunit/lib/SuiteCRM/Search/ElasticSearch/ElasticSearchEngineTest.php b/tests/unit/phpunit/lib/SuiteCRM/Search/ElasticSearch/ElasticSearchEngineTest.php index 2d5c98ab8..32936f81f 100644 --- a/tests/unit/phpunit/lib/SuiteCRM/Search/ElasticSearch/ElasticSearchEngineTest.php +++ b/tests/unit/phpunit/lib/SuiteCRM/Search/ElasticSearch/ElasticSearchEngineTest.php @@ -82,7 +82,7 @@ class ElasticSearchEngineTest extends SearchTestAbstract 'query_string' => [ 'query' => $searchString, 'analyzer' => 'standard', - 'fields' => ['name.*^5', '_all'], + 'fields' => ['name.*^5', '*'], 'default_operator' => 'OR', 'minimum_should_match' => '66%' ] @@ -113,7 +113,7 @@ class ElasticSearchEngineTest extends SearchTestAbstract 'query_string' => [ 'query' => $searchString, 'analyzer' => 'standard', - 'fields' => ['name.*^5', '_all'], + 'fields' => ['name.*^5', '*'], 'default_operator' => 'OR', 'minimum_should_match' => '66%' ] diff --git a/tests/unit/phpunit/modules/Cases/aCaseTest.php b/tests/unit/phpunit/modules/Cases/aCaseTest.php index 2bf1dd0fb..848b0ee76 100644 --- a/tests/unit/phpunit/modules/Cases/aCaseTest.php +++ b/tests/unit/phpunit/modules/Cases/aCaseTest.php @@ -261,7 +261,6 @@ class aCaseTest extends SuitePHPUnitFrameworkTestCase $aCase = BeanFactory::newBean('Cases'); $aCase->name = 'test'; $aCase->priority = 'P1'; - $aCase->sentAssignmentNotifications = false; $aCase->save(); diff --git a/tests/unit/phpunit/modules/Meetings/MeetingTest.php b/tests/unit/phpunit/modules/Meetings/MeetingTest.php index 9310d34d2..523d80692 100644 --- a/tests/unit/phpunit/modules/Meetings/MeetingTest.php +++ b/tests/unit/phpunit/modules/Meetings/MeetingTest.php @@ -237,17 +237,17 @@ class MeetingTest extends SuitePHPUnitFrameworkTestCase public function testsend_assignment_notifications(): void { + $notify_user = new User(1); + $meeting = BeanFactory::newBean('Meetings'); $meeting->date_start = '2016-02-11 17:30:00'; $meeting->date_end = '2016-02-11 17:30:00'; - $meeting->sentAssignmentNotifications = false; + $meeting->sentAssignmentNotifications = []; + $meeting->sentAssignmentNotifications[] = $notify_user->id; $admin = BeanFactory::newBean('Administration'); $admin->retrieveSettings(); - $sendNotifications = false; - - $notify_user = new User(1); // Execute the method and test that it works and doesn't throw an exception. try {