From f6ed54c0e6c5a0dd6a56c359091fe9eaefc555d6 Mon Sep 17 00:00:00 2001 From: Paul Huang Date: Mon, 19 Nov 2012 18:38:07 -0800 Subject: [PATCH] Release 6.5.8 --- ModuleInstall/ModuleScanner.php | 82 +++++-- cache/include/javascript/sugar_grp1.js | 5 +- cache/include/javascript/sugar_grp_emails.js | 6 +- cache/include/javascript/sugar_grp_jsolait.js | 16 +- .../include/javascript/sugar_grp_quickcomp.js | 6 +- data/Link2.php | 2 +- data/Relationships/SugarRelationship.php | 24 +- data/SugarBean.php | 88 ++++++-- files.md5 | 129 +++++------ include/DetailView/header.tpl | 4 +- include/EditView/EditView.tpl | 2 +- .../HTMLPurifier/HTMLPurifier.standalone.php | 1 - include/MVC/View/views/view.importvcard.php | 2 +- .../MVC/View/views/view.importvcardsave.php | 2 +- include/MVC/View/views/view.popup.php | 2 +- include/Smarty/Smarty_Compiler.class.php | 41 ++-- .../Smarty/plugins/function.sugar_button.php | 1 + include/SugarCharts/SugarChart.php | 33 ++- .../SugarEmailAddress/SugarEmailAddress.php | 87 +++++--- include/SugarLogger/LoggerManager.php | 18 ++ include/SugarTheme/SugarTheme.php | 16 +- include/clean.php | 5 +- include/database/MssqlManager.php | 24 +- .../SugarWidgets/SugarWidgetFieldcurrency.php | 91 ++++---- .../SugarWidgetFieldcurrency_id.php | 121 ++++++++++ .../SugarWidgets/SugarWidgetReportField.php | 8 +- .../SugarWidgets/SugarWidgetSubPanelIcon.php | 2 +- include/globalControlLinks.php | 2 +- include/javascript/sugar_3.js | 5 +- include/utils.php | 3 +- .../src_files/include/javascript/sugar_3.js | 12 +- .../modules/Meetings/jsclass_scheduler.js | 64 ------ modules/ACLActions/ACLAction.php | 19 +- modules/Activities/EmailReminder.php | 14 +- modules/Administration/Locale.php | 8 +- modules/Administration/UpgradeWizard.php | 10 +- .../Administration/UpgradeWizardCommon.php | 1 + .../Administration/UpgradeWizard_prepare.php | 5 +- .../Administration/language/en_us.lang.php | 3 +- modules/Calendar/tpls/main.tpl | 4 +- modules/Calls/CallFormBase.php | 7 +- modules/Calls/language/en_us.lang.php | 1 - modules/Calls/metadata/editviewdefs.php | 8 +- modules/Calls/vardefs.php | 11 - modules/Emails/EmailUI.php | 12 +- modules/Emails/javascript/EmailUICompose.js | 2 +- modules/Emails/javascript/ajax.js | 4 +- .../Emails/javascript/composeEmailTemplate.js | 2 +- modules/Import/ImportDuplicateCheck.php | 12 + modules/InboundEmail/InboundEmail.php | 2 +- modules/Leads/tpls/ConvertLead.tpl | 27 ++- modules/Leads/views/view.convertlead.php | 21 ++ modules/Meetings/Meeting.php | 19 +- modules/Meetings/MeetingFormBase.php | 6 + modules/Meetings/jsclass_scheduler.js | 16 +- modules/Meetings/language/en_us.lang.php | 1 - modules/Meetings/metadata/editviewdefs.php | 17 +- modules/Meetings/vardefs.php | 11 - modules/ModuleBuilder/MB/MBPackage.php | 114 ++++++++-- modules/ProjectTask/views/view.list.php | 12 +- modules/SchedulersJobs/SchedulersJob.php | 11 +- modules/Tasks/Task.php | 21 +- modules/Users/User.php | 25 ++- sugar_version.php | 8 +- tests/ModuleInstall/ModuleScannerTest.php | 23 ++ tests/SugarTestHelper.php | 1 + tests/SugarTestOpportunityUtilities.php | 13 +- tests/SugarTestSugarEmailAddressUtilities.php | 183 ++++++++++++++++ tests/data/Bug56652Test.php | 139 ++++++++++++ tests/data/Relationships/Bug56904Test.php | 151 +++++++++++++ tests/data/SugarBeanTest.php | 83 ++++++- tests/include/SugarCharts/Bug44696Test.php | 206 +++++++++++------ .../SugarEmailAddressAddChangeTest.php | 150 +++++++++++++ tests/include/SugarLogger/SugarLoggerTest.php | 38 +++- .../generic/SugarWidgets/Bug51568Test.php | 207 ++++++++++++++++++ .../generic/SugarWidgets/Bug57902Test.php | 136 ++++++++++++ tests/modules/Import/Bug51264Test.php | 119 ++++++++++ tests/modules/Import/ImportCacheFilesTest.php | 7 +- .../Import/ImportDuplicateCheckTest.php | 3 +- .../InboundEmail/AttachmentHeaderTest.php | 96 ++++++++ tests/modules/Meetings/Bug53516Test.php | 86 ++++++++ tests/modules/ModuleBuilder/Bug45339Test.php | 96 ++++++-- tests/modules/SNIP/Bug53942Test.ics | 45 ++++ .../RunnableSchedulersJobsTest.php | 2 +- themes/Sugar5/tpls/_head.tpl | 1 + 85 files changed, 2542 insertions(+), 581 deletions(-) create mode 100644 include/generic/SugarWidgets/SugarWidgetFieldcurrency_id.php create mode 100755 tests/SugarTestSugarEmailAddressUtilities.php create mode 100755 tests/data/Bug56652Test.php create mode 100755 tests/data/Relationships/Bug56904Test.php create mode 100755 tests/include/SugarEmailAddress/SugarEmailAddressAddChangeTest.php create mode 100755 tests/include/generic/SugarWidgets/Bug51568Test.php create mode 100755 tests/include/generic/SugarWidgets/Bug57902Test.php create mode 100755 tests/modules/Import/Bug51264Test.php create mode 100755 tests/modules/InboundEmail/AttachmentHeaderTest.php create mode 100755 tests/modules/Meetings/Bug53516Test.php create mode 100755 tests/modules/SNIP/Bug53942Test.ics diff --git a/ModuleInstall/ModuleScanner.php b/ModuleInstall/ModuleScanner.php index 884a25e4..82ce7e1c 100644 --- a/ModuleInstall/ModuleScanner.php +++ b/ModuleInstall/ModuleScanner.php @@ -56,6 +56,13 @@ class ModuleScanner{ ); + /** + * config settings + * @var array + */ + private $config = array(); + private $config_hash; + private $blackListExempt = array(); private $classBlackListExempt = array(); @@ -392,20 +399,24 @@ class ModuleScanner{ } public function __construct(){ - if(!empty($GLOBALS['sugar_config']['moduleInstaller']['blackListExempt'])){ - $this->blackListExempt = array_merge($this->blackListExempt, $GLOBALS['sugar_config']['moduleInstaller']['blackListExempt']); + if(!empty($GLOBALS['sugar_config']['moduleInstaller'])) { + $this->config = $GLOBALS['sugar_config']['moduleInstaller']; + } + + if(!empty($this->config['blackListExempt'])){ + $this->blackListExempt = array_merge($this->blackListExempt, $this->config['blackListExempt']); } - if(!empty($GLOBALS['sugar_config']['moduleInstaller']['blackList'])){ - $this->blackList = array_merge($this->blackList, $GLOBALS['sugar_config']['moduleInstaller']['blackList']); + if(!empty($this->config['blackList'])){ + $this->blackList = array_merge($this->blackList, $this->config['blackList']); } - if(!empty($GLOBALS['sugar_config']['moduleInstaller']['classBlackListExempt'])){ - $this->classBlackListExempt = array_merge($this->classBlackListExempt, $GLOBALS['sugar_config']['moduleInstaller']['classBlackListExempt']); + if(!empty($this->config['classBlackListExempt'])){ + $this->classBlackListExempt = array_merge($this->classBlackListExempt, $this->config['classBlackListExempt']); } - if(!empty($GLOBALS['sugar_config']['moduleInstaller']['classBlackList'])){ - $this->classBlackList = array_merge($this->classBlackList, $GLOBALS['sugar_config']['moduleInstaller']['classBlackList']); + if(!empty($this->config['classBlackList'])){ + $this->classBlackList = array_merge($this->classBlackList, $this->config['classBlackList']); } - if(!empty($GLOBALS['sugar_config']['moduleInstaller']['validExt'])){ - $this->validExt = array_merge($this->validExt, $GLOBALS['sugar_config']['moduleInstaller']['validExt']); + if(!empty($this->config['validExt'])){ + $this->validExt = array_merge($this->validExt, $this->config['validExt']); } } @@ -596,12 +607,16 @@ class ModuleScanner{ if(!empty($fileIssues)){ return $fileIssues; } - include($manifestPath); - + $this->lockConfig(); + list($manifest, $installdefs) = MSLoadManifest($manifestPath); + $fileIssues = $this->checkConfig($manifestPath); + if(!empty($fileIssues)){ + return $fileIssues; + } //scan for disabled actions - if(isset($GLOBALS['sugar_config']['moduleInstaller']['disableActions'])){ - foreach($GLOBALS['sugar_config']['moduleInstaller']['disableActions'] as $action){ + if(isset($this->config['disableActions'])){ + foreach($this->config['disableActions'] as $action){ if(isset($installdefs[$this->manifestMap[$action]])){ $issues[] = translate('ML_INVALID_ACTION_IN_MANIFEST') . $this->manifestMap[$action]; } @@ -609,7 +624,7 @@ class ModuleScanner{ } //now lets scan for files that will override our files - if(empty($GLOBALS['sugar_config']['moduleInstaller']['disableRestrictedCopy']) && isset($installdefs['copy'])){ + if(empty($this->config['disableRestrictedCopy']) && isset($installdefs['copy'])){ foreach($installdefs['copy'] as $copy){ $from = str_replace('', $this->pathToModule, $copy['from']); $to = $copy['to']; @@ -683,7 +698,7 @@ class ModuleScanner{ public function scanPackage($path){ $this->pathToModule = $path; $this->scanManifest($path . '/manifest.php'); - if(empty($GLOBALS['sugar_config']['moduleInstaller']['disableFileScan'])){ + if(empty($this->config['disableFileScan'])){ $this->scanDir($path); } } @@ -719,8 +734,43 @@ class ModuleScanner{ } + /** + * Lock config settings + */ + public function lockConfig() + { + if(empty($this->config_hash)) { + $this->config_hash = md5(serialize($GLOBALS['sugar_config'])); + } + } + + /** + * Check if config was modified. Return + * @param string $file + * @return array Errors if something wrong, false if no problems + */ + public function checkConfig($file) + { + $config_hash_after = md5(serialize($GLOBALS['sugar_config'])); + if($config_hash_after != $this->config_hash) { + $this->issues['file'][$file] = array(translate('ML_CONFIG_OVERRIDE')); + return $this->issues; + } + return false; + } } +/** + * Load manifest file + * Outside of the class to isolate the context + * @param string $manifest_file + * @return array + */ +function MSLoadManifest($manifest_file) +{ + include( $manifest_file ); + return array($manifest, $installdefs); +} ?> \ No newline at end of file diff --git a/cache/include/javascript/sugar_grp1.js b/cache/include/javascript/sugar_grp1.js index 9aa5bf6d..311dd276 100644 --- a/cache/include/javascript/sugar_grp1.js +++ b/cache/include/javascript/sugar_grp1.js @@ -433,7 +433,10 @@ try{if(result[1].indexOf("src=")>-1){var srcRegex=/.*src=['"]([a-zA-Z0-9_\-\&\/\ {var url=srcResult;Y.Get.script(srcResult,{autopurge:false,onSuccess:function(o){},onFailure:function(o){},onTimeout:function(o){}});});} else {YUI().use("io-base",function(Y){var cfg,response;cfg={method:'GET',sync:true,on:{success:function(transactionid,response,arguments) -{SUGAR.util.globalEval(response.responseText);}}};response=Y.io(srcResult,cfg);});}}else{SUGAR.util.globalEval(result[2]);}} +{SUGAR.util.globalEval(response.responseText);}}};response=Y.io(srcResult,cfg);});}}else{var srcRegex=//;var srcResult=srcRegex.exec(result[2]);if(srcResult&&srcResult.index>-1) +{SUGAR.util.globalEval(srcResult[1]);} +else +{SUGAR.util.globalEval(result[2]);}}} catch(e){if(typeof(console)!="undefined"&&typeof(console.log)=="function") {console.log("error adding script");console.log(e);console.log(result);}} result=objRegex.exec(text);}},getLeftColObj:function(){leftColObj=document.getElementById('leftCol');while(leftColObj.nodeName!='TABLE'){leftColObj=leftColObj.firstChild;} diff --git a/cache/include/javascript/sugar_grp_emails.js b/cache/include/javascript/sugar_grp_emails.js index b7067434..f410c59c 100644 --- a/cache/include/javascript/sugar_grp_emails.js +++ b/cache/include/javascript/sugar_grp_emails.js @@ -817,7 +817,7 @@ var sigs=document.getElementById('signatures'+idx);SE.util.emptySelectOptions(si sigs.options.add(opt);} var htmlEmail=document.getElementById('setEditor'+idx);if(SE.userPrefs.emailSettings.sendPlainText==1){htmlEmail.checked=true;}else{htmlEmail.checked=false;} SE.tinyInstances[SE.tinyInstances.currentHtmleditor].ready=true;},replyForwardEmailStage2:function(){SE.util.clearHiddenFieldValues('emailUIForm');SUGAR.showMessageBox(app_strings.LBL_EMAIL_RETRIEVING_MESSAGE,app_strings.LBL_EMAIL_ONE_MOMENT);var ieId=SE.composeLayout.replyForwardObj.ieId;var uid=SE.composeLayout.replyForwardObj.uid;var mbox=SE.composeLayout.replyForwardObj.mbox;var type=SE.composeLayout.replyForwardObj.type;var idx=SE.composeLayout.currentInstanceId;var sugarEmail=(SE.composeLayout.replyForwardObj.sugarEmail)?'&sugarEmail=true':"";document.getElementById('emailSubject'+idx).value=type;document.getElementById('emailUIAction').value='composeEmail';document.getElementById('composeType').value=type;document.getElementById('ieId').value=ieId;document.getElementById('uid').value=uid;document.getElementById('mbox').value=mbox;document.getElementById('setEditor'+idx).checked=SE.userPrefs.emailSettings.sendPlainText==1?true:false;var formObject=document.getElementById('emailUIForm');YAHOO.util.Connect.setForm(formObject);var sendType=type;AjaxObject.startRequest(callbackReplyForward,urlStandard+"&composeType="+type+sugarEmail);},showHiddenAddress:function(addrType,idx){Dom.removeClass(addrType+"_tr"+idx,"yui-hidden");Dom.addClass(addrType+"_span"+idx,"yui-hidden");Dom.addClass("bcc_cc_sep"+idx,"yui-hidden");this[addrType+'Hidden'+idx]=false;Dom.insertAfter("add_addr_options_tr"+idx,'bcc_tr'+idx);if((typeof(this['ccHidden'+idx])!='undefined'&&typeof(this['bccHidden'+idx])!='undefined')&&(this['ccHidden'+idx]==false&&this['bccHidden'+idx]==false)) -Dom.addClass("add_addr_options_tr"+idx,"yui-hidden");},hideHiddenAddresses:function(idx){var addrTypes=['cc','bcc'];for(var i=0;icontH?(contH+10):(viewH-75))+"px";this.body.style.overflow="auto";},SED.quickCreateDialog);SED.quickCreateDialog.hideEvent.subscribe(function(){var qsFields=YAHOO.util.Dom.getElementsByClassName('.sqsEnabled',null,this.body);});SED.quickCreateDialog.setHeader(app_strings.LBL_EMAIL_QUICK_CREATE);} if(ret.html){ret.html=ret.html.replace('',"");} -SED.quickCreateDialog.setBody(ret.html?ret.html:" ");SED.quickCreateDialog.render();SUGAR.util.evalScript(ret.html+'');SED.quickCreateDialog.ieId=ret.ieId;SED.quickCreateDialog.uid=ret.uid;SED.quickCreateDialog.mbox=ret.mbox;SED.quickCreateDialog.qcmodule=ret.module;SED.quickCreateDialog.show();var editForm=document.getElementById('form_EmailQCView_'+ret.module);if(editForm){editForm.module.value='Emails';var count=SUGAR.EmailAddressWidget.count[ret.module]?SUGAR.EmailAddressWidget.count[ret.module]:0;var tableId=YAHOO.util.Dom.getElementsByClassName('emailaddresses','table',editForm)[0];tableId=tableId?tableId.id:tableId;var instId=ret.module+count;SED.quickCreateEmailsToAdd=ret.emailAddress;SED.quickCreateEmailCallback=function(instId,tableId){if(tableId){var eaw=new SUGAR.EmailAddressWidget.instances[instId];if(eaw){eaw.prefillEmailAddresses(tableId,SUGAR.email2.detailView.quickCreateEmailsToAdd);}else{window.setTimeout(function(){SUGAR.email2.detailView.quickCreateEmailCallback(instId,tableId);},100);}}} +SED.quickCreateDialog.setBody(ret.html?ret.html:" ");SED.quickCreateDialog.render();SUGAR.util.evalScript(ret.html+'');SED.quickCreateDialog.ieId=ret.ieId;SED.quickCreateDialog.uid=ret.uid;SED.quickCreateDialog.mbox=ret.mbox;SED.quickCreateDialog.qcmodule=ret.module;SED.quickCreateDialog.show();var editForm=document.getElementById('form_EmailQCView_'+ret.module);if(editForm){editForm.module.value='Emails';var count=SUGAR.EmailAddressWidget.count[ret.module]?SUGAR.EmailAddressWidget.count[ret.module]:0;var tableId=YAHOO.util.Dom.getElementsByClassName('emailaddresses','table',editForm)[0];tableId=tableId?tableId.id:tableId;var instId=ret.module+(count-1);SED.quickCreateEmailsToAdd=ret.emailAddress;SED.quickCreateEmailCallback=function(instId,tableId){if(tableId){var eaw=SUGAR.EmailAddressWidget.instances[instId];if(eaw){eaw.prefillEmailAddresses(tableId,SUGAR.email2.detailView.quickCreateEmailsToAdd);}else{window.setTimeout(function(){SUGAR.email2.detailView.quickCreateEmailCallback(instId,tableId);},100);}}} window.setTimeout(function(){SUGAR.email2.detailView.quickCreateEmailCallback(instId,tableId);},100);}},saveQuickCreateForm:function(o){SUGAR.hideMessageBox();SUGAR.email2.detailView.quickCreateDialog.hide();validate['EditView']=[];},saveQuickCreateFormAndReply:function(o){SUGAR.hideMessageBox();var ret=YAHOO.lang.JSON.parse(o.responseText);SUGAR.email2.detailView.quickCreateDialog.hide();var qcd=SUGAR.email2.detailView.quickCreateDialog;var type=(qcd.qcmodule=='Cases')?'replyCase':'reply';if(ret){var emailID=ret.id;SUGAR.email2.composeLayout.c0_replyForwardEmail(null,ret.id,'sugar::Emails',type);}else{SUGAR.email2.composeLayout.c0_replyForwardEmail(qcd.ieId,qcd.uid,qcd.mbox,type);} validate['EditView']=[];},saveQuickCreateFormAndAddToAddressBook:function(o){SUGAR.hideMessageBox();SUGAR.email2.detailView.quickCreateDialog.hide();SUGAR.email2.complexLayout.findPanel('contactsTab').show();validate['EditView']=[];},handleAssignmentDialogAssignAction:function(){var assign_user_id=window.document.forms['Distribute'].elements['assigned_user_id'].value;var dist='direct';var users=false;var rules=false;var get="";var found_teams=false;var warning_message=mod_strings.LBL_WARN_NO_USERS;if(!found_teams&&assign_user_id=='') {alert(warning_message);return;} @@ -1005,7 +1005,7 @@ QSProcessedFieldsArray[fullFieldName]=false;if(Dom.get(resultName)) var myBufferedListenerObject=new Object();myBufferedListenerObject.refit=function(){if(SUGAR.email2.grid){SUGAR.email2.grid.autoSize();}}/* End of File modules/Emails/javascript/complexLayout.js */ -SUGAR.email2.templates['compose']='
'+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+'
'+' '+' '+' '+' '+'  {mod_strings.LBL_EMAIL_RELATE}:  '+' '+' '+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+'
'+' '+' '+'
'+'   '+'
'+'
'+' '+' '+'
'+'   '+' '+'
'+'
'+'
   {mod_strings.LBL_ADD_CC} {mod_strings.LBL_ADD_CC_BCC_SEP} {mod_strings.LBL_ADD_BCC}
'+' '+' '+'
'+'   '+' '+'
'+'
'+'
'+' '+' '+'
'+'   '+' '+'
'+'
'+'
'+' '+' '+'
'+'   '+'
'+'
'+'
'+'
'+' '+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+'
'+' {app_strings.LBL_EMAIL_ATTACHMENTS}'+'
'+'  '+'
'+' '+'
'+'
'+'  '+'
'+'  '+'
'+' {app_strings.LBL_EMAIL_ATTACHMENTS2}'+'
'+'  '+'
'+' '+'
'+'
'+'  '+'
'+'  '+'
'+' '+'
'+'  '+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+'
'+' {app_strings.LBL_EMAIL_TEMPLATES}:'+'
'+' '+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+'
'+' {app_strings.LBL_EMAIL_SIGNATURES}:'+'
'+' '+'
'+' '+' '+' '+' '+'
'+'  '+' {mod_strings.LBL_SEND_IN_PLAIN_TEXT}'+'
'+'
'+'
'+'
'+'';/* End of File modules/Emails/javascript/composeEmailTemplate.js */ +SUGAR.email2.templates['compose']='
'+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+'
'+' '+' '+' '+' '+'  {mod_strings.LBL_EMAIL_RELATE}:  '+' '+' '+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+'
'+' '+' '+'
'+'   '+'
'+'
'+' '+' '+'
'+'   '+' '+'
'+'
'+'
   {mod_strings.LBL_ADD_CC} {mod_strings.LBL_ADD_CC_BCC_SEP} {mod_strings.LBL_ADD_BCC}
'+' '+' '+'
'+'   '+' '+'
'+'
'+'
'+' '+' '+'
'+'   '+' '+'
'+'
'+'
'+' '+' '+'
'+'   '+'
'+'
'+'
'+'
'+' '+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+'
'+' {app_strings.LBL_EMAIL_ATTACHMENTS}'+'
'+'  '+'
'+' '+'
'+'
'+'  '+'
'+'  '+'
'+' {app_strings.LBL_EMAIL_ATTACHMENTS2}'+'
'+'  '+'
'+' '+'
'+'
'+'  '+'
'+'  '+'
'+' '+'
'+'  '+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+'
'+' {app_strings.LBL_EMAIL_TEMPLATES}:'+'
'+' '+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+'
'+' {app_strings.LBL_EMAIL_SIGNATURES}:'+'
'+' '+'
'+' '+' '+' '+' '+'
'+'  '+' {mod_strings.LBL_SEND_IN_PLAIN_TEXT}'+'
'+'
'+'
'+'
'+'';/* End of File modules/Emails/javascript/composeEmailTemplate.js */ SUGAR.email2.templates['displayOneEmail']='
'+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+' '+' '+'
'+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' {meta.cc}'+' {email.attachments}'+'
'+' {app_strings.LBL_EMAIL_FROM}:'+' '+' {email.from_addr}'+'
'+' {app_strings.LBL_EMAIL_SUBJECT}:'+' '+' {email.name}'+'
'+' {app_strings.LBL_EMAIL_DATE_SENT_BY_SENDER}:'+' '+' {email.date_start} {email.time_start}'+'
'+' {app_strings.LBL_EMAIL_TO}:'+' '+' {email.toaddrs}'+'
'+'
'+'
';/* End of File modules/Emails/javascript/displayOneEmailTemplate.js */ diff --git a/cache/include/javascript/sugar_grp_jsolait.js b/cache/include/javascript/sugar_grp_jsolait.js index 710da053..2fe8f0b1 100644 --- a/cache/include/javascript/sugar_grp_jsolait.js +++ b/cache/include/javascript/sugar_grp_jsolait.js @@ -104,9 +104,7 @@ GLOBAL_REGISTRY.focus.fields.date_start=date_start;if(has_meridiem){GLOBAL_REGIS GLOBAL_REGISTRY.focus.fields.duration_hours=document.forms[form_name].duration_hours.value;GLOBAL_REGISTRY.focus.fields.duration_minutes=document.forms[form_name].duration_minutes.value;GLOBAL_REGISTRY.focus.fields.datetime_start=SugarDateTime.mysql2jsDateTime(GLOBAL_REGISTRY.focus.fields.date_start,GLOBAL_REGISTRY.focus.fields.time_start);GLOBAL_REGISTRY.scheduler_attendees_obj.init();GLOBAL_REGISTRY.scheduler_attendees_obj.display();} SugarWidgetScheduler.prototype.display=function(){this.parentNode.innerHTML='';var attendees=new SugarWidgetSchedulerAttendees();attendees.load(this.parentNode);var search=new SugarWidgetSchedulerSearch();search.load(this.parentNode);} SugarClass.inherit("SugarWidgetSchedulerAttendees","SugarClass");function SugarWidgetSchedulerAttendees(){this.init();} -SugarWidgetSchedulerAttendees.prototype.init=function(){SugarWidgetSchedulerAttendees.allowedTypes=['Contact','Lead'];$(document).ready(function() -{$('#add_parent_invitee_label').css('visibility','hidden');SugarWidgetSchedulerAttendees.setAddParentLinkVisibility();$('#parent_type').change(function() -{SugarWidgetSchedulerAttendees.setAddParentLinkVisibility();});});var form_name;if(typeof document.EditView!='undefined') +SugarWidgetSchedulerAttendees.prototype.init=function(){var form_name;if(typeof document.EditView!='undefined') form_name="EditView";else if(typeof document.CalendarEditView!='undefined') form_name="CalendarEditView";else return;GLOBAL_REGISTRY.scheduler_attendees_obj=this;var date_start=document.forms[form_name].date_start.value;var hour_start=parseInt(date_start.substring(11,13),10);var minute_start=parseInt(date_start.substring(14,16),10);var has_meridiem=/am|pm/i.test(date_start);if(has_meridiem){var meridiem=trim(date_start.substring(16));} @@ -134,18 +132,6 @@ if(typeof GLOBAL_REGISTRY.focus.users_arr_hash=='undefined'){GLOBAL_REGISTRY.foc for(var i=0;i-1) -{$('#add_parent_invitee').parent().css('display','');} -else -{$('#add_parent_invitee').parent().css('display','none');}} -SugarWidgetSchedulerAttendees.formAddParent=function() -{parent_id=$("#parent_id").val();parent_name=$("#parent_name").val();parent_type=$("#parent_type option:selected").text();if(parent_id.length>0&&$.inArray(parent_type,SugarWidgetSchedulerAttendees.allowedTypes)>-1) -{invitee={fields:{id:parent_id,full_name:parent_name},module:parent_type};contains=false;for(var i=0;icontH?(contH+10):(viewH-75))+"px";this.body.style.overflow="auto";},SED.quickCreateDialog);SED.quickCreateDialog.hideEvent.subscribe(function(){var qsFields=YAHOO.util.Dom.getElementsByClassName('.sqsEnabled',null,this.body);});SED.quickCreateDialog.setHeader(app_strings.LBL_EMAIL_QUICK_CREATE);} if(ret.html){ret.html=ret.html.replace('',"");} -SED.quickCreateDialog.setBody(ret.html?ret.html:" ");SED.quickCreateDialog.render();SUGAR.util.evalScript(ret.html+'');SED.quickCreateDialog.ieId=ret.ieId;SED.quickCreateDialog.uid=ret.uid;SED.quickCreateDialog.mbox=ret.mbox;SED.quickCreateDialog.qcmodule=ret.module;SED.quickCreateDialog.show();var editForm=document.getElementById('form_EmailQCView_'+ret.module);if(editForm){editForm.module.value='Emails';var count=SUGAR.EmailAddressWidget.count[ret.module]?SUGAR.EmailAddressWidget.count[ret.module]:0;var tableId=YAHOO.util.Dom.getElementsByClassName('emailaddresses','table',editForm)[0];tableId=tableId?tableId.id:tableId;var instId=ret.module+count;SED.quickCreateEmailsToAdd=ret.emailAddress;SED.quickCreateEmailCallback=function(instId,tableId){if(tableId){var eaw=new SUGAR.EmailAddressWidget.instances[instId];if(eaw){eaw.prefillEmailAddresses(tableId,SUGAR.email2.detailView.quickCreateEmailsToAdd);}else{window.setTimeout(function(){SUGAR.email2.detailView.quickCreateEmailCallback(instId,tableId);},100);}}} +SED.quickCreateDialog.setBody(ret.html?ret.html:" ");SED.quickCreateDialog.render();SUGAR.util.evalScript(ret.html+'');SED.quickCreateDialog.ieId=ret.ieId;SED.quickCreateDialog.uid=ret.uid;SED.quickCreateDialog.mbox=ret.mbox;SED.quickCreateDialog.qcmodule=ret.module;SED.quickCreateDialog.show();var editForm=document.getElementById('form_EmailQCView_'+ret.module);if(editForm){editForm.module.value='Emails';var count=SUGAR.EmailAddressWidget.count[ret.module]?SUGAR.EmailAddressWidget.count[ret.module]:0;var tableId=YAHOO.util.Dom.getElementsByClassName('emailaddresses','table',editForm)[0];tableId=tableId?tableId.id:tableId;var instId=ret.module+(count-1);SED.quickCreateEmailsToAdd=ret.emailAddress;SED.quickCreateEmailCallback=function(instId,tableId){if(tableId){var eaw=SUGAR.EmailAddressWidget.instances[instId];if(eaw){eaw.prefillEmailAddresses(tableId,SUGAR.email2.detailView.quickCreateEmailsToAdd);}else{window.setTimeout(function(){SUGAR.email2.detailView.quickCreateEmailCallback(instId,tableId);},100);}}} window.setTimeout(function(){SUGAR.email2.detailView.quickCreateEmailCallback(instId,tableId);},100);}},saveQuickCreateForm:function(o){SUGAR.hideMessageBox();SUGAR.email2.detailView.quickCreateDialog.hide();validate['EditView']=[];},saveQuickCreateFormAndReply:function(o){SUGAR.hideMessageBox();var ret=YAHOO.lang.JSON.parse(o.responseText);SUGAR.email2.detailView.quickCreateDialog.hide();var qcd=SUGAR.email2.detailView.quickCreateDialog;var type=(qcd.qcmodule=='Cases')?'replyCase':'reply';if(ret){var emailID=ret.id;SUGAR.email2.composeLayout.c0_replyForwardEmail(null,ret.id,'sugar::Emails',type);}else{SUGAR.email2.composeLayout.c0_replyForwardEmail(qcd.ieId,qcd.uid,qcd.mbox,type);} validate['EditView']=[];},saveQuickCreateFormAndAddToAddressBook:function(o){SUGAR.hideMessageBox();SUGAR.email2.detailView.quickCreateDialog.hide();SUGAR.email2.complexLayout.findPanel('contactsTab').show();validate['EditView']=[];},handleAssignmentDialogAssignAction:function(){var assign_user_id=window.document.forms['Distribute'].elements['assigned_user_id'].value;var dist='direct';var users=false;var rules=false;var get="";var found_teams=false;var warning_message=mod_strings.LBL_WARN_NO_USERS;if(!found_teams&&assign_user_id=='') {alert(warning_message);return;} @@ -448,7 +448,7 @@ var sigs=document.getElementById('signatures'+idx);SE.util.emptySelectOptions(si sigs.options.add(opt);} var htmlEmail=document.getElementById('setEditor'+idx);if(SE.userPrefs.emailSettings.sendPlainText==1){htmlEmail.checked=true;}else{htmlEmail.checked=false;} SE.tinyInstances[SE.tinyInstances.currentHtmleditor].ready=true;},replyForwardEmailStage2:function(){SE.util.clearHiddenFieldValues('emailUIForm');SUGAR.showMessageBox(app_strings.LBL_EMAIL_RETRIEVING_MESSAGE,app_strings.LBL_EMAIL_ONE_MOMENT);var ieId=SE.composeLayout.replyForwardObj.ieId;var uid=SE.composeLayout.replyForwardObj.uid;var mbox=SE.composeLayout.replyForwardObj.mbox;var type=SE.composeLayout.replyForwardObj.type;var idx=SE.composeLayout.currentInstanceId;var sugarEmail=(SE.composeLayout.replyForwardObj.sugarEmail)?'&sugarEmail=true':"";document.getElementById('emailSubject'+idx).value=type;document.getElementById('emailUIAction').value='composeEmail';document.getElementById('composeType').value=type;document.getElementById('ieId').value=ieId;document.getElementById('uid').value=uid;document.getElementById('mbox').value=mbox;document.getElementById('setEditor'+idx).checked=SE.userPrefs.emailSettings.sendPlainText==1?true:false;var formObject=document.getElementById('emailUIForm');YAHOO.util.Connect.setForm(formObject);var sendType=type;AjaxObject.startRequest(callbackReplyForward,urlStandard+"&composeType="+type+sugarEmail);},showHiddenAddress:function(addrType,idx){Dom.removeClass(addrType+"_tr"+idx,"yui-hidden");Dom.addClass(addrType+"_span"+idx,"yui-hidden");Dom.addClass("bcc_cc_sep"+idx,"yui-hidden");this[addrType+'Hidden'+idx]=false;Dom.insertAfter("add_addr_options_tr"+idx,'bcc_tr'+idx);if((typeof(this['ccHidden'+idx])!='undefined'&&typeof(this['bccHidden'+idx])!='undefined')&&(this['ccHidden'+idx]==false&&this['bccHidden'+idx]==false)) -Dom.addClass("add_addr_options_tr"+idx,"yui-hidden");},hideHiddenAddresses:function(idx){var addrTypes=['cc','bcc'];for(var i=0;i'+'
'+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+'
'+' '+' '+' '+' '+'  {mod_strings.LBL_EMAIL_RELATE}:  '+' '+' '+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+'
'+' '+' '+'
'+'   '+'
'+'
'+' '+' '+'
'+'   '+' '+'
'+'
'+'
   {mod_strings.LBL_ADD_CC} {mod_strings.LBL_ADD_CC_BCC_SEP} {mod_strings.LBL_ADD_BCC}
'+' '+' '+'
'+'   '+' '+'
'+'
'+'
'+' '+' '+'
'+'   '+' '+'
'+'
'+'
'+' '+' '+'
'+'   '+'
'+'
'+'
'+'
'+' '+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+'
'+' {app_strings.LBL_EMAIL_ATTACHMENTS}'+'
'+'  '+'
'+' '+'
'+'
'+'  '+'
'+'  '+'
'+' {app_strings.LBL_EMAIL_ATTACHMENTS2}'+'
'+'  '+'
'+' '+'
'+'
'+'  '+'
'+'  '+'
'+' '+'
'+'  '+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+'
'+' {app_strings.LBL_EMAIL_TEMPLATES}:'+'
'+' '+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+'
'+' {app_strings.LBL_EMAIL_SIGNATURES}:'+'
'+' '+'
'+' '+' '+' '+' '+'
'+'  '+' {mod_strings.LBL_SEND_IN_PLAIN_TEXT}'+'
'+'
'+'
'+' '+'';/* End of File modules/Emails/javascript/composeEmailTemplate.js */ +SUGAR.email2.templates['compose']='
'+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+'
'+' '+' '+' '+' '+'  {mod_strings.LBL_EMAIL_RELATE}:  '+' '+' '+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+'
'+' '+' '+'
'+'   '+'
'+'
'+' '+' '+'
'+'   '+' '+'
'+'
'+'
   {mod_strings.LBL_ADD_CC} {mod_strings.LBL_ADD_CC_BCC_SEP} {mod_strings.LBL_ADD_BCC}
'+' '+' '+'
'+'   '+' '+'
'+'
'+'
'+' '+' '+'
'+'   '+' '+'
'+'
'+'
'+' '+' '+'
'+'   '+'
'+'
'+'
'+'
'+' '+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+'
'+' {app_strings.LBL_EMAIL_ATTACHMENTS}'+'
'+'  '+'
'+' '+'
'+'
'+'  '+'
'+'  '+'
'+' {app_strings.LBL_EMAIL_ATTACHMENTS2}'+'
'+'  '+'
'+' '+'
'+'
'+'  '+'
'+'  '+'
'+' '+'
'+'  '+'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+'
'+' {app_strings.LBL_EMAIL_TEMPLATES}:'+'
'+' '+'
'+'
'+' '+' '+' '+' '+' '+' '+' '+'
'+' {app_strings.LBL_EMAIL_SIGNATURES}:'+'
'+' '+'
'+' '+' '+' '+' '+'
'+'  '+' {mod_strings.LBL_SEND_IN_PLAIN_TEXT}'+'
'+'
'+'
'+'
'+'';/* End of File modules/Emails/javascript/composeEmailTemplate.js */ function complexLayoutInit(){var se=SUGAR.email2;var Dom=YAHOO.util.Dom;se.e2Layout={getInnerLayout:function(rows){se.listViewLayout=new YAHOO.widget.Layout('listViewDiv',{parent:se.complexLayout,border:true,hideOnLayout:true,height:400,units:[{position:"center",scroll:false,split:true,body:"
"},{position:"bottom",scroll:true,collapse:false,resize:true,useShim:true,height:'250',body:"
"},{position:"right",scroll:true,collapse:false,resize:true,useShim:true,width:'250',body:"
",titlebar:false}]});se.complexLayout.on("render",function(){var height=SUGAR.email2.innerLayout.get("element").clientHeight-30;SUGAR.email2.innerLayout.get("activeTab").get("contentEl").parentNode.style.height=height+"px";SUGAR.email2.listViewLayout.set("height",height);SUGAR.email2.listViewLayout.render();});se.listViewLayout.render();se.listViewLayout.get("element").parentNode.parentNode.style.padding="0px" diff --git a/data/Link2.php b/data/Link2.php index 92d805f3..1bd16caf 100644 --- a/data/Link2.php +++ b/data/Link2.php @@ -303,7 +303,7 @@ class Link2 { { if ((strtolower($this->def['side']) == 'left' || $this->def['side'] == REL_LHS) //Some relationships make have left in the vardef erroneously if generated by module builder - && $this->name != $this->relationship->def['join_key_lhs']) + && (empty($this->relationship->def['join_key_lhs']) || $this->name != $this->relationship->def['join_key_lhs'])) { return REL_LHS ; } diff --git a/data/Relationships/SugarRelationship.php b/data/Relationships/SugarRelationship.php index 10d4549c..30930624 100644 --- a/data/Relationships/SugarRelationship.php +++ b/data/Relationships/SugarRelationship.php @@ -115,12 +115,14 @@ abstract class SugarRelationship /** * @param $link Link2 removes all the beans associated with this link from the relationship - * @return boolean true if it was successful, false if it was not + * @return boolean true if all beans were successfully removed or there + * were not related beans, false otherwise */ public function removeAll($link) { $focus = $link->getFocus(); $related = $link->getBeans(); + $result = true; foreach($related as $relBean) { if (empty($relBean->id)) { @@ -128,12 +130,18 @@ abstract class SugarRelationship } if ($link->getSide() == REL_LHS) - return $this->remove($focus, $relBean); + { + $sub_result = $this->remove($focus, $relBean); + } else - return $this->remove($relBean, $focus); + { + $sub_result = $this->remove($relBean, $focus); + } + + $result = $result && $sub_result; } - return false; + return $result; } /** @@ -434,6 +442,14 @@ abstract class SugarRelationship { $bean->save(); } + else + { + // Bug 55942 save the in-save id which will be used to send workflow alert later + if (isset($bean->id) && !empty($_SESSION['WORKFLOW_ALERTS'])) + { + $_SESSION['WORKFLOW_ALERTS']['id'] = $bean->id; + } + } } } diff --git a/data/SugarBean.php b/data/SugarBean.php index 53f2c838..83f96eff 100644 --- a/data/SugarBean.php +++ b/data/SugarBean.php @@ -73,7 +73,14 @@ class SugarBean */ var $db; - /** + /** + * Unique object identifier + * + * @var string + */ + public $id; + + /** * When createing a bean, you can specify a value in the id column as * long as that value is unique. During save, if the system finds an * id, it assumes it is an update. Setting new_with_id to true will @@ -271,12 +278,18 @@ class SugarBean * @var array */ protected $loaded_relationships = array(); - + /** * set to true if dependent fields updated */ protected $is_updated_dependent_fields = false; - + + /** + * Blowfish encryption key + * @var string + */ + static protected $field_key; + /** * Constructor for the bean, it performs following tasks: * @@ -466,11 +479,11 @@ class SugarBean * * Internal function, do not override. */ - public function get_custom_table_name() - { - return $this->getTableName().'_cstm'; + public function get_custom_table_name() + { + return $this->getTableName().'_cstm'; } - + /** * If auditing is enabled, create the audit table. * @@ -1703,8 +1716,8 @@ class SugarBean // if LHSModule and RHSModule are same module use left link to add new item b/s of: // $rel_id and $rel_link are not emty - request is from subpanel // $rel_link contains relationship name - checked by call load_relationship - $this->load_relationship($rel_link); - if ( !empty($this->$rel_link) && $this->$rel_link->getRelationshipObject() && $this->$rel_link->getRelationshipObject()->getLHSModule() == $this->$rel_link->getRelationshipObject()->getRHSModule() ) + $isRelationshipLoaded = $this->load_relationship($rel_link); + if ($isRelationshipLoaded && !empty($this->$rel_link) && $this->$rel_link->getRelationshipObject() && $this->$rel_link->getRelationshipObject()->getLHSModule() == $this->$rel_link->getRelationshipObject()->getRHSModule() ) { $new_rel_link = $this->$rel_link->getRelationshipObject()->getLHSLink(); } @@ -2209,7 +2222,7 @@ class SugarBean { $this->custom_fields->fill_relationships(); } - + $this->is_updated_dependent_fields = false; $this->fill_in_additional_detail_fields(); $this->fill_in_relationship_fields(); @@ -2220,7 +2233,7 @@ class SugarBean { $this->fetched_rel_row[$rel_field_name['name']] = $this->$rel_field_name['name']; } - } + } //make a copy of fields in the relationship_fields array. These field values will be used to //clear relationship. foreach ( $this->field_defs as $key => $def ) @@ -2554,12 +2567,12 @@ class SugarBean } $this->load_relationship($related_field_name); - + if ($this->$related_field_name instanceof Link) { - + $query_array = $this->$related_field_name->getQuery(true); } else { - + $query_array = $this->$related_field_name->getQuery(array( "return_as_array" => true, 'where' => '1=1' // hook for 'where' clause in M2MRelationship file @@ -2648,6 +2661,8 @@ class SugarBean $submodulename = $this_subpanel->_instance_properties['module']; $submoduleclass = $beanList[$submodulename]; //require_once($beanFiles[$submoduleclass]); + + /** @var SugarBean $submodule */ $submodule = new $submoduleclass(); $subwhere = $where_definition; @@ -2676,7 +2691,10 @@ class SugarBean $params['include_custom_fields'] = !$subpanel_def->isCollection(); $params['collection_list'] = $subpanel_def->get_inst_prop_value('collection_list'); - $subquery = $submodule->create_new_list_query('',$subwhere ,$list_fields,$params, 0,'', true,$parentbean); + // use single select in case when sorting by relate field + $singleSelect = $submodule->is_relate_field($order_by); + + $subquery = $submodule->create_new_list_query('',$subwhere ,$list_fields,$params, 0,'', true,$parentbean, $singleSelect); $subquery['select'] = $subquery['select']." , '$panel_name' panel_name "; $subquery['from'] = $subquery['from'].$query_array['join']; @@ -3151,7 +3169,8 @@ class SugarBean $jtcount++; } } - if($data['type'] == 'relate' && isset($data['link'])) + + if ($this->is_relate_field($field)) { $this->load_relationship($data['link']); if(!empty($this->$data['link'])) @@ -4328,6 +4347,7 @@ class SugarBean $tracker = new Tracker(); $tracker->makeInvisibleForAll($id); + // call the custom business logic $this->call_custom_logic("after_delete", $custom_logic_arguments); } @@ -4580,7 +4600,7 @@ class SugarBean static $cache = array(); // cn: bug 12270 - sensitive fields being passed arbitrarily in listViews $sensitiveFields = array('user_hash' => ''); - + $return_array = Array(); global $app_list_strings, $mod_strings; foreach($this->field_defs as $field=>$value){ @@ -5337,6 +5357,15 @@ class SugarBean $this->$street_field = trim($this->$street_field, "\n"); } } + + protected function getEncryptKey() + { + if(empty(self::$field_key)) { + self::$field_key = blowfishGetKey('encrypt_field'); + } + return self::$field_key; + } + /** * Encrpyt and base64 encode an 'encrypt' field type in the bean using Blowfish. The default system key is stored in cache/Blowfish/{keytype} * @param STRING value -plain text value of the bean field. @@ -5345,7 +5374,7 @@ class SugarBean function encrpyt_before_save($value) { require_once("include/utils/encryption_utils.php"); - return blowfishEncode(blowfishGetKey('encrypt_field'),$value); + return blowfishEncode($this->getEncryptKey(), $value); } /** @@ -5355,8 +5384,9 @@ class SugarBean */ function decrypt_after_retrieve($value) { + if(empty($value)) return $value; // no need to decrypt empty require_once("include/utils/encryption_utils.php"); - return blowfishDecode(blowfishGetKey('encrypt_field'), $value); + return blowfishDecode($this->getEncryptKey(), $value); } /** @@ -5548,4 +5578,24 @@ class SugarBean { return $this->create_new_list_query($order_by, $where, array(), array(), 0, '', false, $this, true, true); } + + /** + * Determine whether the given field is a relate field + * + * @param string $field Field name + * @return bool + */ + protected function is_relate_field($field) + { + if (!isset($this->field_defs[$field])) + { + return false; + } + + $field_def = $this->field_defs[$field]; + + return isset($field_def['type']) + && $field_def['type'] == 'relate' + && isset($field_def['link']); + } } diff --git a/files.md5 b/files.md5 index ef24e565..63834083 100644 --- a/files.md5 +++ b/files.md5 @@ -1,5 +1,5 @@ 'd3f150e4a5bed444763ebe8a81742a95', './.htaccess' => 'd41d8cd98f00b204e9800998ecf8427e', @@ -268,7 +268,7 @@ $md5_string = array ( './include/HTMLPurifier/standalone/HTMLPurifier/EntityLookup/entities.ser' => '0effa122c2636c1b1d5ed4b900e51e68', './include/HTMLPurifier/standalone/HTMLPurifier/Printer.php' => '530db343c69ec3d4ba27e09e4b837903', './include/HTMLPurifier/VERSION' => 'c9e4dc50b8d6ed20385fdca95873b3a5', - './include/HTMLPurifier/HTMLPurifier.standalone.php' => '98906b387369850c456a850dbf20b9da', + './include/HTMLPurifier/HTMLPurifier.standalone.php' => '7780b45f4f623b2fb08b04c3aed3f0ce', './include/HTMLPurifier/LICENSE' => 'a1b3d3e45e8422eed104489842a6f546', './include/HTMLPurifier/CREDITS' => 'a5f9ddecea015543001404c0a9bfd181', './include/SugarHtml/SugarHtml.php' => '058c02dae665d65a0c630927988e9594', @@ -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' => 'e95a4b6caeb54b3064cda0c7748dd3be', + './include/clean.php' => '4ec6c61c8c04aacee15897e05bf9e07f', './include/externalAPI/ExternalAPIFactory.php' => '0dfa0647b6b6484f28927eb5018749e0', './include/externalAPI/cmis_repository_wrapper.php' => 'ff3bb54e2abd73334bb05df8b6920b8d', './include/externalAPI/Base/WebDocument.php' => 'ede22580002f6416a2502dee7d0be18f', @@ -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' => '4a1139531b33ab4f62d26c4316ffef65', + './include/SugarCharts/SugarChart.php' => '323ee23a6d0775f348ed6184feab960e', './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' => '5184935200fafb7e32b0e99321d939f6', + './include/utils.php' => '132cf74e2ac611d2975de859a9a5eeda', './include/SugarHttpClient.php' => '87fa99a397caaaceb121a21d91ed5260', './include/Sugar_Smarty.php' => 'ac140125309e194a7f43747d41417cd4', './include/phpmailer/extras/htmlfilter.php' => '4d5143899340a690d41a4959428ea674', @@ -620,7 +620,7 @@ $md5_string = array ( './include/database/MssqlHelper.php' => '6b3a36ab4462e0f838c35e0e74e0f02b', './include/database/DBManagerFactory.php' => '021c6c562cd96f304544af0e336dc736', './include/database/SqlsrvManager.php' => '4a3d6c5e56ae8fe5fdb07ead522c324e', - './include/database/MssqlManager.php' => 'a57a3088cab4b17101698bbf8b8e52a4', + './include/database/MssqlManager.php' => '093b32e8227a2e186265800a0c37cce3', './include/timezone/timezones.php' => '15844342704f03ef8d40603abe9aa99b', './include/SugarSQLValidate.php' => 'eb288af9ccb9828370ef3999ad926619', './include/connectors/ConnectorFactory.php' => '33d27fc539bbd684cf7deb0cea6ed37d', @@ -651,7 +651,7 @@ $md5_string = array ( './include/templates/Template.php' => '36ef9b944d7e36d9853d9879f6194969', './include/templates/TemplateGroupChooser.php' => '6ae99e0ff3795b613d03ec0474e52c46', './include/TemplateHandler/TemplateHandler.php' => '4da8355d19789c5c532c621d12d049ed', - './include/SugarTheme/SugarTheme.php' => 'dcebbc005e58ed68b7923423e614f516', + './include/SugarTheme/SugarTheme.php' => '301d36442a1c85b5c23c1a9741c58b7e', './include/SugarTheme/getImage.php' => '19291feae95e57bc666eec37b612664e', './include/SugarTheme/SugarSprites.php' => '10818287a033eed727e4269522cc7044', './include/SugarTheme/cssmin.php' => '05384ba957435def09368425e4480688', @@ -659,7 +659,7 @@ $md5_string = array ( './include/SugarDependentDropdown/javascript/SugarDependentDropdown.js' => '4d077b3991c83098e4bca166bc715071', './include/SugarDependentDropdown/SugarDependentDropdown.php' => '86eb13e7c54068ec87679e98a4e0d406', './include/export_utils.php' => '885a0dd6cda051658520a90f522f787f', - './include/globalControlLinks.php' => 'e5ce2b2390cb6a83129779cfe6d20f57', + './include/globalControlLinks.php' => 'ed8fa6c0797f56e3326a18e3980ce65f', './include/SugarTinyMCE.php' => 'a00a969d2a2df9dbbc80ead4af9b40de', './include/tabs.php' => '7cf9418691424c673218c535fec27a05', './include/SugarOAuthServer.php' => '2213c81d7cef1884997b4a0d38216fd9', @@ -744,7 +744,7 @@ $md5_string = array ( './include/EditView/EditView2.php' => 'a03923ba3c798ef5990abd23d83948f7', './include/EditView/PopupQuickCreate.php' => '9a8b7a895799ed90058b3e070ad7f672', './include/EditView/SugarVCR.tpl' => '5b46cb6d983f213ec90733aa54bfba45', - './include/EditView/EditView.tpl' => 'fe408b4bea39633daf1025738f1f4b4e', + './include/EditView/EditView.tpl' => '25515351fd6fe70f692136f1eb9cc39f', './include/EditView/QuickCreate.php' => 'a4351f400593c2a1933176d8e34bc82c', './include/EditView/SubpanelQuickEdit.php' => 'f7bc58f5f93c60cf2953ec9dbf1e0b15', './include/SugarQueue/SugarCronJobs.php' => 'd7b547d698238a2bd170c86ce3ed67e1', @@ -798,7 +798,7 @@ $md5_string = array ( './include/javascript/sugar_yui_overrides.js' => '2044e4ff54670e82359c21cca12b2dd5', './include/javascript/cookie.js' => '88a6745e90f7c043394eca8b106068b2', './include/javascript/popup_parent_helper.js' => '592953cb14307a0ce288261d40c4f8a9', - './include/javascript/sugar_3.js' => 'fa4ca2af1a0b212ed34c8063cd4b9adb', + './include/javascript/sugar_3.js' => '166f28da9c36b77606b421a6d584d43d', './include/javascript/jquery.js' => '819fb9d29c24f79d34343e9f182aaf24', './include/javascript/sugar_connection_event_listener.js' => '27234843e68e64fc9c399044619320be', './include/javascript/jsclass_async.js' => 'd725c16df9803e561437c4a2e13d1372', @@ -2552,7 +2552,7 @@ $md5_string = array ( './include/MVC/View/tpls/xsrf.tpl' => 'd62524430cf4e4701fe86737f8a7682f', './include/MVC/View/tpls/modulelistmenu.tpl' => '136df5b86eb938738c37bc836c8ace97', './include/MVC/View/views/view.metadata.php' => '358be31f180b06068b9c9296de8a5415', - './include/MVC/View/views/view.importvcardsave.php' => '06077ded9cb261005b36a33aac9f3188', + './include/MVC/View/views/view.importvcardsave.php' => '35e68b8497091ca8ab4c02c4ab63ac68', './include/MVC/View/views/view.quickedit.php' => '986cc9fda8e782b31668586ed5d296e0', './include/MVC/View/views/view.quickcreate.php' => '49806236c0cc41cc5a8b39c2008f6c4f', './include/MVC/View/views/view.detail.config.php' => 'c39a0838b0caa86281c6f500779260df', @@ -2560,12 +2560,12 @@ $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' => 'e7269ffc993b42942c3441a3e63f4e20', + './include/MVC/View/views/view.popup.php' => '20de3c54cb9040995f2e1435b4c048ca', './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', './include/MVC/View/views/view.favorites.php' => 'e8585f22c20d50e37895a3c968f6790e', - './include/MVC/View/views/view.importvcard.php' => 'c066d470c13bdd9d41fddef1d0d01bff', + './include/MVC/View/views/view.importvcard.php' => '6adb2efc88d04eb2514fa974426abd3d', './include/MVC/View/views/view.ajaxui.php' => '2b6496589d96202d453cb98ffbc51d3a', './include/MVC/View/views/view.classic.config.php' => '5d90625b2648beb884b29c10a076b1fe', './include/MVC/View/views/view.edit.php' => 'c815bae865c215630d964e590db57aca', @@ -2641,7 +2641,7 @@ $md5_string = array ( './include/pclzip/gnu-lgpl.txt' => '7fbc338309ac38fefcd64b04bb903e34', './include/pclzip/pclzip.lib.php' => 'f42cfbdfccc2dcd85df39638ae2d141c', './include/SugarEmailAddress/SugarEmailAddress.js' => '6217eae817e6af59e21666cc3087a9d9', - './include/SugarEmailAddress/SugarEmailAddress.php' => '2673a2bec92c810eedc4d1cc7bd63952', + './include/SugarEmailAddress/SugarEmailAddress.php' => '3099caeb2dd86f89e3d90c4bc5c1f00d', './include/SugarEmailAddress/templates/forDuplicatesView.tpl' => '7606911a788f6fa0f4aca806679e4098', './include/SugarEmailAddress/templates/forDetailView.tpl' => '8a913b1d6cbaf35ff7237c8c6022af9c', './include/SugarEmailAddress/templates/forWideFormBodyView.tpl' => '0dc9422da0b8ec60a58ae06d7215c3fb', @@ -2704,7 +2704,7 @@ $md5_string = array ( './include/Smarty/plugins/modifier.lower.php' => '014241bdc9356e4db65ff84902e868d2', './include/Smarty/plugins/function.html_image.php' => '06abba1563143b4b1190ca07d53b0a0d', './include/Smarty/plugins/function.config_load.php' => '752a15886ca6ee831f2ab650ab09fe4e', - './include/Smarty/plugins/function.sugar_button.php' => 'ff430938e7a1ca7f7d2cac229170779d', + './include/Smarty/plugins/function.sugar_button.php' => '8df59ad4424dd32178bc34cd4da80cc5', './include/Smarty/plugins/function.sugar_ajax_url.php' => 'a0f1b3ec9077718a4a020b2be4f12b66', './include/Smarty/plugins/function.popup.php' => 'cf231d09647d1b1cf0adf5904b66b6a6', './include/Smarty/plugins/function.sugar_variable_constructor.php' => '6561cdb5987f989d18090a4713c9a27a', @@ -2762,9 +2762,9 @@ $md5_string = array ( './include/Smarty/plugins/function.html_options.php' => 'a7903c34c86b166373946497fac2b7bb', './include/Smarty/plugins/function.sugar_replace_vars.php' => '0d5489b730db3efb79e2d1731e28f4ad', './include/Smarty/README' => '1a3fe37eed420a020489d1082ea150c8', - './include/Smarty/Smarty_Compiler.class.php' => 'b9a859a96c0d005cee69253bac461599', + './include/Smarty/Smarty_Compiler.class.php' => 'bfeedb6825aa028558e057fede645c58', './include/DetailView/footer.tpl' => '82f240a39faba85858e561048e23fffd', - './include/DetailView/header.tpl' => 'a265fdffd2265242afdd508cf9e2863b', + './include/DetailView/header.tpl' => '271c7dc1c8fa257bfe656211c882e93c', './include/DetailView/DetailView.tpl' => 'a3c4dd95d931815f9845a09fe2e3da33', './include/DetailView/DetailView.php' => '3df8ccba8aca6dffb5969c47001d7435', './include/DetailView/DetailView2.php' => '4f800afa17ab95068341a3474e78fb76', @@ -2774,13 +2774,13 @@ $md5_string = array ( './include/generic/SugarWidgets/SugarWidgetSubPanelEditRoleButton.php' => 'ffd2ba1b7c2b0124a3b70dc00009a94d', './include/generic/SugarWidgets/SugarWidgetSubPanelTopComposeEmailButton.php' => 'b6375e51b1f1f3b827c9aa300cdd065e', './include/generic/SugarWidgets/SugarWidgetFieldurl.php' => '8909a2b419250e770cd07129da34b6d7', - './include/generic/SugarWidgets/SugarWidgetFieldcurrency.php' => '2839093eafaefeeaaf94933f5a66b904', + './include/generic/SugarWidgets/SugarWidgetFieldcurrency.php' => '7a98d1fd1cbea5efb1e82b233c794f9b', './include/generic/SugarWidgets/SugarWidgetSubPanelTopCreateAccountNameButton.php' => 'be445affddc003efff8e6206031385a0', './include/generic/SugarWidgets/SugarWidgetFielddatepicker.php' => 'dee020ff9030fee04b450be6d2f57db4', './include/generic/SugarWidgets/SugarWidgetFieldchar.php' => 'ff4c04e9e87b53eabd82a38fe8c16e35', './include/generic/SugarWidgets/SugarWidgetFieldmultienum.php' => 'ef4f0eec6d7fb12bd9b76d9f26ce0cb6', './include/generic/SugarWidgets/SugarWidgetField.php' => '677f2d56818b2b35611e73799d80140b', - './include/generic/SugarWidgets/SugarWidgetSubPanelIcon.php' => '2a22c376b999d71977dcbcf33b48941c', + './include/generic/SugarWidgets/SugarWidgetSubPanelIcon.php' => '5fc930adb49d6ea0cc0bc381e41e59ef', './include/generic/SugarWidgets/SugarWidgetSubPanelTopMessage.php' => 'a61dac690bca32a9da19652d34d277a5', './include/generic/SugarWidgets/SugarWidgetFieldvarchar.php' => 'e5b8d2c27312e5494f0020949e4d6d83', './include/generic/SugarWidgets/SugarWidgetFieldbool.php' => '16a9aa475696846daf03073c8b107a86', @@ -2791,6 +2791,7 @@ $md5_string = array ( './include/generic/SugarWidgets/SugarWidgetFieldsingleenum.php' => '0338edf920bf35a9d965509024f94473', './include/generic/SugarWidgets/SugarWidgetSubPanelLoadSignedButton.php' => '1ec69a812e9d70198969fc8c753e6256', './include/generic/SugarWidgets/SugarWidgetSubPanelTopSelectContactsButton.php' => 'b9e8b558ba286954747abfde1920fb24', + './include/generic/SugarWidgets/SugarWidgetFieldcurrency_id.php' => '82b683c04041c83281d4a9544c4fa388', './include/generic/SugarWidgets/SugarWidgetFielddate.php' => 'efccab584bdb7950220abab57c1290aa', './include/generic/SugarWidgets/SugarWidgetFielduser_name.php' => 'ac7581e728a68f2f08292dd2ff53def4', './include/generic/SugarWidgets/SugarWidgetFieldid.php' => 'c8e80e951a61d6edbab6051cececa3c7', @@ -2825,7 +2826,7 @@ $md5_string = array ( './include/generic/SugarWidgets/SugarWidgetSubPanelTopButton.php' => '934a6ff7977d2b3501d1551e31445b3b', './include/generic/SugarWidgets/SugarWidgetSubPanelEditButton.php' => '396cf26585199d9f4709af3e21de089c', './include/generic/SugarWidgets/SugarWidgetSubPanelTopCreateCampaignLogEntryButton.php' => 'eda0760a68c648b6924ff97e44d294e5', - './include/generic/SugarWidgets/SugarWidgetReportField.php' => '4046f65a6ccbbb49386e9b19fc756cf7', + './include/generic/SugarWidgets/SugarWidgetReportField.php' => '437d608346ca8511beff7763493148f7', './include/generic/SugarWidgets/SugarWidgetSubPanelCloseButton.php' => '8add175bc8b9b0576efc420c9211d7b1', './include/generic/SugarWidgets/SugarWidgetSubPanelTopCreateNoteButton.php' => '3d0a6b29a27135a455a781a0a81e24f8', './include/generic/SugarWidgets/SugarWidgetFieldnum.php' => '15c06a35b7f2ee9f0a41716d5b6d393d', @@ -2842,7 +2843,7 @@ $md5_string = array ( './include/TimeDate.php' => 'a16a335faac57bf6c82e1ccb338965af', './include/Localization/Localization.php' => '4457d1268188679cb77909a29a8ca988', './include/SugarLogger/SugarLogger.php' => '836fbd1cd96d4e27752cea9f59c0df26', - './include/SugarLogger/LoggerManager.php' => '602f6d77fbd6d38119e8d94b71222927', + './include/SugarLogger/LoggerManager.php' => '6875c6e63bf813acd76d5d867bc2b040', './include/SugarLogger/LoggerTemplate.php' => '3fc58dcd911a3be4116d4a1190e89a17', './include/SugarCache/SugarCacheMemory.php' => '4c04271ae1c5e1ba4266c4c88e88fa47', './include/SugarCache/SugarCachesMash.php' => 'a84aec8a29c65205c426b29625ed4fa8', @@ -2879,7 +2880,7 @@ $md5_string = array ( './dictionary.php' => '19245b9374ee0cfc7048c87c7548652e', './HandleAjaxCall.php' => 'e8f0cb63050a3f85e26d5f295c54d8b6', './ModuleInstall/extensions.php' => 'd17953438bdd75848cce5a5dbe929e5e', - './ModuleInstall/ModuleScanner.php' => 'ca20e34ae03ca921c68eb4195d4efe4b', + './ModuleInstall/ModuleScanner.php' => 'b9570c5d23ff6527607e0e562bb9f728', './ModuleInstall/ModuleInstaller.php' => '7595862d0c0fbaaba337058ed6e61ba7', './ModuleInstall/PackageManager/tpls/PackageForm.tpl' => 'b0f7f452c6c32251c1e88f3f06422018', './ModuleInstall/PackageManager/tpls/PackageManagerScripts.tpl' => '305b5d5a2ea5f04c533b982a5f1422ee', @@ -3301,7 +3302,7 @@ $md5_string = array ( './SugarSecurity.php' => 'e87f1efee51af1d8801dc2376068cee3', './export.php' => '7639b2373c4d0c73765033d70abfb55d', './data/BeanFactory.php' => '5148eb779611ca40e342900456fc6f29', - './data/SugarBean.php' => '592c181708651b1b9faed97f9f41df68', + './data/SugarBean.php' => '889c583c98275bdacc9335de2d8cd9e4', './data/Link.php' => 'de95f31cf30c2f46a234c4a840c01f84', './data/Relationships/One2OneRelationship.php' => '88194998edcdad83a887aa1ef014d5de', './data/Relationships/EmailAddressRelationship.php' => '1a46e6504810e22a7854b64af2377fdf', @@ -3309,9 +3310,9 @@ $md5_string = array ( './data/Relationships/RelationshipFactory.php' => '4c70024ff9b3bbfa9eeb76095f33d472', './data/Relationships/One2MBeanRelationship.php' => '18c6acb5e2f0f51d31fb5078a689102c', './data/Relationships/One2OneBeanRelationship.php' => '654eafffcc24bad9f464a76f0973843e', - './data/Relationships/SugarRelationship.php' => 'f80aa20b39d590f2007c218fee7fba67', + './data/Relationships/SugarRelationship.php' => '458dca2d05e2324badc20455b73c01b8', './data/Relationships/One2MRelationship.php' => 'ec99c10eadc77da58700a0418995d78a', - './data/Link2.php' => 'c2a24b7c7b5eb91e22fb6ad2eb27b8c5', + './data/Link2.php' => 'd65bf580583f873b488ded104f8fd8ac', './data/Tracker.php' => '78c6ca1fadfe9e7984b001fed296f332', './service/core/SugarRestUtils.php' => '183a0d813c88928451133af63934b686', './service/core/webservice.php' => 'e27d4bc434ba5536dce4022124104126', @@ -3386,7 +3387,7 @@ $md5_string = array ( './modules/Leads/LeadsQuickCreate.php' => '22025cf0899bc6ff093e5406a83fb2f7', './modules/Leads/Capture.php' => '8345afcd9e0aaa04101a74329b0360f7', './modules/Leads/Save.php' => '7a4c01eb0290f41237426b2059a85114', - './modules/Leads/tpls/ConvertLead.tpl' => 'b545b499629ae94f250a664725bbd3fd', + './modules/Leads/tpls/ConvertLead.tpl' => '150ba28e60466e4aa1f873fb47a65203', './modules/Leads/tpls/ConvertLeadHeader.tpl' => '1f863d5d7fb31492d3dc8c14df4bdbc2', './modules/Leads/tpls/EditConvertLead.tpl' => '1546ed54811c02bf8deb822160cc7ac3', './modules/Leads/tpls/QuickCreate.tpl' => '7a20b8143b5328b4380553c6f8ecc25d', @@ -3399,7 +3400,7 @@ $md5_string = array ( './modules/Leads/views/view.list.php' => '47e14d2db5e9b71d410c74ef07142f53', './modules/Leads/views/view.edit.php' => '4208b82205cf63936b78da5eac7df01f', './modules/Leads/views/view.detail.php' => 'a9442c60e714251976831e4f045c1808', - './modules/Leads/views/view.convertlead.php' => '7f599cc8b88be9e6242798979df720b2', + './modules/Leads/views/view.convertlead.php' => 'd8d4d82f76a782de52b46ddc73f15508', './modules/Leads/controller.php' => 'a60222b4af972a0171cf83640ea35103', './modules/Leads/field_arrays.php' => 'cdb8bd3732b0e84e9d1efe50e77e1ff4', './modules/Leads/Lead.php' => '77b1e1c182ce6b63c01147735ea44949', @@ -3658,7 +3659,7 @@ $md5_string = array ( './modules/Calendar/tpls/repeat.tpl' => 'a522ad903cfad55945eff151fb0e223b', './modules/Calendar/tpls/shared_users.tpl' => '06446eeee9f3f40013e89d185706e3f7', './modules/Calendar/tpls/settings.tpl' => '5d6bb4517be10eb4cb98019b19d18a08', - './modules/Calendar/tpls/main.tpl' => 'e4986b66baccfadcb7e1506b0c8b6318', + './modules/Calendar/tpls/main.tpl' => '6a98dba4d9f2fab70a0f942eaddeef1e', './modules/Calendar/tpls/header.tpl' => '8662039740d66edc1579f6de9b04e174', './modules/Calendar/tpls/editHeader.tpl' => 'bc0d87d835fdde3fd76141efe81d8182', './modules/Calendar/tpls/empty.tpl' => '01fef0770302cd5098e331c34ae37122', @@ -3716,7 +3717,7 @@ $md5_string = array ( './modules/Emails/MassDelete.php' => 'de2897f4e36f3c288b7afb9035a33abc', './modules/Emails/SearchFormMyInbox.html' => '8487a40c120546ed57546d86fbdc8aba', './modules/Emails/PopupDocuments.php' => 'b99f58a5b000491bad4783f45b744ed2', - './modules/Emails/EmailUI.php' => '5631e6d90775fa51f01411565c2d1dde', + './modules/Emails/EmailUI.php' => 'db89368b13fd5c3eca42f3b719500795', './modules/Emails/Status.php' => '8fac7135044f4315e917a5eb2d4d8ce3', './modules/Emails/Save.php' => '3c0ea8c00c5422e321632a64beb6af93', './modules/Emails/ListViewHome.html' => 'fbb035479e1194d9ac96039ade4b80f5', @@ -3791,13 +3792,13 @@ $md5_string = array ( './modules/Emails/metadata/additionalDetails.php' => 'd6245f09b4988484416ffea3ee28118d', './modules/Emails/Check.php' => 'e955c7c45b1d2488cc57ada923142575', './modules/Emails/SugarRoutingAsync.php' => '0a9ca1ac80b9c759693c1b2e9cbda26d', - './modules/Emails/javascript/composeEmailTemplate.js' => '0701570fcd6d72e8e51d3bbc4e10336d', + './modules/Emails/javascript/composeEmailTemplate.js' => 'e19471934b9acab4ebeeebdbcd4b7fc0', './modules/Emails/javascript/Email.js' => '7a8528f141f6de141336426c497dfbcd', './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' => '8f5fe6bceb18a5f88c98dea09eacffcd', - './modules/Emails/javascript/EmailUICompose.js' => 'a4b38e26f0fd9bd8e70d8d4e2df26241', + './modules/Emails/javascript/ajax.js' => '21be3e955c6335f63c6b15d8bb35f0de', + './modules/Emails/javascript/EmailUICompose.js' => '03df76552ac939af2f08c2476099147f', './modules/Emails/javascript/EmailUI.js' => '8a62cd712eb4f7c5fac2713f00a160d6', './modules/Emails/javascript/grid.js' => '3f466dcfd19ed70d90ff386eb40ff28d', './modules/Emails/javascript/viewPrintable.js' => '1e5ed81de106298be2e5c11f955c6a09', @@ -3917,7 +3918,7 @@ $md5_string = array ( './modules/InboundEmail/DetailView.php' => 'a171268c4c9e85ac2fc62efce30deeb7', './modules/InboundEmail/Delete.php' => 'b49ee65d8850ff8ff370ebf237b0acb5', './modules/InboundEmail/Popup.php' => '472052c2da7990c6e8d63a0a2dccbbd2', - './modules/InboundEmail/InboundEmail.php' => 'ca1009a956a5d7740a576b0e05c397ec', + './modules/InboundEmail/InboundEmail.php' => 'f2adbcc06eef05480de2abf6b442f46e', './modules/InboundEmail/ListView.html' => 'd76aa28386e3f7165f62dabfc6f0beb7', './modules/InboundEmail/index.php' => '6b54e0739c45bd059cc2da5f3aa41d9a', './modules/InboundEmail/language/en_us.lang.php' => 'ae833e99a3be579da67788c144af7ee2', @@ -4049,7 +4050,7 @@ $md5_string = array ( './modules/ModuleBuilder/MB/MBModule.php' => 'db62117969740eb4bf8418c7caca92d6', './modules/ModuleBuilder/MB/AjaxCompose.php' => '0cf04c16ff5531e9b354a21bb56fb17c', './modules/ModuleBuilder/MB/MBPackageTree.php' => '479f8be396033c768a3b82780d8420a9', - './modules/ModuleBuilder/MB/MBPackage.php' => '7b0dc087a0aed5de9714440717fccee2', + './modules/ModuleBuilder/MB/MBPackage.php' => '55948258b4a7d82185166256b6092dfc', './modules/ModuleBuilder/MB/MBVardefs.php' => 'b20c90fac5d47104d918ec502b3781ae', './modules/ModuleBuilder/MB/MBLanguage.php' => '1d1a81b9394953038980af83a724792b', './modules/ModuleBuilder/MB/ModuleBuilder.php' => 'ea380cbffc685a656b46226437940b27', @@ -4087,7 +4088,7 @@ $md5_string = array ( './modules/ProjectTask/tpls/QuickCreate.tpl' => '271f79cf1bed2a22e8af11bd08dd4787', './modules/ProjectTask/Menu.php' => '89042afae82de62f44b2a5d0c8b3b2d6', './modules/ProjectTask/vardefs.php' => '5f8f544c3bffa4ae13260b430023ab1d', - './modules/ProjectTask/views/view.list.php' => 'cb8de25506273a8d5ec84c0e54c4433f', + './modules/ProjectTask/views/view.list.php' => '3cfcb8594c5e0b19bbd5aa37394e30b1', './modules/ProjectTask/Forms.html' => '9ef4e37c85db5975ea0db243a2a47903', './modules/ProjectTask/field_arrays.php' => '83b7d207a5bd035dca4b347460168838', './modules/ProjectTask/MyProjectTasks.html' => '195e2ce8f43de26924bd8aeecef70a23', @@ -4163,7 +4164,7 @@ $md5_string = array ( './modules/Tasks/Dashlets/MyTasksDashlet/MyTasksDashlet.meta.php' => '719d34858e77076907e79c48d35a621b', './modules/Tasks/Dashlets/MyTasksDashlet/MyTasksDashlet.php' => '33b8a83c6c1555983393b8f0918698e2', './modules/Tasks/language/en_us.lang.php' => 'b74f5f371636fec60f50199402160c3b', - './modules/Tasks/Task.php' => '87b0ac5c07c05a726e5a5b585409386f', + './modules/Tasks/Task.php' => '483af7b3adcbf9da488ebd6101868cac', './modules/Opportunities/SubPanelViewProjects.html' => 'ee53a295ab36aa28c8907678365f84f1', './modules/Opportunities/Save.php' => 'c09e98757bed656984ff81482a5a6b30', './modules/Opportunities/tpls/QuickCreate.tpl' => '731c98d4b49e7a608da03ce0819a2204', @@ -4309,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' => '5ba0dc1bb9bbd39eb5125c73976ee3a5', + './modules/Users/User.php' => 'e330d44d37c1321448195c4c8453df4b', './modules/Users/login.tpl' => 'ea831fdb2eaeac643665acb6cb947f33', './modules/Users/LoggedOut.tpl' => '56f709612a02e111d2411a771b11cd80', './modules/Users/SaveTimezone.php' => '3a27e5b03cbb1a9501401521dd2c1168', @@ -4480,9 +4481,9 @@ $md5_string = array ( './modules/Calls/tpls/QuickCreate.tpl' => '83609a9e601a5599dc3f3d2674665941', './modules/Calls/tpls/detailHeader.tpl' => '80c5550af52dc424831101182a9a0dce', './modules/Calls/Menu.php' => '858bb3073b45d382034626a6ae3e13dd', - './modules/Calls/vardefs.php' => 'be5564766ac098579f75769feb16a236', + './modules/Calls/vardefs.php' => 'ac2980875114f34a8d087846144549cc', './modules/Calls/CallsQuickCreate.php' => '1d0f9551f8a18c310d5c37f80a7ee82a', - './modules/Calls/CallFormBase.php' => '9641734f0901841f24960fc3f5846303', + './modules/Calls/CallFormBase.php' => '5d05ab5c814c2b716ca3b7ee015f17a0', './modules/Calls/views/view.list.php' => '5b950a91d105b087fdf4a2972f082e54', './modules/Calls/views/view.edit.php' => '8c94e4b5f35e895b73cf1236abb252fb', './modules/Calls/Call.php' => '730aa76c67ae97883a61557b1c607cae', @@ -4491,7 +4492,7 @@ $md5_string = array ( './modules/Calls/metadata/searchdefs.php' => '892464b109427176fc0dc9ca870ae1e4', './modules/Calls/metadata/subpaneldefs.php' => '74cfe6de17819f40cc6aca39a688a4bd', './modules/Calls/metadata/quickcreatedefs.php' => 'b9a18b440a38cffd04461985c688cbbd', - './modules/Calls/metadata/editviewdefs.php' => '43826b2f9b118c4a86da2dc33b9978a3', + './modules/Calls/metadata/editviewdefs.php' => '716496f9957a632976fa583a0d075196', './modules/Calls/metadata/SearchFields.php' => '478819054d7ea0c931e4601ccbfd62b4', './modules/Calls/metadata/subpanels/ForHistory.php' => 'f645f3a7148de0c2ad69f2c8c9797784', './modules/Calls/metadata/subpanels/ForActivities.php' => '9c8bae8ce3153c87403ea4b9c3ee0d19', @@ -4503,9 +4504,9 @@ $md5_string = array ( './modules/Calls/Dashlets/MyCallsDashlet/MyCallsDashlet.data.php' => 'bbb096633528bb22b112d6e3dc78d9d1', './modules/Calls/Dashlets/MyCallsDashlet/MyCallsDashlet.meta.php' => '81158ed6fa50d810929b4ff429657161', './modules/Calls/Dashlets/MyCallsDashlet/MyCallsDashlet.php' => '6bf0c16b793ffcadcf14333530dafe83', - './modules/Calls/language/en_us.lang.php' => '191b9e3d6488873d207ab9e5b62d7b99', + './modules/Calls/language/en_us.lang.php' => '7fb36747cd1457db91de6f2f10f04a5f', './modules/Calls/SubPanelViewInvitees.html' => '4e7eeaa3d0ea3807ce8632669df1e176', - './modules/ACLActions/ACLAction.php' => '46bd8be93b5b7dc499a1e6da89e3e4e9', + './modules/ACLActions/ACLAction.php' => '0f8782115fb3453d6fb61170cc0d2541', './modules/ACLActions/Menu.php' => '8e2a919d4a5ef7be81da1d595c040756', './modules/ACLActions/vardefs.php' => 'acc6dad81ee8c5f6a1d703b997bab517', './modules/ACLActions/actiondefs.php' => 'b9ba5b27e8883574dd8852b6db41a7f3', @@ -4747,7 +4748,7 @@ $md5_string = array ( './modules/Activities/views/view.modulelistmenu.php' => '632432dc452616687ef23799a059a025', './modules/Activities/SubPanelView.php' => '8edeb509f915078bf8fcec18fcea2906', './modules/Activities/OpenListView.php' => '4eea6e4645852f3139c66e31cb69e772', - './modules/Activities/EmailReminder.php' => 'c1ca405a74fe0625c88519ba63533554', + './modules/Activities/EmailReminder.php' => '92209921b81daede2b8f8d1c14f365dd', './modules/Activities/metadata/subpaneldefs.php' => '653c92853e062ec5a9a4f957b2bcddc0', './modules/Activities/Popup_picker.html' => 'fe2b0d186e38b29321a8db0cefabde30', './modules/Activities/SubPanelViewContacts.html' => 'ba5a475b493fcfb2b9dcec79380f9137', @@ -4806,7 +4807,7 @@ $md5_string = array ( './modules/SchedulersJobs/field_arrays.php' => 'a60602bff510c911ba742833413eba93', './modules/SchedulersJobs/metadata/subpanels/default.php' => 'c3629eb7760c975cdb22ea22cbe16a9c', './modules/SchedulersJobs/language/en_us.lang.php' => 'b0d407e5774510304e1b0ea6c794e25c', - './modules/SchedulersJobs/SchedulersJob.php' => 'c9a7e0499326ffeb7a81556ccb0783f7', + './modules/SchedulersJobs/SchedulersJob.php' => '47ddd29db51a67a93f2308192a720ee1', './modules/Contacts/Contact.js' => '9f9de844775302199af4542ed5928a30', './modules/Contacts/ContactOpportunityRelationshipEdit.php' => '989748fbb9350215e6fc966a50b2523d', './modules/Contacts/Email_picker.html' => 'ffc5a233b91fe04b5c27e1e4d07487a7', @@ -4906,7 +4907,7 @@ $md5_string = array ( './modules/Import/tpls/step2.tpl' => '1a122667e5e8efdf7df90350a4c3cd73', './modules/Import/Menu.php' => '034a5c49ca2cf04f95b2465e051e8c98', './modules/Import/vardefs.php' => '60cff61c52c1283ffe7dd161c28c074a', - './modules/Import/ImportDuplicateCheck.php' => '98eee0e91c80c0ab173076538acceeba', + './modules/Import/ImportDuplicateCheck.php' => 'db288c59aec0610a8a344b3557b554e2', './modules/Import/ImportFieldSanitize.php' => 'd32a76f0cabb2f5dba570ae8b0d440e3', './modules/Import/Importer.php' => 'f4ab99e7a716228d8bfa6a220bc6a1ba', './modules/Import/views/view.dupcheck.php' => '80fded0509056a60cb59280a656b4e7d', @@ -4983,7 +4984,7 @@ $md5_string = array ( './modules/Project/language/en_us.lang.php' => 'c62a8abfa09841a60c54f90e6c9d4e6a', './modules/Project/SubPanelView.html' => 'a8cfd450c5a10dac0f401a57c430a519', './modules/Project/ProjectQuickCreate.php' => '0b45e5508713bd8397d38194ed2743ae', - './modules/Meetings/jsclass_scheduler.js' => 'b22f203a83ddee9499d28e3be3b53bde', + './modules/Meetings/jsclass_scheduler.js' => 'b1364e950a651985cf5523353211bfde', './modules/Meetings/duration_dependency.js' => '68137bd02d0b9cff86e857ffe2d758a8', './modules/Meetings/Save.php' => '82a55c7692d587e20236135aca956f43', './modules/Meetings/tpls/footer.tpl' => 'e0a83373e481789efd51511c01acd3e6', @@ -4994,9 +4995,9 @@ $md5_string = array ( './modules/Meetings/tpls/detailHeader.tpl' => '80c5550af52dc424831101182a9a0dce', './modules/Meetings/tpls/reminders.tpl' => '5848a89a0337c9b681979a8776441d7c', './modules/Meetings/Menu.php' => '63348eb6a3845e5d48389fe80ed6bfff', - './modules/Meetings/vardefs.php' => 'd0058766c72a3d3bc8f69fcf5236aaab', + './modules/Meetings/vardefs.php' => '36101b541ce81f67bb17078a3bc17063', './modules/Meetings/JoinExternalMeeting.php' => 'b71a1a110ff5483fc45d49859d1a5ed4', - './modules/Meetings/Meeting.php' => '74f83a963ce41c971ffe9ac9c02c9528', + './modules/Meetings/Meeting.php' => '5ef820fa297c19095d2f63b9b4b3bf7a', './modules/Meetings/views/view.listbytype.php' => '3ebd214c8727254c33c32619615a8eb4', './modules/Meetings/views/view.list.php' => 'ba747ebcc7fff9f6036e532056d12fb8', './modules/Meetings/views/view.edit.php' => '12b46ccee3f27ce1dfc45187db422e59', @@ -5005,7 +5006,7 @@ $md5_string = array ( './modules/Meetings/metadata/searchdefs.php' => '1812616f0e6dc434312700ebdcf5fe51', './modules/Meetings/metadata/subpaneldefs.php' => '9fcb40ed13d8cffc9cc054e0908726b1', './modules/Meetings/metadata/quickcreatedefs.php' => 'd32ee617268e3c5aa6e97e9e796d81f3', - './modules/Meetings/metadata/editviewdefs.php' => '266280a6fc7cecbf8bd70c78dc0ac420', + './modules/Meetings/metadata/editviewdefs.php' => '72c96ea4f33ace58cf879e7ad660723e', './modules/Meetings/metadata/SearchFields.php' => '06b45aadf77c191d52f16b79c912f896', './modules/Meetings/metadata/subpanels/ForHistory.php' => '28f07ed10e8d45bca8121a9bd1f76fba', './modules/Meetings/metadata/subpanels/ForActivities.php' => '06fbdaca02a664e63b06dd5cef35ca0a', @@ -5019,29 +5020,29 @@ $md5_string = array ( './modules/Meetings/Dashlets/MyMeetingsDashlet/MyMeetingsDashlet.meta.php' => '1f17c035ab5229249ccb4dbbb51a1d39', './modules/Meetings/Dashlets/MyMeetingsDashlet/MyMeetingsDashlet.php' => '4a6c86deb8c094a5eee079604ea3af3b', './modules/Meetings/MeetingsQuickCreate.php' => '5e67b447ae39ad80afe5588a4a293388', - './modules/Meetings/language/en_us.lang.php' => '12c53ba42da07a141e3d0f214459b6b0', + './modules/Meetings/language/en_us.lang.php' => '5fdc57290ad2a3267928821da294b0dc', './modules/Meetings/SubPanelViewInvitees.html' => '7f9d1da5e8384457cadabf14412a88a5', - './modules/Meetings/MeetingFormBase.php' => '1e71c4b3b44293526272618eb16c8d41', + './modules/Meetings/MeetingFormBase.php' => '125d67b87d70e61e2e074c9279bb4090', './modules/Administration/RepairIndex.php' => '31d55e4ce8069277191685e503ade848', './modules/Administration/RepairActivities.php' => '51359b6e6594e7587fdfd3ef50ebb944', './modules/Administration/RepairSeedUsers.php' => '835c36a2118b92fb8c1bcdad8f49baae', './modules/Administration/callJSRepair.php' => '1552f4690bbd2dbc9119f80c833fd609', - './modules/Administration/Locale.php' => '79886ced9700447db850e04dacebe525', + './modules/Administration/Locale.php' => 'f48d8862b913691cd47933e96bfce969', './modules/Administration/repairDatabase.php' => '71ce415b8b9c3a1b4eff54074c38f70e', './modules/Administration/RepairFieldCasing.php' => '3745cce20da1779ce71f71021f8d0ac9', './modules/Administration/PasswordManager.tpl' => 'c8ce6ce9bfb3977986fa3e6659840457', './modules/Administration/repairSelectModule.php' => '0b5056adf4e7229d67c20b60f8842bba', - './modules/Administration/UpgradeWizard_prepare.php' => '79d0670ca24e0948af4a4396ba3c689a', + './modules/Administration/UpgradeWizard_prepare.php' => 'f9b9a9b02c57590e37164f1250cb38f1', './modules/Administration/QuickRepairAndRebuild.php' => 'b4006c2d2925ba20d5403b6a081e1be5', './modules/Administration/DiagnosticDelete.php' => '800d39b37b8bbd477de71a27eba085b2', './modules/Administration/Save.php' => '15bb3509086e8bbadaa0564c02c780b6', - './modules/Administration/UpgradeWizard.php' => '44260efe5d777ba21db42e70f378900f', + './modules/Administration/UpgradeWizard.php' => 'acde8d41b11180562a218e78372072ca', './modules/Administration/ncc_config.php' => '42cd8fc45ba496786a136fe08ab93166', './modules/Administration/Menu.php' => '8516a0e9af7e0a5fcc61b4d87b123cc2', './modules/Administration/vardefs.php' => 'a4b3781befd4731cfacc25e7ab51380d', './modules/Administration/Upgrade.php' => '9da6aaf655be2c986158e50a772d904f', './modules/Administration/SugarSpriteBuilder.php' => '95bb50747b7f6903959bb58404c4a586', - './modules/Administration/UpgradeWizardCommon.php' => '6692078482ee14f39d6120ed762a83d8', + './modules/Administration/UpgradeWizardCommon.php' => 'c043461c8685562f2745e461d8fe43ef', './modules/Administration/index.tpl' => 'c934bbbb1b6c1d224160d3eb2474f880', './modules/Administration/ExportCustomFieldStructure.php' => 'ee31a1faf8364f2164b6b0dd3561c920', './modules/Administration/RebuildConfig.php' => '39fe5857d01ec5a38c41f25deba490e3', @@ -5099,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' => 'b228aa901531c6c26903232abae8993e', + './modules/Administration/language/en_us.lang.php' => '9e652f62a573f42b00177b4538e9db37', './modules/Administration/UpgradeHistory.php' => 'a9ec8a2612a5d3404e974d53de8b4311', './modules/Administration/upgrade_custom_relationships.php' => 'fe1239f73daa16e6a8b7f3170c8cad23', './modules/Administration/ImportCustomFieldStructure.php' => 'fd2baf8134f11375810c5c4daa52c889', @@ -5266,16 +5267,16 @@ $md5_string = array ( './modules/Home/LastViewed.php' => 'e4fd8c8ebf25ad8a93173deabf4b35bc', './modules/Home/AddToFavorites.php' => '2d1240598be9e7f74c497fe3a6578868', './modules/Home/TrainingPortal.php' => '1ec4a300d6dfd51f80eb642eee05f0f0', - './cache/include/javascript/sugar_grp_jsolait.js' => '3cb26c71028e55342bfbac69a6d9a851', - './cache/include/javascript/sugar_grp_quickcomp.js' => '7cb7287770e281b471fc8753e06c6ffb', - './cache/include/javascript/sugar_grp_emails.js' => 'ba25857e9cb53d11cb20bc5dae61cec8', + './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_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' => '8829293fb198afd43a6eb77bb47a2959', + './cache/include/javascript/sugar_grp1.js' => 'a636431c8995f7ba5e714e252f180e14', './cache/layout/index.html' => '9cd784063d39b18d308932c28c385853', './cache/images/index.html' => '9cd784063d39b18d308932c28c385853', './cache/xml/index.html' => '9cd784063d39b18d308932c28c385853', @@ -5346,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' => 'f75a5d5392cb7e4910b46e5b4aaaa8f3', + './sugar_version.php' => '3ccf4839df9359186ce630aa45dedf47', './cron.php' => '96a6fd7893809132e902086e77dde30c', './log4php/LoggerManager.php' => 'fa34194306cd50c01b71d8d5060ee362', './TreeData.php' => '7040af43bf01c450f4e225ece5e3f30c', @@ -6001,7 +6002,7 @@ $md5_string = array ( './themes/Sugar5/tpls/_companyLogo.tpl' => 'aec162121df756deaeb8b2b24a877b65', './themes/Sugar5/tpls/footer.tpl' => 'fbb48d80817323aacb010b920bd5921d', './themes/Sugar5/tpls/header.tpl' => 'f4f2a382c900e9186faba11ce64803c7', - './themes/Sugar5/tpls/_head.tpl' => '53d3a8d5836d1ff25b252b39340d9dda', + './themes/Sugar5/tpls/_head.tpl' => '17375ddb7a0b3aef07dabf1af258356d', './themes/Sugar5/tpls/_welcome.tpl' => 'a758aa0298fc3a281dc9906e6f5ca48f', './themes/Sugar5/tpls/_headerModuleList.tpl' => 'efa0fa3a938be9be6735ea564a546c31', './themes/Sugar5/tpls/_headerLastViewed.tpl' => '3b96479b265365920c2f1d36bad25b18', @@ -6614,7 +6615,7 @@ $md5_string = array ( './jssource/src_files/modules/Currencies/EditView.js' => '83b17318ef591148bbc75e2aebb5c8d5', './jssource/src_files/modules/Administration/javascript/Async.js' => 'd0e7a85e67bde67980dad376c11f1221', './jssource/src_files/modules/Administration/javascript/Administration.js' => '8c7eb2c4bd0024ab3f020d84c58ef1d5', - './jssource/src_files/modules/Meetings/jsclass_scheduler.js' => '3d3817196769cec073bad93d15ac6494', + './jssource/src_files/modules/Meetings/jsclass_scheduler.js' => '38fd2043bdc095d22960685a08729dab', './jssource/src_files/modules/Meetings/duration_dependency.js' => '59bac762067bf2baa5fa6d52824d0338', './jssource/src_files/modules/Project/Project.js' => '935ffab1d5effc64a12e43c5ed8f243d', './jssource/src_files/modules/Contacts/Contact.js' => '57e5e967dd1d1f623d4248922115f258', @@ -7423,7 +7424,7 @@ $md5_string = array ( './jssource/src_files/include/javascript/sugar_yui_overrides.js' => 'ac6afa48c7c53dd7a52fc0e812c54d4f', './jssource/src_files/include/javascript/cookie.js' => 'c4e6168195f22c5fbb1780a0745bde24', './jssource/src_files/include/javascript/popup_parent_helper.js' => 'c546e26584026b47054eecbcba234410', - './jssource/src_files/include/javascript/sugar_3.js' => '5c77eccc2b45d09ad5f9dfbd96ba4444', + './jssource/src_files/include/javascript/sugar_3.js' => '5b206cdd17cc44ea63cbbf5e9930ea2d', './jssource/src_files/include/javascript/jquery.js' => '219073097031d9c1a95a1291d66f3a10', './jssource/src_files/include/javascript/sugar_connection_event_listener.js' => 'e38a0e0155991cbc8fabaa59bcb1b705', './jssource/src_files/include/javascript/jsclass_async.js' => '95072f5177e01c78662f14596255402e', diff --git a/include/DetailView/header.tpl b/include/DetailView/header.tpl index 2e4109e2..871e1f75 100644 --- a/include/DetailView/header.tpl +++ b/include/DetailView/header.tpl @@ -50,7 +50,7 @@ SUGAR.util.doWhen(function(){ - -
+
{{if !isset($form.buttons)}} {{sugar_button module="$module" id="EDIT" view="$view" form_id="formDetailView" appendTo="detail_header_buttons"}} @@ -100,7 +100,7 @@ SUGAR.util.doWhen(function(){
{$ADMIN_EDIT} +{$ADMIN_EDIT} {{if $panelCount == 0}} {{* Render tag for VCR control if SHOW_VCR_CONTROL is true *}} {{if $SHOW_VCR_CONTROL}} diff --git a/include/EditView/EditView.tpl b/include/EditView/EditView.tpl index 63a6029b..36ba493f 100644 --- a/include/EditView/EditView.tpl +++ b/include/EditView/EditView.tpl @@ -111,7 +111,7 @@ class="yui-navset" {{/if}} {{/if}} - +
{{assign var='rowCount' value=0}} diff --git a/include/HTMLPurifier/HTMLPurifier.standalone.php b/include/HTMLPurifier/HTMLPurifier.standalone.php index 03f585ff..5499b578 100644 --- a/include/HTMLPurifier/HTMLPurifier.standalone.php +++ b/include/HTMLPurifier/HTMLPurifier.standalone.php @@ -812,7 +812,6 @@ class HTMLPurifier_AttrValidator // constants are slow, so we use as few as possible if (!defined('HTMLPURIFIER_PREFIX')) { define('HTMLPURIFIER_PREFIX', dirname(__FILE__) . '/standalone'); - set_include_path(HTMLPURIFIER_PREFIX . PATH_SEPARATOR . get_include_path()); } // accomodations for versions earlier than 5.0.2 diff --git a/include/MVC/View/views/view.importvcard.php b/include/MVC/View/views/view.importvcard.php index 1fc758a8..618f0de1 100644 --- a/include/MVC/View/views/view.importvcard.php +++ b/include/MVC/View/views/view.importvcard.php @@ -48,7 +48,7 @@ require_once('include/vCard.php'); class ViewImportvcard extends SugarView { var $type = 'edit'; - + public function __construct() { parent::SugarView(); diff --git a/include/MVC/View/views/view.importvcardsave.php b/include/MVC/View/views/view.importvcardsave.php index 8d7c861e..8bc2ecc1 100644 --- a/include/MVC/View/views/view.importvcardsave.php +++ b/include/MVC/View/views/view.importvcardsave.php @@ -47,7 +47,7 @@ require_once('include/vCard.php'); class ViewImportvcardsave extends SugarView { var $type = 'save'; - + public function __construct() { parent::SugarView(); diff --git a/include/MVC/View/views/view.popup.php b/include/MVC/View/views/view.popup.php index 9634d554..d4d94b48 100644 --- a/include/MVC/View/views/view.popup.php +++ b/include/MVC/View/views/view.popup.php @@ -93,7 +93,7 @@ class ViewPopup extends SugarView{ if(!empty($this->bean) && isset($_REQUEST[$this->module.'2_'.strtoupper($this->bean->object_name).'_offset'])) { if(!empty($_REQUEST['current_query_by_page'])) { $blockVariables = array('mass', 'uid', 'massupdate', 'delete', 'merge', 'selectCount', - 'lvso', 'sortOrder', 'orderBy', 'request_data', 'current_query_by_page'); + 'sortOrder', 'orderBy', 'request_data', 'current_query_by_page'); $current_query_by_page = unserialize(base64_decode($_REQUEST['current_query_by_page'])); foreach($current_query_by_page as $search_key=>$search_value) { if($search_key != $this->module.'2_'.strtoupper($this->bean->object_name).'_offset' diff --git a/include/Smarty/Smarty_Compiler.class.php b/include/Smarty/Smarty_Compiler.class.php index b45a7445..f21f0eec 100644 --- a/include/Smarty/Smarty_Compiler.class.php +++ b/include/Smarty/Smarty_Compiler.class.php @@ -26,8 +26,6 @@ * @package Smarty */ - - /** * Template compiling class * @package Smarty @@ -162,7 +160,7 @@ class Smarty_Compiler extends Smarty { . '(?:\s*,\s*' . $this->_obj_single_param_regexp . ')*)?\)'; $this->_obj_start_regexp = '(?:' . $this->_dvar_regexp . '(?:' . $this->_obj_ext_regexp . ')+)'; $this->_obj_call_regexp = '(?:' . $this->_obj_start_regexp . '(?:' . $this->_obj_params_regexp . ')?(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?)'; - + // matches valid modifier syntax: // |foo // |@foo @@ -333,7 +331,7 @@ class Smarty_Compiler extends Smarty { for ($j = $i + 1; $j < $for_max; $j++) { /* remove leading and trailing whitespaces of each line */ $text_blocks[$j] = preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $text_blocks[$j]); - if ($compiled_tags[$j] == '{/strip}') { + if ($compiled_tags[$j] == '{/strip}') { /* remove trailing whitespaces from the last text_block */ $text_blocks[$j] = rtrim($text_blocks[$j]); } @@ -427,7 +425,7 @@ class Smarty_Compiler extends Smarty { /* Matched comment. */ if (substr($template_tag, 0, 1) == '*' && substr($template_tag, -1) == '*') return ''; - + /* Split tag into two three parts: command, command modifiers and the arguments. */ if(! preg_match('~^(?:(' . $this->_num_const_regexp . '|' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '|\/?' . $this->_reg_obj_regexp . '|\/?' . $this->_func_regexp . ')(' . $this->_mod_regexp . '*)) @@ -435,7 +433,7 @@ class Smarty_Compiler extends Smarty { ~xs', $template_tag, $match)) { $this->_syntax_error("unrecognized tag: $template_tag", E_USER_ERROR, __FILE__, __LINE__); } - + $tag_command = $match[1]; $tag_modifier = isset($match[2]) ? $match[2] : null; $tag_args = isset($match[3]) ? $match[3] : null; @@ -575,7 +573,7 @@ class Smarty_Compiler extends Smarty { } else if ($this->_compile_block_tag($tag_command, $tag_args, $tag_modifier, $output)) { return $output; } else if ($this->_compile_custom_tag($tag_command, $tag_args, $tag_modifier, $output)) { - return $output; + return $output; } else { $this->_syntax_error("unrecognized tag '$tag_command'", E_USER_ERROR, __FILE__, __LINE__); } @@ -975,7 +973,7 @@ class Smarty_Compiler extends Smarty { $arg_value = $arg_value ? 'true' : 'false'; $arg_list[] = "'$arg_name' => $arg_value"; } - + if ( $theme_template == 'true' ) $include_file = '"'.SugarThemeRegistry::current()->getTemplate(str_replace(array('"',"'"),'',$include_file)).'"'; @@ -1259,11 +1257,11 @@ class Smarty_Compiler extends Smarty { if(empty($tokens)) { $_error_msg .= $elseif ? "'elseif'" : "'if'"; - $_error_msg .= ' statement requires arguments'; + $_error_msg .= ' statement requires arguments'; $this->_syntax_error($_error_msg, E_USER_ERROR, __FILE__, __LINE__); } - - + + // make sure we have balanced parenthesis $token_count = array_count_values($tokens); if(isset($token_count['(']) && $token_count['('] != $token_count[')']) { @@ -1388,7 +1386,7 @@ class Smarty_Compiler extends Smarty { } } elseif(preg_match('~^' . $this->_var_regexp . '$~', $token) && isset($tokens[$i+1]) && $tokens[$i+1] == '(') { // variable function call - $this->_syntax_error("variable function call '$token' not allowed in if statement", E_USER_ERROR, __FILE__, __LINE__); + $this->_syntax_error("variable function call '$token' not allowed in if statement", E_USER_ERROR, __FILE__, __LINE__); } elseif(preg_match('~^' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '(?:' . $this->_mod_regexp . '*)$~', $token)) { // object or variable $token = $this->_parse_var_props($token); @@ -1741,12 +1739,12 @@ class Smarty_Compiler extends Smarty { $_var_ref = $var_expr; else $_var_ref = substr($var_expr, 1); - + if(!$_has_math) { - + // get [foo] and .foo and ->foo and (...) pieces preg_match_all('~(?:^\w+)|' . $this->_obj_params_regexp . '|(?:' . $this->_var_bracket_regexp . ')|->\$?\w+|\.\$?\w+|\S+~', $_var_ref, $match); - + $_indexes = $match[0]; $_var_name = array_shift($_indexes); @@ -2006,7 +2004,7 @@ class Smarty_Compiler extends Smarty { array_shift($indexes); $compiled_ref = "(\$this->_foreach[$_var]['iteration']-1)"; break; - + case 'first': array_shift($indexes); $compiled_ref = "(\$this->_foreach[$_var]['iteration'] <= 1)"; @@ -2016,12 +2014,12 @@ class Smarty_Compiler extends Smarty { array_shift($indexes); $compiled_ref = "(\$this->_foreach[$_var]['iteration'] == \$this->_foreach[$_var]['total'])"; break; - + case 'show': array_shift($indexes); $compiled_ref = "(\$this->_foreach[$_var]['total'] > 0)"; break; - + default: unset($_max_index); $compiled_ref = "\$this->_foreach[$_var]"; @@ -2112,7 +2110,7 @@ class Smarty_Compiler extends Smarty { case 'rdelim': $compiled_ref = "'$this->right_delimiter'"; break; - + default: $this->_syntax_error('$smarty.' . $_ref . ' is an unknown reference', E_USER_ERROR, __FILE__, __LINE__); break; @@ -2162,12 +2160,14 @@ class Smarty_Compiler extends Smarty { */ function _load_filters() { + if(!function_exists('smarty_core_load_plugins') && (count($this->_plugins['prefilter']) > 0 || count($this->_plugins['postfilter']) > 0)) { + require_once(SMARTY_CORE_DIR . 'core.load_plugins.php'); + } if (count($this->_plugins['prefilter']) > 0) { foreach ($this->_plugins['prefilter'] as $filter_name => $prefilter) { if ($prefilter === false) { unset($this->_plugins['prefilter'][$filter_name]); $_params = array('plugins' => array(array('prefilter', $filter_name, null, null, false))); - require_once(SMARTY_CORE_DIR . 'core.load_plugins.php'); smarty_core_load_plugins($_params, $this); } } @@ -2177,7 +2177,6 @@ class Smarty_Compiler extends Smarty { if ($postfilter === false) { unset($this->_plugins['postfilter'][$filter_name]); $_params = array('plugins' => array(array('postfilter', $filter_name, null, null, false))); - require_once(SMARTY_CORE_DIR . 'core.load_plugins.php'); smarty_core_load_plugins($_params, $this); } } diff --git a/include/Smarty/plugins/function.sugar_button.php b/include/Smarty/plugins/function.sugar_button.php index 49bbfc8e..62256637 100644 --- a/include/Smarty/plugins/function.sugar_button.php +++ b/include/Smarty/plugins/function.sugar_button.php @@ -364,6 +364,7 @@ function smarty_function_sugar_button($params, &$smarty) case "DCMENUFULLFORM": $output = ' '; $output .= ''; + $output .= ''; break; case "POPUPSAVE": $view = ($view == 'QuickCreate') ? "form_QuickCreate_{$module}" : $view; diff --git a/include/SugarCharts/SugarChart.php b/include/SugarCharts/SugarChart.php index 00c1406d..a0276ab1 100644 --- a/include/SugarCharts/SugarChart.php +++ b/include/SugarCharts/SugarChart.php @@ -188,6 +188,7 @@ class SugarChart { // grab the property and value from the chart_properties variable foreach ($this->chart_properties as $key => $value){ + if(is_array($value)) continue; $properties .= $this->tab("<$key>$value",2); } @@ -382,14 +383,30 @@ class SugarChart { } - function convertCurrency($to_convert){ - global $locale; - $decimals = '2'; - $decimals = $locale->getPrecision(); - $amount = ($this->div == 1) ? $to_convert : round($to_convert * $this->div,$decimals); + /** + * Convert the amount given to the User's currency. + * + * TODO make this use the Currency module to convert from dollars and make + * it deprecated. + * + * @param float $to_convert + * The amount to be converted. + * + * @return float + * The amount converted in the User's current currency. + * + * @see Currency::convertFromDollar() + * @see SugarChart::__construct() + */ + function convertCurrency($to_convert) + { + global $locale; - return $amount; - } + $decimals = $locale->getPrecision(); + $amount = round($to_convert * $this->div, $decimals); + + return $amount; + } function formatNumber($number, $decimals= null, $decimal_point= null, $thousands_sep= null){ global $locale; @@ -766,7 +783,7 @@ class SugarChart { return $templateFile; } - + function getDashletScript($id,$xmlFile="") { $xmlFile = (!$xmlFile) ? $sugar_config['tmp_dir']. $current_user->id . '_' . $this->id . '.xml' : $xmlFile; diff --git a/include/SugarEmailAddress/SugarEmailAddress.php b/include/SugarEmailAddress/SugarEmailAddress.php index da72e18c..4a919864 100644 --- a/include/SugarEmailAddress/SugarEmailAddress.php +++ b/include/SugarEmailAddress/SugarEmailAddress.php @@ -637,7 +637,18 @@ class SugarEmailAddress extends SugarBean { } } - function AddUpdateEmailAddress($addr,$invalid=0,$opt_out=0,$id=null) + /** + * Creates or Updates an entry in the email_addresses table, depending + * on if the email address submitted matches a previous entry (case-insensitive) + * @param String $addr - email address + * @param int $invalid - is the email address marked as Invalid? + * @param int $opt_out - is the email address marked as Opt-Out? + * @param String $id - the GUID of the original SugarEmailAddress bean, + * in case a "email has changed" WorkFlow has triggered - hack to allow workflow-induced changes + * to propagate to the new SugarEmailAddress - see bug 39188 + * @return String GUID of Email Address or '' if cleaned address was empty. + */ + public function AddUpdateEmailAddress($addr,$invalid=0,$opt_out=0,$id=null) { // sanity checks to avoid SQL injection. $invalid = intval($invalid); @@ -646,53 +657,71 @@ class SugarEmailAddress extends SugarBean { $address = $this->db->quote($this->_cleanAddress($addr)); $addressCaps = strtoupper($address); - if ($id) - { + // determine if we have a matching email address + $q = "SELECT * FROM email_addresses WHERE email_address_caps = '{$addressCaps}' and deleted=0"; + $r = $this->db->query($q); + $duplicate_email = $this->db->fetchByAssoc($r); + + // check if we are changing an email address, where workflow might be in play + if ($id) { $r = $this->db->query("SELECT * FROM email_addresses WHERE id='".$this->db->quote($id)."'"); - $a = $this->db->fetchByAssoc($r); + $current_email = $this->db->fetchByAssoc($r); } - else - { - $a = null; + else { + $current_email = null; } - if(!empty($a) && !empty($a['id'])) { - if ($a['invalid_email'] != $invalid || - $a['opt_out'] != $opt_out || - // bug #39378 - did not allow change of case of an email address - strnatcmp(trim($a['email_address']), trim($address)) != 0) - { - if (isset($this->stateBeforeWorkflow[$a['id']])) - { - $data = $this->stateBeforeWorkflow[$a['id']]; + // unless workflow made changes, assume parameters are what to use. + $new_opt_out = $opt_out; + $new_invalid = $invalid; + if (!empty($current_email['id']) && isset($this->stateBeforeWorkflow[$current_email['id']])) { + if ($current_email['invalid_email'] != $invalid || + $current_email['opt_out'] != $opt_out) { + + // workflow could be in play + $before_email = $this->stateBeforeWorkflow[$current_email['id']]; + + // our logic is as follows: choose from parameter, unless workflow made a change to the value, then choose final value + if (intval($before_email['opt_out']) != intval($current_email['opt_out'])) { + $new_opt_out = intval($current_email['opt_out']); } - else - { - $data = $a; + if (intval($before_email['invalid_email']) != intval($current_email['invalid_email'])) { + $new_invalid = intval($current_email['invalid_email']); } + } + } - $upd_q = 'UPDATE ' . $this->table_name . ' ' . - 'SET email_address=\'' . $address . '\', '. - (isset($data['invalid_email']) && $data['invalid_email'] == $a['invalid_email'] ? ('invalid_email=' . $invalid . ', ') : '') . - (isset($data['opt_out']) && $data['opt_out'] == $a['opt_out'] ? ('opt_out=' . $opt_out . ', ') : '') . - 'date_modified=\'' . gmdate($GLOBALS['timedate']->get_db_date_time_format()) . '\' ' . - 'WHERE id=\'' . $this->db->quote($a['id']) . '\''; + // determine how we are going to put in this address - UPDATE or INSERT + if (!empty($duplicate_email['id'])) { + + // address_caps matches - see if we're changing fields + if ($duplicate_email['invalid_email'] != $new_invalid || + $duplicate_email['opt_out'] != $new_opt_out || + (trim($duplicate_email['email_address']) != $address)) { + $upd_q = 'UPDATE ' . $this->table_name . ' ' . + 'SET email_address=\'' . $address . '\', ' . + 'invalid_email=' . $new_invalid . ', ' . + 'opt_out=' . $new_opt_out . ', ' . + 'date_modified=' . $this->db->now() . ' ' . + 'WHERE id=\'' . $this->db->quote($duplicate_email['id']) . '\''; $upd_r = $this->db->query($upd_q); } - return $a['id']; - } else { + return $duplicate_email['id']; + } + else { + // no case-insensitive address match - it's new, or undeleted. $guid = ''; if(!empty($address)){ $guid = create_guid(); $now = TimeDate::getInstance()->nowDb(); $qa = "INSERT INTO email_addresses (id, email_address, email_address_caps, date_created, date_modified, deleted, invalid_email, opt_out) - VALUES('{$guid}', '{$address}', '{$addressCaps}', '$now', '$now', 0 , $invalid, $opt_out)"; + VALUES('{$guid}', '{$address}', '{$addressCaps}', '$now', '$now', 0 , $new_invalid, $new_opt_out)"; $this->db->query($qa); } return $guid; } } - + /** * Returns Primary or newest email address * @param object $focus Object in focus diff --git a/include/SugarLogger/LoggerManager.php b/include/SugarLogger/LoggerManager.php index a75828ce..2c1771c0 100644 --- a/include/SugarLogger/LoggerManager.php +++ b/include/SugarLogger/LoggerManager.php @@ -108,6 +108,24 @@ class LoggerManager } } + /** + * Check if this log level will be producing any logging + * @param string $method + * @return boolean + */ + public function wouldLog($method) + { + if ( !isset(self::$_levelMapping[$method]) ) + $method = $this->_level; + if($method == $this->_level + //otherwise if we have a level mapping for the method and that level is less than or equal to the current level let's let it log + || (!empty(self::$_levelMapping[$method]) + && self::$_levelMapping[$this->_level] >= self::$_levelMapping[$method]) ) { + return true; + } + return false; + } + /** * Used for doing design-by-contract assertions in the code; when the condition fails we'll write * the message to the debug log diff --git a/include/SugarTheme/SugarTheme.php b/include/SugarTheme/SugarTheme.php index 2eee2a5a..5ad0ae09 100644 --- a/include/SugarTheme/SugarTheme.php +++ b/include/SugarTheme/SugarTheme.php @@ -335,9 +335,19 @@ class SugarTheme */ public function __destruct() { - // Bug 28309 - Set the current directory to one which we expect it to be (i.e. the root directory of the install - set_include_path(realpath(dirname(__FILE__) . '/../..') . PATH_SEPARATOR . get_include_path()); - chdir(dirname(__FILE__) . '/../..'); // destruct can be called late, and chdir could change + // Set the current directory to one which we expect it to be (i.e. the root directory of the install + $dir = realpath(dirname(__FILE__) . '/../..'); + static $includePathIsPatched = false; + if ($includePathIsPatched == false) + { + $path = explode(PATH_SEPARATOR, get_include_path()); + if (in_array($dir, $path) == false) + { + set_include_path($dir . PATH_SEPARATOR . get_include_path()); + } + $includePathIsPatched = true; + } + chdir($dir); // destruct can be called late, and chdir could change $cachedir = sugar_cached($this->getFilePath()); sugar_mkdir($cachedir, 0775, true); // clear out the cache on destroy if we are asked to diff --git a/include/clean.php b/include/clean.php index 92f00c50..2bb3878e 100644 --- a/include/clean.php +++ b/include/clean.php @@ -88,7 +88,7 @@ class SugarCleaner $config = HTMLPurifier_Config::createDefault(); if(!is_dir(sugar_cached("htmlclean"))) { - create_cache_directory("htmlclean"); + create_cache_directory("htmlclean/"); } $config->set('HTML.Doctype', 'XHTML 1.0 Transitional'); $config->set('Core.Encoding', 'UTF-8'); @@ -100,6 +100,7 @@ class SugarCleaner $config->set('HTML.TidyLevel', 'light'); $config->set('HTML.ForbiddenElements', array('body' => true, 'html' => true)); $config->set('AutoFormat.RemoveEmpty', false); + $config->set('Cache.SerializerPermissions', 0775); // for style //$config->set('Filter.ExtractStyleBlocks', true); $config->set('Filter.ExtractStyleBlocks.TidyImpl', false); // can't use csstidy, GPL @@ -113,7 +114,7 @@ class SugarCleaner // for link $config->set('HTML.DefinitionID', 'Sugar HTML Def'); $config->set('HTML.DefinitionRev', 2); - $config->set('Cache.DefinitionImpl', null); // TODO: remove this later! + $config->set('Cache.SerializerPath', sugar_cached('htmlclean/')); // IDs are namespaced $config->set('Attr.EnableID', true); $config->set('Attr.IDPrefix', 'sugar_text_'); diff --git a/include/database/MssqlManager.php b/include/database/MssqlManager.php index 81ac50c8..4a6ae48e 100644 --- a/include/database/MssqlManager.php +++ b/include/database/MssqlManager.php @@ -403,14 +403,22 @@ class MssqlManager extends DBManager $unionOrderBy = ' order by ' . $unionOrderBy; } - //Bug 56560 either start = 0 or > 0, use top query in conjunction - //with rownumber() function to create limit query. - //otherwise, it shows duplicates when paging on activities subpanel - $limitUnionSQL = "SELECT TOP $count * FROM( select ROW_NUMBER() OVER ( order by " - .$rowNumOrderBy.") AS row_number, * FROM (" - .$unionsql .") As numbered) " - . "As top_count_limit WHERE row_number > $start " - .$unionOrderBy; + //Bug 56560, use top query in conjunction with rownumber() function + //to create limit query when paging is needed. Otherwise, + //it shows duplicates when paging on activities subpanel. + //If not for paging, no need to use rownumber() function + if ($count == 1) + { + $limitUnionSQL = "SELECT TOP $count * FROM (" .$unionsql .") as top_count ".$unionOrderBy; + } + else + { + $limitUnionSQL = "SELECT TOP $count * FROM( select ROW_NUMBER() OVER ( order by " + .$rowNumOrderBy.") AS row_number, * FROM (" + .$unionsql .") As numbered) " + . "As top_count_limit WHERE row_number > $start " + .$unionOrderBy; + } return $limitUnionSQL; } diff --git a/include/generic/SugarWidgets/SugarWidgetFieldcurrency.php b/include/generic/SugarWidgets/SugarWidgetFieldcurrency.php index ebf9ead1..db726c73 100644 --- a/include/generic/SugarWidgets/SugarWidgetFieldcurrency.php +++ b/include/generic/SugarWidgets/SugarWidgetFieldcurrency.php @@ -74,47 +74,20 @@ class SugarWidgetFieldCurrency extends SugarWidgetFieldInt function & displayList($layout_def) { - static $currencies; + $symbol = ''; + $currency_id = '-99'; // If it's not grouped, or if it's grouped around a system currency column, look up the currency symbol so we can display it next to the amount if ( empty($layout_def['group_function']) || $this->isSystemCurrency($layout_def) ) { - if ( isset($layout_def['varname']) ) { - $key = $layout_def['varname']; - } else { - $key = $this->_get_column_alias($layout_def); + $c = $this->getCurrency($layout_def); + if(!empty($c['currency_id']) && !empty($c['currency_symbol'])) + { + $symbol = $c['currency_symbol']; + $currency_id = $c['currency_id']; } - $key = strtoupper($key); - - if ( $this->isSystemCurrency($layout_def) ) { - $currency_id = '-99'; - } else { - if (isset($layout_def['fields'][$key.'_CURRENCY'])) - $currency_id = $layout_def['fields'][$key.'_CURRENCY']; - else - $currency_id = $layout_def['fields'][$this->getTruncatedColumnAlias($this->_get_column_alias($layout_def)."_currency")]; - } - if ( empty($currency_id) ) { - $currency_id = '-99'; - } - - if ( !isset($currencies[$currency_id]) ) { - $currencies[$currency_id] = new Currency(); - $currencies[$currency_id]->retrieve($currency_id); - } - if(!empty($currencies[$currency_id]->symbol)){ - $symbol = $currencies[$currency_id]->symbol.' '; - } else { - $symbol = ''; - } - } else { - $symbol = ''; } -// $global_currency_obj = get_currency(); -// $display = format_number($this->displayListPlain($layout_def), 2, 2, array('convert' => true, 'currency_symbol' => true)); -// $display = $global_currency_obj->symbol. round($global_currency_obj->convertFromDollar($this->displayListPlain($layout_def)),2); - $value = $this->displayListPlain($layout_def); - $display = $symbol.$value; - - + $layout_def['currency_symbol'] = $symbol; + $layout_def['currency_id'] = $currency_id; + $display = $this->displayListPlain($layout_def); if(!empty($layout_def['column_key'])){ $field_def = $this->reporter->all_fields[$layout_def['column_key']]; @@ -146,8 +119,8 @@ class SugarWidgetFieldCurrency extends SugarWidgetFieldInt } function displayListPlain($layout_def) { -// $value = $this->_get_list_value($layout_def); - $value = format_number(parent::displayListPlain($layout_def), null, null, array('convert' => false, 'currency_symbol' => false)); + $cs = $this->getCurrency($layout_def); + $value = format_number(parent::displayListPlain($layout_def), null, null, array_merge(array('convert' => false), $cs)); return $value; } function queryFilterEquals(&$layout_def) @@ -236,5 +209,45 @@ class SugarWidgetFieldCurrency extends SugarWidgetFieldInt return false; } + /** + * Return currency for layout_def + * @param $layout_def mixed + * @return array Array with currency symbol and currency ID + */ + protected function getCurrency($layout_def) + { + $currency_id = false; + $currency_symbol = false; + if(isset($layout_def['currency_symbol']) && isset($layout_def['currency_id'])) + { + $currency_symbol = $layout_def['currency_symbol']; + $currency_id = $layout_def['currency_id']; + } + else + { + $key = strtoupper(isset($layout_def['varname']) ? $layout_def['varname'] : $this->_get_column_alias($layout_def)); + if ( $this->isSystemCurrency($layout_def) ) + { + $currency_id = '-99'; + } + elseif (isset($layout_def['fields'][$key.'_CURRENCY'])) + { + $currency_id = $layout_def['fields'][$key.'_CURRENCY']; + } + elseif(isset($layout_def['fields'][$this->getTruncatedColumnAlias($this->_get_column_alias($layout_def)."_currency")])) + { + $currency_id = $layout_def['fields'][$this->getTruncatedColumnAlias($this->_get_column_alias($layout_def)."_currency")]; + } + if($currency_id) + { + $currency = BeanFactory::getBean('Currencies', $currency_id); + if(!empty($currency ->symbol)) + { + $currency_symbol = $currency ->symbol; + } + } + } + return array('currency_symbol' => $currency_symbol, 'currency_id' => $currency_id); + } } ?> diff --git a/include/generic/SugarWidgets/SugarWidgetFieldcurrency_id.php b/include/generic/SugarWidgets/SugarWidgetFieldcurrency_id.php new file mode 100644 index 00000000..3867140c --- /dev/null +++ b/include/generic/SugarWidgets/SugarWidgetFieldcurrency_id.php @@ -0,0 +1,121 @@ +get_full_list('name'); + $currency->retrieve('-99'); + if (is_array($list)) + { + $list = array_merge(array($currency), $list); + } + else + { + $list = array($currency); + } + } + return $list; + } + + /** + * Overriding display of value of currency because of currencies are not stored in app_list_strings + * + * @param array $layout_def + * @return string for display + */ + public function &displayListPlain($layout_def) + { + static $currencies; + $value = $this->_get_list_value($layout_def); + if (empty($currencies[$value])) + { + $currency = new Currency(); + $currency->retrieve($value); + $currencies[$value] = $currency->symbol . ' ' . $currency->iso4217; + } + return $currencies[$value]; + } + + /** + * Overriding sorting because of default currency is not present in DB + * + * @param array $layout_def + * @return string for order by + */ + public function queryOrderBy($layout_def) + { + $tmpList = self::getCurrenciesList(); + $list = array(); + foreach ($tmpList as $bean) + { + $list[$bean->id] = $bean->symbol . ' ' . $bean->iso4217; + } + + $field_def = $this->reporter->all_fields[$layout_def['column_key']]; + if (!empty ($field_def['sort_on'])) + { + $order_by = $layout_def['table_alias'].".".$field_def['sort_on']; + } + else + { + $order_by = $this->_get_column_select($layout_def); + } + + if (empty ($layout_def['sort_dir']) || $layout_def['sort_dir'] == 'a') + { + $order_dir = "ASC"; + } + else + { + $order_dir = "DESC"; + } + return $this->reporter->db->orderByEnum($order_by, $list, $order_dir); + } +} diff --git a/include/generic/SugarWidgets/SugarWidgetReportField.php b/include/generic/SugarWidgets/SugarWidgetReportField.php index 57da52f4..c633f69a 100644 --- a/include/generic/SugarWidgets/SugarWidgetReportField.php +++ b/include/generic/SugarWidgets/SugarWidgetReportField.php @@ -158,7 +158,11 @@ class SugarWidgetReportField extends SugarWidgetField { if(!empty($this->reporter->all_fields[$layout_def['column_key']])) $field_def = $this->reporter->all_fields[$layout_def['column_key']]; - if ( ! empty( $field_def['sort_on'])) + if (!empty($layout_def['group_function'])) + { + $order_by = $this->_get_column_alias($layout_def); + } + elseif (!empty($field_def['sort_on'])) { $order_by = $layout_def['table_alias'].".".$field_def['sort_on']; if(!empty($field_def['sort_on2'])) @@ -263,7 +267,7 @@ class SugarWidgetReportField extends SugarWidgetField // this comment is being added to trigger the upgrade package if ( ! empty($layout_def['group_function']) && $layout_def['group_function']=='count') { - return 'count'; + return $layout_def['table_alias'] . '__count'; } if ( ! empty($layout_def['table_alias'])) diff --git a/include/generic/SugarWidgets/SugarWidgetSubPanelIcon.php b/include/generic/SugarWidgets/SugarWidgetSubPanelIcon.php index 963e4142..2132c1c7 100644 --- a/include/generic/SugarWidgets/SugarWidgetSubPanelIcon.php +++ b/include/generic/SugarWidgets/SugarWidgetSubPanelIcon.php @@ -154,7 +154,7 @@ class SugarWidgetSubPanelIcon extends SugarWidgetField } // now handle attachments for Emails else if(!empty($layout_def['module']) && $layout_def['module'] == 'Emails' && !empty($layout_def['fields']['ATTACHMENT_IMAGE'])) { - //$ret.= $layout_def['fields']['ATTACHMENT_IMAGE']; + $ret.= $layout_def['fields']['ATTACHMENT_IMAGE']; } return $ret; } diff --git a/include/globalControlLinks.php b/include/globalControlLinks.php index 3a5becc4..8434096e 100644 --- a/include/globalControlLinks.php +++ b/include/globalControlLinks.php @@ -53,7 +53,7 @@ if(isset( $sugar_config['disc_client']) && $sugar_config['disc_client']){ $global_control_links['employees'] = array( -'linkinfo' => array($app_strings['LBL_EMPLOYEES']=> 'index.php?module=Employees&action=index'), +'linkinfo' => array($app_strings['LBL_EMPLOYEES']=> 'index.php?module=Employees&action=index&query=true'), 'submenu' => '' ); if ( diff --git a/include/javascript/sugar_3.js b/include/javascript/sugar_3.js index 0783a1e0..ad383c6f 100644 --- a/include/javascript/sugar_3.js +++ b/include/javascript/sugar_3.js @@ -466,7 +466,10 @@ try{if(result[1].indexOf("src=")>-1){var srcRegex=/.*src=['"]([a-zA-Z0-9_\-\&\/\ {var url=srcResult;Y.Get.script(srcResult,{autopurge:false,onSuccess:function(o){},onFailure:function(o){},onTimeout:function(o){}});});} else {YUI().use("io-base",function(Y){var cfg,response;cfg={method:'GET',sync:true,on:{success:function(transactionid,response,arguments) -{SUGAR.util.globalEval(response.responseText);}}};response=Y.io(srcResult,cfg);});}}else{SUGAR.util.globalEval(result[2]);}} +{SUGAR.util.globalEval(response.responseText);}}};response=Y.io(srcResult,cfg);});}}else{var srcRegex=//;var srcResult=srcRegex.exec(result[2]);if(srcResult&&srcResult.index>-1) +{SUGAR.util.globalEval(srcResult[1]);} +else +{SUGAR.util.globalEval(result[2]);}}} catch(e){if(typeof(console)!="undefined"&&typeof(console.log)=="function") {console.log("error adding script");console.log(e);console.log(result);}} result=objRegex.exec(text);}},getLeftColObj:function(){leftColObj=document.getElementById('leftCol');while(leftColObj.nodeName!='TABLE'){leftColObj=leftColObj.firstChild;} diff --git a/include/utils.php b/include/utils.php index cb64c1ae..d3085724 100644 --- a/include/utils.php +++ b/include/utils.php @@ -4876,7 +4876,7 @@ function getDuplicateRelationListWithTitle($def, $var_def, $module) $temp_module_strings = return_module_language($current_language, $module); $temp_duplicate_array = array_diff_assoc($def, $select_array); $temp_duplicate_array = array_merge($temp_duplicate_array, array_intersect($select_array, $temp_duplicate_array)); - + foreach ($temp_duplicate_array as $temp_key => $temp_value) { // Don't add duplicate relationships @@ -4893,7 +4893,6 @@ function getDuplicateRelationListWithTitle($def, $var_def, $module) $select_array[$key] .= ' (' . $key . ')'; } } - asort($select_array); return $select_array; } diff --git a/jssource/src_files/include/javascript/sugar_3.js b/jssource/src_files/include/javascript/sugar_3.js index 8fd44334..6a29a438 100644 --- a/jssource/src_files/include/javascript/sugar_3.js +++ b/jssource/src_files/include/javascript/sugar_3.js @@ -2949,7 +2949,17 @@ SUGAR.util = function () { }else{ // Bug #49205 : Subpanels fail to load when selecting subpanel tab // execute script in global context - SUGAR.util.globalEval(result[2]); + // Bug #57288 : don't eval with html comment-out script; that causes syntax error in IE + var srcRegex = //; + var srcResult = srcRegex.exec(result[2]); + if (srcResult && srcResult.index > -1) + { + SUGAR.util.globalEval(srcResult[1]); + } + else + { + SUGAR.util.globalEval(result[2]); + } } } catch(e) { diff --git a/jssource/src_files/modules/Meetings/jsclass_scheduler.js b/jssource/src_files/modules/Meetings/jsclass_scheduler.js index 11aaf65b..3098f4b2 100644 --- a/jssource/src_files/modules/Meetings/jsclass_scheduler.js +++ b/jssource/src_files/modules/Meetings/jsclass_scheduler.js @@ -435,24 +435,6 @@ function SugarWidgetSchedulerAttendees() { SugarWidgetSchedulerAttendees.prototype.init = function() { - // A list of modules which allow the parent to be in the invitees - SugarWidgetSchedulerAttendees.allowedTypes = ['Contact', 'Lead']; - - $(document).ready(function() - { - // Hide the link label - $('#add_parent_invitee_label').css('visibility', 'hidden'); - - // Set visibility on load - SugarWidgetSchedulerAttendees.setAddParentLinkVisibility(); - - // Add listener for parent_type, so we can hide/unhide the link - $('#parent_type').change(function() - { - SugarWidgetSchedulerAttendees.setAddParentLinkVisibility(); - }); - }); - var form_name; if(typeof document.EditView != 'undefined') form_name = "EditView"; @@ -617,52 +599,6 @@ SugarWidgetSchedulerAttendees.form_add_attendee = function (list_row) { GLOBAL_REGISTRY.scheduler_attendees_obj.display(); } -// Function sets the visibility of the Add Parent Link -SugarWidgetSchedulerAttendees.setAddParentLinkVisibility = function() -{ - parent_type = $('#parent_type option:selected').text(); - if ($.inArray(parent_type, SugarWidgetSchedulerAttendees.allowedTypes) > -1) - { - $('#add_parent_invitee').parent().css('display', ''); - } - else - { - $('#add_parent_invitee').parent().css('display', 'none'); - } -} - -// Function used to add the parent to the invitees -SugarWidgetSchedulerAttendees.formAddParent = function() -{ - parent_id = $("#parent_id").val(); - parent_name = $("#parent_name").val(); - parent_type = $("#parent_type option:selected").text(); - - // If it's an allowed parent type and the parent is selected, add it to the invitees - if (parent_id.length > 0 && $.inArray(parent_type, SugarWidgetSchedulerAttendees.allowedTypes) > -1) - { - invitee = { - fields: - {id:parent_id, full_name:parent_name}, - module:parent_type}; - - contains = false; - for(var i = 0; i < GLOBAL_REGISTRY.focus.users_arr.length; i++) - { - if (GLOBAL_REGISTRY.focus.users_arr[i]['fields']['id'] == invitee['fields']['id']) - { - contains = true; - break; - } - } - - if (!contains) - { - GLOBAL_REGISTRY.focus.users_arr[GLOBAL_REGISTRY.focus.users_arr.length] = invitee; - GLOBAL_REGISTRY.scheduler_attendees_obj.display(); - } - } -} ////////////////////////////////////////////////// // class: SugarWidgetScheduleRow diff --git a/modules/ACLActions/ACLAction.php b/modules/ACLActions/ACLAction.php index 575522a0..0b377fd9 100644 --- a/modules/ACLActions/ACLAction.php +++ b/modules/ACLActions/ACLAction.php @@ -89,7 +89,7 @@ class ACLAction extends SugarBean{ * @param STRING $category - the category (e.g module name - Accounts, Contacts) * @param STRING $type - the type (e.g. 'module', 'field') */ - function removeActions($category, $type='module'){ + public static function removeActions($category, $type='module'){ global $ACLActions; $db = DBManagerFactory::getInstance(); if(isset($ACLActions[$type])){ @@ -117,7 +117,7 @@ class ACLAction extends SugarBean{ * @param INT $access - the access level you want the color for * @return the color either name or hex representation or false if the level does not exist */ - function AccessColor($access){ + protected static function AccessColor($access){ global $ACLActionAccessLevels; if(isset($ACLActionAccessLevels[$access])){ @@ -152,7 +152,7 @@ class ACLAction extends SugarBean{ * @param INT $access - the access level you want the color for * @return the access level label or false if the level does not exist */ - function AccessLabel($access){ + protected static function AccessLabel($access){ global $ACLActionAccessLevels; if(isset($ACLActionAccessLevels[$access])){ $label=preg_replace('/(LBL_ACCESS_)(.*)/', '$2', $ACLActionAccessLevels[$access]['label']); @@ -168,7 +168,7 @@ class ACLAction extends SugarBean{ * this is used for building select boxes * @return array containg access levels (ints) as keys and access names as values */ - function getAccessOptions( $action, $type='module'){ + protected static function getAccessOptions( $action, $type='module'){ global $ACLActions; $options = array(); @@ -186,7 +186,7 @@ class ACLAction extends SugarBean{ * * */ - function getDefaultActions($type='module', $action=''){ + public static function getDefaultActions($type='module', $action=''){ $query = "SELECT * FROM acl_actions WHERE deleted=0 "; if(!empty($type)){ $query .= " AND acltype='$type'"; @@ -341,7 +341,7 @@ class ACLAction extends SugarBean{ * @param STRING $action the action of that category you would like to check access for * @param BOOLEAN OPTIONAL $is_owner if the object is owned by the user you are checking access for */ - function userHasAccess($user_id, $category, $action,$type='module', $is_owner = false){ + public static function userHasAccess($user_id, $category, $action,$type='module', $is_owner = false){ global $current_user; if($current_user->isAdminForModule($category)&& !isset($_SESSION['ACL'][$user_id][$category][$type][$action]['aclaccess'])){ return true; @@ -369,7 +369,8 @@ class ACLAction extends SugarBean{ * @param STRING $type * @return INT (ACCESS LEVEL) */ - function getUserAccessLevel($user_id, $category, $action,$type='module'){ + + public static function getUserAccessLevel($user_id, $category, $action,$type='module'){ if(empty($_SESSION['ACL'][$user_id][$category][$type][$action])){ ACLAction::getUserActions($user_id, false); @@ -394,7 +395,7 @@ class ACLAction extends SugarBean{ * @param STRING $type * @return boolean */ - function userNeedsOwnership($user_id, $category, $action,$type='module'){ + public static function userNeedsOwnership($user_id, $category, $action,$type='module'){ //check if we don't have it set in the cache if not lets reload the cache if(empty($_SESSION['ACL'][$user_id][$category][$type][$action])){ @@ -416,7 +417,7 @@ class ACLAction extends SugarBean{ * * @param unknown_type $categories */ - function setupCategoriesMatrix(&$categories){ + public static function setupCategoriesMatrix(&$categories){ global $ACLActions, $current_user; $names = array(); $disabled = array(); diff --git a/modules/Activities/EmailReminder.php b/modules/Activities/EmailReminder.php index 09a5489b..c6897343 100644 --- a/modules/Activities/EmailReminder.php +++ b/modules/Activities/EmailReminder.php @@ -144,10 +144,18 @@ class EmailReminder $mail = new SugarPHPMailer(); $mail->setMailerForSystem(); - $from_address = $user->emailAddress->getReplyToAddress($user); - $from_address = !empty($from_address) ? $from_address : $admin->settings['notify_fromaddress']; + if(empty($admin->settings['notify_send_from_assigning_user'])) + { + $from_address = $admin->settings['notify_fromaddress']; + $from_name = $admin->settings['notify_fromname'] ? "" : $admin->settings['notify_fromname']; + } + else + { + $from_address = $user->emailAddress->getReplyToAddress($user); + $from_name = $user->full_name; + } + $mail->From = $from_address; - $from_name = !empty($user->full_name) ? $user->full_name : $admin->settings['notify_fromname']; $mail->FromName = $from_name; $xtpl = new XTemplate(get_notify_template_file($current_language)); diff --git a/modules/Administration/Locale.php b/modules/Administration/Locale.php index 59242289..4442cf61 100644 --- a/modules/Administration/Locale.php +++ b/modules/Administration/Locale.php @@ -35,12 +35,6 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); * "Powered by SugarCRM". ********************************************************************************/ -/********************************************************************************* - - * Description: - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. All Rights - * Reserved. Contributor(s): ______________________________________.. - * *******************************************************************************/ global $current_user, $sugar_config; if (!is_admin($current_user)) sugar_die("Unauthorized access to administration."); @@ -58,7 +52,7 @@ echo getClassicModuleTitle( $cfg = new Configurator(); $sugar_smarty = new Sugar_Smarty(); -$errors = ''; +$errors = array(); /////////////////////////////////////////////////////////////////////////////// //// HANDLE CHANGES diff --git a/modules/Administration/UpgradeWizard.php b/modules/Administration/UpgradeWizard.php index d940a941..6ab9be65 100644 --- a/modules/Administration/UpgradeWizard.php +++ b/modules/Administration/UpgradeWizard.php @@ -135,14 +135,20 @@ if( isset( $_REQUEST['run'] ) && ($_REQUEST['run'] != "") ){ { //SCAN THE MANIFEST FILE TO MAKE SURE NO COPIES OR ANYTHING ARE HAPPENING IN IT $ms = new ModuleScanner(); + $ms->lockConfig(); $fileIssues = $ms->scanFile($manifest_file); if(!empty($fileIssues)){ echo '

' . $mod_strings['ML_MANIFEST_ISSUE'] . '


'; $ms->displayIssues(); die(); } - require_once( $manifest_file ); - validate_manifest( $manifest ); + list($manifest, $installdefs) = MSLoadManifest($manifest_file); + if($ms->checkConfig($manifest_file)) { + echo '

' . $mod_strings['ML_MANIFEST_ISSUE'] . '


'; + $ms->displayIssues(); + die(); + } + validate_manifest( $manifest ); $upgrade_zip_type = $manifest['type']; diff --git a/modules/Administration/UpgradeWizardCommon.php b/modules/Administration/UpgradeWizardCommon.php index 44a891f9..1df41db6 100644 --- a/modules/Administration/UpgradeWizardCommon.php +++ b/modules/Administration/UpgradeWizardCommon.php @@ -242,4 +242,5 @@ function getDiffFiles($unzip_dir, $install_file, $is_install = true, $previous_v }//fi return $modified_files; } + ?> diff --git a/modules/Administration/UpgradeWizard_prepare.php b/modules/Administration/UpgradeWizard_prepare.php index c4f573c1..ddc54c36 100644 --- a/modules/Administration/UpgradeWizard_prepare.php +++ b/modules/Administration/UpgradeWizard_prepare.php @@ -343,7 +343,7 @@ switch( $mode ){ ?> - +' . } } } + document.getElementById("submit_button").disabled = true; return true; } var keys = [ "license","readme"]; @@ -534,4 +535,4 @@ echo ' + +{sugar_getscript file="modules/Calendar/Cal.js"} {/literal}{$fields.duration_minutes.value} {$MOD.LBL_HOURS_MINUTES}', + ), - array ( - 'name' => 'add_parent_invitee', - 'comment' => 'Link to add invitees', - 'customCode' => '{$MOD.LBL_ADD_PARENT_INVITEE}', - ), - ), - array ( array( 'name' => 'reminder_time', 'customCode' => '{include file="modules/Meetings/tpls/reminders.tpl"}', diff --git a/modules/Calls/vardefs.php b/modules/Calls/vardefs.php index 2f08b340..ffa129cf 100644 --- a/modules/Calls/vardefs.php +++ b/modules/Calls/vardefs.php @@ -442,17 +442,6 @@ $dictionary['Call'] = array('table' => 'calls', 'comment' => 'A Call is an activ 'reportable' => false, 'studio' => false, ), - 'add_parent_invitee' => - array( - 'name' => 'add_parent_invitee', - 'vname' => 'LBL_ADD_PARENT_INVITEE', - 'type' => 'varchar', - 'source' => 'non-db', - 'comment' => 'Helper field for Add To Parent link', - 'massupdate' => false, - 'reportable' => false, - 'importable' => false, - ), ), 'indices' => array ( array( diff --git a/modules/Emails/EmailUI.php b/modules/Emails/EmailUI.php index cecdf0da..a78d6ee9 100644 --- a/modules/Emails/EmailUI.php +++ b/modules/Emails/EmailUI.php @@ -1235,9 +1235,15 @@ eoq; $from = (isset($email->from_name) && !empty($email->from_name)) ? $email->from_name : $email->from_addr; - if(isset($_REQUEST['sugarEmail']) && !empty($_REQUEST['sugarEmail'])) - $from = (isset($email->to_addrs_names) && !empty($email->to_addrs_names)) ? $email->to_addrs_names : $email->to_addrs; - + if(isset($_REQUEST['sugarEmail']) && !empty($_REQUEST['sugarEmail'])) + { + if($email->status == "sent") + { + $from = (isset($email->to_addrs_names) && !empty($email->to_addrs_names)) ? $email->to_addrs_names : $email->to_addrs; + }else{ + $from = (isset($email->from_name) && !empty($email->from_name)) ? $email->from_name : $email->from_addr_name; + } + } $name = explode(" ", trim($from)); diff --git a/modules/Emails/javascript/EmailUICompose.js b/modules/Emails/javascript/EmailUICompose.js index a7c52a67..0f2c2e4e 100644 --- a/modules/Emails/javascript/EmailUICompose.js +++ b/modules/Emails/javascript/EmailUICompose.js @@ -2330,7 +2330,7 @@ SE.composeLayout = { && ( this['ccHidden'+idx] == false && this['bccHidden'+idx] == false) ) Dom.addClass("add_addr_options_tr"+idx, "yui-hidden"); - // SE.composeLayout.resizeEditor(idx); + SE.composeLayout.resizeEditor(idx); }, /** * Hide the cc and bcc fields if they were shown. diff --git a/modules/Emails/javascript/ajax.js b/modules/Emails/javascript/ajax.js index 1a46a7fa..186d2ee5 100644 --- a/modules/Emails/javascript/ajax.js +++ b/modules/Emails/javascript/ajax.js @@ -729,12 +729,12 @@ AjaxObject.detailView = { var count = SUGAR.EmailAddressWidget.count[ret.module] ? SUGAR.EmailAddressWidget.count[ret.module] : 0; var tableId = YAHOO.util.Dom.getElementsByClassName('emailaddresses', 'table', editForm)[0]; tableId = tableId ? tableId.id : tableId; - var instId = ret.module + count; + var instId = ret.module + (count - 1); SED.quickCreateEmailsToAdd = ret.emailAddress; SED.quickCreateEmailCallback = function(instId, tableId) { //try to fill up the email address if and only if emailwidget is existed in the form if(tableId) { - var eaw = new SUGAR.EmailAddressWidget.instances[instId]; + var eaw = SUGAR.EmailAddressWidget.instances[instId]; if (eaw) { eaw.prefillEmailAddresses(tableId, SUGAR.email2.detailView.quickCreateEmailsToAdd); } else { diff --git a/modules/Emails/javascript/composeEmailTemplate.js b/modules/Emails/javascript/composeEmailTemplate.js index 96cc28ec..79b466c1 100644 --- a/modules/Emails/javascript/composeEmailTemplate.js +++ b/modules/Emails/javascript/composeEmailTemplate.js @@ -34,7 +34,7 @@ ********************************************************************************/ SUGAR.email2.templates['compose'] = '
' + -'
' + +'
' + '
' + ' ' + ' ' + diff --git a/modules/Import/ImportDuplicateCheck.php b/modules/Import/ImportDuplicateCheck.php index 2e4340a0..84537dd4 100644 --- a/modules/Import/ImportDuplicateCheck.php +++ b/modules/Import/ImportDuplicateCheck.php @@ -182,6 +182,18 @@ class ImportDuplicateCheck */ public function isADuplicateRecord( $indexlist ) { + // Bug #51264 : Importing updates to rows prevented by duplicates check + if ( !empty($this->_focus) && ($this->_focus instanceof SugarBean) && !empty($this->_focus->id) ) + { + $_focus = clone $this->_focus; + $_focus->id = null; + $_focus->retrieve($this->_focus->id); + if ( !empty($_focus->id) ) + { + return false; + } + unset($_focus); + } //lets strip the indexes of the name field in the value and leave only the index name $origIndexList = $indexlist; diff --git a/modules/InboundEmail/InboundEmail.php b/modules/InboundEmail/InboundEmail.php index a50d4c35..e4cf3825 100644 --- a/modules/InboundEmail/InboundEmail.php +++ b/modules/InboundEmail/InboundEmail.php @@ -3524,7 +3524,7 @@ class InboundEmail extends SugarBean { { $result = ""; - foreach ($part->dparamaters as $k => $v) + foreach ($part->dparameters as $k => $v) { if( strtolower($v->attribute) == 'filename') { diff --git a/modules/Leads/tpls/ConvertLead.tpl b/modules/Leads/tpls/ConvertLead.tpl index 485d4425..9c6918bf 100644 --- a/modules/Leads/tpls/ConvertLead.tpl +++ b/modules/Leads/tpls/ConvertLead.tpl @@ -36,6 +36,7 @@ *} +{{assign var="selectRelation" value=$selectFields[$module]}} {$ERROR} {{foreach name=section from=$sectionPanels key=label item=panel}} {{counter name="panelCount" print=false}} @@ -60,16 +61,18 @@ mod_array.push('{{$module}}');//Bug#50590 add all required modules to mod_array {/if} {if !$def.required || !empty($def.select)} - + +{/if} {{/if}}
diff --git a/modules/Leads/views/view.convertlead.php b/modules/Leads/views/view.convertlead.php index a819f8d9..91dd31e1 100644 --- a/modules/Leads/views/view.convertlead.php +++ b/modules/Leads/views/view.convertlead.php @@ -121,6 +121,27 @@ class ViewConvertLead extends SugarView 'initial_filter' => '&name_advanced=' . urlencode($this->focus->account_name)) ); } + + $relatedFields = $this->contact->get_related_fields(); + $selectFields = array(); + foreach ($this->defs as $moduleName => $mDefs) + { + if (!empty($mDefs[$ev->view]['select']) && !empty($relatedFields[$mDefs[$ev->view]['select']])) + { + $selectFields[$moduleName] = $mDefs[$ev->view]['select']; + continue; + } + foreach ($relatedFields as $fDef) + { + if (!empty($fDef['link']) && !empty($fDef['module']) && $fDef['module'] == $moduleName) + { + $selectFields[$moduleName] = $fDef['name']; + break; + } + } + } + $smarty->assign('selectFields', $selectFields); + $smarty->assign("contact_def", $this->contact->field_defs); $smarty->assign("form_name", "ConvertLead"); $smarty->assign("form_id", "ConvertLead"); diff --git a/modules/Meetings/Meeting.php b/modules/Meetings/Meeting.php index 8ce93895..bf2557b9 100644 --- a/modules/Meetings/Meeting.php +++ b/modules/Meetings/Meeting.php @@ -497,14 +497,17 @@ class Meeting extends SugarBean { } $this->fill_in_additional_detail_fields(); - //make sure we grab the localized version of the contact name, if a contact is provided - if (!empty($this->contact_id)) { - global $locale; - // Bug# 46125 - make first name, last name, salutation and title of Contacts respect field level ACLs - $contact_temp = BeanFactory::getBean("Contacts", $this->contact_id); - $contact_temp->_create_proper_name_field(); - $this->contact_name = $contact_temp->full_name; - } + // make sure we grab the localized version of the contact name, if a contact is provided + if (!empty($this->contact_id)) + { + $contact_temp = BeanFactory::getBean("Contacts", $this->contact_id); + if (!empty($contact_temp)) + { + // Make first name, last name, salutation and title of Contacts respect field level ACLs + $contact_temp->_create_proper_name_field(); + $this->contact_name = $contact_temp->full_name; + } + } $meeting_fields['CONTACT_ID'] = $this->contact_id; $meeting_fields['CONTACT_NAME'] = $this->contact_name; diff --git a/modules/Meetings/MeetingFormBase.php b/modules/Meetings/MeetingFormBase.php index b61cef70..410978e6 100644 --- a/modules/Meetings/MeetingFormBase.php +++ b/modules/Meetings/MeetingFormBase.php @@ -374,6 +374,12 @@ function handleSave($prefix,$redirect=true, $useRequired=false) { $focus->leads_arr = array(); $focus->leads_arr = $leadInvitees; + if(!empty($_POST['parent_id']) && $_POST['parent_type'] == 'Contacts') { + $focus->contacts_arr[] = $_POST['parent_id']; + } + if(!empty($_POST['parent_id']) && $_POST['parent_type'] == 'Leads') { + $focus->leads_arr[] = $_POST['parent_id']; + } // Call the Meeting module's save function to handle saving other fields besides // the users and contacts relationships $focus->update_vcal = false; // Bug #49195 : don't update vcal b/s related users aren't saved yet, create vcal cache below diff --git a/modules/Meetings/jsclass_scheduler.js b/modules/Meetings/jsclass_scheduler.js index 87e50ed8..5f9aa51c 100644 --- a/modules/Meetings/jsclass_scheduler.js +++ b/modules/Meetings/jsclass_scheduler.js @@ -80,9 +80,7 @@ GLOBAL_REGISTRY.focus.fields.date_start=date_start;if(has_meridiem){GLOBAL_REGIS GLOBAL_REGISTRY.focus.fields.duration_hours=document.forms[form_name].duration_hours.value;GLOBAL_REGISTRY.focus.fields.duration_minutes=document.forms[form_name].duration_minutes.value;GLOBAL_REGISTRY.focus.fields.datetime_start=SugarDateTime.mysql2jsDateTime(GLOBAL_REGISTRY.focus.fields.date_start,GLOBAL_REGISTRY.focus.fields.time_start);GLOBAL_REGISTRY.scheduler_attendees_obj.init();GLOBAL_REGISTRY.scheduler_attendees_obj.display();} SugarWidgetScheduler.prototype.display=function(){this.parentNode.innerHTML='';var attendees=new SugarWidgetSchedulerAttendees();attendees.load(this.parentNode);var search=new SugarWidgetSchedulerSearch();search.load(this.parentNode);} SugarClass.inherit("SugarWidgetSchedulerAttendees","SugarClass");function SugarWidgetSchedulerAttendees(){this.init();} -SugarWidgetSchedulerAttendees.prototype.init=function(){SugarWidgetSchedulerAttendees.allowedTypes=['Contact','Lead'];$(document).ready(function() -{$('#add_parent_invitee_label').css('visibility','hidden');SugarWidgetSchedulerAttendees.setAddParentLinkVisibility();$('#parent_type').change(function() -{SugarWidgetSchedulerAttendees.setAddParentLinkVisibility();});});var form_name;if(typeof document.EditView!='undefined') +SugarWidgetSchedulerAttendees.prototype.init=function(){var form_name;if(typeof document.EditView!='undefined') form_name="EditView";else if(typeof document.CalendarEditView!='undefined') form_name="CalendarEditView";else return;GLOBAL_REGISTRY.scheduler_attendees_obj=this;var date_start=document.forms[form_name].date_start.value;var hour_start=parseInt(date_start.substring(11,13),10);var minute_start=parseInt(date_start.substring(14,16),10);var has_meridiem=/am|pm/i.test(date_start);if(has_meridiem){var meridiem=trim(date_start.substring(16));} @@ -110,18 +108,6 @@ if(typeof GLOBAL_REGISTRY.focus.users_arr_hash=='undefined'){GLOBAL_REGISTRY.foc for(var i=0;i-1) -{$('#add_parent_invitee').parent().css('display','');} -else -{$('#add_parent_invitee').parent().css('display','none');}} -SugarWidgetSchedulerAttendees.formAddParent=function() -{parent_id=$("#parent_id").val();parent_name=$("#parent_name").val();parent_type=$("#parent_type option:selected").text();if(parent_id.length>0&&$.inArray(parent_type,SugarWidgetSchedulerAttendees.allowedTypes)>-1) -{invitee={fields:{id:parent_id,full_name:parent_name},module:parent_type};contains=false;for(var i=0;i'Accept?', 'LBL_ADD_BUTTON'=> 'Add', 'LBL_ADD_INVITEE' => 'Add Invitees', - 'LBL_ADD_PARENT_INVITEE' => 'Add Related person to invitees', 'LBL_COLON' => ':', 'LBL_CONTACT_NAME' => 'Contact:', 'LBL_CONTACTS_SUBPANEL_TITLE' => 'Contacts', diff --git a/modules/Meetings/metadata/editviewdefs.php b/modules/Meetings/metadata/editviewdefs.php index 1b59c52d..3cf7012d 100644 --- a/modules/Meetings/metadata/editviewdefs.php +++ b/modules/Meetings/metadata/editviewdefs.php @@ -133,10 +133,10 @@ function formSubmitCheck(){ldelim}if(check_form(\'EditView\')){ldelim}document.E 'updateCallback' => 'SugarWidgetScheduler.update_time();', ), ), + array ( - 'name' => 'location', - 'comment' => 'Meeting location', - 'label' => 'LBL_LOCATION', + 'name' => 'parent_name', + 'label' => 'LBL_LIST_RELATED_TO', ), ), @@ -151,9 +151,11 @@ function formSubmitCheck(){ldelim}if(check_form(\'EditView\')){ldelim}document.E 'updateCallback' => 'SugarWidgetScheduler.update_time();', ), ), + array ( - 'name' => 'parent_name', - 'label' => 'LBL_LIST_RELATED_TO', + 'name' => 'location', + 'comment' => 'Meeting location', + 'label' => 'LBL_LOCATION', ), ), @@ -177,11 +179,6 @@ function formSubmitCheck(){ldelim}if(check_form(\'EditView\')){ldelim}document.E ', 'customCodeReadOnly' => '{$fields.duration_hours.value}{$MOD.LBL_HOURS_ABBREV} {$fields.duration_minutes.value}{$MOD.LBL_MINSS_ABBREV} ', ), - array ( - 'name' => 'add_parent_invitee', - 'comment' => 'Link to add invitees', - 'customCode' => '{$MOD.LBL_ADD_PARENT_INVITEE}', - ), ), array ( array ( diff --git a/modules/Meetings/vardefs.php b/modules/Meetings/vardefs.php index d4d843e8..d23a4fc0 100644 --- a/modules/Meetings/vardefs.php +++ b/modules/Meetings/vardefs.php @@ -501,17 +501,6 @@ $dictionary['Meeting'] = array('table' => 'meetings', 'reportable' => false, 'importable' => false, ), - 'add_parent_invitee' => - array( - 'name' => 'add_parent_invitee', - 'vname' => 'LBL_ADD_PARENT_INVITEE', - 'type' => 'varchar', - 'source' => 'non-db', - 'comment' => 'Helper field for Add To Parent link', - 'massupdate' => false, - 'reportable' => false, - 'importable' => false, - ), ), 'relationships' => array ( 'meetings_assigned_user' => diff --git a/modules/ModuleBuilder/MB/MBPackage.php b/modules/ModuleBuilder/MB/MBPackage.php index ebc14abc..1a981821 100644 --- a/modules/ModuleBuilder/MB/MBPackage.php +++ b/modules/ModuleBuilder/MB/MBPackage.php @@ -397,7 +397,7 @@ function buildInstall($path){ $this->getCustomMetadataManifestForModule($value, $installdefs); }//fi }//foreach - $relationshipsMetaFiles = $this->getCustomRelationshipsMetaFilesByModuleName($value, true, true); + $relationshipsMetaFiles = $this->getCustomRelationshipsMetaFilesByModuleName($value, true, true,$modules); if($relationshipsMetaFiles) { foreach ($relationshipsMetaFiles as $file) @@ -502,9 +502,18 @@ function buildInstall($path){ */ protected function getExtensionsManifestForPackage($path, &$installdefs) { - $installdefs['copy'] = array(); + if(empty($installdefs['copy'])) + { + $installdefs['copy']= array(); + } $generalPath = DIRECTORY_SEPARATOR . 'Extension' . DIRECTORY_SEPARATOR . 'modules'; + //do not process if path is not a valid directory, or recursiveIterator will break. + if(!is_dir($path.$generalPath)) + { + return; + } + $recursiveIterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($path . $generalPath), RecursiveIteratorIterator::SELF_FIRST @@ -559,7 +568,7 @@ function buildInstall($path){ } $extensions = $this->getExtensionsList($module, $modules); - $relMetaFiles = $this->getCustomRelationshipsMetaFilesByModuleName($module, true); + $relMetaFiles = $this->getCustomRelationshipsMetaFilesByModuleName($module, true,false,$modules); $extensions = array_merge($extensions, $relMetaFiles); foreach ($extensions as $file) { @@ -742,6 +751,13 @@ function buildInstall($path){ $includeMask = false; $extPath = sprintf('custom%1$sExtension%1$smodules%1$s' . $module . '%1$sExt', DIRECTORY_SEPARATOR); + //do not process if path is not a valid directory, or recursiveIterator will break. + if(!is_dir($extPath)) + { + return $result; + } + + if (is_array($includeRelationships)) { $includeMask = array(); @@ -772,20 +788,15 @@ function buildInstall($path){ if ($fileInfo->isFile() && !in_array($fileInfo->getPathname(), $result)) { - if ($includeMask === false) + //get the filename in lowercase for easier comparison + $fn = $fileInfo->getFilename(); + if(!empty($fn)) { + $fn = strtolower($fn); + } + + if ($this->filterExportedRelationshipFile($fn,$module,$includeRelationships) ){ $result[] = $fileInfo->getPathname(); - } - else - { - foreach ($includeMask as $v) - { - if (strpos($fileInfo->getFilename(), $v) !== false) - { - $result[] = $fileInfo->getPathname(); - break; - } - } } } } @@ -793,6 +804,57 @@ function buildInstall($path){ return $result; } + /** + * Processes the name of the file and compares against the passed in module names to + * evaluate whether the file should be included for export. Returns true or false + * + * @param $fn (file name that is being evaluated) + * @param $module (name of current module being evaluated) + * @param $includeRelationship (list of related modules that are also being exported, to be used as filters) + * @return boolean true or false + */ + function filterExportedRelationshipFile($fn,$module,$includeRelationships) + { + $shouldExport = false; + if(empty($fn) || !is_array($includeRelationships) || empty($includeRelationships)) + { + return $shouldExport; + } + + //if file name does not contain the current module name then it is not a relationship file, + //or if the module has the current module name twice seperated with an underscore, then this is a relationship within itself + //in both cases set the shouldExport flag to true + $lc_mod = strtolower($module); + $fn = strtolower($fn); + if ((strpos($fn, $lc_mod) === false) || (strpos($fn, $lc_mod.'_'.$lc_mod) !== false)) + { + $shouldExport = true; + }else{ + + //grab only rels that have both modules in the export list + foreach ($includeRelationships as $relatedModule) + { + //skip if the related module is empty + if(empty($relatedModule)) + { + continue; + } + + //if the filename also has the related module name, then add the relationship file + //strip the current module,as we have already checked for existance of module name and dont want any false positives + $fn = str_replace($lc_mod,'',$fn); + if (strpos($fn, strtolower($relatedModule)) !== false) + { + //both modules exist in the filename lets include in the results array + $shouldExport = true; + break; + } + } + } + + return $shouldExport; + } + /** * Returns a set of field defs for fields that will exist when this package is deployed * based on the relationships in all of its modules. @@ -870,6 +932,8 @@ function buildInstall($path){ } /** + * This returns an UNFILTERED list of custom relationships by module name. You will have to filter the relationships + * by the modules being exported after calling this method * @param string $moduleName * @param bool $lhs Return relationships where $moduleName - left module in join. * @return mixed Array or false when module name is wrong. @@ -911,9 +975,10 @@ function buildInstall($path){ * @param string $moduleName * @param bool $lhs Return relationships where $moduleName - left module in join. * @param bool $metadataOnly Return only relationships metadata file. - * @return array + * @param $includeRelationship (list of related modules that are also being exported) + * @return array (array of relationships filtered to only include relationships to modules being exported) */ - protected function getCustomRelationshipsMetaFilesByModuleName($moduleName, $lhs = false, $metadataOnly = false) + protected function getCustomRelationshipsMetaFilesByModuleName($moduleName, $lhs = false, $metadataOnly = false,$exportedModulesFilter=array()) { $path = $metadataOnly ? @@ -921,6 +986,13 @@ function buildInstall($path){ 'custom' . DIRECTORY_SEPARATOR; $result = array(); + + //do not process if path is not a valid directory, or recursiveIterator will break. + if(!is_dir($path)) + { + return $result; + } + $relationships = $this->getCustomRelationshipsByModuleName($moduleName, $lhs); if (!$relationships) @@ -944,9 +1016,11 @@ function buildInstall($path){ { if (strpos($fileInfo->getFilename(), $k) !== false) - { - $result[] = $fileInfo->getPathname(); - break; + { //filter by modules being exported + if ($this->filterExportedRelationshipFile($fileInfo->getFilename(),$moduleName,$exportedModulesFilter) ){ + $result[] = $fileInfo->getPathname(); + break; + } } } } diff --git a/modules/ProjectTask/views/view.list.php b/modules/ProjectTask/views/view.list.php index 04294fa8..6a8f9272 100644 --- a/modules/ProjectTask/views/view.list.php +++ b/modules/ProjectTask/views/view.list.php @@ -95,8 +95,16 @@ class ProjectTaskViewList extends ViewList{ $current_query_by_page = unserialize(base64_decode($_REQUEST['current_query_by_page'])); foreach($current_query_by_page as $search_key=>$search_value) { if($search_key != $module.'2_'.strtoupper($this->bean->object_name).'_offset' && !in_array($search_key, $blockVariables)) { - $_REQUEST[$search_key] = $GLOBALS['db']->quote($search_value); - } + if (!is_array($search_value)) { + $_REQUEST[$search_key] = $GLOBALS['db']->quote($search_value); + } + else { + foreach ($search_value as $key=>&$val) { + $val = $GLOBALS['db']->quote($val); + } + $_REQUEST[$search_key] = $search_value; + } + } } } } diff --git a/modules/SchedulersJobs/SchedulersJob.php b/modules/SchedulersJobs/SchedulersJob.php index 212d2665..d696cf2f 100644 --- a/modules/SchedulersJobs/SchedulersJob.php +++ b/modules/SchedulersJobs/SchedulersJob.php @@ -462,6 +462,7 @@ class SchedulersJob extends Basic */ public function runJob() { + require_once('modules/Schedulers/_AddJobsHere.php'); $this->errors = ""; $exJob = explode('::', $this->target, 2); if($exJob[0] == 'function') { @@ -479,7 +480,6 @@ class SchedulersJob extends Basic $this->resolveJob(self::JOB_FAILURE, translate('ERR_NOUSER', 'SchedulersJobs')); return; } - require_once('modules/Schedulers/_AddJobsHere.php'); $func = $exJob[1]; $GLOBALS['log']->debug("----->SchedulersJob calling function: $func"); set_error_handler(array($this, "errorHandler"), E_ALL & ~E_NOTICE & ~E_STRICT); @@ -533,7 +533,14 @@ class SchedulersJob extends Basic if($tmpJob instanceof RunnableSchedulerJob) { $tmpJob->setJob($this); - return $tmpJob->run($this->data); + $return_status = $tmpJob->run($this->data); + if($return_status) { + $this->resolveJob(self::JOB_SUCCESS); + return true; + } else { + $this->resolveJob(self::JOB_FAILURE); + return false; + } } else { $this->resolveJob(self::JOB_FAILURE, sprintf(translate('ERR_JOBTYPE', 'SchedulersJobs'), strip_tags($this->target))); diff --git a/modules/Tasks/Task.php b/modules/Tasks/Task.php index 136cbdbc..fa0df9f0 100644 --- a/modules/Tasks/Task.php +++ b/modules/Tasks/Task.php @@ -297,15 +297,18 @@ class Task extends SugarBean { $task_fields['SET_COMPLETE'] = $setCompleteUrl . SugarThemeRegistry::current()->getImage("close_inline","title=".translate('LBL_LIST_CLOSE','Tasks')." border='0'",null,null,'.gif',translate('LBL_LIST_CLOSE','Tasks')).""; } - //make sure we grab the localized version of the contact name, if a contact is provided - if (!empty($this->contact_id)) { - // Bug# 46125 - make first name, last name, salutation and title of Contacts respect field level ACLs - $contact = BeanFactory::getBean("Contacts", $this->contact_id); - if(isset($contact->id)) { - $this->contact_name = $contact->full_name; - $this->contact_phone = $contact->phone_work; - } - } + // make sure we grab the localized version of the contact name, if a contact is provided + if (!empty($this->contact_id)) + { + $contact_temp = BeanFactory::getBean("Contacts", $this->contact_id); + if (!empty($contact_temp)) + { + // Make first name, last name, salutation and title of Contacts respect field level ACLs + $contact_temp->_create_proper_name_field(); + $this->contact_name = $contact_temp->full_name; + $this->contact_phone = $contact_temp->phone_work; + } + } $task_fields['CONTACT_NAME']= $this->contact_name; $task_fields['CONTACT_PHONE']= $this->contact_phone; diff --git a/modules/Users/User.php b/modules/Users/User.php index f6b01754..6ef2ad7d 100644 --- a/modules/Users/User.php +++ b/modules/Users/User.php @@ -35,17 +35,8 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); * "Powered by SugarCRM". ********************************************************************************/ -/********************************************************************************* - - * Description: TODO: To be written. - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. - * All Rights Reserved. - * Contributor(s): ______________________________________.. - ********************************************************************************/ - require_once('include/SugarObjects/templates/person/Person.php'); - // User is used to store customer information. class User extends Person { // Stored fields @@ -884,6 +875,9 @@ EOQ; } function fill_in_additional_detail_fields() { + // jmorais@dri Bug #56269 + parent::fill_in_additional_detail_fields(); + // ~jmorais@dri global $locale; $query = "SELECT u1.first_name, u1.last_name from users u1, users u2 where u1.id = u2.reports_to_id AND u2.id = '$this->id' and u1.deleted=0"; @@ -897,6 +891,7 @@ EOQ; $this->reports_to_name = ''; } + $this->_create_proper_name_field(); } @@ -1518,6 +1513,10 @@ EOQ; * @return bool */ public function isDeveloperForAnyModule() { + if(empty($this->id)) { + // empty user is no developer + return false; + } if ($this->isAdmin()) { return true; } @@ -1542,6 +1541,10 @@ EOQ; * @return bool */ public function isDeveloperForModule($module) { + if(empty($this->id)) { + // empty user is no developer + return false; + } if ($this->isAdmin()) { return true; } @@ -1574,6 +1577,10 @@ EOQ; * @return bool */ public function isAdminForModule($module) { + if(empty($this->id)) { + // empty user is no admin + return false; + } if ($this->isAdmin()) { return true; } diff --git a/sugar_version.php b/sugar_version.php index c6bd15f3..46b76e8d 100644 --- a/sugar_version.php +++ b/sugar_version.php @@ -38,10 +38,10 @@ -$sugar_version = '6.5.6'; -$sugar_db_version = '6.5.6'; +$sugar_version = '6.5.8'; +$sugar_db_version = '6.5.8'; $sugar_flavor = 'CE'; -$sugar_build = '8566'; -$sugar_timestamp = '2012-10-17 11:26am'; +$sugar_build = '8613'; +$sugar_timestamp = '2012-11-19 10:26am'; ?> diff --git a/tests/ModuleInstall/ModuleScannerTest.php b/tests/ModuleInstall/ModuleScannerTest.php index 5a8d3523..18f93140 100755 --- a/tests/ModuleInstall/ModuleScannerTest.php +++ b/tests/ModuleInstall/ModuleScannerTest.php @@ -133,10 +133,33 @@ EOQ; $this->assertTrue(!empty($errors)); } + /** + * @group bug58072 + */ + public function testLockConfig() + { + + $fileModContents = << +EOQ; + file_put_contents($this->fileLoc, $fileModContents); + $ms = new MockModuleScanner(); + $ms->config['test'] = false; + $ms->lockConfig(); + MSLoadManifest($this->fileLoc); + $errors = $ms->checkConfig($this->fileLoc); + $this->assertTrue(!empty($errors), "Not detected config change"); + $this->assertFalse($ms->config['test'], "config was changed"); + } } class MockModuleScanner extends ModuleScanner { + public $config; public function isPHPFile($contents) { return parent::isPHPFile($contents); } diff --git a/tests/SugarTestHelper.php b/tests/SugarTestHelper.php index 457ec4e4..73f1aac1 100755 --- a/tests/SugarTestHelper.php +++ b/tests/SugarTestHelper.php @@ -118,6 +118,7 @@ require_once 'SugarTestMergeUtilities.php'; require_once 'SugarTestTaskUtilities.php'; require_once 'SugarTestOpportunityUtilities.php'; require_once 'SugarTestRelationshipUtilities.php'; +require_once 'SugarTestSugarEmailAddressUtilities.php'; $GLOBALS['db']->commit(); diff --git a/tests/SugarTestOpportunityUtilities.php b/tests/SugarTestOpportunityUtilities.php index ce154752..c00e8a61 100755 --- a/tests/SugarTestOpportunityUtilities.php +++ b/tests/SugarTestOpportunityUtilities.php @@ -91,10 +91,15 @@ class SugarTestOpportunityUtilities return $opportunity; } - public static function createOpportunity($id = '') + public static function createOpportunity($id = '', Account $account = null) { - $time = mt_rand(); - $account = self::_createAccount($time); + $time = mt_rand(); + + if ($account === null) + { + $account = self::_createAccount($time); + } + $opportunity = self::_createOpportunity($id, $time, $account); return $opportunity; @@ -138,4 +143,4 @@ class SugarTestOpportunityUtilities return $opportunity_ids; } } -?> \ No newline at end of file +?> diff --git a/tests/SugarTestSugarEmailAddressUtilities.php b/tests/SugarTestSugarEmailAddressUtilities.php new file mode 100755 index 00000000..35eeaa19 --- /dev/null +++ b/tests/SugarTestSugarEmailAddressUtilities.php @@ -0,0 +1,183 @@ +first_name = $name . $time; + $contact->last_name = 'LastName'; + $contact->save(); + + $GLOBALS['db']->commit(); + self::$_createdContact = $contact; + } + + return self::$_createdContact; + } + + /** + * @param $contact + * @param $time + * @param $id + * @param $override + * @return SugarEmailAddress + */ + private static function _createEmailAddress($contact,$time,$id,$override) + { + $params['email_address'] = 'semailaddress@'. $time. 'sugar.com'; + $params['primary'] = true; + $params['reply_to'] = false; + $params['invalid'] = false; + $params['opt_out'] = false; + foreach($override as $key => $value) { + $params[$key] = $value; + } + + + $contact->emailAddress->addAddress($params['email_address'], $params['primary'], $params['reply_to'], + $params['invalid'], $params['opt_out'], $id); + $contact->emailAddress->save($contact->id, $contact->module_dir); + self::$_createdEmailAddresses[] = $contact->emailAddress; + return $contact->emailAddress; + } + + /** + * Create a SugarEmailAddress + * - This version doesn't bother attaching a SugarEmailAddress to a parent bean. + * - As such, save() doesn't work on the email addresses. + * @access public + * @param string $address - custom address to pass, otherwise pass null. + * @param string $id - pass parameter to set a specific uuid for the SugarEmailAddress + * @param array $override - pass key => value array of parameters to override the defaults + * @return SugarEmailAddress + */ + public static function createEmailAddress($address=null,$id = '', $override = array()) + { + $time = mt_rand(); + $contact = self::_createContact($time); + if (!empty($address)) { + $override['email_address'] = $address; + } + $address = self::_createEmailAddress($contact, $time, $id, $override); + return $address; + } + + /** + * Clean up after use + * @access public + */ + public static function removeAllCreatedEmailAddresses() + { + $address_ids = self::getCreatedEmailAddressIds(); + $GLOBALS['db']->query('DELETE FROM email_addresses WHERE id IN (\'' . implode("', '", $address_ids) . '\')'); + } + + /** + * clean up the related bean and the relationship table + * @access public + */ + public static function removeCreatedContactAndRelationships(){ + if (self::$_createdContact === null) { + return; + } + + $GLOBALS['db']->query("DELETE FROM contacts WHERE id = '".self::$_createdContact->id."'"); + $GLOBALS['db']->query('DELETE FROM email_addr_bean_rel WHERE bean_module=\'Contacts\' AND bean_id =\'' . self::$_createdContact->id . '\''); + self::$_createdContact = null; + } + + + /** + * Retrieve a list of all ids of SugarEmailAddresses created through this class + * @access public + * @return array ids of all SugarEmailAddresses created + */ + public static function getCreatedEmailAddressIds() + { + $address_ids = array(); + foreach (self::$_createdEmailAddresses as $address) { + $address_ids[] = $address->id; + } + return $address_ids; + } + + /** + * In case we don't have our bean's UUID - get it via address + * @param $address - email address + * @return string|null UUID of bean for email address. + */ + public static function fetchEmailIdByAddress($address) { + $email_caps = strtoupper(trim($address)); + $rs = $GLOBALS['db']->query("SELECT id from email_addresses where email_address_caps='$email_caps'"); + $a = $GLOBALS['db']->fetchByAssoc($rs); + + if (!empty($a['id'])) { + return $a['id']; + } + else { + return null; + } + } + + /** + * get our parent bean + * @return Contact|null + */ + public static function getContact() { + return self::_createContact(mt_rand()); + } + +} diff --git a/tests/data/Bug56652Test.php b/tests/data/Bug56652Test.php new file mode 100755 index 00000000..ae8281e9 --- /dev/null +++ b/tests/data/Bug56652Test.php @@ -0,0 +1,139 @@ +contact = SugarTestContactUtilities::createContact(); + $this->contact->load_relationship('opportunities'); + foreach ($this->account_names as $account_name) + { + $account = SugarTestAccountUtilities::createAccount(); + $account->name = $account_name; + $account->save(false); + + $opportunity = SugarTestOpportunityUtilities::createOpportunity(null, $account); + $this->contact->opportunities->add($opportunity); + } + } + + /** + * Tears down the fixture, for example, close a network connection. + * This method is called after a test is executed. + */ + public function tearDown() + { + SugarTestAccountUtilities::removeAllCreatedAccounts(); + SugarTestOpportunityUtilities::removeAllCreatedOpportunities(); + SugarTestContactUtilities::removeAllCreatedContacts(); + parent::tearDown(); + + SugarTestHelper::tearDown(); + } + + /** + * @param string $order + * @param string $function + * @dataProvider getOrders + */ + public function testSubPanelDataIsSorted($order, $function) + { + // create a minimum required subpanel definition + $subPanel = new aSubPanel(null, array( + 'module' => 'Opportunities', + 'subpanel_name' => null, + 'get_subpanel_data' => 'opportunities', + ), $this->contact); + + // fetch subpanel data + $response = SugarBean::get_union_related_list( + $this->contact, 'account_name', $order, '', 0, -1, -1, 0, $subPanel + ); + + $this->assertArrayHasKey('list', $response); + + $account_names = array(); + + /** @var Opportunity $opportunity */ + foreach ($response['list'] as $opportunity) + { + $account_names[] = $opportunity->account_name; + } + + $sorted = $account_names; + $function($sorted); + + // ensure that opportunities are sorted by account name in the needed order + $this->assertSame($sorted, $account_names); + } + + /** + * @return array + */ + public static function getOrders() + { + return array( + array('asc', 'sort'), + array('desc', 'rsort'), + ); + } +} diff --git a/tests/data/Relationships/Bug56904Test.php b/tests/data/Relationships/Bug56904Test.php new file mode 100755 index 00000000..204944b6 --- /dev/null +++ b/tests/data/Relationships/Bug56904Test.php @@ -0,0 +1,151 @@ +getRelationshipMock($results); + $link = $this->getLinkMock(count($results)); + + $result = $relationship->removeAll($link); + if ($expected) + { + $this->assertTrue($result); + } + else + { + $this->assertFalse($result); + } + } + + /** + * Creates mock of SugarRelationship object which will return specified + * results on on consecutive SugarRelationship::remove() calls + * + * @param array $results + * @return SugarRelationship + */ + protected function getRelationshipMock(array $results) + { + $mock = $this->getMockForAbstractClass('SugarRelationship'); + $mock->expects($this->exactly(count($results))) + ->method('remove') + ->will( + call_user_func_array(array($this, 'onConsecutiveCalls'), $results) + ); + return $mock; + } + + /** + * Creates mock of Link2 object with specified number of related beans + * + * @param int $count + * @return Link2 + */ + protected function getLinkMock($count) + { + if ($count > 0) + { + $bean = new SugarBean(); + $bean->id = 'Bug56904Test'; + $beans = array_fill(0, $count, $bean); + } + else + { + $beans = array(); + } + + $mock = $this->getMock('Link2', array('getSide', 'getFocus', 'getBeans'), array(), '', false); + $mock->expects($this->any()) + ->method('getSide') + ->will($this->returnValue(REL_LHS)); + $mock->expects($this->any()) + ->method('getFocus') + ->will($this->returnValue(new SugarBean())); + $mock->expects($this->any()) + ->method('getBeans') + ->will($this->returnValue($beans)); + return $mock; + } + + /** + * Provides results that should be returned by SugarRelationship::remove() + * calls and expected result of SugarRelationship::removeAll() + * + * @return array + */ + public static function getRemoveResults() + { + return array( + array( + array(), true, + ), + array( + array(true), true, + ), + array( + array(false), false, + ), + array( + array(true, false), false, + ), + array( + array(false, true), false, + ), + array( + array(false, false), false, + ), + array( + array(true, true), true, + ), + ); + } +} diff --git a/tests/data/SugarBeanTest.php b/tests/data/SugarBeanTest.php index 36438159..b88a1004 100755 --- a/tests/data/SugarBeanTest.php +++ b/tests/data/SugarBeanTest.php @@ -118,6 +118,79 @@ class SugarBeanTest extends Sugar_PHPUnit_Framework_TestCase SugarTestAccountUtilities::removeAllCreatedAccounts(); } + /** + * Test whether a relate field is determined correctly + * + * @param array $field_defs + * @param string $field_name + * @param bool $is_relate + * @dataProvider isRelateFieldProvider + * @covers SugarBean::is_relate_field + */ + public function testIsRelateField(array $field_defs, $field_name, $is_relate) + { + $bean = new BeanIsRelateFieldMock(); + $bean->field_defs = $field_defs; + $actual = $bean->is_relate_field($field_name); + + if ($is_relate) + { + $this->assertTrue($actual); + } + else + { + $this->assertFalse($actual); + } + } + + public static function isRelateFieldProvider() + { + return array( + // test for on a non-existing field + array( + array(), 'dummy', false, + ), + // test for non-specified field type + array( + array( + 'my_field' => array(), + ), 'my_field', false, + ), + // test on a non-relate field type + array( + array( + 'my_field' => array( + 'type' => 'varchar', + ), + ), 'my_field', false, + ), + // test on a relate field type but link not specified + array( + array( + 'my_field' => array( + 'type' => 'relate', + ), + ), 'my_field', false, + ), + // test when only link is specified + array( + array( + 'my_field' => array( + 'link' => 'my_link', + ), + ), 'my_field', false, + ), + // test on a relate field type + array( + array( + 'my_field' => array( + 'type' => 'relate', + 'link' => 'my_link', + ), + ), 'my_field', true, + ), + ); + } } // Using Mssql here because mysql needs real connection for quoting @@ -151,4 +224,12 @@ class BeanMockTestObjectName extends SugarBean function BeanMockTestObjectName() { parent::SugarBean(); } -} \ No newline at end of file +} + +class BeanIsRelateFieldMock extends SugarBean +{ + public function is_relate_field($field_name_name) + { + return parent::is_relate_field($field_name_name); + } +} diff --git a/tests/include/SugarCharts/Bug44696Test.php b/tests/include/SugarCharts/Bug44696Test.php index f27bfdbd..71e373f6 100755 --- a/tests/include/SugarCharts/Bug44696Test.php +++ b/tests/include/SugarCharts/Bug44696Test.php @@ -34,92 +34,138 @@ * "Powered by SugarCRM". ********************************************************************************/ + require_once('include/SugarCharts/SugarChart.php'); + /** - * Created: Sep 28, 2011 + * Bug 44696 - Wrong shortcut to the opportunities module from the dashlet + * "Pipeline By Sales Stage" + * + * @ticket 44696 + * @ticket 53845 */ class Bug44696Test extends Sugar_PHPUnit_Framework_TestCase { - public $sugarChartObject; - - public function setUp() + /** + * @var SugarChart + */ + protected $sugarChartObject; + /** + * @var User + */ + protected $currentUser; + + protected function setUp() { - $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser(); + parent::setUp(); + + SugarTestHelper::init(); + SugarTestHelper::setUp('current_user'); + $this->currentUser = $GLOBALS['current_user']; + $this->currentUser->setPreference( + 'default_number_grouping_seperator', + '.' + ); + $this->currentUser->setPreference('default_decimal_seperator', ','); + $sugarChartObject = new SugarChart(); - $sugarChartObject->group_by = array ('sales_stage', 'user_name'); + $sugarChartObject->group_by = array('sales_stage', 'user_name'); $sugarChartObject->data_set = $this->getDataSet(); - $sugarChartObject->base_url = array ('module' => 'Opportunities', - 'action' => 'index', - 'query' => 'true', - 'searchFormTab' => 'advanced_search'); - $sugarChartObject->url_params = array (); + $sugarChartObject->base_url = array( + 'module' => 'Opportunities', + 'action' => 'index', + 'query' => 'true', + 'searchFormTab' => 'advanced_search' + ); + $sugarChartObject->url_params = array(); $sugarChartObject->is_currency = true; // we have 5 users - $sugarChartObject->super_set = array ('will', 'max', 'sarah', 'sally', 'chris'); + $sugarChartObject->super_set = array( + 'will', + 'max', + 'sarah', + 'sally', + 'chris' + ); $this->sugarChartObject = $sugarChartObject; } - public function tearDown() + protected function tearDown() { - SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); - unset($GLOBALS['current_user']); + SugarTestHelper::tearDown(); + parent::tearDown(); } - - public function getDataSet() { - return array ( - array ( - 'sales_stage' => 'Proposal/Price Quote', - 'user_name' => 'max', - 'assigned_user_id' => 'seed_max_id', - 'opp_count' => '1', - 'total' => '50', - 'key' => 'Proposal/Price Quote', - 'value' => 'Proposal/Price Quote', - ), - array ( - 'sales_stage' => 'Proposal/Price Quote', - 'user_name' => 'sally', - 'assigned_user_id' => 'seed_sally_id', - 'opp_count' => '2', - 'total' => '75', - 'key' => 'Proposal/Price Quote', - 'value' => 'Proposal/Price Quote', - ), - ); - } - + /** - * We check, that groups with NULL value remain their order in subgroups tag and won't fall down under not null valued groups. - * This way we guarantee that links will be put correctly to each user in whole user list (will, max, etc.). + * We check, that groups with NULL value remain their order in subgroups tag + * and won't fall down under not null valued groups. + * This way we guarantee that links will be put correctly to each user in + * whole user list (will, max, etc.). + * + * @group 44696 + * @group 53845 */ - public function testCorrectXml() + public function testCorrectXml() { $actual = $this->sugarChartObject->xmlDataGenericChart(); $expected = $this->compareXml(); - $order = array("\r\n", "\n", "\r", "\t"); + $order = array("\r\n", "\n", "\r", "\t"); $replace = ""; // remove all break lines and spaces and tabs - $expected = str_replace($order, $replace, $expected); - $actual = str_replace($order, $replace, $actual); + $expected = str_replace($order, $replace, $expected); + $actual = str_replace($order, $replace, $actual); $this->assertEquals($expected, $actual); } - + + protected function getDataSet() + { + return array( + array( + 'sales_stage' => 'Proposal/Price Quote', + 'user_name' => 'max', + 'assigned_user_id' => 'seed_max_id', + 'opp_count' => '1', + 'total' => 50.1234, + 'key' => 'Proposal/Price Quote', + 'value' => 'Proposal/Price Quote', + ), + array( + 'sales_stage' => 'Proposal/Price Quote', + 'user_name' => 'sally', + 'assigned_user_id' => 'seed_sally_id', + 'opp_count' => '2', + 'total' => 75.98765, + 'key' => 'Proposal/Price Quote', + 'value' => 'Proposal/Price Quote', + ), + ); + } + /** - * @return xml string + * Expected XML from SugarChart after. + * + * @return string + * The XML string that we expect to be returned by the chart. */ - public function compareXml() + protected function compareXml() { - $max = 50; - $sally = 75; + $dataSet = $this->getDataSet(); + $max = $dataSet[0]['total']; + $sally = $dataSet[1]['total']; $total = $max + $sally; - $max = $this->convertCurrency($max); - $sally = $this->convertCurrency($sally); - $total = $this->convertCurrency($total); - + + list($maxSubAmount, $maxSubAmountFormatted) = $this->getAmounts($max); + list($sallySubAmount, $sallySubAmountFormatted) = $this->getAmounts( + $sally + ); + list($totalSubAmount, $totalSubAmountFormatted) = $this->getAmounts( + $total + ); + return " Proposal/Price Quote - {$total->subAmount} - + {$totalSubAmount} + index.php?module=Opportunities&action=index&query=true&searchFormTab=advanced_search&sales_stage=Proposal%2FPrice+Quote @@ -130,8 +176,8 @@ class Bug44696Test extends Sugar_PHPUnit_Framework_TestCase max - {$max->subAmount} - + {$maxSubAmount} + index.php?module=Opportunities&action=index&query=true&searchFormTab=advanced_search&sales_stage=Proposal%2FPrice+Quote&assigned_user_id[]=seed_max_id @@ -142,8 +188,8 @@ class Bug44696Test extends Sugar_PHPUnit_Framework_TestCase sally - {$sally->subAmount} - + {$sallySubAmount} + index.php?module=Opportunities&action=index&query=true&searchFormTab=advanced_search&sales_stage=Proposal%2FPrice+Quote&assigned_user_id[]=seed_sally_id @@ -154,14 +200,34 @@ class Bug44696Test extends Sugar_PHPUnit_Framework_TestCase "; } - - public function convertCurrency($value) { - $sub_amount = $this->sugarChartObject->formatNumber($this->sugarChartObject->convertCurrency($value)); - $sub_amount_formatted = $this->sugarChartObject->currency_symbol . $sub_amount . 'K'; - $sub_amount = $this->sugarChartObject->convertCurrency($value); - $return = new stdClass(); - $return->subAmount = $sub_amount; - $return->subAmountFormatted = $sub_amount_formatted; - return $return; + + /** + * Get the amounts that the chart should have for the value given. + * + * @param float $value + * The value to get formatted as chart would. + * + * @return array + * A list with: the value in K's and the value in currency format. + */ + protected function getAmounts($value) + { + global $locale; + global $sugar_config; + + $subAmount = round($value, $locale->getPrecision($this->currentUser)); + // TODO use the Localization::getLocaleFormattedNumber when it works! + // FIXME SugarCharts should use the user format preferences for charts + $subAmountFormatted = number_format( + $value, + $locale->getPrecision($this->currentUser), + $sugar_config['default_decimal_seperator'], + $sugar_config['default_number_grouping_seperator'] + ); + $subAmountFormatted = $locale->getCurrencySymbol( + $this->currentUser + ) . $subAmountFormatted . 'K'; + + return array($subAmount, $subAmountFormatted); } -} \ No newline at end of file +} diff --git a/tests/include/SugarEmailAddress/SugarEmailAddressAddChangeTest.php b/tests/include/SugarEmailAddress/SugarEmailAddressAddChangeTest.php new file mode 100755 index 00000000..dfd72de3 --- /dev/null +++ b/tests/include/SugarEmailAddress/SugarEmailAddressAddChangeTest.php @@ -0,0 +1,150 @@ +disable_row_level_security = true; // SugarEmailAddress doesn't roll with security + $sea->retrieve($uuid); + return $sea; + } + + protected function setUp() + { + $this->email = SugarTestSugarEmailAddressUtilities::createEmailAddress($this->old_email); + $this->old_uuid = SugarTestSugarEmailAddressUtilities::fetchEmailIdByAddress($this->old_email); + } + + protected function tearDown() + { + SugarTestSugarEmailAddressUtilities::removeCreatedContactAndRelationships(); + SugarTestSugarEmailAddressUtilities::removeAllCreatedEmailAddresses(); + } + + /** + * @group bug57426 + */ + public function testEmailAddressesBrandNew() + { + $new_address = 'test_george@sugar.example.com'; + + // now change the email, keeping track of bean UUIDs + $old_uuid = $this->old_uuid; + $uuid = $this->email->AddUpdateEmailAddress($new_address); + + $this->assertNotNull($uuid, 'Failed to enter the new email in the database!'); + $this->assertNotNull($old_uuid, 'Not seeing the old email in the database!'); + $this->assertNotEquals($uuid, $old_uuid, 'Same Email Address Bean used for different Email Addresses!'); + + $new_sea = $this->readSugarEmailAddress($uuid); + $old_sea = $this->readSugarEmailAddress($old_uuid); + $this->assertNotNull($new_sea, 'New Email Address not saved in database!'); + $this->assertEquals($this->old_email, $old_sea->email_address, 'Old Email Address was improperly Changed'); + $this->assertEquals($new_address, $new_sea->email_address, 'New Email Address was improperly saved!'); + + } + + public function testEmailAddressesNoChange() + { + $uuid = $this->email->AddUpdateEmailAddress($this->old_email); + + $this->assertNotNull($uuid, 'Where did my email address go?'); + $this->assertEquals($this->old_uuid,$uuid, 'We are using a different bean for the same email address!'); + + $sea = $this->readSugarEmailAddress($uuid); + $this->assertNotNull($sea, 'We lost our Email Address row!'); + $this->assertEquals($this->old_email, $sea->email_address, 'Our Email Address Improperly Changed!'); + } + + public function testEmailAddressesChangeCaps() + { + $new_address = 'TEST@SUGAR.example.COM'; + // change the email with caps + $old_uuid = $this->old_uuid; + $uuid = $this->email->AddUpdateEmailAddress($new_address); + + $this->assertNotNull($uuid, 'Failed to enter the new email in the database!'); + $this->assertNotNull($old_uuid, 'Not seeing the old email in the database!'); + $this->assertEquals($uuid, $old_uuid, 'Different Email Address Bean used for same Email Address!'); + + $new_sea = $this->readSugarEmailAddress($uuid); + $this->assertNotNull($new_sea, 'Email Address not found in DB!'); + $this->assertEquals($new_address, $new_sea->email_address, 'Email Address in DB was not updated.'); + } + + public function testEmailSimulatedInvalidFlagWorkflow() + { + + $workflow_email = 'testworkflow@sugar.example.com'; + $new_email = 'afreshnewemail@sugar.example.com'; + + // simulate a before workflow: invalid is set to true + $email_old_invalid = SugarTestSugarEmailAddressUtilities::createEmailAddress($workflow_email,'',array('invalid' => true)); + $old_uuid = SugarTestSugarEmailAddressUtilities::fetchEmailIdByAddress($workflow_email); + $contact = SugarTestSugarEmailAddressUtilities::getContact(); + + $email_old_invalid->stash($contact->id, $contact->module_dir); + $email_old_invalid->AddUpdateEmailAddress($workflow_email,0); // 'workflow' + + $uuid = $email_old_invalid->AddUpdateEmailAddress($new_email,1,0,$old_uuid); // workflow is processed + + $this->assertNotNull($old_uuid, 'where is the old email address?'); + $this->assertNotNull($uuid, 'where is our new email address?'); + $this->assertNotEquals($old_uuid, $uuid, 'we used the same Email Address Bean for different Email Addresses!'); + + // need a way to see our new work + $fresh_sea = $this->readSugarEmailAddress($uuid); + + $this->assertNotNull($fresh_sea, 'Email Address not found in DB!'); + $this->assertEquals($new_email, $fresh_sea->email_address, 'Email Address in DB is not the same as expected.'); + $this->assertNotEquals(1, intval($fresh_sea->invalid_email), 'Workflow changes to Email not protected'); + } +} diff --git a/tests/include/SugarLogger/SugarLoggerTest.php b/tests/include/SugarLogger/SugarLoggerTest.php index 225821b0..728e752a 100755 --- a/tests/include/SugarLogger/SugarLoggerTest.php +++ b/tests/include/SugarLogger/SugarLoggerTest.php @@ -34,7 +34,7 @@ * "Powered by SugarCRM". ********************************************************************************/ - + class SugarLoggerTest extends Sugar_PHPUnit_Framework_TestCase { public function tearDown() @@ -44,7 +44,7 @@ class SugarLoggerTest extends Sugar_PHPUnit_Framework_TestCase if (!empty($level)) $GLOBALS['log']->setLevel($level); } - + public function providerWriteLogEntries() { return array( @@ -57,7 +57,7 @@ class SugarLoggerTest extends Sugar_PHPUnit_Framework_TestCase array('fatal','warn','foo7',false,'[WARN] foo7'), ); } - + /** * @dataProvider providerWriteLogEntries */ @@ -67,15 +67,15 @@ class SugarLoggerTest extends Sugar_PHPUnit_Framework_TestCase $logMessage, $shouldMessageBeWritten, $messageWritten - ) + ) { $GLOBALS['log']->setLevel($currentLevel); $GLOBALS['log']->$logLevel($logMessage); - + $config = SugarConfig::getInstance(); $ext = $config->get('logger.file.ext'); $logfile = $config->get('logger.file.name'); - $log_dir = $config->get('log_dir'); + $log_dir = $config->get('log_dir'); $log_dir = $log_dir . (empty($log_dir)?'':'/'); $file_suffix = $config->get('logger.file.suffix'); $date_suffix = ""; @@ -87,23 +87,23 @@ class SugarLoggerTest extends Sugar_PHPUnit_Framework_TestCase $logFile = file_get_contents($log_dir . $logfile . $date_suffix . $ext); - + if ( $shouldMessageBeWritten ) $this->assertContains($messageWritten,$logFile); else $this->assertNotContains($messageWritten,$logFile); } - + public function testAssertLogging() { $GLOBALS['log']->setLevel('debug'); $GLOBALS['log']->assert('this was asserted true',true); $GLOBALS['log']->assert('this was asserted false',false); - + $config = SugarConfig::getInstance(); $ext = $config->get('logger.file.ext'); $logfile = $config->get('logger.file.name'); - $log_dir = $config->get('log_dir'); + $log_dir = $config->get('log_dir'); $log_dir = $log_dir . (empty($log_dir)?'':'/'); $file_suffix = $config->get('logger.file.suffix'); $date_suffix = ""; @@ -114,7 +114,7 @@ class SugarLoggerTest extends Sugar_PHPUnit_Framework_TestCase } $logFile = file_get_contents($log_dir . $logfile . $date_suffix . $ext); - + $this->assertContains('[DEBUG] this was asserted false',$logFile); $this->assertNotContains('[DEBUG] this was asserted true',$logFile); } @@ -204,4 +204,20 @@ class SugarLoggerTest extends Sugar_PHPUnit_Framework_TestCase //If the logger returns correct file format, the file must exist in the path. $this->assertFileExists($full_path, "SugarLogger generates invalid log file format"); } + + /** + * @dataProvider providerWriteLogEntries + */ + public function testWouldLog( + $currentLevel, + $logLevel, + $logMessage, + $shouldMessageBeWritten, + $messageWritten + ) + { + $GLOBALS['log']->setLevel($currentLevel); + $this->assertEquals($shouldMessageBeWritten, $GLOBALS['log']->wouldLog($logLevel)); + + } } diff --git a/tests/include/generic/SugarWidgets/Bug51568Test.php b/tests/include/generic/SugarWidgets/Bug51568Test.php new file mode 100755 index 00000000..02d4afa1 --- /dev/null +++ b/tests/include/generic/SugarWidgets/Bug51568Test.php @@ -0,0 +1,207 @@ +setPreference('dec_sep', ','); + $current_user->setPreference('num_grp_sep', '.'); + $current_user->setPreference('default_currency_significant_digits', 3); + + SugarTestHelper::setUp('app_list_strings'); + SugarTestHelper::setUp('beanFiles'); + SugarTestHelper::setUp('beanList'); + parent::setUp(); + + $this->lm = new LayoutManager(); + $this->lm->setAttribute('reporter', new stdClass()); + + $this->currency_51568 = new Currency(); + $this->currency_51568->symbol = 'TT'; + $this->currency_51568->conversion_rate = 0.5; + $this->currency_51568->save(false); + $this->currency_system = new Currency(); + $this->currency_system->retrieve(-99); + $this->backupSymbol = $this->currency_system->symbol; + $this->currency_system->symbol = '¥'; + $this->currency_system->save(false); + $sugar_config['default_currency_symbol'] = '¥'; + get_number_seperators(true); + } + + /** + * @group 51568 + */ + public function testFieldCurrencyPlainWithLayoutDef() + { + $data = array( + 'currency_id' => $this->currency_51568->id, + 'currency_symbol' => $this->currency_51568->symbol + ); + $result = $this->getResults($data); + $this->assertEquals('TT100.500,000', $result); + } + + /** + * @group 51568 + */ + public function testFieldCurrencyPlainWithCurrencyField() + { + $data = array( + 'fields' => array( + '51568table_some_field_currency' => $this->currency_51568->id) + ); + $result = $this->getResults($data); + $this->assertEquals('TT100.500,000', $result); + } + + /** + * @group 51568 + */ + public function testFieldCurrencyPlainWithAnotherCurrencyField() + { + $data = array( + 'fields' => array( + '51568TABLE_SOME_FIELD_CURRENCY' => $this->currency_51568->id) + ); + $result = $this->getResults($data); + $this->assertEquals('TT100.500,000', $result); + } + + /** + * @group 51568 + */ + public function testFieldCurrencyPlainWithSystemCurrencyField() + { + $data = array( + 'name' => 'some_field_usdoll', + 'column_key' => 'self::some_field_usdoll', + 'fields' => array( + '51568TABLE_SOME_FIELD_USDOLL' => 100500 + ) + ); + $result = $this->getResults($data); + $this->assertEquals('¥100.500,000', $result); + } + + /** + * @group 51568 + */ + public function testFieldCurrencyPlainWithWrongCurrency() + { + $data = array( + 'currency_id' => '-51568', + 'currency_symbol' => '£' + ); + $result = $this->getResults($data); + $this->assertEquals('¥100.500,000', $result); + } + + protected function getResults($layout_def_addon) + { + $layout_def = array( + 'column_key' => 'self::some_field', + 'fields' => array( + '51568TABLE_SOME_FIELD' => 100500, + ), + 'name' => 'some_field', + 'table_key' => 'self', + 'table_alias' => '51568table', + 'type' => 'currency' + ); + foreach($layout_def_addon as $k => $v) + { + if(is_array($v)) + { + $layout_def = array_merge_recursive($layout_def, array($k => $v)); + } + else + { + $layout_def[$k] = $v; + } + } + $sf = $this->getMock('SugarWidgetFieldCurrency', + array('getTruncatedColumnAlias'), + array(&$this->lm)); + $sf->expects($this->any()) + ->method('getTruncatedColumnAlias') + ->will($this->returnArgument(0)); + return $sf->displayListPlain($layout_def); + } + + public function tearDown() + { + global $sugar_config; + $this->currency_system->symbol = $this->backupSymbol; + $this->currency_system->save(false); + $sugar_config['default_currency_symbol'] = $this->backupSymbol; + $this->currency_51568->mark_deleted($this->currency_51568->id); + SugarTestHelper::tearDown(); + get_number_seperators(true); + } +} \ No newline at end of file diff --git a/tests/include/generic/SugarWidgets/Bug57902Test.php b/tests/include/generic/SugarWidgets/Bug57902Test.php new file mode 100755 index 00000000..54a48289 --- /dev/null +++ b/tests/include/generic/SugarWidgets/Bug57902Test.php @@ -0,0 +1,136 @@ + 'self', + 'group_function' => 'count', + 'sort_dir' => 'a', + 'table_alias' => 'calls', + 'table_key' => 'self' + ), + 'calls__count ASC' + ), + array( + array( + 'column_function' => 'avg', + 'column_key' => 'self:duration_hours', + 'group_function' => 'avg', + 'name' => 'duration_hours', + 'sort_dir' => 'a', + 'table_alias' => 'calls', + 'table_key' => 'self', + 'type' => 'int' + ), + 'calls_avg_duration_hours ASC' + ), + array( + array( + 'column_function' => 'max', + 'column_key' => 'self:duration_hours', + 'group_function' => 'max', + 'name' => 'duration_hours', + 'sort_dir' => 'a', + 'table_alias' => 'calls', + 'table_key' => 'self', + 'type' => 'int' + ), + 'calls_max_duration_hours ASC' + ), + array( + array( + 'column_function' => 'min', + 'column_key' => 'self:duration_hours', + 'group_function' => 'min', + 'name' => 'duration_hours', + 'sort_dir' => 'a', + 'table_alias' => 'calls', + 'table_key' => 'self', + 'type' => 'int' + ), + 'calls_min_duration_hours ASC' + ), + array( + array( + 'column_function' => 'sum', + 'column_key' => 'self:duration_hours', + 'group_function' => 'sum', + 'name' => 'duration_hours', + 'sort_dir' => 'a', + 'table_alias' => 'calls', + 'table_key' => 'self', + 'type' => 'int' + ), + 'calls_sum_duration_hours ASC' + ) + ); + + } + + /** + * Test asserts that for group functions order by is alias instead of table.field + * + * @dataProvider dataProvider + * @group 57902 + * @return void + */ + public function testQueryOrderBy($layout_def, $expected) + { + $layoutManager = new LayoutManager(); + $sugarWidgetReportField = new SugarWidgetReportField($layoutManager); + + $actual = $sugarWidgetReportField->queryOrderBy($layout_def); + + $this->assertEquals($expected, $actual, 'ORDER BY string is incorrect'); + } +} diff --git a/tests/modules/Import/Bug51264Test.php b/tests/modules/Import/Bug51264Test.php new file mode 100755 index 00000000..1dd2190b --- /dev/null +++ b/tests/modules/Import/Bug51264Test.php @@ -0,0 +1,119 @@ +contact = SugarTestContactUtilities::createContact(); + } + + public function tearDown() + { + SugarTestContactUtilities::removeAllCreatedContacts(); + unset($this->contact); + unset($GLOBALS['beanFiles'], $GLOBALS['beanList']); + + SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); + unset($GLOBALS['current_user']); + } + + /** + * @group 51264 + */ + public function testIsADuplicateRecordWithID() + { + $idc = new ImportDuplicateCheck($this->contact); + $result = $idc->isADuplicateRecord(array('special_idx_email1::email1')); + $this->assertFalse($result); + } + + /** + * @group 51264 + */ + public function testIsADuplicateRecordWithInvalidID() + { + $contact = new Contact(); + $contact->id = '0000000000000000'; + $contact->email1 = $this->contact->email1; + $idc = new ImportDuplicateCheck($contact); + $result = $idc->isADuplicateRecord(array('special_idx_email1::email1')); + $this->assertTrue($result); + } + + /** + * @group 51264 + */ + public function testIsADuplicateRecordWithInvalidID2() + { + $contact = new Contact(); + $contact->id = '0000000000000000'; + $contact->email1 = 'Bug51264Test@Bug51264Test.com'; + $idc = new ImportDuplicateCheck($contact); + $result = $idc->isADuplicateRecord(array('special_idx_email1::email1')); + $this->assertFalse($result); + } + + /** + * @group 51264 + */ + public function testIsADuplicateRecord() + { + $contact = new Contact(); + $contact->email1 = $this->contact->email1; + $idc = new ImportDuplicateCheck($contact); + $result = $idc->isADuplicateRecord(array('special_idx_email1::email1')); + $this->assertTrue($result); + } +} \ No newline at end of file diff --git a/tests/modules/Import/ImportCacheFilesTest.php b/tests/modules/Import/ImportCacheFilesTest.php index 003d7bc5..cae7c22d 100755 --- a/tests/modules/Import/ImportCacheFilesTest.php +++ b/tests/modules/Import/ImportCacheFilesTest.php @@ -41,14 +41,15 @@ class ImportCacheFilesTest extends Sugar_PHPUnit_Framework_TestCase { public function setUp() { - $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser(); + SugarTestHelper::setUp('beanFiles'); + SugarTestHelper::setUp('beanList'); + SugarTestHelper::setUp('current_user'); $this->importdir = ImportCacheFiles::getImportDir(); } public function tearDown() { - SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); - unset($GLOBALS['current_user']); + SugarTestHelper::tearDown(); } public function testgetDuplicateFileName() diff --git a/tests/modules/Import/ImportDuplicateCheckTest.php b/tests/modules/Import/ImportDuplicateCheckTest.php index f95269c5..769973f9 100755 --- a/tests/modules/Import/ImportDuplicateCheckTest.php +++ b/tests/modules/Import/ImportDuplicateCheckTest.php @@ -188,7 +188,8 @@ class ImportDuplicateCheckTest extends Sugar_PHPUnit_Framework_TestCase $focus->last_name = 'last '.date("YmdHis"); $focus->assigned_user_id = '1'; $focus->save(); - + //because of fix 51264, stored beans can't be duplicates + $focus->id = null; //create the importDuplicateCheck object and get the list of duplicateCheckIndexes $idc = new ImportDuplicateCheck($focus); diff --git a/tests/modules/InboundEmail/AttachmentHeaderTest.php b/tests/modules/InboundEmail/AttachmentHeaderTest.php new file mode 100755 index 00000000..d1c38220 --- /dev/null +++ b/tests/modules/InboundEmail/AttachmentHeaderTest.php @@ -0,0 +1,96 @@ +ie = new InboundEmail(); + } + + /** + * @param $param -> "dparameters" | "parameters" + * @param $a -> attribute + * @param $v -> value + * @return stdClass: $obj->attribute = $a, $obj->value = $v + */ + protected function _convertToObject($param,$a,$v) + { + $obj = new stdClass; + $obj->attribute = $a; + $obj->value = $v; + + $outer = new stdClass; + $outer->parameters = ($param == 'parameters') ? array($obj) : array(); + $outer->isparameters = !empty($outer->parameters); + $outer->dparameters = ($param == 'dparameters') ? array($obj) : array(); + $outer->isdparameters = !empty($outer->dparameters); + + return $outer; + } + + public function contentParameterProvider() + { + return array( + // pretty standard dparameters + array( + $this->_convertToObject('dparameters','filename','test.txt'), + 'test.txt' + ), + + // how about a regular parameter set + array( + $this->_convertToObject('parameters','name','bonus.txt'), + 'bonus.txt' + ) + ); + } + + /** + * @group bug57309 + * @dataProvider contentParameterProvider + * @param array $in - the part parameters -> will convert to object in test method + * @param string $expected - the name digested from the parameters + */ + public function testRetrieveAttachmentNameFromStructure($in, $expected) + { + $this->assertEquals($expected, $this->ie->retrieveAttachmentNameFromStructure($in), 'We did not get the attachmentName'); + } +} diff --git a/tests/modules/Meetings/Bug53516Test.php b/tests/modules/Meetings/Bug53516Test.php new file mode 100755 index 00000000..e7c5b365 --- /dev/null +++ b/tests/modules/Meetings/Bug53516Test.php @@ -0,0 +1,86 @@ +contact = SugarTestContactUtilities::createContact(); + } + + protected function tearDown() + { + SugarTestContactUtilities::removeAllCreatedContacts(); + SugarTestContactUtilities::removeCreatedContactsEmailAddresses(); + SugarTestContactUtilities::removeCreatedContactsUsersRelationships(); + SugarTestMeetingUtilities::removeAllCreatedMeetings(); + SugarTestMeetingUtilities::removeMeetingContacts(); + SugarTestMeetingUtilities::removeMeetingUsers(); + SugarTestHelper::tearDown(); + } + + /** + * Ensure that saving relationship changes do not fail with fatal error and works fine + * when saving relation field with type id + * + * @group 53516 + */ + public function testSaveRelationOnRelateFieldWithIdType() + { + $meeting = SugarTestMeetingUtilities::createMeeting(); + $meeting->in_workflow = true; + $meeting->not_use_rel_in_req = true; + $meeting->contact_id = $meeting->new_rel_id = $this->contact->id; + $meeting->new_rel_relname = 'contact_id'; + $meeting->save_relationship_changes(false); + } +} diff --git a/tests/modules/ModuleBuilder/Bug45339Test.php b/tests/modules/ModuleBuilder/Bug45339Test.php index c7bfebbb..0177e0ba 100755 --- a/tests/modules/ModuleBuilder/Bug45339Test.php +++ b/tests/modules/ModuleBuilder/Bug45339Test.php @@ -64,6 +64,8 @@ class Bug45339Test extends Sugar_PHPUnit_Framework_TestCase 'rhs_subpanel' => "default", ); private $packName = 'test_package'; + private $df = null; + private $field = null; public function setUp() { @@ -96,12 +98,50 @@ class Bug45339Test extends Sugar_PHPUnit_Framework_TestCase $this->relationContactAccount = $relationContactAccount->addFromPost(); $relationContactAccount->save(); $relationContactAccount->build(); + SugarTestHelper::setUp('relation', array( + 'Contacts', + 'Accounts' + )); + + //create a new field for accounts + $this->field = get_widget('varchar'); + $this->field->id = 'Accountstest_45339333_c'; + $this->field->name = 'test_45339333_c'; + $this->field->vname = 'LBL_TEST_CUSTOM_C'; + $this->field->help = NULL; + $this->field->custom_module = 'Accounts'; + $this->field->type = 'varchar'; + $this->field->label = 'LBL_TEST_CUSTOM_C'; + $this->field->len = 255; + $this->field->required = 0; + $this->field->default_value = NULL; + $this->field->date_modified = '2012-10-31 02:23:23'; + $this->field->deleted = 0; + $this->field->audited = 0; + $this->field->massupdate = 0; + $this->field->duplicate_merge = 0; + $this->field->reportable = 1; + $this->field->importable = 'true'; + $this->field->ext1 = NULL; + $this->field->ext2 = NULL; + $this->field->ext3 = NULL; + $this->field->ext4 = NULL; + + //add field to metadata + $this->df = new DynamicField('Accounts'); + $this->df->setup(new Account()); + $this->df->addFieldObject($this->field); + $this->df->buildCache('Accounts'); + VardefManager::clearVardef(); + VardefManager::refreshVardefs('Accounts', 'Account'); + $this->mbPackage = new Bug45339MBPackageMock($this->packName); } public function tearDown() { + $this->df->deleteField($this->field); $relationshipAccountContact = new DeployedRelationships($this->relationAccountContact->getLhsModule()); $relationshipAccountContact->delete($this->relationAccountContact->getName()); $relationshipAccountContact->save(); @@ -112,7 +152,7 @@ class Bug45339Test extends Sugar_PHPUnit_Framework_TestCase SugarRelationshipFactory::deleteCache(); - unset($_REQUEST); + $_REQUEST = array(); SugarTestHelper::tearDown(); } @@ -156,15 +196,15 @@ class Bug45339Test extends Sugar_PHPUnit_Framework_TestCase ); /* @var $this->mbPackage MBPackage */ - $accountsAllFiles = $this->mbPackage->getCustomRelationshipsMetaFilesByModuleNameTest('Accounts'); - $accountsOnlyMetaFile = $this->mbPackage->getCustomRelationshipsMetaFilesByModuleNameTest('Accounts', true, true); + $accountsAllFiles = $this->mbPackage->getCustomRelationshipsMetaFilesByModuleNameTest('Accounts',false,false, array('Accounts','Contacts')); + $accountsOnlyMetaFile = $this->mbPackage->getCustomRelationshipsMetaFilesByModuleNameTest('Accounts', true, true, array('Accounts')); $wrongModuleName = $this->mbPackage->getCustomRelationshipsMetaFilesByModuleNameTest('Wrong_module_name'); $this->assertContains($accountContactMetaPath, $accountsAllFiles); $this->assertContains($accountContactTablePath, $accountsAllFiles); $this->assertContains($contactAccountMetaPath, $accountsAllFiles); - $this->assertContains($accountContactMetaPath, $accountsOnlyMetaFile); + $this->assertNotContains($accountContactMetaPath, $accountsOnlyMetaFile); $this->assertNotContains($contactAccountMetaPath, $accountsOnlyMetaFile); $this->assertInternalType('array', $wrongModuleName); @@ -174,7 +214,7 @@ class Bug45339Test extends Sugar_PHPUnit_Framework_TestCase /** * @group 45339 */ - public function testGetExtensionsList() + public function testGetExtensionsList() { // Create new relationship between Leads and Accounts $_REQUEST['view_module'] = "Leads"; @@ -188,6 +228,7 @@ class Bug45339Test extends Sugar_PHPUnit_Framework_TestCase $deployedRelation->save(); $deployedRelation->build(); + //create expected file paths from custom extensions $accountContactRelInAccountVardefExtensions = sprintf( 'custom%1$sExtension%1$smodules%1$sAccounts%1$sExt%1$sVardefs%1$s' . $this->relationAccountContact->getName() . '_Accounts.php', DIRECTORY_SEPARATOR @@ -200,11 +241,16 @@ class Bug45339Test extends Sugar_PHPUnit_Framework_TestCase 'custom%1$sExtension%1$smodules%1$sAccounts%1$sExt%1$sVardefs%1$s' . $relationLeadAccount->getName() . '_Accounts.php', DIRECTORY_SEPARATOR ); + $sugarfieldAccountVardefExtensions = sprintf( + 'custom%1$sExtension%1$smodules%1$sAccounts%1$sExt%1$sVardefs%1$s' .'sugarfield_'. $this->field->name . '.php', + DIRECTORY_SEPARATOR + ); - /* @var $this->mbPackage MBPackage */ - $accountAllExtensions = $this->mbPackage->getExtensionsListTest('Accounts'); - $accountExtContacts = $this->mbPackage->getExtensionsListTest('Accounts', array('Contacts')); - $accountExtWithWrongRelationship = $this->mbPackage->getExtensionsListTest('Accounts', array('')); + //call mbPackage to retrieve arrays of Files to be exported using different test parameters + $accountAllExtensions = $this->mbPackage->getExtensionsListTest('Accounts',array('Accounts','Contacts','Leads')); + $accountExtContacts = $this->mbPackage->getExtensionsListTest('Accounts',array('Accounts','Contacts')); + $accountExtOnly = $this->mbPackage->getExtensionsListTest('Accounts', array('Accounts')); + $contactExtWithWrongRelationship = $this->mbPackage->getExtensionsListTest('Contacts', array('')); $wrongModuleName = $this->mbPackage->getExtensionsListTest('Wrong_module_name'); // Remove relationship @@ -212,18 +258,27 @@ class Bug45339Test extends Sugar_PHPUnit_Framework_TestCase $deployedRelation->save(); SugarRelationshipFactory::deleteCache(); - $this->assertContains($accountContactRelInAccountVardefExtensions, $accountAllExtensions); - $this->assertContains($contactAccountRelInAccountVardefExtensions, $accountAllExtensions); - $this->assertContains($leadAccountRelInAccountVardefExtensions, $accountAllExtensions); + //assert that contact rels are exported when all rels were defined + $this->assertContains($accountContactRelInAccountVardefExtensions, $accountAllExtensions,'Contact Relationship should have been exported when accounts and contacts modules are exported'); - $this->assertContains($accountContactRelInAccountVardefExtensions, $accountExtContacts); - $this->assertContains($contactAccountRelInAccountVardefExtensions, $accountExtContacts); - $this->assertNotContains($leadAccountRelInAccountVardefExtensions, $accountExtContacts); + //assert that contact rels are not exported when contact is not defined + $this->assertNotContains($accountContactRelInAccountVardefExtensions, $accountExtOnly,'Contact Relationship should NOT have been exported when exporting accounts only'); - $this->assertEmpty($accountExtWithWrongRelationship); + //assert that non relationship change is exported when no related module is defined + $this->assertContains($sugarfieldAccountVardefExtensions, $accountExtOnly,'Sugarfield change should have been exported when exporting Accounts only'); - $this->assertInternalType('array', $wrongModuleName); - $this->assertEmpty($wrongModuleName); + //assert only contact and Account modules are present when both contact and Accounts are defined + $this->assertContains($accountContactRelInAccountVardefExtensions, $accountExtContacts,'Accounts rels should be present when exporting Contacts and Accounts'); + $this->assertContains($contactAccountRelInAccountVardefExtensions, $accountExtContacts,'Contacts rels should be present when exporting Contacts and Accounts'); + $this->assertNotContains($leadAccountRelInAccountVardefExtensions, $accountExtContacts,'Leads rels should NOT be present when exporting Contacts and Accounts'); + + //assert that requesting a wrong relationship returns an empty array + $this->assertInternalType('array', $contactExtWithWrongRelationship,'array type should be returned when no relationships are exported, and no other changes exist'); + $this->assertEmpty($contactExtWithWrongRelationship,'An empty array should be returned when no relationships are exported, and no other changes exist'); + + //assert that requesting a wrong module name returns an empty array + $this->assertInternalType('array', $wrongModuleName,'An array type should be returned when a bad module is requested for export'); + $this->assertEmpty($wrongModuleName,'An empty array should be returned when a bad module is requested for export'); } /** @@ -291,9 +346,9 @@ class Bug45339MBPackageMock extends MBPackage return $this->getExtensionsList($module, $includeRelationships); } - public function getCustomRelationshipsMetaFilesByModuleNameTest($moduleName, $lhs = false, $metadataOnly = false) + public function getCustomRelationshipsMetaFilesByModuleNameTest($moduleName, $lhs = false, $metadataOnly = false,$exportModules=array()) { - return $this->getCustomRelationshipsMetaFilesByModuleName($moduleName, $lhs, $metadataOnly); + return $this->getCustomRelationshipsMetaFilesByModuleName($moduleName, $lhs, $metadataOnly,$exportModules); } public function getCustomRelationshipsByModuleNameTest($moduleName, $lhs = false) @@ -301,4 +356,5 @@ class Bug45339MBPackageMock extends MBPackage return $this->getCustomRelationshipsByModuleName($moduleName, $lhs); } + } diff --git a/tests/modules/SNIP/Bug53942Test.ics b/tests/modules/SNIP/Bug53942Test.ics new file mode 100755 index 00000000..a670b76b --- /dev/null +++ b/tests/modules/SNIP/Bug53942Test.ics @@ -0,0 +1,45 @@ +BEGIN:VCALENDAR +PRODID:Zimbra-Calendar-Provider +VERSION:2.0 +METHOD:REQUEST +BEGIN:VTIMEZONE +TZID:America/New_York +BEGIN:STANDARD +DTSTART:19710101T020000 +TZOFFSETTO:-0500 +TZOFFSETFROM:-0400 +RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=11;BYDAY=1SU +TZNAME:EST +END:STANDARD +BEGIN:DAYLIGHT +DTSTART:19710101T020000 +TZOFFSETTO:-0400 +TZOFFSETFROM:-0500 +RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=3;BYDAY=2SU +TZNAME:EDT +END:DAYLIGHT +END:VTIMEZONE +BEGIN:VEVENT +UID:73fc8eef-bacc-4d7b-94eb-af2080437132 +SUMMARY:ZimbraTest NoonEST +ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:mailto:c@sugarcrm.com +ATTENDEE;CN=Ellen True;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:mailto:et@sugarcrm.com +ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:mailto:h@sugarondemand.com +ORGANIZER;CN=A T:mailto:zz@gatech.edu +DTSTART;TZID="America/New_York":20120621T120000 +DTEND;TZID="America/New_York":20120621T123000 +STATUS:CONFIRMED +CLASS:PUBLIC +X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY +TRANSP:OPAQUE +LAST-MODIFIED:20120621T213648Z +DTSTAMP:20120621T213648Z +SEQUENCE:0 +DESCRIPTION:The following is a new meeting request +BEGIN:VALARM +ACTION:DISPLAY +TRIGGER;RELATED=START:-PT10M +DESCRIPTION:Reminder +END:VALARM +END:VEVENT +END:VCALENDAR diff --git a/tests/modules/SchedulersJobs/RunnableSchedulersJobsTest.php b/tests/modules/SchedulersJobs/RunnableSchedulersJobsTest.php index 3cc030c2..134d9853 100755 --- a/tests/modules/SchedulersJobs/RunnableSchedulersJobsTest.php +++ b/tests/modules/SchedulersJobs/RunnableSchedulersJobsTest.php @@ -113,7 +113,7 @@ class TestRunnableJob implements RunnableSchedulerJob { $this->job->runnable_ran = true; $this->job->runnable_data = $data; - $this->job->succeedJob(); + return $this->job->succeedJob(); } public function setJob(SchedulersJob $job) diff --git a/themes/Sugar5/tpls/_head.tpl b/themes/Sugar5/tpls/_head.tpl index 8fc6b527..4e875c12 100644 --- a/themes/Sugar5/tpls/_head.tpl +++ b/themes/Sugar5/tpls/_head.tpl @@ -40,6 +40,7 @@ + {$APP.LBL_BROWSER_TITLE} {$SUGAR_CSS} {$SUGAR_JS} -- 2.42.0