From bb473d233ca45bd87bab5a95df211162d0b54ae8 Mon Sep 17 00:00:00 2001 From: Paul Huang Date: Thu, 20 Dec 2012 16:10:16 -0800 Subject: [PATCH] Release 6.5.9 --- ModuleInstall/ModuleScanner.php | 14 +- cache/include/javascript/sugar_grp1.js | 2 +- cache/include/javascript/sugar_grp_emails.js | 36 ++- .../include/javascript/sugar_grp_quickcomp.js | 36 ++- data/Relationships/M2MRelationship.php | 11 +- data/SugarBean.php | 30 ++- download.php | 15 +- files.md5 | 131 +++++----- include/DetailView/DetailView2.php | 6 +- include/EditView/EditView2.php | 2 +- include/ListView/ListViewData.php | 13 +- include/MVC/View/views/view.popup.php | 23 +- include/Popups/PopupSmarty.php | 6 +- include/SugarCharts/SugarChart.php | 3 +- .../SugarEmailAddress/SugarEmailAddress.php | 2 + .../SugarFields/Fields/Relate/DetailView.tpl | 2 +- .../Fields/Relate/SugarFieldRelate.php | 1 - .../SugarObjects/templates/person/Person.php | 7 +- include/SugarTheme/SugarTheme.php | 5 +- include/clean.php | 10 +- include/database/DBManager.php | 118 +++++---- include/export_utils.php | 5 +- include/formbase.php | 2 - include/javascript/ajaxUI.js | 2 +- include/language/en_us.lang.php | 3 +- include/utils.php | 8 +- .../src_files/include/javascript/ajaxUI.js | 4 + .../Administration/language/en_us.lang.php | 1 + modules/Administration/updater_utils.php | 17 +- modules/Calendar/tpls/form.tpl | 1 + modules/Calls/Save.php | 10 +- modules/Cases/Case.php | 4 +- modules/Cases/metadata/popupdefs.php | 3 - modules/Configurator/tpls/EditView.tpl | 4 +- modules/Configurator/views/view.edit.php | 8 +- .../ext/rest/insideview/tpls/InsideView.tpl | 18 +- modules/Emails/Email.php | 15 +- modules/Emails/Popup.php | 7 +- modules/Emails/javascript/Email.js | 2 +- modules/Emails/javascript/EmailUICompose.js | 75 ++++-- modules/Employees/EmployeesSearchForm.php | 2 +- modules/Home/views/view.list.php | 14 +- modules/Import/CsvAutoDetect.php | 13 +- modules/Import/Importer.php | 2 +- modules/Import/sources/ImportFile.php | 115 ++++++--- modules/Import/views/view.confirm.php | 14 -- modules/Meetings/Save.php | 7 + modules/UpgradeWizard/UpgradeRemoval.php | 6 +- modules/UpgradeWizard/commit.php | 15 +- modules/UpgradeWizard/end.php | 59 +---- modules/UpgradeWizard/index.php | 15 +- modules/UpgradeWizard/preflight.php | 65 +++-- modules/UpgradeWizard/silentUpgrade.php | 3 +- .../UpgradeWizard/silentUpgrade_dce_step2.php | 3 +- modules/UpgradeWizard/silentUpgrade_step1.php | 28 +-- modules/UpgradeWizard/silentUpgrade_step2.php | 48 +--- modules/UpgradeWizard/uw_ajax.php | 53 ++-- modules/UpgradeWizard/uw_utils.php | 138 ++++++----- modules/Users/User.php | 53 +--- modules/iCals/iCal.php | 8 +- service/v3/SugarWebServiceImplv3.php | 8 +- soap/SoapHelperFunctions.php | 2 +- soap/SoapSugarUsers.php | 5 + sugar_version.php | 8 +- tests/ModuleInstall/ModuleScannerTest.php | 31 +++ tests/SugarTestEmailAddressUtilities.php | 115 +++++++++ tests/SugarTestHelper.php | 1 + tests/SugarTestUserUtilities.php | 2 +- tests/data/Bug33036Test.php | 2 +- tests/data/Bug49281Test.php | 3 + tests/data/Bug54639Test.php | 91 +++++++ tests/data/Relationships/Bug57409Test.php | 94 ++++++++ tests/data/SugarBeanTest.php | 11 + tests/include/MVC/View/Bug44831Test.php | 1 + tests/include/MassUpdate/Bug46276Test.php | 3 + tests/include/database/Bug42475Test.php | 20 +- tests/include/utils/XssTest.php | 5 + tests/modules/Calendar/Bug57299Test.php | 191 +++++++++++++++ tests/modules/Campaigns/Bug41523Test.php | 2 + tests/modules/EmailAddresses/Bug56938Test.php | 115 +++++++++ tests/modules/Import/Bug58207Test.csv | 8 + .../Bug58207Test.php} | 85 +++---- tests/modules/UpgradeWizard/Bug57162Test.php | 84 +++++++ tests/modules/Users/Bug49896Test.php | 117 --------- tests/service/Bug51617Test.php | 21 +- tests/soap/Bug58138Test.php | 226 ++++++++++++++++++ themes/Sugar5/tpls/header.tpl | 2 +- .../images/IBMSmartCloud_image_inline.png | Bin 0 -> 603 bytes 88 files changed, 1774 insertions(+), 802 deletions(-) create mode 100755 tests/SugarTestEmailAddressUtilities.php create mode 100755 tests/data/Bug54639Test.php create mode 100755 tests/data/Relationships/Bug57409Test.php create mode 100755 tests/modules/Calendar/Bug57299Test.php create mode 100755 tests/modules/EmailAddresses/Bug56938Test.php create mode 100755 tests/modules/Import/Bug58207Test.csv rename tests/modules/{UpgradeWizard/Bug42490Test.php => Import/Bug58207Test.php} (61%) create mode 100755 tests/modules/UpgradeWizard/Bug57162Test.php delete mode 100755 tests/modules/Users/Bug49896Test.php create mode 100755 tests/soap/Bug58138Test.php create mode 100644 themes/default/images/IBMSmartCloud_image_inline.png diff --git a/ModuleInstall/ModuleScanner.php b/ModuleInstall/ModuleScanner.php index 82ce7e1c..ffd74101 100644 --- a/ModuleInstall/ModuleScanner.php +++ b/ModuleInstall/ModuleScanner.php @@ -383,6 +383,7 @@ class ModuleScanner{ 'xml_set_start_namespace_decl_handler', 'xml_set_unparsed_entity_decl_handler', ); + private $methodsBlackList = array('setlevel'); public function printToWiki(){ echo "'''Default Extensions'''
"; @@ -541,14 +542,21 @@ class ModuleScanner{ if(!in_array($lastToken[1], $this->classBlackList))break; if(in_array($lastToken[1], $this->classBlackListExempt))break; } else { - if(!in_array($token[1], $this->blackList))break; - if(in_array($token[1], $this->blackListExempt))break; - + //if nothing else fit, lets check the last token to see if this is a possible method call if ($lastToken !== false && ($lastToken[0] == T_OBJECT_OPERATOR || $lastToken[0] == T_DOUBLE_COLON)) { + //this is a method call, check the black list + if(in_array($token[1], $this->methodsBlackList)){ + $issues[]= translate('ML_INVALID_METHOD') . ' ' .$token[1]. '()'; + } break; } + + + if(!in_array($token[1], $this->blackList))break; + if(in_array($token[1], $this->blackListExempt))break; + } case T_VARIABLE: $checkFunction = true; diff --git a/cache/include/javascript/sugar_grp1.js b/cache/include/javascript/sugar_grp1.js index 311dd276..eeb8861b 100644 --- a/cache/include/javascript/sugar_grp1.js +++ b/cache/include/javascript/sugar_grp1.js @@ -706,7 +706,7 @@ return true;}else{if(typeof(YAHOO.util.Selector.query("input[type=submit]",form) form.submit();return false;}},cleanGlobals:function() {sqs_objects={};QSProcessedFieldsArray={};collection={};if(SUGAR.EmailAddressWidget){SUGAR.EmailAddressWidget.instances={};SUGAR.EmailAddressWidget.count={};} YAHOO.util.Event.removeListener(window,'resize');if(typeof(dialog)!='undefined'&&typeof(dialog.destroy)=='function'){dialog.destroy();delete dialog;}},firstLoad:function() -{var url=YAHOO.util.History.getBookmarkedState('ajaxUILoc');var aRegex=/action=([^&#]*)/.exec(window.location);var action=aRegex?aRegex[1]:false;var mRegex=/module=([^&#]*)/.exec(window.location);var module=mRegex?mRegex[1]:false;if(module!="ModuleBuilder") +{SUGAR.ajaxUI.menuFix=true;var url=YAHOO.util.History.getBookmarkedState('ajaxUILoc');var aRegex=/action=([^&#]*)/.exec(window.location);var action=aRegex?aRegex[1]:false;var mRegex=/module=([^&#]*)/.exec(window.location);var module=mRegex?mRegex[1]:false;if(module!="ModuleBuilder") {var go=url!=null||action=="ajaxui";url=url?url:'index.php?module=Home&action=index';YAHOO.util.History.register('ajaxUILoc',url,SUGAR.ajaxUI.go);YAHOO.util.History.initialize("ajaxUI-history-field","ajaxUI-history-iframe");SUGAR.ajaxUI.hist_loaded=true;if(go) SUGAR.ajaxUI.go(url);} SUGAR_callsInProgress--;},print:function() diff --git a/cache/include/javascript/sugar_grp_emails.js b/cache/include/javascript/sugar_grp_emails.js index f410c59c..1be1a40e 100644 --- a/cache/include/javascript/sugar_grp_emails.js +++ b/cache/include/javascript/sugar_grp_emails.js @@ -739,27 +739,47 @@ var text='';if(json_objects['email_template_object']['fields']['text_only']==1) else {text=decodeURI(encodeURI(json_objects['email_template_object']['fields']['body_html'])).replace(/
/ig,'\n').replace(/
/gi,"\n").replace(/&/gi,'&').replace(/</gi,'<').replace(/>/gi,'>').replace(/'/gi,'\'').replace(/"/gi,'"');document.getElementById('setEditor'+idx).checked=false;SUGAR.email2.composeLayout.renderTinyMCEToolBar(idx,0);} var tiny=SE.util.getTiny('htmleditor'+idx);var tinyHTML=tiny.getContent();var openTag='
';var closeTag='
';var htmllow=tinyHTML.toLowerCase();var start=htmllow.indexOf(openTag);if(start>-1){var htmlPart2=tinyHTML.substr(start);tinyHTML=text+htmlPart2;tiny.setContent(tinyHTML);}else{tiny.setContent(text);} -setTimeout("SUGAR.email2.composeLayout.setSignature("+idx+");",500);},setSignature:function(idx){if(!tinyMCE) +setTimeout("SUGAR.email2.composeLayout.setSignature("+idx+");",500);},setSignature:function(idx) +{if(!tinyMCE) return false;var hide=document.getElementById('setEditor'+idx).checked;SE.composeLayout.renderTinyMCEToolBar(idx,hide);if(!SE.composeLayout.signatures){setTimeout("SE.composeLayout.setSignature("+idx+");",1000);return;} if(idx!=null){var sel=document.getElementById('signatures'+idx);}else{var sel=document.getElementById('signature_id');idx=SE.tinyInstances.currentHtmleditor;} if(typeof(SE.composeLayout.loadedTinyInstances[idx])!='undefined'&&SE.composeLayout.loadedTinyInstances[idx]==false){setTimeout("SE.composeLayout.setSignature("+idx+");",1000);return;} var signature='';try{signature=sel.options[sel.selectedIndex].value;}catch(e){} -var openTag='
';var closeTag='
';var t=tinyMCE.getInstanceById('htmleditor'+idx);if(typeof(t)!='undefined') +var openTag='

';var closeTag=' 
';var t=tinyMCE.getInstanceById('htmleditor'+idx);if(typeof(t)!='undefined') {t.contentDocument=t.contentWindow.document;var html=t.getContent();} else {var html='';} -var htmllow=html.toLowerCase();var start=htmllow.indexOf(openTag);var end=htmllow.indexOf(closeTag);if(end>=0){end+=closeTag.length;} -else{end=htmllow.length;} -if(signature==''){if(start>-1){var htmlPart1=html.substr(0,start);var htmlPart2=html.substr(end,html.length);html=htmlPart1+htmlPart2;t.setContent(html);} +var htmllow=html.toLowerCase();var start=htmllow.indexOf(openTag);var end=htmllow.indexOf(closeTag,start);if(end>=0) +{end+=closeTag.length;} +else +{end=htmllow.length;} +if(signature=='') +{if(start>-1) +{var htmlPart1=html.substr(0,start);var htmlPart2=html.substr(end,html.length);html=htmlPart1+htmlPart2;t.setContent(html);} SE.signatures.lastAttemptedLoad='';return false;} if(!SE.signatures.lastAttemptedLoad) -SE.signatures.lastAttemptedLoad='';SE.signatures.lastAttemptedLoad=signature;if(typeof(SE.signatures[signature])=='undefined'){SE.signatures.lastAttemptedLoad='';SE.signatures.targetInstance=(idx)?idx:"";AjaxObject.target='';AjaxObject.startRequest(callbackLoadSignature,urlStandard+"&emailUIAction=getSignature&id="+signature);}else{var newSignature=this.prepareSignature(SE.signatures[signature]);if(SE.signatures.lastAttemptedLoad&&start>-1){var htmlPart1=html.substr(0,start);var htmlPart2=html.substr(end,html.length);html=htmlPart1+htmlPart2;} -start=html.indexOf('

');if(SE.userPrefs.signatures.signature_prepend=='true'&&start>-1){var htmlPart1=html.substr(0,start);var htmlPart2=html.substr(start,html.length);var newHtml=htmlPart1+openTag+newSignature+closeTag+htmlPart2;}else if(SUGAR.email2.userPrefs.signatures.signature_prepend=='true'){var newHtml=html;var spacing='


 ';var customSpacingStart=html.indexOf(spacing);if(customSpacingStart>-1) +{SE.signatures.lastAttemptedLoad='';} +SE.signatures.lastAttemptedLoad=signature;if(typeof(SE.signatures[signature])=='undefined') +{SE.signatures.lastAttemptedLoad='';SE.signatures.targetInstance=(idx)?idx:"";AjaxObject.target='';AjaxObject.startRequest(callbackLoadSignature,urlStandard+"&emailUIAction=getSignature&id="+signature);} +else +{var newSignature=this.prepareSignature(SE.signatures[signature]);if(SE.signatures.lastAttemptedLoad&&start>-1) +{var htmlPart1=html.substr(0,start);var htmlPart2=html.substr(end,html.length);html=htmlPart1+htmlPart2;} +start=html.indexOf('

');if(SE.userPrefs.signatures.signature_prepend=='true'&&start>-1) +{var htmlPart1=html.substr(0,start);var htmlPart2=html.substr(start,html.length);var newHtml=htmlPart1+openTag+newSignature+closeTag+htmlPart2;} +else if(SUGAR.email2.userPrefs.signatures.signature_prepend=='true') +{var newHtml=html;var spacing='


 ';var customSpacingStart=html.indexOf(spacing);if(customSpacingStart>-1) {var part1=newHtml.substr(0,customSpacingStart);var part2=newHtml.substr(customSpacingStart+spacing.length,newHtml.length);newHtml=part1+part2;} var bodyStartTag='';var body=newHtml.indexOf(bodyStartTag);if(body>-1) {var part1=newHtml.substr(0,body+bodyStartTag.length);var part2=newHtml.substr(body+bodyStartTag.length,newHtml.length);newHtml=part1+spacing+openTag+newSignature+closeTag+part2;} else -{newHtml=openTag+newSignature+closeTag+newHtml;}}else{var body=html.indexOf('');if(body>-1){var part1=html.substr(0,body);var part2=html.substr(body,html.length);var newHtml=part1+openTag+newSignature+closeTag+part2;}else{var newHtml=html+openTag+newSignature+closeTag;}} +{newHtml=openTag+newSignature+closeTag+newHtml;}} +else +{var bodyStringEmpty=htmllow.indexOf("")>-1&&htmllow.replace(/\s/g,"").match(/.+<\/body>/)==null;if(htmllow.length==0||bodyStringEmpty) +{openTag="
"+openTag;} +var body=html.indexOf('');if(body>-1) +{var part1=html.substr(0,body);var part2=html.substr(body,html.length);var newHtml=part1+openTag+newSignature+closeTag+part2;} +else +{var newHtml=html+openTag+newSignature+closeTag;}} t.setContent(newHtml);}},prepareSignature:function(str){var signature=new String(str);signature=signature.replace(/</gi,'<');signature=signature.replace(/>/gi,'>');return signature;},showAttachmentPanel:function(idx){var east=SE.composeLayout[idx].getUnitByPosition("right");var tabs=SE.composeLayout[idx].rightTabs;east.expand();tabs.set("activeTab",tabs.getTab(0));},showOptionsPanel:function(idx){var east=SE.composeLayout[idx].getUnitByPosition("right");var tabs=SE.composeLayout[idx].rightTabs;east.expand();tabs.set("activeTab",tabs.getTab(1));},showContactsPanel:function(){SE.complexLayout.regions.west.showPanel("contactsTab");},addDocumentField:function(idx){var basket=document.getElementById('addedDocuments'+idx);if(basket){var index=(basket.childNodes.length / 7)-1;if(index<0) index=0;}else{index=0;} var test=document.getElementById('documentId'+idx+index);while(test!=null){index++;test=document.getElementById('documentId'+idx+index);} diff --git a/cache/include/javascript/sugar_grp_quickcomp.js b/cache/include/javascript/sugar_grp_quickcomp.js index 6f79a36f..788f012c 100644 --- a/cache/include/javascript/sugar_grp_quickcomp.js +++ b/cache/include/javascript/sugar_grp_quickcomp.js @@ -370,27 +370,47 @@ var text='';if(json_objects['email_template_object']['fields']['text_only']==1) else {text=decodeURI(encodeURI(json_objects['email_template_object']['fields']['body_html'])).replace(/
/ig,'\n').replace(/
/gi,"\n").replace(/&/gi,'&').replace(/</gi,'<').replace(/>/gi,'>').replace(/'/gi,'\'').replace(/"/gi,'"');document.getElementById('setEditor'+idx).checked=false;SUGAR.email2.composeLayout.renderTinyMCEToolBar(idx,0);} var tiny=SE.util.getTiny('htmleditor'+idx);var tinyHTML=tiny.getContent();var openTag='
';var closeTag='
';var htmllow=tinyHTML.toLowerCase();var start=htmllow.indexOf(openTag);if(start>-1){var htmlPart2=tinyHTML.substr(start);tinyHTML=text+htmlPart2;tiny.setContent(tinyHTML);}else{tiny.setContent(text);} -setTimeout("SUGAR.email2.composeLayout.setSignature("+idx+");",500);},setSignature:function(idx){if(!tinyMCE) +setTimeout("SUGAR.email2.composeLayout.setSignature("+idx+");",500);},setSignature:function(idx) +{if(!tinyMCE) return false;var hide=document.getElementById('setEditor'+idx).checked;SE.composeLayout.renderTinyMCEToolBar(idx,hide);if(!SE.composeLayout.signatures){setTimeout("SE.composeLayout.setSignature("+idx+");",1000);return;} if(idx!=null){var sel=document.getElementById('signatures'+idx);}else{var sel=document.getElementById('signature_id');idx=SE.tinyInstances.currentHtmleditor;} if(typeof(SE.composeLayout.loadedTinyInstances[idx])!='undefined'&&SE.composeLayout.loadedTinyInstances[idx]==false){setTimeout("SE.composeLayout.setSignature("+idx+");",1000);return;} var signature='';try{signature=sel.options[sel.selectedIndex].value;}catch(e){} -var openTag='
';var closeTag='
';var t=tinyMCE.getInstanceById('htmleditor'+idx);if(typeof(t)!='undefined') +var openTag='

';var closeTag=' 
';var t=tinyMCE.getInstanceById('htmleditor'+idx);if(typeof(t)!='undefined') {t.contentDocument=t.contentWindow.document;var html=t.getContent();} else {var html='';} -var htmllow=html.toLowerCase();var start=htmllow.indexOf(openTag);var end=htmllow.indexOf(closeTag);if(end>=0){end+=closeTag.length;} -else{end=htmllow.length;} -if(signature==''){if(start>-1){var htmlPart1=html.substr(0,start);var htmlPart2=html.substr(end,html.length);html=htmlPart1+htmlPart2;t.setContent(html);} +var htmllow=html.toLowerCase();var start=htmllow.indexOf(openTag);var end=htmllow.indexOf(closeTag,start);if(end>=0) +{end+=closeTag.length;} +else +{end=htmllow.length;} +if(signature=='') +{if(start>-1) +{var htmlPart1=html.substr(0,start);var htmlPart2=html.substr(end,html.length);html=htmlPart1+htmlPart2;t.setContent(html);} SE.signatures.lastAttemptedLoad='';return false;} if(!SE.signatures.lastAttemptedLoad) -SE.signatures.lastAttemptedLoad='';SE.signatures.lastAttemptedLoad=signature;if(typeof(SE.signatures[signature])=='undefined'){SE.signatures.lastAttemptedLoad='';SE.signatures.targetInstance=(idx)?idx:"";AjaxObject.target='';AjaxObject.startRequest(callbackLoadSignature,urlStandard+"&emailUIAction=getSignature&id="+signature);}else{var newSignature=this.prepareSignature(SE.signatures[signature]);if(SE.signatures.lastAttemptedLoad&&start>-1){var htmlPart1=html.substr(0,start);var htmlPart2=html.substr(end,html.length);html=htmlPart1+htmlPart2;} -start=html.indexOf('

');if(SE.userPrefs.signatures.signature_prepend=='true'&&start>-1){var htmlPart1=html.substr(0,start);var htmlPart2=html.substr(start,html.length);var newHtml=htmlPart1+openTag+newSignature+closeTag+htmlPart2;}else if(SUGAR.email2.userPrefs.signatures.signature_prepend=='true'){var newHtml=html;var spacing='


 ';var customSpacingStart=html.indexOf(spacing);if(customSpacingStart>-1) +{SE.signatures.lastAttemptedLoad='';} +SE.signatures.lastAttemptedLoad=signature;if(typeof(SE.signatures[signature])=='undefined') +{SE.signatures.lastAttemptedLoad='';SE.signatures.targetInstance=(idx)?idx:"";AjaxObject.target='';AjaxObject.startRequest(callbackLoadSignature,urlStandard+"&emailUIAction=getSignature&id="+signature);} +else +{var newSignature=this.prepareSignature(SE.signatures[signature]);if(SE.signatures.lastAttemptedLoad&&start>-1) +{var htmlPart1=html.substr(0,start);var htmlPart2=html.substr(end,html.length);html=htmlPart1+htmlPart2;} +start=html.indexOf('

');if(SE.userPrefs.signatures.signature_prepend=='true'&&start>-1) +{var htmlPart1=html.substr(0,start);var htmlPart2=html.substr(start,html.length);var newHtml=htmlPart1+openTag+newSignature+closeTag+htmlPart2;} +else if(SUGAR.email2.userPrefs.signatures.signature_prepend=='true') +{var newHtml=html;var spacing='


 ';var customSpacingStart=html.indexOf(spacing);if(customSpacingStart>-1) {var part1=newHtml.substr(0,customSpacingStart);var part2=newHtml.substr(customSpacingStart+spacing.length,newHtml.length);newHtml=part1+part2;} var bodyStartTag='';var body=newHtml.indexOf(bodyStartTag);if(body>-1) {var part1=newHtml.substr(0,body+bodyStartTag.length);var part2=newHtml.substr(body+bodyStartTag.length,newHtml.length);newHtml=part1+spacing+openTag+newSignature+closeTag+part2;} else -{newHtml=openTag+newSignature+closeTag+newHtml;}}else{var body=html.indexOf('');if(body>-1){var part1=html.substr(0,body);var part2=html.substr(body,html.length);var newHtml=part1+openTag+newSignature+closeTag+part2;}else{var newHtml=html+openTag+newSignature+closeTag;}} +{newHtml=openTag+newSignature+closeTag+newHtml;}} +else +{var bodyStringEmpty=htmllow.indexOf("")>-1&&htmllow.replace(/\s/g,"").match(/.+<\/body>/)==null;if(htmllow.length==0||bodyStringEmpty) +{openTag="
"+openTag;} +var body=html.indexOf('');if(body>-1) +{var part1=html.substr(0,body);var part2=html.substr(body,html.length);var newHtml=part1+openTag+newSignature+closeTag+part2;} +else +{var newHtml=html+openTag+newSignature+closeTag;}} t.setContent(newHtml);}},prepareSignature:function(str){var signature=new String(str);signature=signature.replace(/</gi,'<');signature=signature.replace(/>/gi,'>');return signature;},showAttachmentPanel:function(idx){var east=SE.composeLayout[idx].getUnitByPosition("right");var tabs=SE.composeLayout[idx].rightTabs;east.expand();tabs.set("activeTab",tabs.getTab(0));},showOptionsPanel:function(idx){var east=SE.composeLayout[idx].getUnitByPosition("right");var tabs=SE.composeLayout[idx].rightTabs;east.expand();tabs.set("activeTab",tabs.getTab(1));},showContactsPanel:function(){SE.complexLayout.regions.west.showPanel("contactsTab");},addDocumentField:function(idx){var basket=document.getElementById('addedDocuments'+idx);if(basket){var index=(basket.childNodes.length / 7)-1;if(index<0) index=0;}else{index=0;} var test=document.getElementById('documentId'+idx+index);while(test!=null){index++;test=document.getElementById('documentId'+idx+index);} diff --git a/data/Relationships/M2MRelationship.php b/data/Relationships/M2MRelationship.php index d626b3ad..08e08e31 100644 --- a/data/Relationships/M2MRelationship.php +++ b/data/Relationships/M2MRelationship.php @@ -335,6 +335,7 @@ class M2MRelationship extends SugarRelationship $knownKey = $this->def['join_key_lhs']; $targetKey = $this->def['join_key_rhs']; $relatedSeed = BeanFactory::getBean($this->getRHSModule()); + $relatedSeedKey = $this->def['rhs_key']; if (!empty($params['where'])) $whereTable = (empty($params['right_join_table_alias']) ? $relatedSeed->table_name : $params['right_join_table_alias']); } @@ -343,6 +344,7 @@ class M2MRelationship extends SugarRelationship $knownKey = $this->def['join_key_rhs']; $targetKey = $this->def['join_key_lhs']; $relatedSeed = BeanFactory::getBean($this->getLHSModule()); + $relatedSeedKey = $this->def['lhs_key']; if (!empty($params['where'])) $whereTable = (empty($params['left_join_table_alias']) ? $relatedSeed->table_name : $params['left_join_table_alias']); } @@ -358,9 +360,14 @@ class M2MRelationship extends SugarRelationship } $deleted = !empty($params['deleted']) ? 1 : 0; - $from = $rel_table; - if (!empty($params['where'])) + $from = $rel_table . " "; + if (!empty($params['where'])) { $from .= ", $whereTable"; + if (isset($relatedSeed->custom_fields)) { + $customJoin = $relatedSeed->custom_fields->getJOIN(); + $from .= $customJoin ? $customJoin['join'] : ''; + } + } if (empty($params['return_as_array'])) { $query = "SELECT $targetKey id FROM $from WHERE $where AND $rel_table.deleted=$deleted"; diff --git a/data/SugarBean.php b/data/SugarBean.php index 83f96eff..04cb765e 100644 --- a/data/SugarBean.php +++ b/data/SugarBean.php @@ -405,7 +405,7 @@ class SugarBean * Before calling this function, check whether audit has been enabled for the table/module or not. * You would set the audit flag in the implemting module's vardef file. * - * @return an array of + * @return array * @see is_AuditEnabled * * Internal function, do not override. @@ -1123,6 +1123,19 @@ class SugarBean } } else { + + //Expose the cooresponding id field of a relate field if it is only defined as a link so that users can relate records by id during import + if( isset($value_array['type']) && ($value_array['type'] == 'relate') && isset($value_array['id_name']) ) + { + $idField = $value_array['id_name']; + if( isset($fieldDefs[$idField]) && isset($fieldDefs[$idField]['type'] ) && $fieldDefs[$idField]['type'] == 'link' ) + { + $tmpFieldDefs = $fieldDefs[$idField]; + $tmpFieldDefs['vname'] = translate($value_array['vname'], $this->module_dir) . " " . $GLOBALS['app_strings']['LBL_ID']; + $importableFields[$idField]=$tmpFieldDefs; + } + } + $importableFields[$key]=$value_array; } } @@ -1302,7 +1315,7 @@ class SugarBean if(isset($def['dbType'])) $type .= $def['dbType']; - if($def['type'] == 'html') { + if($def['type'] == 'html' || $def['type'] == 'longhtml') { $this->$key = SugarCleaner::cleanHtml($this->$key, true); } elseif((strpos($type, 'char') !== false || strpos($type, 'text') !== false || @@ -1413,12 +1426,12 @@ class SugarBean $this->preprocess_fields_on_save(); //construct the SQL to create the audit record if auditing is enabled. - $dataChanges=array(); + $auditDataChanges=array(); if ($this->is_AuditEnabled()) { if ($isUpdate && !isset($this->fetched_row)) { $GLOBALS['log']->debug('Auditing: Retrieve was not called, audit record will not be created.'); } else { - $dataChanges=$this->db->getDataChanges($this); + $auditDataChanges=$this->db->getAuditDataChanges($this); } } @@ -1430,9 +1443,9 @@ class SugarBean $this->db->insert($this); } - if (!empty($dataChanges) && is_array($dataChanges)) + if (!empty($auditDataChanges) && is_array($auditDataChanges)) { - foreach ($dataChanges as $change) + foreach ($auditDataChanges as $change) { $this->db->save_audit_records($this,$change); } @@ -1443,6 +1456,11 @@ class SugarBean SugarRelationship::resaveRelatedBeans(); } + // populate fetched row with current bean values + foreach ($auditDataChanges as $change) { + $this->fetched_row[$change['field_name']] = $change['after']; + } + //If we aren't in setup mode and we have a current user and module, then we track if(isset($GLOBALS['current_user']) && isset($this->module_dir)) diff --git a/download.php b/download.php index 85e35c76..79bb4a1d 100644 --- a/download.php +++ b/download.php @@ -178,9 +178,18 @@ else { } } else { - header("Content-Type: application/force-download"); - header("Content-type: application/octet-stream"); - header("Content-Disposition: attachment; filename=\"".$name."\";"); + if ($check_image && ($mime = getimagesize($download_location)) !== false) + { + header("Content-Type: " . $mime['mime']); + } + else + { + header("Content-type: application/octet-stream"); + } + + if (!$check_image) { + header("Content-Disposition: attachment; filename=\"".$name."\";"); + } } // disable content type sniffing in MSIE header("X-Content-Type-Options: nosniff"); diff --git a/files.md5 b/files.md5 index 63834083..76d9d2a6 100644 --- a/files.md5 +++ b/files.md5 @@ -1,5 +1,5 @@ 'd3f150e4a5bed444763ebe8a81742a95', './.htaccess' => 'd41d8cd98f00b204e9800998ecf8427e', @@ -82,7 +82,7 @@ $md5_string = array ( './include/SugarObjects/templates/person/metadata/listviewdefs.php' => '05ce4144900a1e6d3949cb3d50c0ea5d', './include/SugarObjects/templates/person/metadata/detailviewdefs.php' => '3345c1e3c927e0ed0ba010cb0cc7fdfe', './include/SugarObjects/templates/person/language/en_us.lang.php' => '6e1b1001dcd92b7382fdc25064830171', - './include/SugarObjects/templates/person/Person.php' => '763305f02b1506a2f0e00f9408b5cfdc', + './include/SugarObjects/templates/person/Person.php' => '633c0299f8d0cae3173ecd4f8681303d', './include/SugarObjects/templates/basic/vardefs.php' => '595e708242310b7863643e48d397263a', './include/SugarObjects/templates/basic/icons/Createbasic.gif' => 'e25889cd660d838655f5e213fe565f0d', './include/SugarObjects/templates/basic/icons/basic_32.gif' => 'd92dc1c8a1ef6e0351b6948d78bf1436', @@ -292,7 +292,7 @@ $md5_string = array ( './include/Sugarpdf/Sugarpdf.php' => '7e44d3d7308df3c1e5fad15c776c88ee', './include/Sugarpdf/sugarpdf_default.php' => '7f19994bcf11b5d98801c3739eab57a2', './include/Sugarpdf/sugarpdf_config.php' => '3768422dd5bfb14aca352ea209a0ebae', - './include/clean.php' => '4ec6c61c8c04aacee15897e05bf9e07f', + './include/clean.php' => '9b7b0a1481c54af43961e2e0cb25d692', './include/externalAPI/ExternalAPIFactory.php' => '0dfa0647b6b6484f28927eb5018749e0', './include/externalAPI/cmis_repository_wrapper.php' => 'ff3bb54e2abd73334bb05df8b6920b8d', './include/externalAPI/Base/WebDocument.php' => 'ede22580002f6416a2502dee7d0be18f', @@ -351,9 +351,9 @@ $md5_string = array ( './include/SugarFields/Fields/Currency/ListView.tpl' => '9b169f665697516c771151a27ab7dc3a', './include/SugarFields/Fields/Password/SugarFieldPassword.php' => '50644b74c6a8bc8d1a62b81bbb4d7d80', './include/SugarFields/Fields/Password/EditView.tpl' => 'aa42f8ace5d954a82a0cecd46b9fd549', - './include/SugarFields/Fields/Relate/DetailView.tpl' => '256e3bfa0a77434237fad67fee60d0d6', + './include/SugarFields/Fields/Relate/DetailView.tpl' => 'c4f05c779e3ef4d4eb0dbe0f8b7a1ed8', './include/SugarFields/Fields/Relate/EditView.tpl' => '6fd3f5f47d2908588f15ce55c347fb4a', - './include/SugarFields/Fields/Relate/SugarFieldRelate.php' => '7e609408b86d29d7214da9aa374cc838', + './include/SugarFields/Fields/Relate/SugarFieldRelate.php' => '8b378ab85b595ab51e646870f48dd300', './include/SugarFields/Fields/Relate/SearchView.tpl' => 'ceca0856d893a7ae78cecd35b95fcff9', './include/SugarFields/Fields/Phone/SugarFieldPhone.php' => '4f5d715e5ce3fde8d43d669ab0edc0d1', './include/SugarFields/Fields/Phone/DetailView.tpl' => 'ce6b524b3132e8c3712f28baee4a97f8', @@ -475,7 +475,7 @@ $md5_string = array ( './include/SugarCharts/swf/groupByChart.swf' => '2eca03fe41128001349bacf997b1fedc', './include/SugarCharts/SugarChartFactory.php' => '4873cc48dd3a2258af3a7998713b2398', './include/SugarCharts/JsChart.php' => '93080932f4335c6ef0c74049d3c566ce', - './include/SugarCharts/SugarChart.php' => '323ee23a6d0775f348ed6184feab960e', + './include/SugarCharts/SugarChart.php' => '31a132fbdf5f45a7ac2059130e294ccc', './include/SugarCharts/Jit/js/sugarCharts.js' => '643ed60792a2efe2c62c6ee3f094d735', './include/SugarCharts/Jit/js/mySugarCharts.js' => '6b3dd85fe7c6d5714b6d12c63e536982', './include/SugarCharts/Jit/js/Jit/jit.js' => 'de9a71d630e97395d4bae316c5995fca', @@ -576,7 +576,7 @@ $md5_string = array ( './include/nusoap/license.txt' => '25823f4a2e463ab2c6b5873f07e428e1', './include/nusoap/class.wsdl.php' => 'cd7f1a43ca08891ac1ce04d4d1282c49', './include/nusoap/class.soap_val.php' => '084a898ecf261c201427fd41d4ee40e0', - './include/utils.php' => '132cf74e2ac611d2975de859a9a5eeda', + './include/utils.php' => '84115533f27ece3b429751eb2eb33122', './include/SugarHttpClient.php' => '87fa99a397caaaceb121a21d91ed5260', './include/Sugar_Smarty.php' => 'ac140125309e194a7f43747d41417cd4', './include/phpmailer/extras/htmlfilter.php' => '4d5143899340a690d41a4959428ea674', @@ -610,7 +610,7 @@ $md5_string = array ( './include/phpmailer/language/phpmailer.lang-br.php' => 'a1364ab381ebdf3f05999b31bada24bd', './include/phpmailer/class.phpmailer.php' => 'f5db91a4a2a3889d87bf62f05723cb6b', './include/php-sql-parser.php' => '4fd316e1251bd1134a46134ad7ddaf57', - './include/database/DBManager.php' => '42f443e30bb586e94da21462070650e6', + './include/database/DBManager.php' => 'f393eec6a3bcf1750d38b1946ff9b7f1', './include/database/MysqlHelper.php' => '6081c98891b401e3653bde7ec539b6d9', './include/database/DBHelper.php' => '74b36f164c288872a50d1f6132d4875e', './include/database/MysqlManager.php' => '968d27d3e911f4e34bed9a9aa24f19d6', @@ -645,20 +645,20 @@ $md5_string = array ( './include/Popups/tpls/footer.tpl' => 'cda2c59d64c7135b261e145856bb3e5d', './include/Popups/tpls/header.tpl' => '82b7b2df20533719b3b2585158e37b5f', './include/Popups/tpls/PopupGeneric.tpl' => '8a376cc11e38482a3c3bf6ff18e8b5ff', - './include/Popups/PopupSmarty.php' => '291a228a7cd7277c965353cf733af8e3', + './include/Popups/PopupSmarty.php' => '2f2c1f2760ded14dbb3a7a91e132d79a', './include/Popups/Popup_picker.php' => '021273a0792c4a8469f9f9fb6839df31', './include/templates/TemplateDragDropChooser.php' => '312be77f2351b29f7e79bf416ddd8772', './include/templates/Template.php' => '36ef9b944d7e36d9853d9879f6194969', './include/templates/TemplateGroupChooser.php' => '6ae99e0ff3795b613d03ec0474e52c46', './include/TemplateHandler/TemplateHandler.php' => '4da8355d19789c5c532c621d12d049ed', - './include/SugarTheme/SugarTheme.php' => '301d36442a1c85b5c23c1a9741c58b7e', + './include/SugarTheme/SugarTheme.php' => '940de3a50f5ff709e5aae8e03cbc7a62', './include/SugarTheme/getImage.php' => '19291feae95e57bc666eec37b612664e', './include/SugarTheme/SugarSprites.php' => '10818287a033eed727e4269522cc7044', './include/SugarTheme/cssmin.php' => '05384ba957435def09368425e4480688', './include/SugarDependentDropdown/metadata/dependentDropdown.php' => '687d5cf1b099d7f81bd40cace28f33dc', './include/SugarDependentDropdown/javascript/SugarDependentDropdown.js' => '4d077b3991c83098e4bca166bc715071', './include/SugarDependentDropdown/SugarDependentDropdown.php' => '86eb13e7c54068ec87679e98a4e0d406', - './include/export_utils.php' => '885a0dd6cda051658520a90f522f787f', + './include/export_utils.php' => '458faa802b7085997195af9c0de35488', './include/globalControlLinks.php' => 'ed8fa6c0797f56e3326a18e3980ce65f', './include/SugarTinyMCE.php' => 'a00a969d2a2df9dbbc80ead4af9b40de', './include/tabs.php' => '7cf9418691424c673218c535fec27a05', @@ -741,7 +741,7 @@ $md5_string = array ( './include/EditView/header.tpl' => '1851218e36edd4d98fdbb803a2f79977', './include/EditView/QuickCreate.tpl' => 'fa3dacaca4c4985fa7d4e19e44d8a30a', './include/EditView/EditView.php' => '585450ac1a175834d05e944f77364c17', - './include/EditView/EditView2.php' => 'a03923ba3c798ef5990abd23d83948f7', + './include/EditView/EditView2.php' => 'd80d40a7347dba0ff74b7729ab0b7b8a', './include/EditView/PopupQuickCreate.php' => '9a8b7a895799ed90058b3e070ad7f672', './include/EditView/SugarVCR.tpl' => '5b46cb6d983f213ec90733aa54bfba45', './include/EditView/EditView.tpl' => '25515351fd6fe70f692136f1eb9cc39f', @@ -787,7 +787,7 @@ $md5_string = array ( './include/tcpdf/CHANGELOG.TXT' => 'b41664d05748e067b3d52ba1eba1e9c3', './include/tcpdf/tcpdf.php' => 'e1032f914233be45b287bbb29bdfb452', './include/tcpdf/README.TXT' => 'f64835b5e9149a89515a9eb589d13a38', - './include/javascript/ajaxUI.js' => '127986b360cdede27e18b3a7f0041c0a', + './include/javascript/ajaxUI.js' => '32752d6cc977636316710b5fb5a5d91c', './include/javascript/calendar.js' => '74fcfcacbdf160e7eb749d7697ad8788', './include/javascript/iscroll.js' => 'f6b1477d2416ee1c40578d56c89220c1', './include/javascript/include.js' => 'f3ef613992bd21dcb9a6033c03675b90', @@ -2560,7 +2560,7 @@ $md5_string = array ( './include/MVC/View/views/view.vcard.php' => 'b28901f6dd26f4b92c82a50b562610fb', './include/MVC/View/views/view.multiedit.php' => '14e60eed1da6bdd4484a9fba241ac7a0', './include/MVC/View/views/view.list.php' => '3d73c1e5d7d7310bb54cf1a8ca7b0e28', - './include/MVC/View/views/view.popup.php' => '20de3c54cb9040995f2e1435b4c048ca', + './include/MVC/View/views/view.popup.php' => '5d4f62662b35bdb11c46e76bc2152895', './include/MVC/View/views/view.quick.php' => '4c1fda7615101d7c9a11af7e9c495289', './include/MVC/View/views/view.xml.php' => '5ca6f033ae95a3d8d7eacbaaac86d58a', './include/MVC/View/views/view.sugarpdf.config.php' => '85c23b2aa8b6af2b82efc3eae453a118', @@ -2616,7 +2616,7 @@ $md5_string = array ( './include/Pear/XML_HTMLSax3/LICENSE' => 'a45bb1bbeed9e26b26c5763df1d3913d', './include/Pear/XML_HTMLSax3/HTMLSax3.php' => '11107d97b19feb13feb394cd858603f0', './include/ListView/ListViewSmarty.php' => 'a69eeef5b31ce1e1fa029519006f9f35', - './include/ListView/ListViewData.php' => '3797a56eeb35041d403100afc200bc26', + './include/ListView/ListViewData.php' => '339402ba0c5582827ee4404920d72d78', './include/ListView/ListViewGeneric.tpl' => '32370f4af0164b0985b20c7b7079800c', './include/ListView/ListView.php' => '1ea1f2788eeb0e0c7d7bc047221eb0d7', './include/ListView/ListViewFacade.php' => 'e82b5372d43acd05f1dbe5855c40cdbd', @@ -2628,20 +2628,20 @@ $md5_string = array ( './include/vCard.php' => 'b9b49b4d676cbb05c00771e037687ef3', './include/upload_file.php' => '3f2b33e37ce73612401ca178375668e3', './include/controller/Controller.php' => 'c5d723fc98af89861c9e68ae49ac9fee', - './include/formbase.php' => '83bb022a5179b6a203b3d677bc21efc5', + './include/formbase.php' => '97e99a85cd88d994bb483122bd7b26d7', './include/SugarOauth.php' => 'e9c19b3799b9f64560a80eb1523144f8', './include/resource/ResourceManager.php' => 'c5a246f1eab1d1af90b1a5cb1b1044f5', './include/resource/Observers/WebResourceObserver.php' => 'b88f9b5b9d7498fcdd8fc7ccf3cf80a7', './include/resource/Observers/ResourceObserver.php' => 'd93dc69d2372859fe8fb0f1068587d54', './include/resource/Observers/SoapResourceObserver.php' => 'bff762397d04d958883d06ed160d8bd1', './include/language/jsLanguage.php' => '3aade005a1d8758085838ed1a22ebf34', - './include/language/en_us.lang.php' => 'dbb89df09c1f0fbd6f9c627afb717e04', + './include/language/en_us.lang.php' => '020ef6320159e879c73e17a2eaf07c20', './include/language/en_us.notify_template.html' => 'ca23107160665bd7ebb6e94177a3a1ba', './include/pclzip/readme.txt' => '2265cad9ccb84cfcd4093ce26b22dc97', './include/pclzip/gnu-lgpl.txt' => '7fbc338309ac38fefcd64b04bb903e34', './include/pclzip/pclzip.lib.php' => 'f42cfbdfccc2dcd85df39638ae2d141c', './include/SugarEmailAddress/SugarEmailAddress.js' => '6217eae817e6af59e21666cc3087a9d9', - './include/SugarEmailAddress/SugarEmailAddress.php' => '3099caeb2dd86f89e3d90c4bc5c1f00d', + './include/SugarEmailAddress/SugarEmailAddress.php' => '22f7cd13dc5e5dd46ab0ad782d761144', './include/SugarEmailAddress/templates/forDuplicatesView.tpl' => '7606911a788f6fa0f4aca806679e4098', './include/SugarEmailAddress/templates/forDetailView.tpl' => '8a913b1d6cbaf35ff7237c8c6022af9c', './include/SugarEmailAddress/templates/forWideFormBodyView.tpl' => '0dc9422da0b8ec60a58ae06d7215c3fb', @@ -2767,7 +2767,7 @@ $md5_string = array ( './include/DetailView/header.tpl' => '271c7dc1c8fa257bfe656211c882e93c', './include/DetailView/DetailView.tpl' => 'a3c4dd95d931815f9845a09fe2e3da33', './include/DetailView/DetailView.php' => '3df8ccba8aca6dffb5969c47001d7435', - './include/DetailView/DetailView2.php' => '4f800afa17ab95068341a3474e78fb76', + './include/DetailView/DetailView2.php' => '422e4464db16770ac09a835e910443e4', './include/generic/DeleteRelationship.php' => '73e87c09bc4e90c35a551a6d290965c1', './include/generic/Save2.php' => '3d3e77582a8f9617417a84a0a5165c39', './include/generic/LayoutManager.php' => '48a5feb70ed0fc1f360d6ba9d917d139', @@ -2880,7 +2880,7 @@ $md5_string = array ( './dictionary.php' => '19245b9374ee0cfc7048c87c7548652e', './HandleAjaxCall.php' => 'e8f0cb63050a3f85e26d5f295c54d8b6', './ModuleInstall/extensions.php' => 'd17953438bdd75848cce5a5dbe929e5e', - './ModuleInstall/ModuleScanner.php' => 'b9570c5d23ff6527607e0e562bb9f728', + './ModuleInstall/ModuleScanner.php' => '36650e9109451c6382b3b677d2471b34', './ModuleInstall/ModuleInstaller.php' => '7595862d0c0fbaaba337058ed6e61ba7', './ModuleInstall/PackageManager/tpls/PackageForm.tpl' => 'b0f7f452c6c32251c1e88f3f06422018', './ModuleInstall/PackageManager/tpls/PackageManagerScripts.tpl' => '305b5d5a2ea5f04c533b982a5f1422ee', @@ -3302,11 +3302,11 @@ $md5_string = array ( './SugarSecurity.php' => 'e87f1efee51af1d8801dc2376068cee3', './export.php' => '7639b2373c4d0c73765033d70abfb55d', './data/BeanFactory.php' => '5148eb779611ca40e342900456fc6f29', - './data/SugarBean.php' => '889c583c98275bdacc9335de2d8cd9e4', + './data/SugarBean.php' => '88135dafc4f25a1bc483222c7d60af24', './data/Link.php' => 'de95f31cf30c2f46a234c4a840c01f84', './data/Relationships/One2OneRelationship.php' => '88194998edcdad83a887aa1ef014d5de', './data/Relationships/EmailAddressRelationship.php' => '1a46e6504810e22a7854b64af2377fdf', - './data/Relationships/M2MRelationship.php' => 'bbeac74a733f37995f1c80b9a192648e', + './data/Relationships/M2MRelationship.php' => '8cb1c279c2438c4f732f49df619bda57', './data/Relationships/RelationshipFactory.php' => '4c70024ff9b3bbfa9eeb76095f33d472', './data/Relationships/One2MBeanRelationship.php' => '18c6acb5e2f0f51d31fb5078a689102c', './data/Relationships/One2OneBeanRelationship.php' => '654eafffcc24bad9f464a76f0973843e', @@ -3340,7 +3340,7 @@ $md5_string = array ( './service/v3/soap.php' => 'd24efe4da4263ebf08872c5bfd9caa26', './service/v3/registry.php' => '05ac619953459b229719023a5de2f2eb', './service/v3/rest.php' => 'a0958deeacb950bb921ef16afdfd4393', - './service/v3/SugarWebServiceImplv3.php' => '1e5896f16f3a72070cccbb202c36fc77', + './service/v3/SugarWebServiceImplv3.php' => '765711114b22b6c58d84a9e8622e7676', './service/v3/SugarWebServiceUtilv3.php' => 'a1a5712040f4c1e08103767b0f9bef78', './service/v3_1/SugarWebServiceImplv3_1.php' => 'a73f5627fc7a6679409512c16f484b99', './service/v3_1/soap.php' => 'cca72b94407d160e626dd7fedde64e30', @@ -3468,7 +3468,7 @@ $md5_string = array ( './modules/Audit/language/en_us.lang.php' => '4b250a9c07b0f30383cceabdbda25a8f', './modules/iCals/Server.php' => '46efc1e6f756b139c8281d55829f34f9', './modules/iCals/HTTP_WebDAV_Server_iCal.php' => '203944d373f7db4f6dae06a8d7b9a7b8', - './modules/iCals/iCal.php' => '7efd624a7b70a2395abe2a0830207705', + './modules/iCals/iCal.php' => '588939dd990935ea007ad7f96b2555bf', './modules/OAuthKeys/vardefs.php' => 'a22b30275d60d0796af0edc2a540fd25', './modules/OAuthKeys/controller.php' => 'b5bbc3b2221d9dc948d743bd02c50b2f', './modules/OAuthKeys/metadata/searchdefs.php' => 'b5cf0109ae9f61be62a611d5f14c1299', @@ -3492,7 +3492,7 @@ $md5_string = array ( './modules/Cases/metadata/quickcreatedefs.php' => 'a2a24e05ecc6f05e84452043f27f5d57', './modules/Cases/metadata/editviewdefs.php' => '278db1ef426a37843d4f23a56ad7da53', './modules/Cases/metadata/SearchFields.php' => '3d226c553e39062349e80b6149845350', - './modules/Cases/metadata/popupdefs.php' => '8d3e2d8d61244443efa1d22a813210c0', + './modules/Cases/metadata/popupdefs.php' => 'e8259827e11e5872d7f345cb7ac1507f', './modules/Cases/metadata/subpanels/ForAccounts.php' => '31b016ecd2eba56cc716461b5b1e497d', './modules/Cases/metadata/subpanels/default.php' => '13d86e68ecc5ed8835ef0a63e7d318e2', './modules/Cases/metadata/subpanels/ForEmails.php' => 'b4b7f7a936a1e3430498c0bca45173ac', @@ -3505,7 +3505,7 @@ $md5_string = array ( './modules/Cases/Dashlets/MyCasesDashlet/MyCasesDashlet.php' => '6681a60a934612ae489592f2fd976d11', './modules/Cases/Dashlets/MyCasesDashlet/MyCasesDashlet.data.php' => '78590a9ee41fffceb0b06f1a05d711e4', './modules/Cases/language/en_us.lang.php' => '0130e84c1b1b56106feadeac5847e1ff', - './modules/Cases/Case.php' => '861df4f7a833be8214429234b4b48a25', + './modules/Cases/Case.php' => '4e4adebd39a65799a9d83a5f1a4040c1', './modules/Cases/SugarFeeds/CaseFeed.php' => 'f28ac1cf2e358afa0981b2c50d699669', './modules/Documents/documents.js' => '711c1c3534c03089c931006ba71abbaa', './modules/Documents/GetLatestRevision.php' => '4810e123a8d2793523ba6010bcf3a55f', @@ -3663,7 +3663,7 @@ $md5_string = array ( './modules/Calendar/tpls/header.tpl' => '8662039740d66edc1579f6de9b04e174', './modules/Calendar/tpls/editHeader.tpl' => 'bc0d87d835fdde3fd76141efe81d8182', './modules/Calendar/tpls/empty.tpl' => '01fef0770302cd5098e331c34ae37122', - './modules/Calendar/tpls/form.tpl' => '6b68aff7e53fc6ea8316964813be3216', + './modules/Calendar/tpls/form.tpl' => '34000602b9a8529a2c1ba163bf412b5d', './modules/Calendar/CalendarUtils.php' => 'aee721e454e09cb8203be13e1dcac681', './modules/Calendar/Menu.php' => 'ede3b80a5a058f7045bf1cdbc623b424', './modules/Calendar/views/view.getgr.php' => 'a39da65c98dcfacf66119d87e0dd0fc8', @@ -3793,12 +3793,12 @@ $md5_string = array ( './modules/Emails/Check.php' => 'e955c7c45b1d2488cc57ada923142575', './modules/Emails/SugarRoutingAsync.php' => '0a9ca1ac80b9c759693c1b2e9cbda26d', './modules/Emails/javascript/composeEmailTemplate.js' => 'e19471934b9acab4ebeeebdbcd4b7fc0', - './modules/Emails/javascript/Email.js' => '7a8528f141f6de141336426c497dfbcd', + './modules/Emails/javascript/Email.js' => '0ebbd0050388cd39986d2e96edf954f3', './modules/Emails/javascript/email_popup_helper.js' => '104dd8dd391a907e53606df613d90f34', './modules/Emails/javascript/init.js' => 'b48256570c9c73556b36248fd7b45d8b', './modules/Emails/javascript/displayOneEmailTemplate.js' => '4efbf9ed736dffca56a40d16456adf58', './modules/Emails/javascript/ajax.js' => '21be3e955c6335f63c6b15d8bb35f0de', - './modules/Emails/javascript/EmailUICompose.js' => '03df76552ac939af2f08c2476099147f', + './modules/Emails/javascript/EmailUICompose.js' => '387bf13766e19e3dab16d7ca3b8986e4', './modules/Emails/javascript/EmailUI.js' => '8a62cd712eb4f7c5fac2713f00a160d6', './modules/Emails/javascript/grid.js' => '3f466dcfd19ed70d90ff386eb40ff28d', './modules/Emails/javascript/viewPrintable.js' => '1e5ed81de106298be2e5c11f955c6a09', @@ -3808,7 +3808,7 @@ $md5_string = array ( './modules/Emails/Dashlets/MyEmailsDashlet/MyEmailsDashlet.data.php' => '0feed910c9a96a7dc40b92fab7cdecf7', './modules/Emails/Dashlets/MyEmailsDashlet/MyEmailsDashlet.meta.php' => '78e3080b36e3fc91059ec1a4c00e6fa2', './modules/Emails/Dashlets/MyEmailsDashlet/MyEmailsDashlet.php' => '800c73f841d60c1dcddf8f9efe1ce481', - './modules/Emails/Popup.php' => 'a308a838c667fe38cc188ae8192bdca7', + './modules/Emails/Popup.php' => '01b77c77761593000f0852969f7c9b10', './modules/Emails/SearchFormSent.html' => '1f871f23a8d4c690585d7d39113a146d', './modules/Emails/Popup_picker.html' => 'f5852b7f84e960e1ad0f38618d7d6019', './modules/Emails/index.php' => '793a57712ae26b09706ba36c5445fd9a', @@ -3818,7 +3818,7 @@ $md5_string = array ( './modules/Emails/PessimisticLock.php' => 'eec9f812607afdf9681c668939cf1794', './modules/Emails/language/en_us.lang.php' => '694b3c5daffb0a1d311a6c12efdbb0b8', './modules/Emails/ListViewMyInbox.html' => '80a65ca00efffeda3eed9767b4dc5164', - './modules/Emails/Email.php' => '579338214fa6d4afef15ab81dd57268f', + './modules/Emails/Email.php' => '4389ec861306f76565a2106689b8b088', './modules/Emails/subpanels/ForQueues.php' => '627f6382bc5961151c8ff23c44e3dae7', './modules/Emails/subpanels/ForHistory.php' => '7b08fa447e4f5623997e1b9fa1016389', './modules/Emails/subpanels/ForContacts.php' => '1e6eec75a19bfe36e1fbb9a47fa56d76', @@ -3833,7 +3833,7 @@ $md5_string = array ( './modules/Configurator/tpls/SugarpdfSettings.tpl' => '531e1a326d57e6fc4ad8d13c2396725e', './modules/Configurator/tpls/adminwizard.tpl' => '8ca3b6a6ff4601c1497a48a86183f89f', './modules/Configurator/tpls/fontmanager.tpl' => '1825567230ccefbe24318f6e87fd18a8', - './modules/Configurator/tpls/EditView.tpl' => '1dcfefd2b20650c81d68d40ebb02c687', + './modules/Configurator/tpls/EditView.tpl' => '858260c8d89f7abee3cf4497ec9ce976', './modules/Configurator/tpls/SugarpdfSettingsFields.tpl' => '220de2fecf8bd16f2a6bde807a3d1196', './modules/Configurator/tpls/addFontResult.tpl' => '883aab2f2c47f7dd78d69d8094257a79', './modules/Configurator/Menu.php' => '5cbc243dd9e97433e65b6c2c97a5249b', @@ -3841,7 +3841,7 @@ $md5_string = array ( './modules/Configurator/views/view.sugarpdfsettings.php' => 'c103556cc9abd3acaa666fb9787e1aee', './modules/Configurator/views/view.addfontresult.php' => '2e92eedd9ae52db5903bb11d5286b77b', './modules/Configurator/views/view.addfontview.php' => '4219a23aa0e9d936b847dc353aa1bd2b', - './modules/Configurator/views/view.edit.php' => '5f9d38761eb1cdb4e71b3e15a33bfb9f', + './modules/Configurator/views/view.edit.php' => 'fac52bad122639909f1e00bc63d95b97', './modules/Configurator/views/view.adminwizard.php' => '9480e2203342deabc404d9768bee258f', './modules/Configurator/views/view.fontmanager.php' => 'ce7094f56148716bbf592e6ee39c5c79', './modules/Configurator/controller.php' => 'b0a13efcd7259e5228b0e4e5153aa69c', @@ -4310,7 +4310,7 @@ $md5_string = array ( './modules/Users/views/view.detail.php' => 'ea79f6d76e0b9ac1650a018fca3f857a', './modules/Users/controller.php' => 'ab707e79b219d0f9a9302b7549cf9d8e', './modules/Users/SaveSignature.php' => 'cc2276e326ce4a58a4fce9b147302c4f', - './modules/Users/User.php' => 'e330d44d37c1321448195c4c8453df4b', + './modules/Users/User.php' => '314a230243dc35c3e1c22a43dbddc92b', './modules/Users/login.tpl' => 'ea831fdb2eaeac643665acb6cb947f33', './modules/Users/LoggedOut.tpl' => '56f709612a02e111d2411a771b11cd80', './modules/Users/SaveTimezone.php' => '3a27e5b03cbb1a9501401521dd2c1168', @@ -4425,25 +4425,25 @@ $md5_string = array ( './modules/UpgradeWizard/deleteCache.php' => 'df77658b8c5c1c86badb998120ab73e5', './modules/UpgradeWizard/SILENTUPGRADE.txt' => '8bc2c883f98135447095081ef933a04e', './modules/UpgradeWizard/populateColumns.php' => 'e9a77b423f33e94e6c2e8664293e2a4b', - './modules/UpgradeWizard/preflight.php' => 'f54a095ddbbf38c82e613992573e30d0', + './modules/UpgradeWizard/preflight.php' => '3c63bfe2aee6be5c1f7684c3f680f1a1', './modules/UpgradeWizard/silentUpgrade_dce_step1.php' => 'e0c3c8dc26626e9e633b5072dd5c854d', './modules/UpgradeWizard/tpls/layoutsMerge.tpl' => '75425a4a3b20b5dadd5e6e9601324c59', './modules/UpgradeWizard/start.php' => '46d768e67728644f5a312b3a7ad081c7', './modules/UpgradeWizard/Menu.php' => '43d8984853b46c9211f4e9a1481476e1', './modules/UpgradeWizard/upload.php' => '9ba05618220928f7964f42446c8ffff9', - './modules/UpgradeWizard/uw_ajax.php' => '8ed909021c2e338d0a185d01fa046a80', + './modules/UpgradeWizard/uw_ajax.php' => '85d28ba59fbe4e471979fa055382d584', './modules/UpgradeWizard/commitJson.php' => 'e02a21bb4ce00448e6bbb98526f860dd', - './modules/UpgradeWizard/UpgradeRemoval.php' => 'dafb5c6a72582cf510bca521d1c1bcb6', - './modules/UpgradeWizard/silentUpgrade_step2.php' => 'a8394b5b6de525b860fcc88b786ca115', + './modules/UpgradeWizard/UpgradeRemoval.php' => '39c70eb093074fc8ceb1298f76de8431', + './modules/UpgradeWizard/silentUpgrade_step2.php' => '3a8ce23ed431a0adcbaf92b04d1044d8', './modules/UpgradeWizard/UploadFileCheck.php' => 'e5d0bac07ff5bb02ffaf9db0b605c9f4', - './modules/UpgradeWizard/silentUpgrade_dce_step2.php' => '6ff56d8935422615d4a5d3cb078b6e40', + './modules/UpgradeWizard/silentUpgrade_dce_step2.php' => '9d2d8812126b2775814cf554f286c5f1', './modules/UpgradeWizard/layouts.php' => '8e4ae4f83d7825ddb7dca7ef2dfc62b3', './modules/UpgradeWizard/uw_emptyFunctions.php' => '81001e5fc9970324677c2b084052eace', - './modules/UpgradeWizard/commit.php' => '95151a7c632a6f3b8afea1afdd9ec077', + './modules/UpgradeWizard/commit.php' => '26c3efd7dbf0b1d7f2e2985a0dbe018a', './modules/UpgradeWizard/processing.gif' => 'd7c43fc19181ee59862601bfce100b41', './modules/UpgradeWizard/systemCheckJson.php' => '1b3ca3638039d16eab4dc010373effcd', - './modules/UpgradeWizard/end.php' => '156a8eec0106685ba60de86190381f0b', - './modules/UpgradeWizard/uw_utils.php' => '30fc0f5f974afea027b84d86b7da3310', + './modules/UpgradeWizard/end.php' => '2863d38052cefd49d911cb47f4fce71d', + './modules/UpgradeWizard/uw_utils.php' => '61a38e467f234fc7a964f81b6da66539', './modules/UpgradeWizard/preflightJson.php' => 'f9430751b95094f6d831f98fbaed9d80', './modules/UpgradeWizard/upgradeTimeCounter.php' => '13650e724da4e4fe127bae4a8073565c', './modules/UpgradeWizard/uw_files.php' => 'a874d9aca1246f5125cb8007e9a9364a', @@ -4456,11 +4456,11 @@ $md5_string = array ( './modules/UpgradeWizard/SugarMerge/EditViewMerge.php' => 'f888204f91ba43aa33a10303a5201cb8', './modules/UpgradeWizard/upgradeMetaHelper.php' => 'e8ec7f254fdb515c8e519d4535c3954d', './modules/UpgradeWizard/cancel.php' => '97d22fbe214ea672250b63389101320f', - './modules/UpgradeWizard/index.php' => '2e05260dc2035a5b5ea0bc24154cd434', + './modules/UpgradeWizard/index.php' => 'daa91ea1645fa7e9ab758a07d72501f1', './modules/UpgradeWizard/language/en_us.lang.php' => '30b9ca62507c02ea4cfc6392320dc6d3', './modules/UpgradeWizard/uw_main.tpl' => '9151371cd86f8d5781f3de7586f89437', - './modules/UpgradeWizard/silentUpgrade.php' => '7164ea2f72f43f71aa0fb787f69923f2', - './modules/UpgradeWizard/silentUpgrade_step1.php' => '409101acf1c53e3bfea30ed21c714717', + './modules/UpgradeWizard/silentUpgrade.php' => 'd2107446b635baf47ea51f83c3bad60f', + './modules/UpgradeWizard/silentUpgrade_step1.php' => '97402947f36e9e276e65db5e9c2ffd8d', './modules/UpgradeWizard/systemCheck.php' => '1e9941dbb5ecbe1cc3220b5dea998030', './modules/CampaignLog/Menu.php' => 'b76d9693b31806b29d1c9d2ac554c4d3', './modules/CampaignLog/vardefs.php' => '3c7fe72e50e32f9ff6e59a651f868ca0', @@ -4476,7 +4476,7 @@ $md5_string = array ( './modules/UserPreferences/index.php' => '903eebcc2f8a7d04d245821c5f13121f', './modules/UserPreferences/UserPreference.php' => '3445d8d3dee076a46facefe75647f5b6', './modules/Calls/CallHelper.php' => 'b351db4a49e4b47b518a04e4b20c504f', - './modules/Calls/Save.php' => '89bcb06dff3026f3627692ee1616d86a', + './modules/Calls/Save.php' => 'f9b6acd033f28dfe5aee61b8fb21ccbc', './modules/Calls/tpls/footer.tpl' => '7c4a89f076f85e253dcfa064d1a86ae3', './modules/Calls/tpls/QuickCreate.tpl' => '83609a9e601a5599dc3f3d2674665941', './modules/Calls/tpls/detailHeader.tpl' => '80c5550af52dc424831101182a9a0dce', @@ -4546,7 +4546,7 @@ $md5_string = array ( './modules/Connectors/connectors/sources/ext/rest/linkedin/language/en_us.lang.php' => '96a61d905c5f567917ff0a2ddc540185', './modules/Connectors/connectors/sources/ext/rest/insideview/config.php' => 'c92b8816212c0ef5203a9c19676fb193', './modules/Connectors/connectors/sources/ext/rest/insideview/InsideViewLogicHook.php' => '9ea893764bea3c7ef9007e9c523a41cc', - './modules/Connectors/connectors/sources/ext/rest/insideview/tpls/InsideView.tpl' => '6fb1a8d4171a47561ca474f7fcc164a4', + './modules/Connectors/connectors/sources/ext/rest/insideview/tpls/InsideView.tpl' => 'ad9b20d00156b1ae043fb6f9a16f3046', './modules/Connectors/connectors/sources/ext/rest/insideview/images/insideview.png' => 'b94d9483f486e0f53b3d98c6d04bd9f6', './modules/Connectors/connectors/sources/ext/rest/insideview/images/insideview_collapsed.png' => 'dc728b8cb2023847a28eb54a06c4d78e', './modules/Connectors/connectors/sources/ext/rest/insideview/images/insideview_expanded.png' => 'db7e5e84b7891adaed90dfd211338959', @@ -4723,7 +4723,7 @@ $md5_string = array ( './modules/Employees/views/view.edit.php' => 'dfa544fca99d42d2ec4e21af1b4d10c7', './modules/Employees/views/view.detail.php' => '755840909fe611ca102dc256b22e8777', './modules/Employees/controller.php' => 'c364dd30c16977791c985bc52698a97b', - './modules/Employees/EmployeesSearchForm.php' => '81b214b49b93923bf432d6b49445cf25', + './modules/Employees/EmployeesSearchForm.php' => '746e5a0acc150624f5e36c1af5d3d924', './modules/Employees/field_arrays.php' => '01119ad0d1c31523e44c8012e736ad70', './modules/Employees/metadata/searchdefs.php' => '770e2e9664317f5808351d83750e9b85', './modules/Employees/metadata/quickcreatedefs.php' => '90d87adecd90ca756fd1d52772c0ae59', @@ -4909,9 +4909,9 @@ $md5_string = array ( './modules/Import/vardefs.php' => '60cff61c52c1283ffe7dd161c28c074a', './modules/Import/ImportDuplicateCheck.php' => 'db288c59aec0610a8a344b3557b554e2', './modules/Import/ImportFieldSanitize.php' => 'd32a76f0cabb2f5dba570ae8b0d440e3', - './modules/Import/Importer.php' => 'f4ab99e7a716228d8bfa6a220bc6a1ba', + './modules/Import/Importer.php' => '7bfe2c610f410ed4e073053c65a50f8e', './modules/Import/views/view.dupcheck.php' => '80fded0509056a60cb59280a656b4e7d', - './modules/Import/views/view.confirm.php' => '66c9964b3c6cbffcbe05bf18b14b8948', + './modules/Import/views/view.confirm.php' => 'f6af955c2ea94efbda534dba9ab6acc4', './modules/Import/views/view.step2.php' => '0d92e6b7b74f46b33ad4764cc10bbb4a', './modules/Import/views/ImportListView.php' => '8a86c159a94446b315785c4ca0f8fa25', './modules/Import/views/view.step4.php' => '2759ba63cac39f2d75fa521bbc9c2b3d', @@ -4923,12 +4923,12 @@ $md5_string = array ( './modules/Import/views/view.step3.php' => 'fe493834f72ac6fa5da8cb1d7f61ae1b', './modules/Import/views/view.error.php' => '27af21ad339434f78abc51a28c8a6f0b', './modules/Import/controller.php' => 'ec75d24cc37cc2b6528f9d2c316aa537', - './modules/Import/CsvAutoDetect.php' => '0388c726dd7ffdcd44190eb1aaac9aad', + './modules/Import/CsvAutoDetect.php' => 'ad545d17d77e88b4d8c15b8cded2b626', './modules/Import/ImportCacheFiles.php' => '8847d29eafee0b588ce907e6ae498743', './modules/Import/language/en_us.lang.php' => '82467768109f364d7cfe422a25de1c23', './modules/Import/sources/ImportDataSource.php' => '3736d8c8e5edd94906477f7de408c7e0', './modules/Import/sources/ExternalSourceEAPMAdapter.php' => '3225e6643f00846460a653872e652e25', - './modules/Import/sources/ImportFile.php' => 'eb0e3f87a1844350535ec4cc74b6398b', + './modules/Import/sources/ImportFile.php' => '642ae62f7c9582eb31747a1bf879f893', './modules/Import/maps/ImportMapOther.php' => '81aeac351009f118c50481daf8e096a9', './modules/Import/maps/ImportMapTab.php' => 'b9a4fd5a189c914c02f1b5bb66d6debb', './modules/Import/maps/ImportMapCsv.php' => 'cbe41f5e574067e60ae6098aa1afeacf', @@ -4986,7 +4986,7 @@ $md5_string = array ( './modules/Project/ProjectQuickCreate.php' => '0b45e5508713bd8397d38194ed2743ae', './modules/Meetings/jsclass_scheduler.js' => 'b1364e950a651985cf5523353211bfde', './modules/Meetings/duration_dependency.js' => '68137bd02d0b9cff86e857ffe2d758a8', - './modules/Meetings/Save.php' => '82a55c7692d587e20236135aca956f43', + './modules/Meetings/Save.php' => 'e9b294c4e8a2e4a293c957a386ba4705', './modules/Meetings/tpls/footer.tpl' => 'e0a83373e481789efd51511c01acd3e6', './modules/Meetings/tpls/header.tpl' => 'd2ecbc05b238906de6b4dfd3c0e06129', './modules/Meetings/tpls/QuickCreate.tpl' => '713e1113ca260e860e7f8b68085caec9', @@ -5083,7 +5083,7 @@ $md5_string = array ( './modules/Administration/RebuildDashlets.php' => '12665a69f23f34d4b92bb222baf2b6da', './modules/Administration/UpgradeIISAccess.php' => 'fa50ac29309a95d7a325c1ec7444013c', './modules/Administration/updateTimezonePrefs.php' => '46aea97ac223ee9e40328b39696164b3', - './modules/Administration/updater_utils.php' => 'ca5c63f9b7d4590abfed013b6f3ec89f', + './modules/Administration/updater_utils.php' => '73c4060c575586bc77f8c5b3a4b24971', './modules/Administration/DiagnosticDownload.php' => '5a09f54e964d71d49211bde5cb49a449', './modules/Administration/DisplayWarnings.php' => 'a213dc06752ed24dd25310f1c492b5ef', './modules/Administration/RepairJSFile.php' => 'f8cf5338d5659ea27a2662d44150b7fd', @@ -5100,7 +5100,7 @@ $md5_string = array ( './modules/Administration/PasswordManager.php' => '11ef65dbd8f4ef09c813483507fff134', './modules/Administration/Locale.tpl' => 'bb9afeb5e9db4919bdcd1808cabf2999', './modules/Administration/RebuildExpressionPlugins.php' => 'a926f301737fb11ba1a71673eb51424c', - './modules/Administration/language/en_us.lang.php' => '9e652f62a573f42b00177b4538e9db37', + './modules/Administration/language/en_us.lang.php' => '75664cd0f6f24a6491b34198f05451d9', './modules/Administration/UpgradeHistory.php' => 'a9ec8a2612a5d3404e974d53de8b4311', './modules/Administration/upgrade_custom_relationships.php' => 'fe1239f73daa16e6a8b7f3170c8cad23', './modules/Administration/ImportCustomFieldStructure.php' => 'fd2baf8134f11375810c5c4daa52c889', @@ -5212,7 +5212,7 @@ $md5_string = array ( './modules/Home/sitemap.tpl' => '3619e568a9ad07ab4b5e35dd3780b298', './modules/Home/views/view.tour.php' => '3dc3f80c5aaa969b148c575a8ba7d644', './modules/Home/views/view.additionaldetailsretrieve.php' => 'b0ca3fbad18270986844993c737e49d3', - './modules/Home/views/view.list.php' => 'ddcaf125190670eb41676357c6e8f903', + './modules/Home/views/view.list.php' => 'e1b021326932f91bec727610c7d89c79', './modules/Home/views/view.modulelistmenu.php' => 'a1a8df55d774b049f8728fd70d8de48c', './modules/Home/SubpanelCreates.php' => '798fa6f7a2355b85c7a2ce071354cac5', './modules/Home/PopupSugar.php' => '2f0b676cc4df0d744543bf69851dc2e5', @@ -5268,15 +5268,15 @@ $md5_string = array ( './modules/Home/AddToFavorites.php' => '2d1240598be9e7f74c497fe3a6578868', './modules/Home/TrainingPortal.php' => '1ec4a300d6dfd51f80eb642eee05f0f0', './cache/include/javascript/sugar_grp_jsolait.js' => '9aced6d7d2669515690f61e506834ed9', - './cache/include/javascript/sugar_grp_quickcomp.js' => 'feb5c26dd77dd0b333f3b6660b75d792', - './cache/include/javascript/sugar_grp_emails.js' => '773266de297a33b88e3d85731f3cafce', + './cache/include/javascript/sugar_grp_quickcomp.js' => '25802810d67410c2e15ce45d672ec559', + './cache/include/javascript/sugar_grp_emails.js' => 'ae0c60cd858ee7c4f1444e80d0720777', './cache/include/javascript/sugar_grp_yui2.js' => '53c8d4d026a0adc7ea775e6488245de5', './cache/include/javascript/sugar_grp_yui_widgets.css' => '17f5b268fda1a8a3e27b41ebefe4d408', './cache/include/javascript/sugar_grp_yui_widgets.js' => '35fe43cba48260f75b169dd1af5c64fe', './cache/include/javascript/sugar_grp1_yui.js' => '9c3853420e26cad638181691de71e991', './cache/include/javascript/sugar_field_grp.js' => '339b3b1d92f554dbac7fad410360c8f1', './cache/include/javascript/sugar_grp1_jquery.js' => '9c164fdc669d8af0c3e11559154a214c', - './cache/include/javascript/sugar_grp1.js' => 'a636431c8995f7ba5e714e252f180e14', + './cache/include/javascript/sugar_grp1.js' => '134d2e89bbcb33418ac8b67a83c5ef6e', './cache/layout/index.html' => '9cd784063d39b18d308932c28c385853', './cache/images/index.html' => '9cd784063d39b18d308932c28c385853', './cache/xml/index.html' => '9cd784063d39b18d308932c28c385853', @@ -5347,7 +5347,7 @@ $md5_string = array ( './metadata/prospect_lists_prospectsMetaData.php' => 'fe3dc7d813428ca0fa774884a88ef5c4', './metadata/inboundEmail_autoreplyMetaData.php' => '7c670a62c7142827bbdf675c8b4be221', './metadata/acl_roles_actionsMetaData.php' => 'a3446107943a271bf6e329a80deb06e8', - './sugar_version.php' => '3ccf4839df9359186ce630aa45dedf47', + './sugar_version.php' => '66307b116057ea07ea1bcf17606b2f02', './cron.php' => '96a6fd7893809132e902086e77dde30c', './log4php/LoggerManager.php' => 'fa34194306cd50c01b71d8d5060ee362', './TreeData.php' => '7040af43bf01c450f4e225ece5e3f30c', @@ -5741,6 +5741,7 @@ $md5_string = array ( './themes/default/images/tentative_inline.gif' => '7ce50732e43bbdde45b954694b14ec4b', './themes/default/images/icon_Charts_Funnel.gif' => 'fbbeb7f36751a847b43cbc29042bef83', './themes/default/images/info_inline.gif' => '9db230bae1c0ecdf0052806eb1b684f0', + './themes/default/images/IBMSmartCloud_image_inline.png' => '005c572caac9f9af6e722ae7246299f5', './themes/default/images/icon_JotPad.gif' => '1e5d01a07e4f988611af6677a037f318', './themes/default/images/pdf_logo.jpg' => '5fc1b97a4344bc5e5644763c80b26c6f', './themes/default/images/OpportunityReports.gif' => '7d7c840292ae89a66e97afa3e68df9a7', @@ -6001,7 +6002,7 @@ $md5_string = array ( './themes/Sugar5/js/style.js' => '729f0fb1f3ce59288e4e61014293a7b9', './themes/Sugar5/tpls/_companyLogo.tpl' => 'aec162121df756deaeb8b2b24a877b65', './themes/Sugar5/tpls/footer.tpl' => 'fbb48d80817323aacb010b920bd5921d', - './themes/Sugar5/tpls/header.tpl' => 'f4f2a382c900e9186faba11ce64803c7', + './themes/Sugar5/tpls/header.tpl' => 'df33e653712e8364dda80361657ca120', './themes/Sugar5/tpls/_head.tpl' => '17375ddb7a0b3aef07dabf1af258356d', './themes/Sugar5/tpls/_welcome.tpl' => 'a758aa0298fc3a281dc9906e6f5ca48f', './themes/Sugar5/tpls/_headerModuleList.tpl' => 'efa0fa3a938be9be6735ea564a546c31', @@ -6648,7 +6649,7 @@ $md5_string = array ( './jssource/src_files/service/utils/SugarRest.js' => '25bb6ba045022c695e3b3582f4a00ce6', './jssource/src_files/include/MySugar/javascript/MySugar.js' => '33dea628a26df11e8d89eb78f4684db4', './jssource/src_files/include/SugarEmailAddress/SugarEmailAddress.js' => '38bed07b58bbd3f74ab81c169089650e', - './jssource/src_files/include/javascript/ajaxUI.js' => '1995926ed3a525e197d37062b9adfdb1', + './jssource/src_files/include/javascript/ajaxUI.js' => 'cc7a92e2ca120a2e236b8ce6970c3531', './jssource/src_files/include/javascript/calendar.js' => '8a64349697d88a99b897514e60afcb4d', './jssource/src_files/include/javascript/iscroll.js' => 'b6c232e3c54b2a1320b22c7ad920c842', './jssource/src_files/include/javascript/include.js' => 'b120bd1c521be781c2dee60e719fb15d', @@ -7507,14 +7508,14 @@ $md5_string = array ( './install/license.php' => '00d8b0f04104eaa3cab95f1d1b26fb33', './install/installType.php' => 'f5b3025e3996ad16b8218d3b1424e389', './install/download_modules.php' => 'a1625e32936a669709b617a609c5a7ba', - './download.php' => '24c458db455efd69a3f135ace60ea02c', + './download.php' => '30af6e601d7accd8a408c0ef131e5964', './campaign_trackerv2.php' => 'd474548736ceaf4275064094e5aa798b', './install.php' => 'a4e2e1c845b63962dfa89cd8ff50c9f7', './soap/SoapDeprecated.php' => '309e512eb7592c910a824f991869c4b4', './soap/SoapError.php' => '10185ef40a2442914fa8707591cf7b9d', - './soap/SoapHelperFunctions.php' => '0cda7e6e106832d2b04dc2ce607ea614', + './soap/SoapHelperFunctions.php' => '1901df0d5a654d5fdb810fec57f2d5ca', './soap/SoapPortalHelper.php' => '302d5e90cf56d708b6d3f087fec2e72f', - './soap/SoapSugarUsers.php' => '7e37b94b10e10b8f863831b6f3652575', + './soap/SoapSugarUsers.php' => '98b0fe604fe74b3660094f287be8d9e9', './soap/SoapStudio.php' => '0fd81758942a52940c119f3afa134fcd', './soap/SoapRelationshipHelper.php' => '03cfb58253ac766d90ddf57d38d36afe', './soap/SoapErrorDefinitions.php' => '0ba2c58cdbdaec479860537420e4cf30', diff --git a/include/DetailView/DetailView2.php b/include/DetailView/DetailView2.php index 4ffcd358..5f7ba5a6 100644 --- a/include/DetailView/DetailView2.php +++ b/include/DetailView/DetailView2.php @@ -74,7 +74,7 @@ class DetailView2 extends EditView $this->showVCRControl = !$GLOBALS['sugar_config']['disable_vcr']; } if(!empty($this->metadataFile) && file_exists($this->metadataFile)){ - require_once($this->metadataFile); + require($this->metadataFile); }else { //If file doesn't exist we create a best guess if(!file_exists("modules/$this->module/metadata/detailviewdefs.php") && @@ -98,11 +98,11 @@ class DetailView2 extends EditView echo $error; die(); } - require_once("modules/$this->module/metadata/detailviewdefs.php"); + require("modules/$this->module/metadata/detailviewdefs.php"); } $this->defs = $viewdefs[$this->module][$this->view]; } } -?> \ No newline at end of file +?> diff --git a/include/EditView/EditView2.php b/include/EditView/EditView2.php index ab9e46b4..387e615b 100644 --- a/include/EditView/EditView2.php +++ b/include/EditView/EditView2.php @@ -149,7 +149,7 @@ class EditView die(); } - require_once("modules/$this->module/metadata/editviewdefs.php"); + require("modules/$this->module/metadata/editviewdefs.php"); } $this->defs = $viewdefs[$this->module][$this->view]; diff --git a/include/ListView/ListViewData.php b/include/ListView/ListViewData.php index 1de25c20..79a55868 100644 --- a/include/ListView/ListViewData.php +++ b/include/ListView/ListViewData.php @@ -436,11 +436,14 @@ class ListViewData { $pageData['tag'][$dataIndex] = $pageData['tag'][$idIndex[$row[$id_field]][0]]; } $data[$dataIndex] = $temp->get_list_view_data($filter_fields); - $pageData['rowAccess'][$dataIndex] = array('view' => $temp->ACLAccess('DetailView'), 'edit' => $temp->ACLAccess('EditView')); - $additionalDetailsAllow = $this->additionalDetails && $temp->ACLAccess('DetailView') && (file_exists('modules/' . $temp->module_dir . '/metadata/additionalDetails.php') || file_exists('custom/modules/' . $temp->module_dir . '/metadata/additionalDetails.php')); - //if($additionalDetailsAllow) $pageData['additionalDetails'] = array(); - $additionalDetailsEdit = $temp->ACLAccess('EditView'); - if($additionalDetailsAllow) { + $detailViewAccess = $temp->ACLAccess('DetailView'); + $editViewAccess = $temp->ACLAccess('EditView'); + $pageData['rowAccess'][$dataIndex] = array('view' => $detailViewAccess, 'edit' => $editViewAccess); + $additionalDetailsAllow = $this->additionalDetails && $detailViewAccess && (file_exists( + 'modules/' . $temp->module_dir . '/metadata/additionalDetails.php' + ) || file_exists('custom/modules/' . $temp->module_dir . '/metadata/additionalDetails.php')); + $additionalDetailsEdit = $editViewAccess; + if($additionalDetailsAllow) { if($this->additionalDetailsAjax) { $ar = $this->getAdditionalDetailsAjax($data[$dataIndex]['ID']); } diff --git a/include/MVC/View/views/view.popup.php b/include/MVC/View/views/view.popup.php index d4d94b48..4c98d1a7 100644 --- a/include/MVC/View/views/view.popup.php +++ b/include/MVC/View/views/view.popup.php @@ -35,6 +35,7 @@ ********************************************************************************/ class ViewPopup extends SugarView{ + protected $override_popup = array(); var $type ='list'; function ViewPopup(){ parent::SugarView(); @@ -151,7 +152,23 @@ class ViewPopup extends SugarView{ } $popup->massUpdateData = $massUpdateData; - $popup->setup('include/Popups/tpls/PopupGeneric.tpl'); + $tpl = 'include/Popups/tpls/PopupGeneric.tpl'; + if(file_exists($this->getCustomFilePathIfExists("modules/{$this->module}/tpls/popupGeneric.tpl"))) + { + $tpl = $this->getCustomFilePathIfExists("modules/{$this->module}/tpls/popupGeneric.tpl"); + } + + if(file_exists($this->getCustomFilePathIfExists("modules/{$this->module}/tpls/popupHeader.tpl"))) + { + $popup->headerTpl = $this->getCustomFilePathIfExists("modules/{$this->module}/tpls/popupHeader.tpl"); + } + + if(file_exists($this->getCustomFilePathIfExists("modules/{$this->module}/tpls/popupFooter.tpl"))) + { + $popup->footerTpl = $this->getCustomFilePathIfExists("modules/{$this->module}/tpls/popupFooter.tpl"); + } + + $popup->setup($tpl); //We should at this point show the header and javascript even if to_pdf is true. //The insert_popup_header javascript is incomplete and shouldn't be relied on. @@ -163,6 +180,10 @@ class ViewPopup extends SugarView{ $this->_displayJavascript(); } insert_popup_header(null, false); + if(isset($this->override_popup['template_data']) && is_array($this->override_popup['template_data'])) + { + $popup->th->ss->assign($this->override_popup['template_data']); + } echo $popup->display(); }else{ diff --git a/include/Popups/PopupSmarty.php b/include/Popups/PopupSmarty.php index ae91db2d..6505de41 100644 --- a/include/Popups/PopupSmarty.php +++ b/include/Popups/PopupSmarty.php @@ -76,6 +76,8 @@ class PopupSmarty extends ListViewSmarty{ $this->module = $module; $this->searchForm = new SearchForm($this->seed, $this->module); $this->th->deleteTemplate($module, $this->view); + $this->headerTpl = 'include/Popups/tpls/header.tpl'; + $this->footerTpl = 'include/Popups/tpls/footer.tpl'; } @@ -230,8 +232,8 @@ class PopupSmarty extends ListViewSmarty{ $json = getJSONobj(); $this->th->ss->assign('jsLang', $jsLang); $this->th->ss->assign('lang', substr($GLOBALS['current_language'], 0, 2)); - $this->th->ss->assign('headerTpl', 'include/Popups/tpls/header.tpl'); - $this->th->ss->assign('footerTpl', 'include/Popups/tpls/footer.tpl'); + $this->th->ss->assign('headerTpl', $this->headerTpl); + $this->th->ss->assign('footerTpl', $this->footerTpl); $this->th->ss->assign('ASSOCIATED_JAVASCRIPT_DATA', 'var associated_javascript_data = '.$json->encode($associated_row_data). '; var is_show_fullname = '.$is_show_fullname.';'); $this->th->ss->assign('module', $this->seed->module_dir); $request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data']; diff --git a/include/SugarCharts/SugarChart.php b/include/SugarCharts/SugarChart.php index a0276ab1..e81d7430 100644 --- a/include/SugarCharts/SugarChart.php +++ b/include/SugarCharts/SugarChart.php @@ -652,8 +652,9 @@ class SugarChart { $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("xml"); + create_cache_directory($filename_temp); } return $filename; diff --git a/include/SugarEmailAddress/SugarEmailAddress.php b/include/SugarEmailAddress/SugarEmailAddress.php index 4a919864..06f662a4 100644 --- a/include/SugarEmailAddress/SugarEmailAddress.php +++ b/include/SugarEmailAddress/SugarEmailAddress.php @@ -62,6 +62,8 @@ class SugarEmailAddress extends SugarBean { var $view = ''; private $stateBeforeWorkflow; + public $email_address; + static $count = 0; /** diff --git a/include/SugarFields/Fields/Relate/DetailView.tpl b/include/SugarFields/Fields/Relate/DetailView.tpl index 54bd4aa1..74ae18e0 100644 --- a/include/SugarFields/Fields/Relate/DetailView.tpl +++ b/include/SugarFields/Fields/Relate/DetailView.tpl @@ -40,7 +40,7 @@ {capture assign="detail_url"}index.php?module={{$vardef.module}}&action=DetailView&record={{sugarvar memberName='vardef.id_name' key='value'}}{/capture} {/if} {{/if}} -{{sugarvar key='value'}} +{{sugarvar key='value'}} {{if !$nolink && !empty($vardef.id_name)}} {if !empty({{sugarvar memberName='vardef.id_name' key='value' string='true'}})}{/if} {{/if}} diff --git a/include/SugarFields/Fields/Relate/SugarFieldRelate.php b/include/SugarFields/Fields/Relate/SugarFieldRelate.php index dd706ea0..31ad93bb 100644 --- a/include/SugarFields/Fields/Relate/SugarFieldRelate.php +++ b/include/SugarFields/Fields/Relate/SugarFieldRelate.php @@ -158,7 +158,6 @@ class SugarFieldRelate extends SugarFieldBase { } function getPopupViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex){ - $displayParams['clearOnly'] = true; return $this->getSearchViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex); } diff --git a/include/SugarObjects/templates/person/Person.php b/include/SugarObjects/templates/person/Person.php index db7aa13b..dca2a8bb 100644 --- a/include/SugarObjects/templates/person/Person.php +++ b/include/SugarObjects/templates/person/Person.php @@ -44,7 +44,12 @@ class Person extends Basic * @var bool controls whether or not to invoke the getLocalFormatttedName method with title and salutation */ var $createLocaleFormattedName = true; - + + /** + * @var Link2 + */ + public $email_addresses; + public function Person() { parent::Basic(); diff --git a/include/SugarTheme/SugarTheme.php b/include/SugarTheme/SugarTheme.php index 5ad0ae09..5b1e287f 100644 --- a/include/SugarTheme/SugarTheme.php +++ b/include/SugarTheme/SugarTheme.php @@ -1114,9 +1114,10 @@ class SugarThemeRegistry ) { // make sure the we know the sugar version - if ( !isset($GLOBALS['sugar_version']) ) { + global $sugar_version; + if (empty($sugar_version)) + { include('sugar_version.php'); - $GLOBALS['sugar_version'] = $sugar_version; } // Assume theme is designed for 5.5.x if not specified otherwise diff --git a/include/clean.php b/include/clean.php index 2bb3878e..75e8070d 100644 --- a/include/clean.php +++ b/include/clean.php @@ -104,10 +104,12 @@ class SugarCleaner // for style //$config->set('Filter.ExtractStyleBlocks', true); $config->set('Filter.ExtractStyleBlocks.TidyImpl', false); // can't use csstidy, GPL - // for object - $config->set('HTML.SafeObject', true); - // for embed - $config->set('HTML.SafeEmbed', true); + if(!empty($GLOBALS['sugar_config']['html_allow_objects'])) { + // for object + $config->set('HTML.SafeObject', true); + // for embed + $config->set('HTML.SafeEmbed', true); + } $config->set('Output.FlashCompat', true); // for iframe and xmp $config->set('Filter.Custom', array(new HTMLPurifier_Filter_Xmp())); diff --git a/include/database/DBManager.php b/include/database/DBManager.php index c95333ce..e1315fce 100644 --- a/include/database/DBManager.php +++ b/include/database/DBManager.php @@ -2786,11 +2786,9 @@ protected function checkQuery($sql, $object_name = false) $values['field_name']= $this->massageValue($changes['field_name'], $fieldDefs['field_name']); $values['data_type'] = $this->massageValue($changes['data_type'], $fieldDefs['data_type']); if ($changes['data_type']=='text') { - $bean->fetched_row[$changes['field_name']]=$changes['after'];; $values['before_value_text'] = $this->massageValue($changes['before'], $fieldDefs['before_value_text']); $values['after_value_text'] = $this->massageValue($changes['after'], $fieldDefs['after_value_text']); } else { - $bean->fetched_row[$changes['field_name']]=$changes['after'];; $values['before_value_string'] = $this->massageValue($changes['before'], $fieldDefs['before_value_string']); $values['after_value_string'] = $this->massageValue($changes['after'], $fieldDefs['after_value_string']); } @@ -2816,17 +2814,17 @@ protected function checkQuery($sql, $object_name = false) } /** - * Uses the audit enabled fields array to find fields whose value has changed. + * Finds fields whose value has changed. * The before and after values are stored in the bean. * Uses $bean->fetched_row && $bean->fetched_rel_row to compare * * @param SugarBean $bean Sugarbean instance that was changed + * @param array|null $field_filter Array of filter names to be inspected (NULL means all fields) * @return array */ - public function getDataChanges(SugarBean &$bean) + public function getDataChanges(SugarBean &$bean, array $field_filter = null) { - $changed_values=array(); - $audit_fields=$bean->getAuditEnabledFieldDefinitions(); + $changed_values=array(); $fetched_row = array(); if (is_array($bean->fetched_row)) @@ -2834,52 +2832,80 @@ protected function checkQuery($sql, $object_name = false) $fetched_row = array_merge($bean->fetched_row, $bean->fetched_rel_row); } - if ($fetched_row && is_array($audit_fields) and count($audit_fields) > 0) { - foreach ($audit_fields as $field=>$properties) { - if (array_key_exists($field, $fetched_row)) { - $before_value = $fetched_row[$field]; - $after_value=$bean->$field; - if (isset($properties['type'])) { - $field_type=$properties['type']; - } else { - if (isset($properties['dbType'])) - $field_type=$properties['dbType']; - else if(isset($properties['data_type'])) - $field_type=$properties['data_type']; - else - $field_type=$properties['dbtype']; - } + if ($fetched_row) { - //Because of bug #25078(sqlserver haven't 'date' type, trim extra "00:00:00" when insert into *_cstm table). - // so when we read the audit datetime field from sqlserver, we have to replace the extra "00:00:00" again. - if(!empty($field_type) && $field_type == 'date'){ - $before_value = $this->fromConvert($before_value , $field_type); - } - //if the type and values match, do nothing. - if (!($this->_emptyValue($before_value,$field_type) && $this->_emptyValue($after_value,$field_type))) { - if (trim($before_value) !== trim($after_value)) { - // Bug #42475: Don't directly compare numeric values, instead do the subtract and see if the comparison comes out to be "close enough", it is necessary for floating point numbers. - // Manual merge of fix 95727f2eed44852f1b6bce9a9eccbe065fe6249f from DBHelper - // This fix also fixes Bug #44624 in a more generic way and therefore eliminates the need for fix 0a55125b281c4bee87eb347709af462715f33d2d in DBHelper - if (!($this->isNumericType($field_type) && - abs( - 2*((trim($before_value)+0)-(trim($after_value)+0))/((trim($before_value)+0)+(trim($after_value)+0)) // Using relative difference so that it also works for other numerical types besides currencies - )<0.0000000001)) { // Smaller than 10E-10 - if (!($this->isBooleanType($field_type) && ($this->_getBooleanValue($before_value)== $this->_getBooleanValue($after_value)))) { - $changed_values[$field]=array('field_name'=>$field, - 'data_type'=>$field_type, - 'before'=>$before_value, - 'after'=>$after_value); - } - } - } - } - } + $field_defs = $bean->field_defs; + + if (is_array($field_filter)) { + $field_defs = array_intersect_key($field_defs, array_flip($field_filter)); + } + + // remove fields which do not present in fetched row + $field_defs = array_intersect_key($field_defs, $fetched_row); + + // remove fields which do not exist as bean property + $field_defs = array_intersect_key($field_defs, (array) $bean); + + foreach ($field_defs as $field => $properties) { + $before_value = $fetched_row[$field]; + $after_value=$bean->$field; + if (isset($properties['type'])) { + $field_type=$properties['type']; + } else { + if (isset($properties['dbType'])) { + $field_type=$properties['dbType']; + } + else if(isset($properties['data_type'])) { + $field_type=$properties['data_type']; + } + else { + $field_type=$properties['dbtype']; + } + } + + //Because of bug #25078(sqlserver haven't 'date' type, trim extra "00:00:00" when insert into *_cstm table). + // so when we read the audit datetime field from sqlserver, we have to replace the extra "00:00:00" again. + if(!empty($field_type) && $field_type == 'date'){ + $before_value = $this->fromConvert($before_value , $field_type); + } + //if the type and values match, do nothing. + if (!($this->_emptyValue($before_value,$field_type) && $this->_emptyValue($after_value,$field_type))) { + if (trim($before_value) !== trim($after_value)) { + // Bug #42475: Don't directly compare numeric values, instead do the subtract and see if the comparison comes out to be "close enough", it is necessary for floating point numbers. + // Manual merge of fix 95727f2eed44852f1b6bce9a9eccbe065fe6249f from DBHelper + // This fix also fixes Bug #44624 in a more generic way and therefore eliminates the need for fix 0a55125b281c4bee87eb347709af462715f33d2d in DBHelper + if (!($this->isNumericType($field_type) && + abs( + 2*((trim($before_value)+0)-(trim($after_value)+0))/((trim($before_value)+0)+(trim($after_value)+0)) // Using relative difference so that it also works for other numerical types besides currencies + )<0.0000000001)) { // Smaller than 10E-10 + if (!($this->isBooleanType($field_type) && ($this->_getBooleanValue($before_value)== $this->_getBooleanValue($after_value)))) { + $changed_values[$field]=array('field_name'=>$field, + 'data_type'=>$field_type, + 'before'=>$before_value, + 'after'=>$after_value); + } + } + } + } } } return $changed_values; } + /** + * Uses the audit enabled fields array to find fields whose value has changed. + * The before and after values are stored in the bean. + * Uses $bean->fetched_row && $bean->fetched_rel_row to compare + * + * @param SugarBean $bean Sugarbean instance that was changed + * @return array + */ + public function getAuditDataChanges(SugarBean $bean) + { + $audit_fields = $bean->getAuditEnabledFieldDefinitions(); + return $this->getDataChanges($bean, array_keys($audit_fields)); + } + /** * Setup FT indexing * @abstract diff --git a/include/export_utils.php b/include/export_utils.php index 41e8b5f2..4d993c79 100644 --- a/include/export_utils.php +++ b/include/export_utils.php @@ -407,8 +407,9 @@ function generateSearchWhere($module, $query) {//this function is similar with f //retrieve the export content $content = export($type, null, false, true); - //add details on removing the sample data - return $content . $app_strings['LBL_IMPORT_SAMPLE_FILE_TEXT']; + // Add a new row and add details on removing the sample data + // Our Importer will stop after he gets to the new row, ignoring the text below + return $content . "\n" . $app_strings['LBL_IMPORT_SAMPLE_FILE_TEXT']; } //this function will take in the bean and field mapping and return a proper value diff --git a/include/formbase.php b/include/formbase.php index 4072e502..9fdb2c25 100644 --- a/include/formbase.php +++ b/include/formbase.php @@ -127,11 +127,9 @@ function populateFromPost($prefix, &$focus, $skipRetrieve=false) { $focus->$field = $value; } } - return $focus; } - function add_hidden_elements($key, $value) { $elements = ''; diff --git a/include/javascript/ajaxUI.js b/include/javascript/ajaxUI.js index 671ea067..116bd867 100644 --- a/include/javascript/ajaxUI.js +++ b/include/javascript/ajaxUI.js @@ -80,7 +80,7 @@ return true;}else{if(typeof(YAHOO.util.Selector.query("input[type=submit]",form) form.submit();return false;}},cleanGlobals:function() {sqs_objects={};QSProcessedFieldsArray={};collection={};if(SUGAR.EmailAddressWidget){SUGAR.EmailAddressWidget.instances={};SUGAR.EmailAddressWidget.count={};} YAHOO.util.Event.removeListener(window,'resize');if(typeof(dialog)!='undefined'&&typeof(dialog.destroy)=='function'){dialog.destroy();delete dialog;}},firstLoad:function() -{var url=YAHOO.util.History.getBookmarkedState('ajaxUILoc');var aRegex=/action=([^&#]*)/.exec(window.location);var action=aRegex?aRegex[1]:false;var mRegex=/module=([^&#]*)/.exec(window.location);var module=mRegex?mRegex[1]:false;if(module!="ModuleBuilder") +{SUGAR.ajaxUI.menuFix=true;var url=YAHOO.util.History.getBookmarkedState('ajaxUILoc');var aRegex=/action=([^&#]*)/.exec(window.location);var action=aRegex?aRegex[1]:false;var mRegex=/module=([^&#]*)/.exec(window.location);var module=mRegex?mRegex[1]:false;if(module!="ModuleBuilder") {var go=url!=null||action=="ajaxui";url=url?url:'index.php?module=Home&action=index';YAHOO.util.History.register('ajaxUILoc',url,SUGAR.ajaxUI.go);YAHOO.util.History.initialize("ajaxUI-history-field","ajaxUI-history-iframe");SUGAR.ajaxUI.hist_loaded=true;if(go) SUGAR.ajaxUI.go(url);} SUGAR_callsInProgress--;},print:function() diff --git a/include/language/en_us.lang.php b/include/language/en_us.lang.php index c5b50512..8cfce2aa 100644 --- a/include/language/en_us.lang.php +++ b/include/language/en_us.lang.php @@ -2183,7 +2183,7 @@ $app_strings = array ( 'LBL_RELATED_CAMPAIGN' =>'Related campaign', 'LBL_ADD_ALL_LEAD_FIELDS' => 'Add All Fields', 'LBL_REMOVE_ALL_LEAD_FIELDS' => 'Remove All Fields', - 'LBL_ONLY_IMAGE_ATTACHMENT' => 'Only image type attachment can be embedded', + 'LBL_ONLY_IMAGE_ATTACHMENT' => 'Only the following supported image type attachments can be embedded: JPG, PNG.', 'LBL_REMOVE' => 'Remove', 'LBL_TRAINING' => 'Support', 'ERR_DATABASE_CONN_DROPPED'=>'Error executing a query. Possibly, your database dropped the connection. Please refresh this page, you may need to restart you web server.', @@ -2474,6 +2474,7 @@ $app_strings = array ( 'UPLOAD_ERROR_TEXT_SIZEINFO' => 'ERROR: There was an error during upload. Error code: {0} - {1}. The upload_maxsize is {2} ', 'UPLOAD_ERROR_HOME_TEXT' => 'ERROR: There was an error during your upload, please contact an administrator for help.', 'UPLOAD_MAXIMUM_EXCEEDED' => 'Size of Upload ({0} bytes) Exceeded Allowed Maximum: {1} bytes', + 'UPLOAD_REQUEST_ERROR' => 'An error has occured. Please refresh your page and try again.', //508 used Access Keys diff --git a/include/utils.php b/include/utils.php index d3085724..b90acd63 100644 --- a/include/utils.php +++ b/include/utils.php @@ -1549,13 +1549,15 @@ function get_select_options_with_id_separate_key ($label_list, $key_list, $selec /** * Call this method instead of die(). - * Then we call the die method with the error message that is passed in. + * We print the error message and then die with an appropriate + * exit code. */ -function sugar_die($error_message) +function sugar_die($error_message, $exit_code = 1) { global $focus; sugar_cleanup(); - die($error_message); + echo $error_message; + die($exit_code); } diff --git a/jssource/src_files/include/javascript/ajaxUI.js b/jssource/src_files/include/javascript/ajaxUI.js index bb97b8b2..3750d782 100644 --- a/jssource/src_files/include/javascript/ajaxUI.js +++ b/jssource/src_files/include/javascript/ajaxUI.js @@ -174,6 +174,7 @@ SUGAR.ajaxUI = { go : function(url) { + if(YAHOO.lang.trim(url) != "") { var con = YAHOO.util.Connect, ui = SUGAR.ajaxUI; @@ -301,6 +302,9 @@ SUGAR.ajaxUI = { }, firstLoad : function() { + // WebKit menu hack, to be used in theme style.js when setting superfish + SUGAR.ajaxUI.menuFix = true; + //Setup Browser History var url = YAHOO.util.History.getBookmarkedState('ajaxUILoc'); var aRegex = /action=([^&#]*)/.exec(window.location); diff --git a/modules/Administration/language/en_us.lang.php b/modules/Administration/language/en_us.lang.php index 68767a60..934bdb7d 100644 --- a/modules/Administration/language/en_us.lang.php +++ b/modules/Administration/language/en_us.lang.php @@ -1014,6 +1014,7 @@ $mod_strings = array ( 'ML_INVALID_ACTION_IN_MANIFEST'=>'Invalid action in your manifest:', 'ML_NO_MANIFEST'=>'This package does not contain a manifest', 'ML_INVALID_FUNCTION'=>'Invalid usage of a function ', +'ML_INVALID_METHOD'=>'Invalid usage of a reserved method name ', 'ML_INVALID_EXT'=>'Invalid file extension ', 'ML_ISSUES'=>'Issues', 'ML_MANIFEST_ISSUE'=>'Issue with the manifest', diff --git a/modules/Administration/updater_utils.php b/modules/Administration/updater_utils.php index 2c7a565b..955af917 100644 --- a/modules/Administration/updater_utils.php +++ b/modules/Administration/updater_utils.php @@ -391,7 +391,13 @@ function loginLicense(){ set_last_check_date_config_setting("$current_date_time"); include('sugar_version.php'); - if(!empty($version)&& count($version) == 1 && $version[0]['version'] > $sugar_version && is_admin($current_user)) + $newVersion = ''; + if (!empty($version) && count($version) == 1) + { + $newVersion = $version[0]['version']; + } + + if (version_compare($newVersion, $sugar_version, '>') && is_admin($current_user)) { //set session variables. $_SESSION['available_version']=$version[0]['version']; @@ -403,12 +409,3 @@ function loginLicense(){ } - - - - - - - - -?> diff --git a/modules/Calendar/tpls/form.tpl b/modules/Calendar/tpls/form.tpl index 1a2849ab..cc01bb15 100644 --- a/modules/Calendar/tpls/form.tpl +++ b/modules/Calendar/tpls/form.tpl @@ -38,6 +38,7 @@
+ diff --git a/modules/Calls/Save.php b/modules/Calls/Save.php index 211e7b59..d3a3355e 100644 --- a/modules/Calls/Save.php +++ b/modules/Calls/Save.php @@ -43,7 +43,15 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); * All Rights Reserved. * Contributor(s): ______________________________________.. ********************************************************************************/ + +// prevent overriding of a newly specified parent_id by existing relate_id +if (!empty($_REQUEST['relate_id']) && !empty($_REQUEST['parent_id']) + && $_REQUEST['relate_id'] != $_REQUEST['parent_id'] +) { + $_REQUEST['relate_id'] = false; +} + require_once('modules/Calls/CallFormBase.php'); $formBase = new CallFormBase(); $formBase->handleSave('', true, false); -?> \ No newline at end of file +?> diff --git a/modules/Cases/Case.php b/modules/Cases/Case.php index d9bbb44c..06afedc0 100644 --- a/modules/Cases/Case.php +++ b/modules/Cases/Case.php @@ -116,8 +116,8 @@ class aCase extends Basic { } $this->setupCustomFields('Cases'); - foreach ($this->field_defs as $field) { - $this->field_name_map[$field['name']] = $field; + foreach ($this->field_defs as $name => $field) { + $this->field_name_map[$name] = $field; } } diff --git a/modules/Cases/metadata/popupdefs.php b/modules/Cases/metadata/popupdefs.php index 91883c63..c18dda5e 100644 --- a/modules/Cases/metadata/popupdefs.php +++ b/modules/Cases/metadata/popupdefs.php @@ -87,6 +87,3 @@ $popupMeta = array( array('name' => 'assigned_user_id', 'type' => 'enum', 'label' => 'LBL_ASSIGNED_TO', 'function' => array('name' => 'get_user_array', 'params' => array(false))), ) ); -?> - - \ No newline at end of file diff --git a/modules/Configurator/tpls/EditView.tpl b/modules/Configurator/tpls/EditView.tpl index 7291930d..a012d216 100644 --- a/modules/Configurator/tpls/EditView.tpl +++ b/modules/Configurator/tpls/EditView.tpl @@ -335,8 +335,8 @@ - +{if $logger_visible} @@ -360,13 +360,13 @@ +{/if}

{$MOD.LBL_LOGGER}

{$MOD.LBL_LOGGER_MAX_LOGS}
{$MOD.LBL_LOGVIEW}
-
  diff --git a/modules/Configurator/views/view.edit.php b/modules/Configurator/views/view.edit.php index b0f3a334..ecdfdaeb 100644 --- a/modules/Configurator/views/view.edit.php +++ b/modules/Configurator/views/view.edit.php @@ -125,7 +125,13 @@ class ConfiguratorViewEdit extends ViewEdit } else { $this->ss->assign('filename_suffix', get_select_options_with_id( SugarLogger::$filename_suffix,'')); } - + if (isset($configurator->config['logger_visible'])) { + $this->ss->assign('logger_visible', $configurator->config['logger_visible']); + } + else { + $this->ss->assign('logger_visible', true); + } + echo $this->getModuleTitle(false); $this->ss->display('modules/Configurator/tpls/EditView.tpl'); diff --git a/modules/Connectors/connectors/sources/ext/rest/insideview/tpls/InsideView.tpl b/modules/Connectors/connectors/sources/ext/rest/insideview/tpls/InsideView.tpl index 1c7f0f2d..13c50eda 100644 --- a/modules/Connectors/connectors/sources/ext/rest/insideview/tpls/InsideView.tpl +++ b/modules/Connectors/connectors/sources/ext/rest/insideview/tpls/InsideView.tpl @@ -113,20 +113,18 @@ function toggleGettingStartedButton(){ldelim}

+ + + + {sugar_getimage name='basic_search' attr='border="0" align="absmiddle"' ext='.gif' alt=$APP.LBL_HIDE } + + InsideView

- - - - - - - {sugar_getimage name='basic_search' attr='border="0" align="absmiddle"' ext='.gif' alt=$APP.LBL_HIDE } - diff --git a/modules/Emails/Email.php b/modules/Emails/Email.php index 2a86c903..cf20e7e6 100644 --- a/modules/Emails/Email.php +++ b/modules/Emails/Email.php @@ -1030,7 +1030,8 @@ class Email extends SugarBean { $this->bcc_addrs_names = $this->cleanEmails($this->bcc_addrs_names); $this->reply_to_addr = $this->cleanEmails($this->reply_to_addr); $this->description = SugarCleaner::cleanHtml($this->description); - $this->description_html = SugarCleaner::cleanHtml($this->description_html); + $this->description_html = SugarCleaner::cleanHtml($this->description_html, true); + $this->raw_source = SugarCleaner::cleanHtml($this->raw_source, true); $this->saveEmailText(); $this->saveEmailAddresses(); @@ -1215,9 +1216,9 @@ class Email extends SugarBean { if($ret) { $ret->retrieveEmailText(); - $ret->raw_source = SugarCleaner::cleanHtml($ret->raw_source); + //$ret->raw_source = SugarCleaner::cleanHtml($ret->raw_source); $ret->description = to_html($ret->description); - $ret->description_html = SugarCleaner::cleanHtml($ret->description_html); + //$ret->description_html = SugarCleaner::cleanHtml($ret->description_html); $ret->retrieveEmailAddresses(); $ret->date_start = ''; @@ -2537,7 +2538,7 @@ class Email extends SugarBean { //Perform a count query needed for pagination. $countQuery = $this->create_list_count_query($fullQuery); - + $count_rs = $this->db->query($countQuery, false, 'Error executing count query for imported emails search'); $count_row = $this->db->fetchByAssoc($count_rs); $total_count = ($count_row != null) ? $count_row['c'] : 0; @@ -2650,7 +2651,7 @@ class Email extends SugarBean { $query['where'] .= " AND NOT EXISTS ( SELECT id FROM notes n WHERE n.parent_id = emails.id AND n.deleted = 0 AND n.filename is not null )"; $fullQuery = "SELECT " . $query['select'] . " " . $query['joins'] . " " . $query['where']; - + return $fullQuery; } /** @@ -2684,8 +2685,8 @@ class Email extends SugarBean { $additionalWhereClause[] = "{$properties['table_name']}.$db_key $opp '$searchValue' "; } } - - + + $isDateFromSearchSet = !empty($_REQUEST['searchDateFrom']); $isdateToSearchSet = !empty($_REQUEST['searchDateTo']); diff --git a/modules/Emails/Popup.php b/modules/Emails/Popup.php index 4fb7e8d7..48425844 100644 --- a/modules/Emails/Popup.php +++ b/modules/Emails/Popup.php @@ -36,15 +36,10 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); ********************************************************************************/ - - if(isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'show_raw') { - if(!class_exists("Email")) { - - } $email = new Email(); $email->retrieve($_REQUEST['metadata']); - echo nl2br(SugarCleaner::cleanHtml($email->raw_source)); + echo nl2br($email->raw_source); } else { require_once('include/Popups/Popup_picker.php'); $popup = new Popup_Picker(); diff --git a/modules/Emails/javascript/Email.js b/modules/Emails/javascript/Email.js index 848e7387..479373f2 100644 --- a/modules/Emails/javascript/Email.js +++ b/modules/Emails/javascript/Email.js @@ -335,7 +335,7 @@ function multiFiles( list_target){ fileName = filePathComponents[filePathComponents.length - 1], // constants - allowedTypes = ['gif', 'bmp', 'png', 'jpg', 'jpeg'], + allowedTypes = ['png', 'jpg', 'jpeg'], imglocation = 'cache/images/'; //check if filetype is valid diff --git a/modules/Emails/javascript/EmailUICompose.js b/modules/Emails/javascript/EmailUICompose.js index 0f2c2e4e..9fdab4f0 100644 --- a/modules/Emails/javascript/EmailUICompose.js +++ b/modules/Emails/javascript/EmailUICompose.js @@ -1421,7 +1421,8 @@ SE.composeLayout = { /** * Writes out the signature in the email editor */ - setSignature : function(idx) { + setSignature : function(idx) + { if (!tinyMCE) return false; var hide = document.getElementById('setEditor' + idx).checked; @@ -1453,10 +1454,14 @@ SE.composeLayout = { } - var openTag = '
'; - var closeTag = '
'; + // The tags are used for finding the signature + var openTag = '

'; + var closeTag = ' 
'; + + // Get tinyMCE instance var t = tinyMCE.getInstanceById('htmleditor' + idx); - //IE 6 Hack + + // IE 6 Hack if(typeof(t) != 'undefined') { t.contentDocument = t.contentWindow.document; @@ -1469,17 +1474,22 @@ SE.composeLayout = { var htmllow = html.toLowerCase(); var start = htmllow.indexOf(openTag); - var end = htmllow.indexOf(closeTag); - if (end >= 0) { + // Start looking for the closeTag where the start tag was found + var end = htmllow.indexOf(closeTag, start); + if (end >= 0) + { end += closeTag.length; } - else { + else + { end = htmllow.length; } // selected "none" - remove signature from email - if(signature == '') { - if (start > -1) { + if (signature == '') + { + if (start > -1) + { var htmlPart1 = html.substr(0, start); var htmlPart2 = html.substr(end, html.length); @@ -1490,22 +1500,28 @@ SE.composeLayout = { return false; } - if(!SE.signatures.lastAttemptedLoad) // lazy load place holder + if (!SE.signatures.lastAttemptedLoad) // lazy load place holder + { SE.signatures.lastAttemptedLoad = ''; + } SE.signatures.lastAttemptedLoad = signature; - if(typeof(SE.signatures[signature]) == 'undefined') { + if (typeof(SE.signatures[signature]) == 'undefined') + { //lazy load SE.signatures.lastAttemptedLoad = ''; // reset this flag for recursion SE.signatures.targetInstance = (idx) ? idx : ""; AjaxObject.target = ''; AjaxObject.startRequest(callbackLoadSignature, urlStandard + "&emailUIAction=getSignature&id="+signature); - } else { + } + else + { var newSignature = this.prepareSignature(SE.signatures[signature]); // clear out old signature - if(SE.signatures.lastAttemptedLoad && start > -1) { + if (SE.signatures.lastAttemptedLoad && start > -1) + { var htmlPart1 = html.substr(0, start); var htmlPart2 = html.substr(end, html.length); @@ -1514,12 +1530,14 @@ SE.composeLayout = { // pre|append start = html.indexOf('

'); - if(SE.userPrefs.signatures.signature_prepend == 'true' && start > -1) { + if (SE.userPrefs.signatures.signature_prepend == 'true' && start > -1) // Prepend + { var htmlPart1 = html.substr(0, start); var htmlPart2 = html.substr(start, html.length); var newHtml = htmlPart1 + openTag + newSignature + closeTag + htmlPart2; - } else if(SUGAR.email2.userPrefs.signatures.signature_prepend == 'true') { - + } + else if (SUGAR.email2.userPrefs.signatures.signature_prepend == 'true') // Prepend + { //bug 48285 var newHtml = html; @@ -1549,17 +1567,34 @@ SE.composeLayout = { newHtml = openTag + newSignature + closeTag + newHtml; } //end bug 48285 - } else { + } + else // Append + { + // On full compose mail has element empty + var bodyStringEmpty = htmllow.indexOf("") > -1 && htmllow.replace(/\s/g, "").match(/.+<\/body>/) == null; + // On quick compose a new document has html.length == 0 + if (htmllow.length == 0 || bodyStringEmpty) + { + // Prepend
to openTag because if it's an empty document + // or a document with nothing other than whitespace in + // TinyMCE will pick the id of the div containing the signature + // when adding a new row and duplicate it so this might cause + // trouble when changing signatures + openTag = "
" + openTag; + } + var body = html.indexOf(''); - if (body > -1) { + if (body > -1) + { var part1 = html.substr(0, body); var part2 = html.substr(body, html.length); var newHtml = part1 + openTag + newSignature + closeTag + part2; - } else { + } + else + { var newHtml = html + openTag + newSignature + closeTag; } } - //tinyMCE.setContent(newHtml); t.setContent(newHtml); } }, diff --git a/modules/Employees/EmployeesSearchForm.php b/modules/Employees/EmployeesSearchForm.php index 8ac3e17a..95a89b74 100644 --- a/modules/Employees/EmployeesSearchForm.php +++ b/modules/Employees/EmployeesSearchForm.php @@ -76,7 +76,7 @@ class EmployeesSearchForm extends SearchForm { // Add in code to remove portal/group/hidden users $where_clauses[] = "users.portal_only = 0"; - $where_clauses[] = "users.is_group = 0"; + $where_clauses[] = "(users.is_group = 0 or users.is_group is null)"; $where_clauses[] = "users.show_on_employees = 1"; return $where_clauses; } diff --git a/modules/Home/views/view.list.php b/modules/Home/views/view.list.php index 6476c256..62392168 100644 --- a/modules/Home/views/view.list.php +++ b/modules/Home/views/view.list.php @@ -45,6 +45,11 @@ class HomeViewList extends ViewList{ function display(){ global $mod_strings, $export_module, $current_language, $theme, $current_user, $dashletData, $sugar_flavor; + $this->processMaxPostErrors(); + include('modules/Home/index.php'); + } + + function processMaxPostErrors() { if($this->checkPostMaxSizeError()){ $this->errors[] = $GLOBALS['app_strings']['UPLOAD_ERROR_HOME_TEXT']; $contentLength = $_SERVER['CONTENT_LENGTH']; @@ -62,13 +67,16 @@ class HomeViewList extends ViewList{ $maxUploadSize = (int) $maxUploadSize * pow(2, 20); $max_size = min($maxPostSize, $maxUploadSize); + if ($contentLength > $max_size) { + $errMessage = string_format($GLOBALS['app_strings']['UPLOAD_MAXIMUM_EXCEEDED'],array($contentLength, $max_size)); + } else { + $errMessage =$GLOBALS['app_strings']['UPLOAD_REQUEST_ERROR']; + } - $errMessage = string_format($GLOBALS['app_strings']['UPLOAD_MAXIMUM_EXCEEDED'],array($contentLength, $max_size)); $this->errors[] = '* '.$errMessage; $this->displayErrors(); } - include('modules/Home/index.php'); - } + } } ?> diff --git a/modules/Import/CsvAutoDetect.php b/modules/Import/CsvAutoDetect.php index 998686d3..b3931305 100644 --- a/modules/Import/CsvAutoDetect.php +++ b/modules/Import/CsvAutoDetect.php @@ -249,7 +249,7 @@ class CsvAutoDetect { * @param bool $heading true of it has header, false if not * @return bool true if header is found, false if error */ - public function hasHeader(&$heading, $module) { + public function hasHeader(&$heading, $module, $encoding = null) { if (!$this->_parsed) { return false; @@ -270,9 +270,16 @@ class CsvAutoDetect { $mod_strings = return_module_language($GLOBALS['current_language'], $module); + global $locale; // process only the first row - foreach ($this->_parser->data[0] as $val) { - + foreach ($this->_parser->data[0] as $val) + { + if (!empty($encoding)) + { + // Convert all values to UTF-8 + $val = $locale->translateCharset($val, $encoding); + } + // bug51433 - everything relies on $val having a value so if it's empty, // we can skip this iteration and not get warnings if( !empty( $val ) ) diff --git a/modules/Import/Importer.php b/modules/Import/Importer.php index 0d859efa..9ff120ba 100644 --- a/modules/Import/Importer.php +++ b/modules/Import/Importer.php @@ -546,7 +546,7 @@ class Importer // Bug51192: check if there are any changes in the imported data $hasDataChanges = false; - $dataChanges=$focus->db->getDataChanges($focus); + $dataChanges=$focus->db->getAuditDataChanges($focus); if(!empty($dataChanges)) { foreach($dataChanges as $field=>$fieldData) { diff --git a/modules/Import/sources/ImportFile.php b/modules/Import/sources/ImportFile.php index deec5094..b3f9936c 100644 --- a/modules/Import/sources/ImportFile.php +++ b/modules/Import/sources/ImportFile.php @@ -92,6 +92,11 @@ class ImportFile extends ImportDataSource * Enclosure string we are using (i.e. ' or ") */ private $_enclosure; + + /** + * File encoding, used to translate the data into UTF-8 for display and import + */ + private $_encoding; /** @@ -125,7 +130,9 @@ class ImportFile extends ImportDataSource $this->_delimiter = "\t"; } $this->_enclosure = ( empty($enclosure) ? '' : trim($enclosure) ); - $this->setFpAfterBOM(); + + // Autodetect does setFpAfterBOM() + $this->_encoding = $this->autoDetectCharacterSet(); } /** @@ -193,30 +200,51 @@ class ImportFile extends ImportDataSource $this->_currentRow = FALSE; if (!$this->fileExists()) + { return false; + } // explode on delimiter instead if enclosure is an empty string - if ( empty($this->_enclosure) ) { - $row = explode($this->_delimiter,rtrim(fgets($this->_fp, 8192),"\r\n")); - if ($row !== false && !( count($row) == 1 && trim($row[0]) == '') ) + if (empty($this->_enclosure)) + { + $row = explode($this->_delimiter, rtrim(fgets($this->_fp, 8192), "\r\n")); + if ($row !== false && !(count($row) == 1 && trim($row[0]) == '')) + { $this->_currentRow = $row; + } else + { return false; + } } - else { + else + { $row = fgetcsv($this->_fp, 8192, $this->_delimiter, $this->_enclosure); if ($row !== false && $row != array(null)) + { $this->_currentRow = $row; + } else + { return false; + } } - - // Bug 26219 - Convert all line endings to the same style as PHP_EOL - foreach ( $this->_currentRow as $key => $value ) { - // use preg_replace instead of str_replace as str_replace may cause extra lines on Windows - $this->_currentRow[$key] = preg_replace("[\r\n|\n|\r]", PHP_EOL, $value); + + global $locale; + foreach ($this->_currentRow as $key => $value) + { + // If encoding is set, convert all values from it + if (!empty($this->_encoding)) + { + // Convert all values to UTF-8 for display and import purposes + $this->_currentRow[$key] = $locale->translateCharset($value, $this->_encoding); + } + + // Convert all line endings to the same style as PHP_EOL + // Use preg_replace instead of str_replace as str_replace may cause extra lines on Windows + $this->_currentRow[$key] = preg_replace("[\r\n|\n|\r]", PHP_EOL, $this->_currentRow[$key]); } - + $this->_rowsCount++; return $this->_currentRow; @@ -292,43 +320,54 @@ class ImportFile extends ImportDataSource public function autoDetectCharacterSet() { - global $locale; - + // If encoding is already detected, just return it + if (!empty($this->_encoding)) + { + return $this->_encoding; + } + + // Move file pointer to start $this->setFpAfterBOM(); - - //Retrieve a sample set of data - $rows = array(); - + + global $locale; $user_charset = $locale->getExportCharset(); $system_charset = $locale->default_export_charset; $other_charsets = 'UTF-8, UTF-7, ASCII, CP1252, EUC-JP, SJIS, eucJP-win, SJIS-win, JIS, ISO-2022-JP'; $detectable_charsets = "UTF-8, {$user_charset}, {$system_charset}, {$other_charsets}"; + // Bug 26824 - mb_detect_encoding() thinks CP1252 is IS0-8859-1, so use that instead in the encoding list passed to the function - $detectable_charsets = str_replace('CP1252','ISO-8859-1',$detectable_charsets); - $charset_for_import = $user_charset; //We will set the default import charset option by user's preference. - $able_to_detect = function_exists('mb_detect_encoding'); - for ( $i = 0; $i < 3; $i++ ) + $detectable_charsets = str_replace('CP1252', 'ISO-8859-1', $detectable_charsets); + + // If we are able to detect encoding + if (function_exists('mb_detect_encoding')) { - $rows[$i] = $this->getNextRow(); - if(!empty($rows[$i]) && $able_to_detect) + // Retrieve a sample of data set + $text = ''; + + // Read 10 lines from the file and put them all together in a variable + $i = 0; + while ($i < 10 && $temp = fgets($this->_fp, 8192)) + { + $text .= $temp; + $i++; + } + + // If we picked any text, try to detect charset + if (strlen($text) > 0) { - foreach($rows[$i] as & $temp_value) - { - $current_charset = mb_detect_encoding($temp_value, $detectable_charsets); - if(!empty($current_charset) && $current_charset != "UTF-8") - { - $temp_value = $locale->translateCharset($temp_value, $current_charset);// we will use utf-8 for displaying the data on the page. - $charset_for_import = $current_charset; - //set the default import charset option according to the current_charset. - //If it is not utf-8, tt may be overwritten by the later one. So the uploaded file should not contain two types of charset($user_charset, $system_charset), and I think this situation will not occur. - } - } + $charset_for_import = mb_detect_encoding($text, $detectable_charsets); } } - - //Reset the fp to after the bom if applicable. + + // If we couldn't detect the charset, set it to default export/import charset + if (empty($charset_for_import)) + { + $charset_for_import = $locale->getExportCharset(); + } + + // Reset the fp to after the bom if applicable. $this->setFpAfterBOM(); - + return $charset_for_import; } @@ -369,7 +408,7 @@ class ImportFile extends ImportDataSource $heading = FALSE; if ($this->_detector) - $ret = $this->_detector->hasHeader($heading, $module); + $ret = $this->_detector->hasHeader($heading, $module, $this->_encoding); if ($ret) $this->_hasHeader = $heading; diff --git a/modules/Import/views/view.confirm.php b/modules/Import/views/view.confirm.php index 9f82d024..4862626b 100644 --- a/modules/Import/views/view.confirm.php +++ b/modules/Import/views/view.confirm.php @@ -440,19 +440,6 @@ eoq; { array_unshift($rows, array_fill(0,1,'') ); } - - // to be displayed in UTF-8 format - global $locale; - $encoding = $importFile->autoDetectCharacterSet(); - if (!empty($encoding) && $encoding != 'UTF-8') { - foreach ($rows as &$row) { - if (is_array($row)) { - foreach ($row as &$val) { - $val = $locale->translateCharset($val, $encoding); - } - } - } - } foreach ($rows as &$row) { if (is_array($row)) { @@ -461,7 +448,6 @@ eoq; } } } - return $rows; } diff --git a/modules/Meetings/Save.php b/modules/Meetings/Save.php index 5ab419ef..7351886e 100644 --- a/modules/Meetings/Save.php +++ b/modules/Meetings/Save.php @@ -44,6 +44,13 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); * Contributor(s): ______________________________________.. ********************************************************************************/ +// prevent overriding of a newly specified parent_id by existing relate_id +if (!empty($_REQUEST['relate_id']) && !empty($_REQUEST['parent_id']) + && $_REQUEST['relate_id'] != $_REQUEST['parent_id'] +) { + $_REQUEST['relate_id'] = false; +} + require_once('modules/Meetings/MeetingFormBase.php'); $formBase = new MeetingFormBase(); $formBase->handleSave('', true, false); diff --git a/modules/UpgradeWizard/UpgradeRemoval.php b/modules/UpgradeWizard/UpgradeRemoval.php index b4c4a737..1edd9a4e 100644 --- a/modules/UpgradeWizard/UpgradeRemoval.php +++ b/modules/UpgradeWizard/UpgradeRemoval.php @@ -51,6 +51,11 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); class UpgradeRemoval { + /** + * @var string minimal version for removal + */ + public $version = ''; + /** * getFilesToRemove * Return array of files/directories to remove. Default implementation returns empty array. @@ -124,4 +129,3 @@ protected function backup($file) } } -?> \ No newline at end of file diff --git a/modules/UpgradeWizard/commit.php b/modules/UpgradeWizard/commit.php index 393dc164..e1d89e42 100644 --- a/modules/UpgradeWizard/commit.php +++ b/modules/UpgradeWizard/commit.php @@ -321,7 +321,8 @@ eoq; require("sugar_version.php"); - if($_SESSION['current_db_version'] != $_SESSION['target_db_version']){ + if (version_compare($_SESSION['current_db_version'], $_SESSION['target_db_version'], '!=')) + { logThis('Performing UWrebuild()...'); UWrebuild(); logThis('UWrebuild() done.'); @@ -356,8 +357,8 @@ eoq; /////////////////////////////////////////////////////////////////////////////// logThis('check if current_db_version in $_SESSION equals target_db_version in $_SESSION'); -if($_SESSION['current_db_version'] == $_SESSION['target_db_version']){ - +if (version_compare($_SESSION['current_db_version'], $_SESSION['target_db_version'], '=')) +{ logThis('current_db_version in $_SESSION and target_db_version in $_SESSION are equal'); $_SESSION['license_seats_needed'] = ''; //Clean modules from cache @@ -464,10 +465,12 @@ $customized_mods_Desc = ''; $old_schema= ''; $old_schema_opt = ''; $skipped_queries = ''; -if($_SESSION['current_db_version'] != $_SESSION['target_db_version']){ +if (version_compare($_SESSION['current_db_version'], $_SESSION['target_db_version'], '!=')) +{ global $sugar_version; - $origVersion = substr(preg_replace("/[^0-9]/", "", $_SESSION['current_db_version']),0,3); - $destVersion = substr(preg_replace("/[^0-9]/", "", $_SESSION['target_db_version']),0,3); + + $origVersion = implodeVersion($_SESSION['current_db_version']); + $destVersion = implodeVersion($_SESSION['target_db_version']); //old schema to be dropped $old_schema_contents = ''; diff --git a/modules/UpgradeWizard/end.php b/modules/UpgradeWizard/end.php index a729cfbd..dcbd6e22 100644 --- a/modules/UpgradeWizard/end.php +++ b/modules/UpgradeWizard/end.php @@ -177,17 +177,14 @@ set_upgrade_progress('end','in_progress'); if(isset($_SESSION['current_db_version']) && isset($_SESSION['target_db_version'])){ - if($_SESSION['current_db_version'] != $_SESSION['target_db_version']){ - logThis("Upgrading multienum data", $path); - if(file_exists("$unzip_dir/scripts/upgrade_multienum_data.php")) { - require_once("$unzip_dir/scripts/upgrade_multienum_data.php"); - upgrade_multienum_data(); - } + if (version_compare($_SESSION['current_db_version'], $_SESSION['target_db_version'], '!=')) + { } //keeping separate. making easily visible and readable - if($_SESSION['current_db_version'] == $_SESSION['target_db_version']){ + if (version_compare($_SESSION['current_db_version'], $_SESSION['target_db_version'], '=')) + { $_REQUEST['upgradeWizard'] = true; ob_start(); include('modules/ACL/install_actions.php'); @@ -235,44 +232,6 @@ upgrade_connectors(); logThis('End upgrade_connectors', $path); -// Enable the InsideView connector by default -if($_SESSION['current_db_version'] < '621' && function_exists('upgradeEnableInsideViewConnector')) { - upgradeEnableInsideViewConnector(); -} - -/* -if ($_SESSION['current_db_version'] < '620' && ($sugar_config['dbconfig']['db_type'] == 'mssql' || $sugar_config['dbconfig']['db_type'] == 'oci8')) -{ - repair_long_relationship_names($path); -} -*/ - -//Global search support -/* -if($_SESSION['current_db_version'] < '620' && function_exists('add_unified_search_to_custom_modules_vardefs')) -{ - logThis('Add global search for custom modules start .', $path); - add_unified_search_to_custom_modules_vardefs(); - logThis('Add global search for custom modules finished .', $path); -} -*/ - -//Upgrade system displayed tabs and subpanels -if(function_exists('upgradeDisplayedTabsAndSubpanels')) -{ - upgradeDisplayedTabsAndSubpanels($_SESSION['current_db_version']); -} - -if ($_SESSION['current_db_version'] < '650') -{ - // Bug 53650 - Workflow Type Templates not saving Type upon upgrade to 6.5.0, usable as Email Templates - $db->query("UPDATE email_templates SET type = 'workflow' WHERE - coalesce(" . $db->convert("base_module", "length") . ",0) > 0 - AND - coalesce(" . $db->convert("type", "length") . ",0) = 0 - "); -} - //Unlink files that have been removed if(function_exists('unlinkUpgradeFiles')) { @@ -285,7 +244,7 @@ if(function_exists('rebuildSprites') && function_exists('imagecreatetruecolor')) } //Run repairUpgradeHistoryTable -if($_SESSION['current_db_version'] < '650' && function_exists('repairUpgradeHistoryTable')) +if (version_compare($_SESSION['current_db_version'], '6.5.0', '<') && function_exists('repairUpgradeHistoryTable')) { repairUpgradeHistoryTable(); } @@ -295,14 +254,6 @@ upgrade_custom_relationships(); require_once('modules/UpgradeWizard/uw_utils.php'); -/* -if($_SESSION['current_db_version'] < '620') -{ - upgradeDateTimeFields($path); - upgradeDocumentTypeFields($path); -} -*/ - //Update the license logThis('Start Updating the license ', $path); ob_start(); diff --git a/modules/UpgradeWizard/index.php b/modules/UpgradeWizard/index.php index 23922399..01a6b4a0 100644 --- a/modules/UpgradeWizard/index.php +++ b/modules/UpgradeWizard/index.php @@ -288,13 +288,6 @@ if($upgradeStepFile == 'end'){ deleteCache(); } ob_end_clean(); - if(isset($_SESSION['current_db_version']) && substr($_SESSION['current_db_version'],0,1) == 4){ - //Remove footer from themes except default, love and link themes - logThis('Start removing footer.php file from themes...'); - $deleteNot =array('themes/default/footer.php','themes/Love/footer.php','themes/Links/footer.php'); - removeFileFromPath('footer.php','themes', $deleteNot); - logThis('End removing footer.php file from themes...'); - } //} } @@ -539,13 +532,7 @@ if(!empty($GLOBALS['top_message'])){ $smarty->assign('top_message', $GLOBALS['top_message']); } -if ($sugar_config['sugar_version'] < '5.5') { - $smarty->assign('includeContainerCSS', true); -} else { - $smarty->assign('includeContainerCSS', false); -} // else +$smarty->assign('includeContainerCSS', false); $smarty->display('modules/UpgradeWizard/uw_main.tpl'); //// END PAGE OUTPUT /////////////////////////////////////////////////////////////////////////////// - -?> diff --git a/modules/UpgradeWizard/preflight.php b/modules/UpgradeWizard/preflight.php index e62404fa..ae3006e3 100644 --- a/modules/UpgradeWizard/preflight.php +++ b/modules/UpgradeWizard/preflight.php @@ -142,9 +142,7 @@ if (version_compare(phpversion(),'5.2.0') >=0) { $db =& DBManagerFactory::getInstance(); //Quickcreatedefs on the basis of editviewdefs - if(substr($sugar_version,0,1) >= 5){ - updateQuickCreateDefs(); - } + updateQuickCreateDefs(); upgradeSugarCache($_SESSION['install_file']); if((count($errors) == 1)) { // only diffs @@ -271,51 +269,51 @@ $diffs =''; //// SCHEMA SCRIPT HANDLING logThis('starting schema preflight check...'); //Check the current and target versions and store them in session variables - if(!isset($sugar_db_version) || empty($sugar_db_version)) { - include('./sugar_version.php'); - } + if (empty($sugar_db_version)) + { + include('sugar_version.php'); + } if(!isset($manifest['version']) || empty($manifest['version'])) { include($_SESSION['unzip_dir'].'/manifest.php'); } - $current_version = substr(preg_replace("#[^0-9]#", "", $sugar_db_version),0,3); - $targetVersion = substr(preg_replace("#[^0-9]#", "", $manifest['version']),0,3); + + $origVersion = implodeVersion($sugar_db_version, 3, '0'); + $destVersion = implodeVersion($manifest['version'], 3, '0'); //save the versions as session variables - $_SESSION['current_db_version'] = $current_version; - $_SESSION['target_db_version'] = $targetVersion; + $_SESSION['current_db_version'] = $sugar_db_version; + $_SESSION['target_db_version'] = $manifest['version']; $_SESSION['upgrade_from_flavor'] = $manifest['name']; // aw: BUG 10161: check flavor conversion sql files $sqlFile = ''; // cn: bug - if($current_version == $targetVersion) { + if (version_compare($sugar_db_version, $manifest['version'], '=')) + { $type = $db->getScriptName(); - if(preg_match('/(.*?)([^0])$/', $current_version, $matches)) - { - $current_version = $matches[1].'0'; - } - switch($manifest['name']){ - case 'SugarCE to SugarPro': - $sqlFile = $current_version.'_ce_to_pro_'.$type; - break; - case 'SugarCE to SugarEnt': - $sqlFile = $current_version.'_ce_to_ent_'.$type; - break; + switch($manifest['name']) + { + case 'SugarCE to SugarPro': + $sqlFile = $origVersion . '_ce_to_pro_' . $type; + break; + case 'SugarCE to SugarEnt': + $sqlFile = $origVersion . '_ce_to_ent_' . $type; + break; case 'SugarCE to SugarCorp': - $sqlFile = $current_version.'_ce_to_corp_'.$db->dbType; - break; + $sqlFile = $origVersion . '_ce_to_corp_' . $db->dbType; + break; case 'SugarCE to SugarUlt': - $sqlFile = $current_version.'_ce_to_ult_'.$db->dbType; - break; - case 'SugarPro to SugarEnt': - $sqlFile = $current_version.'_pro_to_ent_'.$type; - break; - default: - break; - } + $sqlFile = $origVersion . '_ce_to_ult_' . $db->dbType; + break; + case 'SugarPro to SugarEnt': + $sqlFile = $origVersion . '_pro_to_ent_' . $type; + break; + default: + break; + } } else { $type = $db->dbType; if($type == 'oci8') $type = 'oracle'; - $sqlFile = $current_version.'_to_'.$targetVersion.'_'.$type; + $sqlFile = $origVersion . '_to_' . $destVersion . '_' . $type; } $newTables = array(); @@ -495,4 +493,3 @@ $stepCancel = -1; $stepRecheck = $_REQUEST['step']; $_SESSION['step'][$steps['files'][$_REQUEST['step']]] = ($stop) ? 'failed' : 'success'; -?> \ No newline at end of file diff --git a/modules/UpgradeWizard/silentUpgrade.php b/modules/UpgradeWizard/silentUpgrade.php index 4292199d..dc759a87 100644 --- a/modules/UpgradeWizard/silentUpgrade.php +++ b/modules/UpgradeWizard/silentUpgrade.php @@ -112,4 +112,5 @@ if($run_dce_upgrade) { if($output != 0) { echo "*************** silentupgrade failed ***************: $output\n"; } -?> \ No newline at end of file +exit($output); +?> diff --git a/modules/UpgradeWizard/silentUpgrade_dce_step2.php b/modules/UpgradeWizard/silentUpgrade_dce_step2.php index 39761755..ed310d73 100644 --- a/modules/UpgradeWizard/silentUpgrade_dce_step2.php +++ b/modules/UpgradeWizard/silentUpgrade_dce_step2.php @@ -777,7 +777,8 @@ if($upgradeType == constant('DCE_INSTANCE')){ //Also set the tracker settings if flavor conversion ce->pro or ce->ent if(isset($_SESSION['current_db_version']) && isset($_SESSION['target_db_version'])){ - if($_SESSION['current_db_version'] == $_SESSION['target_db_version']){ + if (version_compare($_SESSION['current_db_version'], $_SESSION['target_db_version'], '=')) + { $_REQUEST['upgradeWizard'] = true; ob_start(); include('include/Smarty/internals/core.write_file.php'); diff --git a/modules/UpgradeWizard/silentUpgrade_step1.php b/modules/UpgradeWizard/silentUpgrade_step1.php index b187e47c..abf75d60 100644 --- a/modules/UpgradeWizard/silentUpgrade_step1.php +++ b/modules/UpgradeWizard/silentUpgrade_step1.php @@ -660,9 +660,7 @@ if(function_exists('initialize_session_vars')){ if(!didThisStepRunBefore('preflight')){ set_upgrade_progress('preflight','in_progress'); //Quickcreatedefs on the basis of editviewdefs - if(substr($sugar_version,0,1) >= 5){ - updateQuickCreateDefs(); - } + updateQuickCreateDefs(); set_upgrade_progress('preflight','done'); } ////////////////COMMIT PROCESS BEGINS/////////////////////////////////////////////////////////////// @@ -730,10 +728,8 @@ if(!didThisStepRunBefore('commit')){ } require_once(clean_path($unzip_dir.'/scripts/upgrade_utils.php')); $new_sugar_version = getUpgradeVersion(); - $origVersion = substr(preg_replace("/[^0-9]/", "", $sugar_version),0,3); - $destVersion = substr(preg_replace("/[^0-9]/", "", $new_sugar_version),0,3); - $siv_varset_1 = setSilentUpgradeVar('origVersion', $origVersion); - $siv_varset_2 = setSilentUpgradeVar('destVersion', $destVersion); + $siv_varset_1 = setSilentUpgradeVar('origVersion', $sugar_version); + $siv_varset_2 = setSilentUpgradeVar('destVersion', $new_sugar_version); $siv_write = writeSilentUpgradeVars(); if(!$siv_varset_1 || !$siv_varset_2 || !$siv_write){ logThis("Error with silent upgrade variables: origVersion write success is ({$siv_varset_1}) ". @@ -846,10 +842,14 @@ if(!didThisStepRunBefore('commit')){ $errors[] = 'Could not write config.php!'; } - logThis('Upgrade the sugar_version', $path); - $sugar_config['sugar_version'] = $sugar_version; - if($destVersion == $origVersion) - require('config.php'); + if (version_compare($new_sugar_version, $sugar_version, '=')) + { + require('config.php'); + } + //upgrade the sugar version prior to writing config file. + logThis('Upgrade the sugar_version', $path); + $sugar_config['sugar_version'] = $sugar_version; + if( !write_array_to_file( "sugar_config", $sugar_config, "config.php" ) ) { logThis('*** ERROR: could not write config.php! - upgrade will fail!', $path); $errors[] = 'Could not write config.php!'; @@ -1024,7 +1024,8 @@ if($ce_to_pro_ent) //Also set the tracker settings if flavor conversion ce->pro or ce->ent if(isset($_SESSION['current_db_version']) && isset($_SESSION['target_db_version'])){ - if($_SESSION['current_db_version'] == $_SESSION['target_db_version']){ + if (version_compare($_SESSION['current_db_version'], $_SESSION['target_db_version'], '=')) + { $_REQUEST['upgradeWizard'] = true; ob_start(); include('include/Smarty/internals/core.write_file.php'); @@ -1133,6 +1134,3 @@ function repairTableDictionaryExtFile() } //if } } - - -?> \ No newline at end of file diff --git a/modules/UpgradeWizard/silentUpgrade_step2.php b/modules/UpgradeWizard/silentUpgrade_step2.php index 6947329e..8a2fafc6 100644 --- a/modules/UpgradeWizard/silentUpgrade_step2.php +++ b/modules/UpgradeWizard/silentUpgrade_step2.php @@ -266,8 +266,8 @@ $errors = array(); $zip_from_dir = substr($patchName, 0, strlen($patchName) - 4); // patch folder name (minus ".zip") $path = $argv[2]; // custom log file, if blank will use ./upgradeWizard.log $db = &DBManagerFactory::getInstance(); - $UWstrings = return_module_language('en_us', 'UpgradeWizard'); - $adminStrings = return_module_language('en_us', 'Administration'); + $UWstrings = return_module_language('en_us', 'UpgradeWizard', true); + $adminStrings = return_module_language('en_us', 'Administration', true); $app_list_strings = return_app_list_strings_language('en_us'); $mod_strings = array_merge($adminStrings, $UWstrings); $subdirs = array('full', 'langpack', 'module', 'patch', 'theme', 'temp'); @@ -473,10 +473,11 @@ logThis('End rebuild relationships.', $path); include("$unzip_dir/manifest.php"); $ce_to_pro_ent = isset($manifest['name']) && ($manifest['name'] == 'SugarCE to SugarPro' || $manifest['name'] == 'SugarCE to SugarEnt' || $manifest['name'] == 'SugarCE to SugarCorp' || $manifest['name'] == 'SugarCE to SugarUlt'); -$origVersion = getSilentUpgradeVar('origVersion'); -if(!$origVersion){ +$sugar_version = getSilentUpgradeVar('origVersion'); +if (!$sugar_version) +{ global $silent_upgrade_vars_loaded; - logThis("Error retrieving silent upgrade var for origVersion: cache dir is {$GLOBALS['sugar_config']['cache_dir']} -- full cache for \$silent_upgrade_vars_loaded is ".var_export($silent_upgrade_vars_loaded, true), $path); + logThis("Error retrieving silent upgrade var for sugar_version: cache dir is {$GLOBALS['sugar_config']['cache_dir']} -- full cache for \$silent_upgrade_vars_loaded is ".var_export($silent_upgrade_vars_loaded, true), $path); } @@ -510,10 +511,6 @@ if($ce_to_pro_ent) { } } - -/* -*/ - //bug: 37214 - merge config_si.php settings if available logThis('Begin merge_config_si_settings', $path); merge_config_si_settings(true, '', '', $path); @@ -524,37 +521,11 @@ logThis('Begin upgrade_connectors', $path); upgrade_connectors(); logThis('End upgrade_connectors', $path); -// Enable the InsideView connector by default -if($origVersion < '621' && function_exists('upgradeEnableInsideViewConnector')) { - logThis("Looks like we need to enable the InsideView connector\n",$path); - upgradeEnableInsideViewConnector($path); -} - - -//bug: 36845 - ability to provide global search support for custom modules -/* -*/ - -//Upgrade system displayed tabs and subpanels -if(function_exists('upgradeDisplayedTabsAndSubpanels')) -{ - upgradeDisplayedTabsAndSubpanels($origVersion); -} - -if ($origVersion < '650') -{ - // Bug 53650 - Workflow Type Templates not saving Type upon upgrade to 6.5.0, usable as Email Templates - $db->query("UPDATE email_templates SET type = 'workflow' WHERE - coalesce(" . $db->convert("base_module", "length") . ",0) > 0 - AND - coalesce(" . $db->convert("type", "length") . ",0) = 0 - "); -} //Unlink files that have been removed if(function_exists('unlinkUpgradeFiles')) { - unlinkUpgradeFiles($origVersion); + unlinkUpgradeFiles($sugar_version); } if(function_exists('rebuildSprites') && function_exists('imagecreatetruecolor')) @@ -563,7 +534,7 @@ if(function_exists('rebuildSprites') && function_exists('imagecreatetruecolor')) } //Run repairUpgradeHistoryTable -if($origVersion < '650' && function_exists('repairUpgradeHistoryTable')) +if (version_compare($sugar_version, '6.5.0', '<') && function_exists('repairUpgradeHistoryTable')) { repairUpgradeHistoryTable(); } @@ -603,6 +574,3 @@ if(count($errors) > 0) { echo "******** Run Repair -> Rebuild Relationships **********************\n"; echo "********************************************************************\n"; } - - -?> diff --git a/modules/UpgradeWizard/uw_ajax.php b/modules/UpgradeWizard/uw_ajax.php index 18062315..0dd29d7a 100644 --- a/modules/UpgradeWizard/uw_ajax.php +++ b/modules/UpgradeWizard/uw_ajax.php @@ -369,9 +369,10 @@ function preflightCheckJsonDiffFiles($persistence) { global $sugar_version; global $mod_strings; - if(!isset($sugar_version) || empty($sugar_version)) { - - } + if (empty($sugar_version)) + { + require('sugar_version.php'); + } // get md5 sums $md5_string = array(); @@ -581,18 +582,20 @@ function preflightCheckJsonPrepSchemaCheck($persistence, $preflight=true) { else logThis('Preparing SQL statements for sequential execution...'); - if(!isset($sugar_db_version) || empty($sugar_db_version)) { - include('./sugar_version.php'); - } + if (empty($sugar_db_version)) + { + include('sugar_version.php'); + } if(!isset($manifest['version']) || empty($manifest['version'])) { include($persistence['unzip_dir'].'/manifest.php'); } - $current_version = substr(preg_replace("#[^0-9]#", "", $sugar_db_version),0,3); - $targetVersion = substr(preg_replace("#[^0-9]#", "", $manifest['version']),0,3); + $origVersion = implodeVersion($sugar_db_version); + $destVersion = implodeVersion($manifest['version']); + $script_name = $db->getScriptType(); - $sqlScript = $persistence['unzip_dir']."/scripts/{$current_version}_to_{$targetVersion}_{$script_name}.sql"; + $sqlScript = $persistence['unzip_dir']."/scripts/{$origVersion}_to_{$destVersion}_{$script_name}.sql"; $newTables = array(); @@ -698,9 +701,10 @@ function preflightCheckJsonFillSchema() { global $manifest; global $db; - if(empty($sugar_db_version)) { - include('sugar_version'); - } + if (empty($sugar_db_version)) + { + include('sugar_version.php'); + } if(empty($manifest)) { include($persistence['unzip_dir'].'/manifest.php'); } @@ -709,10 +713,12 @@ function preflightCheckJsonFillSchema() { //// SCHEMA SCRIPT HANDLING $schema = ''; $alterTableSchemaOut = ''; - $current_version = substr(preg_replace("#[^0-9]#", "", $sugar_db_version),0,3); - $targetVersion = substr(preg_replace("#[^0-9]#", "", $manifest['version']),0,3); + + $origVersion = implodeVersion($sugar_db_version); + $destVersion = implodeVersion($manifest['version']); + $script_name = $db->getScriptType(); - $sqlScript = $persistence['unzip_dir']."/scripts/{$current_version}_to_{$targetVersion}_{$script_name}.sql"; + $sqlScript = $persistence['unzip_dir']."/scripts/{$origVersion}_to_{$destVersion}_{$script_name}.sql"; $newTables = array(); logThis('looking for SQL script for DISPLAY at '.$sqlScript); @@ -740,19 +746,7 @@ function preflightCheckJsonAlterTableCharset() { if(empty($sugar_db_version)) include('sugar_version.php'); - $current_version = substr(preg_replace("#[^0-9]#", "", $sugar_db_version),0,3); - - if(version_compare($current_version, '450', "<")) { - if(isset($persistence['allTables']) && !empty($persistence['allTables'])) { - $alterTableContents = printAlterTableSql($persistence['allTables']); - $alterTableSchema = "

{$mod_strings['LBL_UW_CHARSET_SCHEMA_CHANGE']}"; - $alterTableSchema .= "

"; - } - } else { - $alterTableSchema = ''.$mod_strings['LBL_UW_PREFLIGHT_NOT_NEEDED'].''; - } + $alterTableSchema = ''.$mod_strings['LBL_UW_PREFLIGHT_NOT_NEEDED'].''; ob_start(); echo $alterTableSchema; @@ -897,6 +891,3 @@ function systemCheckJsonCheckFiles($persistence) { echo $filesOut; return $persistence; } - - -?> diff --git a/modules/UpgradeWizard/uw_utils.php b/modules/UpgradeWizard/uw_utils.php index 33cbadb7..cfbaef6b 100644 --- a/modules/UpgradeWizard/uw_utils.php +++ b/modules/UpgradeWizard/uw_utils.php @@ -38,6 +38,46 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); +/** + * Implodes some parts of version with specified delimiter, beta & rc parts are removed all time + * + * @example ('6.5.6') returns 656 + * @example ('6.5.6beta2') returns 656 + * @example ('6.5.6rc3') returns 656 + * @example ('6.6.0.1') returns 6601 + * @example ('6.5.6', 3, 'x') returns 65x + * @example ('6', 3, '', '.') returns 6.0.0 + * + * @param string $version like 6, 6.2, 6.5.0beta1, 6.6.0rc1, 6.5.7 (separated by dot) + * @param int $size number of the first parts of version which are requested + * @param string $lastSymbol replace last part of version by some string + * @param string $delimiter delimiter for result + * @return string + */ +function implodeVersion($version, $size = 0, $lastSymbol = '', $delimiter = '') +{ + preg_match('/^\d+(\.\d+)*/', $version, $parsedVersion); + if (empty($parsedVersion)) { + return ''; + } + + $parsedVersion = $parsedVersion[0]; + $parsedVersion = explode('.', $parsedVersion); + + if ($size == 0) { + $size = count($parsedVersion); + } + + $parsedVersion = array_pad($parsedVersion, $size, 0); + $parsedVersion = array_slice($parsedVersion, 0, $size); + if ($lastSymbol !== '') { + array_pop($parsedVersion); + array_push($parsedVersion, $lastSymbol); + } + + return implode($delimiter, $parsedVersion); +} + /** * Helper function for upgrade - get path from upload:// name * @param string $path @@ -125,7 +165,7 @@ function commitCopyNewFiles($unzip_dir, $zip_from_dir, $path='') { logThis('Starting file copy process...', $path); global $sugar_version; $backwardModules=''; - if(substr($sugar_version,0,1) >= 5){ + $modules = getAllModules(); $backwardModules = array(); foreach($modules as $mod){ @@ -138,7 +178,6 @@ function commitCopyNewFiles($unzip_dir, $zip_from_dir, $path='') { } } } - } $newFiles = findAllFiles(clean_path($unzip_dir . '/' . $zip_from_dir), array()); $zipPath = clean_path($unzip_dir . '/' . $zip_from_dir); @@ -713,9 +752,8 @@ function upgradeUWFiles($file) { if(file_exists("$from_dir/include/utils/sugar_file_utils.php")) { $allFiles[] = "$from_dir/include/utils/sugar_file_utils.php"; } - // users - if(file_exists("$from_dir/modules/Users")) { - $allFiles[] = findAllFiles("$from_dir/modules/Users", $allFiles); + if(file_exists("$from_dir/include/utils/autoloader.php")) { + $allFiles[] = "$from_dir/include/utils/autoloader.php"; } upgradeUWFilesCopy($allFiles, $from_dir); @@ -1413,9 +1451,10 @@ function preLicenseCheck() { global $mod_strings; global $sugar_version; - if(!isset($sugar_version) || empty($sugar_version)) { - require_once('./sugar_version.php'); - } + if (empty($sugar_version)) + { + require('sugar_version.php'); + } if(!isset($_SESSION['unzip_dir']) || empty($_SESSION['unzip_dir'])) { logThis('unzipping files in upgrade archive...'); @@ -1557,9 +1596,10 @@ function preflightCheck() { global $mod_strings; global $sugar_version; - if(!isset($sugar_version) || empty($sugar_version)) { - require_once('./sugar_version.php'); - } + if (empty($sugar_version)) + { + require('sugar_version.php'); + } unset($_SESSION['rebuild_relationships']); unset($_SESSION['rebuild_extensions']); @@ -2155,8 +2195,6 @@ function resetUwSession() { unset($_SESSION['alterCustomTableQueries']); if(isset($_SESSION['skip_zip_upload'])) unset($_SESSION['skip_zip_upload']); - if(isset($_SESSION['sugar_version_file'])) - unset($_SESSION['sugar_version_file']); if(isset($_SESSION['install_file'])) unset($_SESSION['install_file']); if(isset($_SESSION['unzip_dir'])) @@ -3909,7 +3947,7 @@ function merge_config_si_settings($write_to_upgrade_log=false, $config_location= } else { if($write_to_upgrade_log) { - logThis('config.php values are in sync with config_si.php values. Skipped merging.'); + logThis('config.php values are in sync with config_si.php values. Skipped merging.', $path); } return false; } @@ -4145,6 +4183,9 @@ function upgradeSugarCache($file) if(file_exists("$from_dir/include/utils/sugar_file_utils.php")) { $allFiles[] = "$from_dir/include/utils/sugar_file_utils.php"; } + if(file_exists("$from_dir/include/utils/autoloader.php")) { + $allFiles[] = "$from_dir/include/utils/autoloader.php"; + } foreach($allFiles as $k => $file) { $destFile = str_replace($from_dir."/", "", $file); @@ -4160,41 +4201,6 @@ function upgradeSugarCache($file) } } - -/** - * upgradeDisplayedTabsAndSubpanels - * - * @param $version String value of current system version (pre upgrade) - */ -function upgradeDisplayedTabsAndSubpanels($version) -{ - if($version < '620') - { - logThis('start upgrading system displayed tabs and subpanels'); - require_once('modules/MySettings/TabController.php'); - $tc = new TabController(); - - //grab the existing system tabs - $tabs = $tc->get_tabs_system(); - - //add Calls, Meetings, Tasks, Notes, Prospects (Targets) and ProspectLists (Target Lists) - //to displayed tabs unless explicitly set to hidden - $modules_to_add = array('Calls', 'Meetings', 'Tasks', 'Notes', 'Prospects', 'ProspectLists'); - $added_tabs = array(); - - foreach($modules_to_add as $module) - { - $tabs[0][$module] = $module; - $added_tabs[] = $module; - } - - logThis('calling set_system_tabs on TabController to add tabs: ' . var_export($added_tabs, true)); - $tc->set_system_tabs($tabs[0]); - logThis('finish upgrading system displayed tabs and subpanels'); - } -} - - /** * unlinkUpgradeFiles * This is a helper function to clean up @@ -4229,26 +4235,26 @@ function unlinkUpgradeFiles($version) { if(preg_match('/UpgradeRemoval(\d+)x\.php/', $script, $matches)) { - $checkVersion = $matches[1] + 1; //Increment by one to check everything equal or below the target version $upgradeClass = 'UpgradeRemoval' . $matches[1] . 'x'; require_once($_SESSION['unzip_dir'].'/scripts/files_to_remove/' . $upgradeClass . '.php'); + if (class_exists($upgradeClass) == false) + { + continue; + } - //Check to make sure we should load and run this UpgradeRemoval instance - if($checkVersion <= $version && class_exists($upgradeClass)) - { - $upgradeInstance = new $upgradeClass(); - if($upgradeInstance instanceof UpgradeRemoval) - { - logThis('Running UpgradeRemoval instance ' . $upgradeClass); - logThis('Files will be backed up to custom/backup'); - $files = $upgradeInstance->getFilesToRemove($version); - foreach($files as $file) - { - logThis($file); - } - $upgradeInstance->processFilesToRemove($files); - } - } + //Check to make sure we should load and run this UpgradeRemoval instance + $upgradeInstance = new $upgradeClass(); + if ($upgradeInstance instanceof UpgradeRemoval && version_compare($upgradeInstance->version, $version, '<=')) + { + logThis('Running UpgradeRemoval instance ' . $upgradeClass); + logThis('Files will be backed up to custom/backup'); + $files = $upgradeInstance->getFilesToRemove($version); + foreach($files as $file) + { + logThis($file); + } + $upgradeInstance->processFilesToRemove($files); + } } } } diff --git a/modules/Users/User.php b/modules/Users/User.php index 6ef2ad7d..8b9e528b 100644 --- a/modules/Users/User.php +++ b/modules/Users/User.php @@ -475,7 +475,6 @@ class User extends Person { $setNewUserPreferences = empty($this->id) || !empty($this->new_with_id); - parent::save($check_notify); @@ -784,9 +783,9 @@ EOQ; /** * Verify that the current password is correct and write the new password to the DB. * - * @param string $user name - Must be non null and at least 1 character. * @param string $user_password - Must be non null and at least 1 character. * @param string $new_password - Must be non null and at least 1 character. + * @param string $system_generated * @return boolean - If passwords pass verification and query succeeds, return true, else return false. */ function change_password($user_password, $new_password, $system_generated = '0') @@ -800,11 +799,6 @@ EOQ; return false; } - // Check new password against rules set by admin - if (!$this->check_password_rules($new_password)) { - $this->error_string = $mod_strings['ERR_PASSWORD_CHANGE_FAILED_1'].$current_user->user_name.$mod_strings['ERR_PASSWORD_CHANGE_FAILED_3']; - return false; - } if (!$current_user->isAdminForModule('Users')) { //check old password first @@ -820,51 +814,6 @@ EOQ; return true; } - /** - * Check new password against rules set by admin - * @param string $password - * @return boolean - */ - function check_password_rules($password) { - $length = mb_strlen($password); - - // Min length - if(!empty($GLOBALS["sugar_config"]["passwordsetting"]["minpwdlength"]) && $GLOBALS["sugar_config"]["passwordsetting"]["minpwdlength"] > 0 && $length < $GLOBALS["sugar_config"]["passwordsetting"]["minpwdlength"]) { - return false; - } - - // Max length - if(!empty($GLOBALS['sugar_config']['passwordsetting']['maxpwdlength']) && $GLOBALS['sugar_config']['passwordsetting']['maxpwdlength'] > 0 && $length > $GLOBALS['sugar_config']['passwordsetting']['maxpwdlength']) { - return false; - } - - // One lower case - if(!empty($GLOBALS["sugar_config"]["passwordsetting"]["onelower"]) && !preg_match('/[a-z]+/', $password)){ - return false; - } - - // One upper case - if(!empty($GLOBALS["sugar_config"]["passwordsetting"]["oneupper"]) && !preg_match('/[A-Z]+/', $password)){ - return false; - } - - // One number - if(!empty($GLOBALS["sugar_config"]["passwordsetting"]["onenumber"]) && !preg_match('/[0-9]+/', $password)){ - return false; - } - - // One special character - if(!empty($GLOBALS["sugar_config"]["passwordsetting"]["onespecial"]) && !preg_match('/[|}{~!@#$%^&*()_+=-]+/', $password)){ - return false; - } - - // Custom regex - if(!empty($GLOBALS["sugar_config"]["passwordsetting"]["customregex"]) && !preg_match($GLOBALS["sugar_config"]["passwordsetting"]["customregex"], $password)){ - return false; - } - - return true; - } function is_authenticated() { return $this->authenticated; diff --git a/modules/iCals/iCal.php b/modules/iCals/iCal.php index 71cee808..9db4dee0 100644 --- a/modules/iCals/iCal.php +++ b/modules/iCals/iCal.php @@ -92,11 +92,7 @@ class iCal extends vCal { protected function getUtcTime($ts) { global $timedate, $sugar_version; - if (substr($sugar_version, 0, 1) > 5) { - $timestamp = ($ts+(date('Z')-$timedate->adjustmentForUserTimeZone()*60)); - } else { - $timestamp = ($ts); - } + $timestamp = ($ts+(date('Z')-$timedate->adjustmentForUserTimeZone()*60)); return $this->getUtcDateTime(new SugarDateTime("@" . $ts)); } @@ -494,5 +490,3 @@ class iCal extends vCal { } } - -?> \ No newline at end of file diff --git a/service/v3/SugarWebServiceImplv3.php b/service/v3/SugarWebServiceImplv3.php index 9079ea7d..b4780d6b 100644 --- a/service/v3/SugarWebServiceImplv3.php +++ b/service/v3/SugarWebServiceImplv3.php @@ -192,10 +192,14 @@ class SugarWebServiceImplv3 extends SugarWebServiceImpl { */ function get_server_info(){ $GLOBALS['log']->info('Begin: SugarWebServiceImpl->get_server_info'); - require_once('sugar_version.php'); + global $sugar_flavor, $sugar_version; + if (empty($sugar_version)) + { + require_once('sugar_version.php'); + } $GLOBALS['log']->info('End: SugarWebServiceImpl->get_server_info'); - return array('flavor' => $GLOBALS['sugar_flavor'], 'version' => $GLOBALS['sugar_version'], 'gmt_time' => TimeDate::getInstance()->nowDb()); + return array('flavor' => $sugar_flavor, 'version' => $sugar_version, 'gmt_time' => TimeDate::getInstance()->nowDb()); } // fn /** diff --git a/soap/SoapHelperFunctions.php b/soap/SoapHelperFunctions.php index 03e6f56b..8f67cf98 100644 --- a/soap/SoapHelperFunctions.php +++ b/soap/SoapHelperFunctions.php @@ -903,7 +903,7 @@ function add_create_account($seed) $arr = array(); - $query = "select id, deleted from {$focus->table_name} "; + $query = "select {$focus->table_name}.id, {$focus->table_name}.deleted from {$focus->table_name} "; $query .= " WHERE name='".$seed->db->quote($account_name)."'"; $query .=" ORDER BY deleted ASC"; $result = $seed->db->query($query, true); diff --git a/soap/SoapSugarUsers.php b/soap/SoapSugarUsers.php index b2084a75..d7f6ed5b 100644 --- a/soap/SoapSugarUsers.php +++ b/soap/SoapSugarUsers.php @@ -1179,6 +1179,11 @@ function get_relationships($session, $module_name, $module_id, $related_module, $sql = "SELECT {$related_mod->table_name}.id FROM {$related_mod->table_name} "; + if (isset($related_mod->custom_fields)) { + $customJoin = $related_mod->custom_fields->getJOIN(); + $sql .= $customJoin ? $customJoin['join'] : ''; + } + $sql .= " WHERE {$related_mod->table_name}.id IN ({$in}) "; if (!empty($related_module_query)) { diff --git a/sugar_version.php b/sugar_version.php index 46b76e8d..1978eee2 100644 --- a/sugar_version.php +++ b/sugar_version.php @@ -38,10 +38,10 @@ -$sugar_version = '6.5.8'; -$sugar_db_version = '6.5.8'; +$sugar_version = '6.5.9'; +$sugar_db_version = '6.5.9'; $sugar_flavor = 'CE'; -$sugar_build = '8613'; -$sugar_timestamp = '2012-11-19 10:26am'; +$sugar_build = '8653'; +$sugar_timestamp = '2012-12-19 09:22am'; ?> diff --git a/tests/ModuleInstall/ModuleScannerTest.php b/tests/ModuleInstall/ModuleScannerTest.php index 18f93140..19b0951e 100755 --- a/tests/ModuleInstall/ModuleScannerTest.php +++ b/tests/ModuleInstall/ModuleScannerTest.php @@ -133,6 +133,37 @@ EOQ; $this->assertTrue(!empty($errors)); } + + public function testCallMethodObjectOperatorFail() + { + + $fileModContents = <<setLevel(); +?> +EOQ; + file_put_contents($this->fileLoc, $fileModContents); + $ms = new ModuleScanner(); + $errors = $ms->scanFile($this->fileLoc); + $this->assertNotEmpty($errors, 'There should have been an error caught for use of "->setLevel()'); + } + + public function testCallMethodDoubleColonFail() + { + + $fileModContents = << +EOQ; + file_put_contents($this->fileLoc, $fileModContents); + $ms = new ModuleScanner(); + $errors = $ms->scanFile($this->fileLoc); + $this->assertNotEmpty($errors, 'There should have been an error caught for use of "::setLevel()'); + } + /** * @group bug58072 */ diff --git a/tests/SugarTestEmailAddressUtilities.php b/tests/SugarTestEmailAddressUtilities.php new file mode 100755 index 00000000..4628e822 --- /dev/null +++ b/tests/SugarTestEmailAddressUtilities.php @@ -0,0 +1,115 @@ +email_address = $address; + $email_address->save(); + + self::$createdAddresses[] = $email_address; + return $email_address; + } + + /** + * Add specified email address to the person + * + * @param Person $person + * @param string|EmailAddress $address + * @param array $additional_values + * @return boolean|EmailAddress + * @throws InvalidArgumentException + */ + public static function addAddressToPerson(Person $person, $address, array $additional_values = array()) + { + if (is_string($address)) + { + $address = self::createEmailAddress($address); + } + + if (!$address instanceof EmailAddress) + { + throw new InvalidArgumentException( + 'Address must be a string or an instance of EmailAddress, ' + . gettype($address) . ' given' + ); + } + + if (!$person->load_relationship('email_addresses')) + { + return false; + } + + // create relation between user and email address + $person->email_addresses->add(array($address), $additional_values); + $GLOBALS['db']->commit(); + return $address; + } + + public static function removeAllCreatedAddresses() + { + $ids = self::getCreatedEmailAddressIds(); + if (count($ids) > 0) + { + $GLOBALS['db']->query('DELETE FROM email_addresses WHERE id IN (\'' . implode("', '", $ids) . '\')'); + } + self::$createdAddresses = array(); + } + + public static function getCreatedEmailAddressIds() + { + $ids = array(); + foreach (self::$createdAddresses as $address) + { + $ids[] = $address->id; + } + return $ids; + } +} diff --git a/tests/SugarTestHelper.php b/tests/SugarTestHelper.php index 73f1aac1..6e4f3b5a 100755 --- a/tests/SugarTestHelper.php +++ b/tests/SugarTestHelper.php @@ -102,6 +102,7 @@ require_once 'SugarTestObjectUtilities.php'; require_once 'SugarTestProjectUtilities.php'; require_once 'SugarTestProjectTaskUtilities.php'; require_once 'SugarTestUserUtilities.php'; +require_once 'SugarTestEmailAddressUtilities.php'; require_once 'SugarTestLangPackCreator.php'; require_once 'SugarTestThemeUtilities.php'; require_once 'SugarTestContactUtilities.php'; diff --git a/tests/SugarTestUserUtilities.php b/tests/SugarTestUserUtilities.php index 2ca1181d..b8811652 100755 --- a/tests/SugarTestUserUtilities.php +++ b/tests/SugarTestUserUtilities.php @@ -93,4 +93,4 @@ class SugarTestUserUtilities return $user_ids; } -} \ No newline at end of file +} diff --git a/tests/data/Bug33036Test.php b/tests/data/Bug33036Test.php index cc517706..1b30d5d3 100755 --- a/tests/data/Bug33036Test.php +++ b/tests/data/Bug33036Test.php @@ -77,7 +77,7 @@ class Bug33036Test extends Sugar_PHPUnit_Framework_TestCase $this->obj->retrieve(); $this->obj->account_name = $test_account_name; - $changes = $this->obj->db->getDataChanges($this->obj); + $changes = $this->obj->db->getAuditDataChanges($this->obj); $this->assertEquals($changes['account_name']['after'], $test_account_name); diff --git a/tests/data/Bug49281Test.php b/tests/data/Bug49281Test.php index 7aea1f89..63b95b38 100755 --- a/tests/data/Bug49281Test.php +++ b/tests/data/Bug49281Test.php @@ -42,6 +42,8 @@ class Bug49281Test extends Sugar_PHPUnit_Framework_TestCase public function setUp() { + SugarTestHelper::setUp('beanList'); + SugarTestHelper::setUp('beanFiles'); $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser(); } @@ -50,6 +52,7 @@ class Bug49281Test extends Sugar_PHPUnit_Framework_TestCase SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); unset($GLOBALS['current_user']); SugarTestAccountUtilities::removeAllCreatedAccounts(); + SugarTestHelper::tearDown(); } /** * @ticket 49281 diff --git a/tests/data/Bug54639Test.php b/tests/data/Bug54639Test.php new file mode 100755 index 00000000..729d44bf --- /dev/null +++ b/tests/data/Bug54639Test.php @@ -0,0 +1,91 @@ +contact = new Contact(); + $this->contact->field_defs["as_tetrispe_accounts_name"] = array ( + 'name' => 'as_tetrispe_accounts_name', + 'type' => 'relate', + 'source' => 'non-db', + 'vname' => 'LBL_AS_TETRISPERSON_ACCOUNTS_FROM_ACCOUNTS_TITLE', + 'save' => true, + 'id_name' => 'as_tetrispac95ccounts_ida', + 'link' => 'as_tetrisperson_accounts', + 'table' => 'accounts', + 'module' => 'Accounts', + 'rname' => 'name', + ); + + $this->contact->field_defs["as_tetrispac95ccounts_ida"] = array ( + 'name' => 'as_tetrispac95ccounts_ida', + 'type' => 'link', + 'relationship' => 'as_tetrisperson_accounts', + 'source' => 'non-db', + 'reportable' => false, + 'side' => 'right', + 'vname' => 'LBL_AS_TETRISPERSON_ACCOUNTS_FROM_AS_TETRISPERSON_TITLE', + ); + } + + /** + * Test getting import fields from a bean when a relationship has been defined and the id field is only defined as a link + * and not a relate entry. The id field should be exposed so that users can select it from a list during the import process. + * + * @group bug54639 + * @return void + */ + public function testGetImportableFields() + { + $c = new Contact(); + $importableFields = $c->get_importable_fields(); + $this->assertTrue(isset($importableFields['as_tetrispac95ccounts_ida'])); + } +} \ No newline at end of file diff --git a/tests/data/Relationships/Bug57409Test.php b/tests/data/Relationships/Bug57409Test.php new file mode 100755 index 00000000..18563264 --- /dev/null +++ b/tests/data/Relationships/Bug57409Test.php @@ -0,0 +1,94 @@ +contact = SugarTestContactUtilities::createContact(); + $this->contact->load_relationship('opportunities'); + $this->contact->opportunities->add($opp1->id); + } + + public function tearDown() + { + SugarTestOpportunityUtilities::removeAllCreatedOpportunities(); + SugarTestContactUtilities::removeAllCreatedContacts(); + + SugarTestHelper::tearDown(); + } + + /** + * Test asserts that query returns correct number of records + * + * @group 57409 + * @return void + */ + public function testGetQuery() + { + $query = $this->contact->opportunities->relationship->getQuery($this->contact->opportunities, array( + 'enforce_teams' => true + )); + + $actual = 0; + $result = $GLOBALS['db']->query($query); + while ($GLOBALS['db']->fetchByAssoc($result, FALSE)) { + $actual++; + } + + $this->assertEquals(1, $actual, 'Number of fetched opportunities is incorrect'); + } +} \ No newline at end of file diff --git a/tests/data/SugarBeanTest.php b/tests/data/SugarBeanTest.php index b88a1004..f525c53a 100755 --- a/tests/data/SugarBeanTest.php +++ b/tests/data/SugarBeanTest.php @@ -46,6 +46,17 @@ class SugarBeanTest extends Sugar_PHPUnit_Framework_TestCase $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser(); } + public function setUp() + { + SugarTestHelper::setUp('beanFiles'); + SugarTestHelper::setUp('beanList'); + } + + public function tearDown() + { + SugarTestHelper::tearDown(); + } + public static function tearDownAfterClass() { SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); diff --git a/tests/include/MVC/View/Bug44831Test.php b/tests/include/MVC/View/Bug44831Test.php index a730c9c8..a71dbe42 100755 --- a/tests/include/MVC/View/Bug44831Test.php +++ b/tests/include/MVC/View/Bug44831Test.php @@ -104,6 +104,7 @@ EOQ; SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); unset($GLOBALS['app_list_strings']); unset($GLOBALS['current_user']); + unset($_SERVER['REQUEST_METHOD']); } /** diff --git a/tests/include/MassUpdate/Bug46276Test.php b/tests/include/MassUpdate/Bug46276Test.php index a78db169..76561361 100755 --- a/tests/include/MassUpdate/Bug46276Test.php +++ b/tests/include/MassUpdate/Bug46276Test.php @@ -45,6 +45,9 @@ class Bug46276Test extends Sugar_PHPUnit_Framework_TestCase public function setUp() { + // in case someone wipes out these globals. + SugarTestHelper::setUp('beanList'); + SugarTestHelper::setUp('beanFiles'); global $current_user, $timedate; // Create Anon User setted on GMT+1 TimeZone diff --git a/tests/include/database/Bug42475Test.php b/tests/include/database/Bug42475Test.php index b48c2b83..643c844f 100755 --- a/tests/include/database/Bug42475Test.php +++ b/tests/include/database/Bug42475Test.php @@ -40,16 +40,32 @@ */ class Bug42475Test extends Sugar_PHPUnit_Framework_TestCase { + /** @var Bug42475TestBean */ + private $bean; + + public function setUp() + { + $this->bean = new Bug42475TestBean(); + $this->bean->field_defs['test_field'] = array( + 'type' => 'currency', + ); + } + + public function tearDown() + { + unset($this->bean->field_defs['test_field']); + } + public function testAuditingCurrency() { // getDataChanges $testBean = new Bug42475TestBean(); - $dataChanges = $testBean->db->getDataChanges($testBean); + $dataChanges = $testBean->db->getAuditDataChanges($testBean); $this->assertEquals(0,count($dataChanges), "New test bean shouldn't have any changes"); $testBean = new Bug42475TestBean(); $testBean->test_field = 3829.83862; - $dataChanges = $testBean->db->getDataChanges($testBean); + $dataChanges = $testBean->db->getAuditDataChanges($testBean); $this->assertEquals(1,count($dataChanges), "Test bean should have 1 change since we added assigned new value to test_field"); diff --git a/tests/include/utils/XssTest.php b/tests/include/utils/XssTest.php index cb8451f4..ed3125b9 100755 --- a/tests/include/utils/XssTest.php +++ b/tests/include/utils/XssTest.php @@ -49,6 +49,11 @@ class XssTest extends Sugar_PHPUnit_Framework_TestCase $this->email_xss = $sugar_config['email_xss']; $sugar_config['email_xss'] = ''; } + if(isset($GLOBALS['sugar_config']['html_allow_objects'])) { + $this->allow_objects = $GLOBALS['sugar_config']['html_allow_objects']; + } + $GLOBALS['sugar_config']['html_allow_objects'] = true; + SugarCleaner::$instance = null; } public function tearDown() diff --git a/tests/modules/Calendar/Bug57299Test.php b/tests/modules/Calendar/Bug57299Test.php new file mode 100755 index 00000000..ef6f171d --- /dev/null +++ b/tests/modules/Calendar/Bug57299Test.php @@ -0,0 +1,191 @@ +name)); + + $this->user = $GLOBALS['current_user']; + + $this->user->setPreference('datef', 'm/d/Y'); + $this->user->setPreference('timef', 'h:ia'); + $this->user->setPreference('timezone', 'UTC'); + + } + + public function tearDown() + { + $_POST = array(); + + $this->bean->db->query("DELETE FROM meetings WHERE id = '". $this->bean->id ."'"); + $this->bean->db->query("DELETE FROM {$this->bean->rel_users_table} WHERE meeting_id = '". $this->bean->id ."'"); + + parent::tearDown(); + SugarTestHelper::tearDown(); + } + + public function getPostData() + { + return array( + 'module' => 'Calendar', + 'name' => 'Bug57299_'.time(), + 'current_module' => $this->name, + 'record' => '', + 'user_invitees' => '1', + 'contact_invitees' => '', + 'lead_invitees' => '', + 'send_invites' => '', + 'edit_all_recurrences' => true, + 'repeat_parent_id' => '', + 'repeat_type' => '', + 'repeat_interval' => '', + 'repeat_count' => '', + 'repeat_until' => '', + 'repeat_dow' => '', + 'appttype' => $this->name, + 'type' => 'Sugar', + 'date_start' => '11/25/2012 12:00pm', + 'parent_type' => 'Accounts', + 'parent_name' => '', + 'parent_id' => '', + 'date_end' => '11/25/2012 12:15pm', + 'location' => '', + 'duration' => 900, + 'duration_hours' => 0, + 'duration_minutes' => 15, + 'reminder_checked' => 1, + 'reminder_time' => 1800, + 'email_reminder_checked' => 0, + 'email_reminder_time' => 60, + 'assigned_user_name' => 'Administrator', + 'assigned_user_id' => 1, + 'update_fields_team_name_collection' => '', + 'team_name_new_on_update' => false, + 'team_name_allow_update' => '', + 'team_name_allow_new' => true, + 'team_name' => 'team_name', + 'team_name_field' => 'team_name_table', + 'arrow_team_name' => 'hide', + 'team_name_collection_0' => 'Global', + 'id_team_name_collection_0' => 1, + 'primary_team_name_collection' => 0, + 'description' => '', + ); + } + + /** + * providerData + * + * @return Array values for testing + */ + public function providerData() + { + return array( + array('Held', true), + array('Held', false), + ); + } + + /** + * @group 57299 + * Test that new Meeting created from module Calendar save in database correctly + * + * @dataProvider providerData + * @return void + */ + public function testDisplaysMeetingWithStatusHeldInCalendar($status, $return_module) + { + $_POST = $this->getPostData(); + $_POST['status'] = $status; + $_POST['return_module'] = ($return_module) ? 'Calendar' : ''; + $_REQUEST = $_POST; + + $this->formBase = new MeetingFormBase(); + $this->bean = $this->formBase->handleSave('', false, false); + + $sql = "SELECT * FROM {$this->bean->rel_users_table} WHERE meeting_id = '". $this->bean->id . "'"; + $result = $this->bean->db->query($sql); + $rows = $this->bean->db->fetchByAssoc($result); + + //assert that if we return name of Calendar module + //create relation between created Meeting and current User + if($return_module) + { + $this->assertNotNull($rows); + } + else + { + $this->assertFalse($rows); + } + } +} diff --git a/tests/modules/Campaigns/Bug41523Test.php b/tests/modules/Campaigns/Bug41523Test.php index d3f92747..602caf3d 100755 --- a/tests/modules/Campaigns/Bug41523Test.php +++ b/tests/modules/Campaigns/Bug41523Test.php @@ -77,6 +77,8 @@ class Bug41523Test extends Sugar_PHPUnit_Framework_TestCase public function tearDown() { + unset($_SERVER['REQUEST_METHOD']); + // Delete created campaings SugarTestCampaignUtilities::removeAllCreatedCampaigns(); diff --git a/tests/modules/EmailAddresses/Bug56938Test.php b/tests/modules/EmailAddresses/Bug56938Test.php new file mode 100755 index 00000000..7a9267c8 --- /dev/null +++ b/tests/modules/EmailAddresses/Bug56938Test.php @@ -0,0 +1,115 @@ +user = SugarTestUserUtilities::createAnonymousUser(); + SugarTestEmailAddressUtilities::addAddressToPerson( + $this->user, + 'bug-56938-test@example.com' + ); + } + + /** + * Ensure that a new instance of EmailAddress is created during creating + * User duplicate + */ + public function testCreateDuplicate() + { + // retrieve created user from database in order to populate email addresses + $original = new User(); + $original->retrieve($this->user->id); + + // simulate request parameters of "Duplicate" web form + $address = $original->emailAddress->addresses[0]; + $_REQUEST = array( + 'Users_email_widget_id' => '1', + 'Users1emailAddress0' => $address['email_address'], + 'Users1emailAddressId0' => $address['email_address_id'], + ); + + // create a duplicate and retrieve it from database as well + $duplicate = $this->duplicate = new User(); + $duplicate->save(); + + $retrieved = new User(); + $retrieved->retrieve($duplicate->id); + + // ensure that email address is created in duplicate + $this->assertEquals(1, count($retrieved->emailAddress->addresses)); + + // ensure that it's value is the same as original email address + $this->assertEquals( + $original->emailAddress->addresses[0]['email_address'], + $retrieved->emailAddress->addresses[0]['email_address'] + ); + + // ensure that new instance of EmailAddress is created instead of + // sharing the same instance between users + $this->assertNotEquals( + $original->emailAddress->addresses[0]['email_address_id'], + $retrieved->emailAddress->addresses[0]['email_address_id'] + ); + } + + /** + * Tears down the fixture, for example, close a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() + { + $_REQUEST = array(); + SugarTestEmailAddressUtilities::removeAllCreatedAddresses(); + SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); + if ($this->duplicate) + { + $this->duplicate->mark_deleted($this->duplicate->id); + } + } +} diff --git a/tests/modules/Import/Bug58207Test.csv b/tests/modules/Import/Bug58207Test.csv new file mode 100755 index 00000000..e1ee6243 --- /dev/null +++ b/tests/modules/Import/Bug58207Test.csv @@ -0,0 +1,8 @@ +"–¼‘O","ID","WebƒTƒCƒg","“dŽqƒ[ƒ‹ƒAƒhƒŒƒX","‰ïŽÐ“d˜b","‚»‚Ì‘¼‚Ì“d˜b","ƒtƒ@ƒbƒNƒX","¿‹æ”Ô’n‚»‚Ì‘¼","¿‹æŽs‹æ’¬‘º","¿‹æ“s“¹•{Œ§","¿‹æ—X•Ö”ԍ†","¿‹æ‘","o‰×æ”Ô’n‚»‚Ì‘¼","o‰×æŽs‹æ’¬‘º","o‰×æ“s“¹•{Œ§","o‰×æ—X•Ö”ԍ†","o‰×æ‘","Ú×","ƒ^ƒCƒv","‹ÆŠE","”NŠÔ”„ã","]‹Æˆõ","‹ÆŠEƒR[ƒh","ØŒ”ƒR[ƒh","eŽæˆøæID","Šé‹ÆŒ`‘Ô","ƒLƒƒƒ“ƒy[ƒ“ID","Ši•t","ƒAƒTƒCƒ“æ","ƒAƒTƒCƒ“æ","ƒ`[ƒ€ID","ƒ`[ƒ€","ƒ`[ƒ€ƒZƒbƒgID","ì¬“ú","XV“ú","XVŽÒ","ì¬ŽÒ","íœÏ‚Ý" +"Waverly Trading House","37de5701-fdf2-902c-b363-50b540c79fb4","www.imbeans.tv","the47@example.de","(148) 991-4528","","","999 Baker Way","Los Angeles","NY","66541","USA","999 Baker Way","Los Angeles","NY","66541","USA","","Customer","Banking","","","","","","","","","Chris Olliver","seed_chris_id","East","East, West","8bf7322a-f7a1-79f3-8580-50b540ef736f","11/27/2012 11:34 pm","11/27/2012 11:34 pm","1","1","0" +"Grow-Fast Inc","3fc1b188-1cfd-b472-2160-50b540cd6d67","www.thesales.co.uk","dev.hr.info@example.com","(333) 484-4996","","","1715 Scott Dr","Kansas City","NY","86109","USA","1715 Scott Dr","Kansas City","NY","86109","USA","","Customer","Technology","","","","","","","","","Chris Olliver","seed_chris_id","East","East","East","11/27/2012 11:34 pm","11/27/2012 11:34 pm","1","1","0" +"T-Cat Media Group Inc","50032c30-1a03-e691-67b2-50b5403bbfbf","www.qasupport.org","qa94@example.co.uk","(812) 064-9923","","","999 Baker Way","Santa Monica","NY","84468","USA","999 Baker Way","Santa Monica","NY","84468","USA","","Customer","Insurance","","","","","","","","","Chris Olliver","seed_chris_id","East","East, West","8bf7322a-f7a1-79f3-8580-50b540ef736f","11/27/2012 11:34 pm","11/27/2012 11:34 pm","1","1","0" +"Insight Marketing Inc","5b39dd88-85c6-ec1d-0773-50b540dae62a","www.kidinfo.us","sales.section.vegan@example.biz","(727) 078-1390","","","777 West Filmore Ln","Alabama","NY","26640","USA","777 West Filmore Ln","Alabama","NY","26640","USA","","Customer","Recreation","","","","","","","","","Chris Olliver","seed_chris_id","East","East","East","11/27/2012 11:34 pm","11/27/2012 11:34 pm","1","1","0" +"X-Sell Holdings","64bc1316-52da-e2aa-2581-50b540272da0","www.supportsales.co.uk","sales93@example.info","(143) 610-4401","","","345 Sugar Blvd.","Santa Monica","NY","39128","USA","345 Sugar Blvd.","Santa Monica","NY","39128","USA","","Customer","Banking","","","","","","","","","Chris Olliver","seed_chris_id","East","East, West","8bf7322a-f7a1-79f3-8580-50b540ef736f","11/27/2012 11:34 pm","11/27/2012 11:34 pm","1","1","0" + +"‚±‚ê‚́A‚·‚®‚ɃCƒ“ƒ|[ƒg‰Â”\‚ȃtƒ@ƒCƒ‹‚Æ‚µ‚Ä—˜—p‰Â”\‚ȃTƒ“ƒvƒ‹ƒCƒ“ƒ|[ƒgƒtƒ@ƒCƒ‹‚Å‚·B"
"ƒtƒ@ƒCƒ‹‚Í‹æØ‚蕶Žš‚Ƀ_ƒuƒ‹ƒNƒH[ƒg‚ðŽg—p‚µ‚½ƒJƒ“ƒ}‹æØ‚è‚Ì.csvƒtƒ@ƒCƒ‹‚Å‚·B"

"ƒwƒbƒ_s‚̓tƒ@ƒCƒ‹‚̈ê”ԏã‚̍s‚ŁAƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚Å•\Ž¦‚³‚ê‚éƒtƒB[ƒ‹ƒhƒ‰ƒxƒ‹‚ªŠÜ‚Ü‚ê‚Ä‚¢‚Ü‚·B"
"ƒ‰ƒxƒ‹‚̓AƒvƒŠƒP[ƒVƒ‡ƒ“‚̃tƒB[ƒ‹ƒh‚Ƀ}ƒbƒ`ƒ“ƒO‚·‚éÛ‚ÉŽg—p‚³‚ê‚Ü‚·B"

"’: ƒf[ƒ^ƒx[ƒX–¼‚àƒwƒbƒ_[s‚Æ‚µ‚Ä—˜—p‚Å‚«‚Ü‚·B‚±‚ê‚́AphpMyAdmin‚»‚Ì‘¼‚̃f[ƒ^ƒx[ƒXƒc[ƒ‹‚ð—˜—p‚µ‚ăCƒ“ƒ|[ƒg—p‚̃f[ƒ^‚ðƒGƒNƒXƒ|[ƒg‚·‚éê‡‚É•Ö—˜‚È‹@”\‚Å‚·B"
"ƒCƒ“ƒ|[ƒgŽž‚ɂ̃wƒbƒ_[s‚ÉŠî‚­ƒf[ƒ^‚̃}ƒbƒ`ƒ“ƒO‚É‚¨‚¢‚āAƒJƒ‰ƒ€‡‚ÍŠÖŒW‚ ‚è‚Ü‚¹‚ñB"


"‚±‚̃tƒ@ƒCƒ‹‚ðƒeƒ“ƒvƒŒ[ƒg‚Æ‚µ‚ÄŽg—p‚·‚é‚ɂ͈ȉº‚̂悤‚ÉŽÀŽ{‚µ‚Ä‚­‚¾‚³‚¢B:"
"1. ƒf[ƒ^‚̃Tƒ“ƒvƒ‹s‚ðíœ‚µ‚Ü‚·"
"2. ‚±‚̃wƒ‹ƒvƒeƒLƒXƒg‚ðíœ‚µ‚Ü‚·"
"3. Š’è‚̍s‚Æ—ñ‚Ƀf[ƒ^‚ðƒCƒ“ƒvƒbƒg‚µ‚Ü‚·"
"4. ‚í‚©‚éêŠ‚Ƀtƒ@ƒCƒ‹‚ð•Û‘¶‚µ‚Ü‚·"
"5. ƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚̃AƒNƒVƒ‡ƒ“ƒƒjƒ…[‚©‚çƒCƒ“ƒ|[ƒgƒIƒvƒVƒ‡ƒ“‚ðƒNƒŠƒbƒN‚µ‚ătƒ@ƒCƒ‹‚̃Aƒbƒvƒ[ƒh‚ð‘I‘ð‚µ‚Ü‚·" \ No newline at end of file diff --git a/tests/modules/UpgradeWizard/Bug42490Test.php b/tests/modules/Import/Bug58207Test.php similarity index 61% rename from tests/modules/UpgradeWizard/Bug42490Test.php rename to tests/modules/Import/Bug58207Test.php index 2206aae9..6989b755 100755 --- a/tests/modules/UpgradeWizard/Bug42490Test.php +++ b/tests/modules/Import/Bug58207Test.php @@ -34,51 +34,56 @@ * "Powered by SugarCRM". ********************************************************************************/ - -require_once('modules/UpgradeWizard/uw_utils.php'); -require_once('modules/MySettings/TabController.php'); -class Bug42490Test extends Sugar_PHPUnit_Framework_TestCase +require_once('modules/Import/sources/ImportFile.php'); + +/** + * Test checks Import when not using UTF-8 encoding + * + * @ticket 58207 + * @author avucinic + * + */ +class Bug58207Test extends Sugar_PHPUnit_Framework_TestCase { - private $_originalEnabledTabs; - private $_tc; - + + private $_file; + private $_sugarConfig; + public function setUp() { - SugarTestHelper::setUp('moduleList'); - SugarTestHelper::setUp('current_user', array(true, 1)); - $this->_tc = new TabController(); - $tabs = $this->_tc->get_tabs_system(); - $this->_originalEnabledTabs = $tabs[0]; + // SJIS encoded Japanese CSV + $this->_file = 'tests/modules/Import/Bug58207Test.csv'; + + global $sugar_config; + $this->_sugarConfig = $sugar_config; + $sugar_config['default_export_charset'] = "SJIS"; + + SugarTestHelper::setUp('current_user'); } - public function tearDown() - { - if (!empty($this->_originalEnabledTabs)) - { - $this->_tc->set_system_tabs($this->_originalEnabledTabs); - } - } + public function tearDown() + { + SugarTestHelper::tearDown(); + global $sugar_config; + $sugar_config = $this->_sugarConfig; + } + + /** + * Import a SJIS encoded file, and check if getNextRow() properly + * converts all the data into UTF-8 + */ + public function testFileImportEncoding() + { + $importFile = new ImportFile($this->_file, ',', '"', FALSE, FALSE); - public function testUpgradeDisplayedTabsAndSubpanels() - { - $modules_to_add = array( - 'Calls', - 'Meetings', - 'Tasks', - 'Notes', - 'Prospects', - 'ProspectLists', - ); + $row = $importFile->getNextRow(); + + // Hardcode some Japanese strings + $this->assertEquals('名前', $row[0]); + $this->assertEquals('請求先郵便番号', $row[10]); + $this->assertEquals('年間売上', $row[20]); + $this->assertEquals('チームID', $row[30]); + } - upgradeDisplayedTabsAndSubpanels('610'); - - $all_tabs = $this->_tc->get_tabs_system(); - $tabs = $all_tabs[0]; - - foreach($modules_to_add as $module) - { - $this->assertArrayHasKey($module, $tabs, 'Assert that ' . $module . ' tab is set for system tabs'); - } - } -} +} \ No newline at end of file diff --git a/tests/modules/UpgradeWizard/Bug57162Test.php b/tests/modules/UpgradeWizard/Bug57162Test.php new file mode 100755 index 00000000..38ef1e7a --- /dev/null +++ b/tests/modules/UpgradeWizard/Bug57162Test.php @@ -0,0 +1,84 @@ +assertEquals($expected, $actual, 'Result is incorrect'); + } +} diff --git a/tests/modules/Users/Bug49896Test.php b/tests/modules/Users/Bug49896Test.php deleted file mode 100755 index aad82f1d..00000000 --- a/tests/modules/Users/Bug49896Test.php +++ /dev/null @@ -1,117 +0,0 @@ -_passwordSetting = $GLOBALS['sugar_config']['passwordsetting']; - } - $GLOBALS['sugar_config']['passwordsetting'] = array('onenumber'=>1, - 'onelower'=>1, - 'oneupper'=>1, - 'onespecial'=>1, - 'minpwdlength'=>6, - 'maxpwdlength'=>15); - $this->_currentUser = SugarTestUserUtilities::createAnonymousUser(false); - } - - public function tearDown() - { - if(!empty($this->_passwordSetting)) - { - $GLOBALS['sugar_config']['passwordsetting'] = $this->_passwordSetting; - } - SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); - } - - public function testMinLength() - { - $result = $this->_currentUser->check_password_rules('Tes1!'); - $this->assertEquals(false, $result, 'Assert that min length rule is checked'); - } - - public function testMaxLength() - { - $result = $this->_currentUser->check_password_rules('Tester123456789!'); - $this->assertEquals(false, $result, 'Assert that max length rule is checked'); - } - - public function testOneNumber() - { - $result = $this->_currentUser->check_password_rules('Tester!'); - $this->assertEquals(false, $result, 'Assert that one number rule is checked'); - } - - public function testOneLower() - { - $result = $this->_currentUser->check_password_rules('TESTER1!'); - $this->assertEquals(false, $result, 'Assert that one lower rule is checked'); - } - - public function testOneUpper() - { - $result = $this->_currentUser->check_password_rules('tester1!'); - $this->assertEquals(false, $result, 'Assert that one upper rule is checked'); - } - - public function testOneSpecial() - { - $result = $this->_currentUser->check_password_rules('Tester1'); - $this->assertEquals(false, $result, 'Assert that one special rule is checked'); - } - - public function testCustomRegex() - { - $GLOBALS['sugar_config']['passwordsetting']['customregex'] = '/^T/'; - $result = $this->_currentUser->check_password_rules('tester1!'); - $this->assertEquals(false, $result, 'Assert that custom regex is checked'); - } - - public function testAllCombinations() - { - $result = $this->_currentUser->check_password_rules('Tester1!'); - $this->assertEquals(true, $result, 'Assert that all rules are checked and passed'); - } -} -?> \ No newline at end of file diff --git a/tests/service/Bug51617Test.php b/tests/service/Bug51617Test.php index 8a025a62..3ed27ce0 100755 --- a/tests/service/Bug51617Test.php +++ b/tests/service/Bug51617Test.php @@ -45,15 +45,9 @@ class Bug51617Test extends SOAPTestCase { $this->_soapURL = $GLOBALS['sugar_config']['site_url'].'/service/v2/soap.php'; - $beanList = array(); - $beanFiles = array(); - require('include/modules.php'); - $GLOBALS['beanList'] = $beanList; - $GLOBALS['beanFiles'] = $beanFiles; - $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser(); - $GLOBALS['current_user']->status = 'Active'; - $GLOBALS['current_user']->is_admin = 1; - $GLOBALS['current_user']->save(); + SugarTestHelper::setUp('beanFiles'); + SugarTestHelper::setUp('beanList'); + SugarTestHelper::setUp('current_user', array(true, 1)); $this->field = get_widget('varchar'); $this->field->id = 'Accountstest_custom_c'; @@ -104,17 +98,14 @@ class Bug51617Test extends SOAPTestCase SugarTestAccountUtilities::removeAllCreatedAccounts(); - SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); - unset($GLOBALS['current_user']); - parent::tearDown(); global $soap_version_test_accountId, $soap_version_test_opportunityId, $soap_version_test_contactId; unset($soap_version_test_accountId); unset($soap_version_test_opportunityId); unset($soap_version_test_contactId); - unset($GLOBALS['beanFiles']); - unset($GLOBALS['beanList']); + + SugarTestHelper::tearDown(); } public function testGetEntryListWithCustomField() @@ -124,7 +115,7 @@ class Bug51617Test extends SOAPTestCase array( 'session'=>$this->_sessionId, "module_name" => 'Accounts', - '', + "accounts.id = '{$this->_account->id}'", '', 0, "select_fields" => array('id', 'name', 'test_custom_c'), diff --git a/tests/soap/Bug58138Test.php b/tests/soap/Bug58138Test.php new file mode 100755 index 00000000..2be1d563 --- /dev/null +++ b/tests/soap/Bug58138Test.php @@ -0,0 +1,226 @@ +field = get_widget('varchar'); + $this->field->id = 'Contactstest_c'; + $this->field->name = 'test_c'; + $this->field->type = 'varchar'; + $this->field->len = 255; + $this->field->importable = 'true'; + + $this->field->label = ''; + + $this->module = new Contact(); + + $this->dynamicField = new DynamicField('Contacts'); + + $this->dynamicField->setup($this->module); + $this->dynamicField->addFieldObject($this->field); + + SugarTestHelper::setUp('dictionary'); + $GLOBALS['reload_vardefs'] = true; + + $this->account = SugarTestAccountUtilities::createAccount(); + + $this->contact = SugarTestContactUtilities::createContact(); + $this->contact->account_id = $this->account->id; + $this->contact->test_c = 'test value'; + $this->contact->load_relationship('accounts'); + $this->contact->accounts->add($this->account->id); + $this->contact->save(); + + $GLOBALS['db']->commit(); + } + + /** + * Removing field, account, contact + */ + public function tearDown() + { + SugarTestContactUtilities::removeAllCreatedContacts(); + SugarTestAccountUtilities::removeAllCreatedAccounts(); + + $this->dynamicField->deleteField($this->field); + + SugarTestHelper::tearDown(); + } + + /** + * Test asserts that contact can be found by custom field + * + * @group 58138 + */ + public function testSoap() + { + $soap_url = $GLOBALS['sugar_config']['site_url'] . '/soap.php'; + $this->soap = new nusoapclient($soap_url); + + $result = $this->soap->call('login', array( + 'user_auth' => array( + 'user_name' => $GLOBALS['current_user']->user_name, + 'password' => $GLOBALS['current_user']->user_hash, + 'version' => '.01' + ), + 'application_name' => 'SoapTest' + ) + ); + + $actual = $this->soap->call('get_relationships', array( + 'session' => $result['id'], + 'module_name' => 'Accounts', + 'module_id' => $this->account->id, + 'link_field_name' => 'Contacts', + 'related_module_query' => "contacts_cstm.test_c = 'test value' ", + 'deleted' => '1', + )); + + $this->assertInternalType('array', $actual, 'Incorrect response'); + + if (empty($actual['ids'])) + { + $this->fail('Data is not present'); + } + + $actual = reset($actual['ids']); + $this->assertEquals($this->contact->id, $actual['id'], 'Contact is incorrect'); + } + + public static function dataProvider() + { + return array( + array('/service/v2/soap.php'), + array('/service/v2_1/soap.php'), + array('/service/v3/soap.php'), + array('/service/v3_1/soap.php'), + array('/service/v4/soap.php'), + array('/service/v4_1/soap.php') + ); + } + + /** + * Test asserts that contact can be found by custom field + * + * @group 58138 + * @dataProvider dataProvider + */ + public function testSoapVersions($url) + { + $soap_url = $GLOBALS['sugar_config']['site_url'] . $url; + $this->soap = new nusoapclient($soap_url); + + $result = $this->soap->call('login', array( + 'user_auth' => array( + 'user_name' => $GLOBALS['current_user']->user_name, + 'password' => $GLOBALS['current_user']->user_hash, + 'version' => '.01' + ), + 'application_name' => 'SoapTest' + ) + ); + + $actual = $this->soap->call('get_relationships', array( + 'session' => $result['id'], + 'module_name' => 'Accounts', + 'module_id' => $this->account->id, + 'link_field_name' => 'contacts', + 'related_module_query' => "contacts_cstm.test_c = 'test value' ", + 'link_module_fields' => array('id'), + 'deleted' => '1', + )); + + $this->assertInternalType('array', $actual, 'Incorrect response'); + + if (empty($actual['entry_list'])) + { + $this->fail('Data is not present'); + } + + $actual = reset($actual['entry_list']); + $this->assertEquals($this->contact->id, $actual['id'], 'Contact is incorrect'); + } +} diff --git a/themes/Sugar5/tpls/header.tpl b/themes/Sugar5/tpls/header.tpl index 339f0e9d..4e9c9a44 100644 --- a/themes/Sugar5/tpls/header.tpl +++ b/themes/Sugar5/tpls/header.tpl @@ -38,7 +38,7 @@ {include file="_head.tpl" theme_template=true} -{$SUGAR_DCJS} +{$DCSCRIPT}