Squashed 'public/legacy/' changes from 92c30d9960..ee41ae127f

ee41ae127f SuiteCRM 7.13.3 Release
710b977fe9 Fix #10009 - Cannot configure Module Menu Filters on PHP8+
096b87c982 Fix #9153 - Adding dynamicenum case option for export
0cf566c131 Fix #8897 - Adding missing relationship for SurveyResponses module
c25ec3546c Fix #9470 - Set fdow in Calendar popup date selector
1d8ee63779 Fix #9326 - Adding decimal and float case option for export to use user-defined decimal separator
8ecc413cea Fix #9476 - Mass assign security groups only assigns selected on current page
8c8dacb256 Fix #9542 - added checks for count methods
c7eeca8db8 Fix #7759, #8273 - Double compose button in subpanels
e022f2e094 Fix #9621 - Workflows Calculate Field Actions don't translate dynamicenum fields
461f50a089 Fix #9764 - Add extra To addresses to CC field
4cf46d154d Fix salesagility#9768 - Do not convert link URLs in TinyMCE
c5ad471977 Fix #9783 - Compose view quick search
45c5c2a8d0 Fix #9780 - Popup does not show after creating a user
637c15e048 Fix #9812 - Decimal number calculations workflows
c025ca0659 Fix #9817 - Typo
a8cc7d8d5c Fix #9828 - $mod_strings not in scope for line 395 of the same file
41ef82116b Fix #9849 - allowed_preview is defined twice in the array
646d655e8e Fix #9875 SugarFeed shows 0 seconds ago and negative interval for certain datetime formats
f2fa7c3940 Fix #9902 - Workflow - Some Date calculations fail with certain formats
e28458a79d Fix #9930 - Recurrent calendar items
7a9c5f2490 Fix #9602 - ProspectLists save function has a duplication issue
b3e757172a Fix #9963 - Upgrade league/oauth2-server to latest version
6e61173aa3 Fix #9974 - External Providers saving with no type
1b0b5d6007 Fix #9974 - inbound emails saving with no type

git-subtree-dir: public/legacy
git-subtree-split: ee41ae127ff74a9182c42af4e1c63db32e2f1fec
This commit is contained in:
Clemente Raposo 2023-05-08 12:35:02 +01:00
parent 444c2169fe
commit 601c0c039b
43 changed files with 356 additions and 201 deletions

View file

@ -36,7 +36,7 @@
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/(function($){$.fn.EmailsComposeViewModal=function(options){"use strict";var self=this;var opts=$.extend({},$.fn.EmailsComposeViewModal.defaults,options);self.handleClick=function(e){"use strict";var self=this;self.emailComposeView=null;var opts=$.extend({},$.fn.EmailsComposeViewModal.defaults);var composeBox=$('<div></div>').appendTo(opts.contentSelector);composeBox.messageBox({"showHeader":false,"showFooter":false,"size":'lg'});composeBox.setBody('<div class="email-in-progress"><img src="themes/'+SUGAR.themes.theme_name+'/images/loading.gif"></div>');composeBox.show();$.ajax({type:"GET",cache:false,url:'index.php?module=Emails&action=ComposeView&in_popup=1'}).done(function(data){if(data.length===0){console.error("Unable to display ComposeView");composeBox.setBody(SUGAR.language.translate('','ERR_AJAX_LOAD'));return;}
composeBox.setBody(data);self.emailComposeView=composeBox.controls.modal.body.find('.compose-view').EmailsComposeView();$(self.emailComposeView).on('sentEmail',function(event,composeView){composeBox.hide();composeBox.remove();});$(self.emailComposeView).on('disregardDraft',function(event,composeView){if(typeof messageBox!=="undefined"){var mb=messageBox({size:'lg'});mb.setTitle(SUGAR.language.translate('','LBL_CONFIRM_DISREGARD_DRAFT_TITLE'));mb.setBody(SUGAR.language.translate('','LBL_CONFIRM_DISREGARD_DRAFT_BODY'));mb.on('ok',function(){mb.remove();composeBox.hide();composeBox.remove();});mb.on('cancel',function(){mb.remove();});mb.show();}else{if(confirm(self.translatedErrorMessage)){composeBox.hide();composeBox.remove();}}});composeBox.on('cancel',function(){composeBox.remove();});composeBox.on('hide.bs.modal',function(){composeBox.remove();});}).fail(function(data){composeBox.controls.modal.content.html(SUGAR.language.translate('','LBL_EMAIL_ERROR_GENERAL_TITLE'));});return $(self);};self.construct=function(){"use strict";$(opts.buttonSelector).click(self.handleClick)};self.destruct=function(){};self.construct();return $(self);};$.fn.openComposeViewModal=function(source){"use strict";window.event.preventDefault();window.event.stopImmediatePropagation();var self=this;self.emailComposeView=null;var opts=$.extend({},$.fn.EmailsComposeViewModal.defaults);var composeBox=$('<div></div>').appendTo(opts.contentSelector);composeBox.messageBox({"showHeader":false,"showFooter":false,"size":'lg'});composeBox.setBody('<div class="email-in-progress"><img src="themes/'+SUGAR.themes.theme_name+'/images/loading.gif"></div>');composeBox.show();var relatedId=$('[name="record"]').val();var ids='&ids=';if($(source).attr('data-record-id')!==''){ids=ids+$(source).attr('data-record-id');relatedId=$(source).attr('data-record-id');}
composeBox.setBody(data);self.emailComposeView=composeBox.controls.modal.body.find('.compose-view').EmailsComposeView();$(self.emailComposeView).on('sentEmail',function(event,composeView){composeBox.hide();composeBox.remove();});$(self.emailComposeView).on('disregardDraft',function(event,composeView){if(typeof messageBox!=="undefined"){var mb=messageBox({size:'lg'});mb.setTitle(SUGAR.language.translate('','LBL_CONFIRM_DISREGARD_DRAFT_TITLE'));mb.setBody(SUGAR.language.translate('','LBL_CONFIRM_DISREGARD_DRAFT_BODY'));mb.on('ok',function(){mb.remove();composeBox.hide();composeBox.remove();});mb.on('cancel',function(){mb.remove();});mb.show();}else{if(confirm(self.translatedErrorMessage)){composeBox.hide();composeBox.remove();}}});composeBox.on('cancel',function(){composeBox.remove();});composeBox.on('hide.bs.modal',function(){composeBox.remove();});$("#emails_email_templates_name").change(function(){$.fn.EmailsComposeView.onTemplateChange()});}).fail(function(data){composeBox.controls.modal.content.html(SUGAR.language.translate('','LBL_EMAIL_ERROR_GENERAL_TITLE'));});return $(self);};self.construct=function(){"use strict";$(opts.buttonSelector).click(self.handleClick)};self.destruct=function(){};self.construct();return $(self);};$.fn.openComposeViewModal=function(source){"use strict";window.event.preventDefault();window.event.stopImmediatePropagation();var self=this;self.emailComposeView=null;var opts=$.extend({},$.fn.EmailsComposeViewModal.defaults);var composeBox=$('<div></div>').appendTo(opts.contentSelector);composeBox.messageBox({"showHeader":false,"showFooter":false,"size":'lg'});composeBox.setBody('<div class="email-in-progress"><img src="themes/'+SUGAR.themes.theme_name+'/images/loading.gif"></div>');composeBox.show();var relatedId=$('[name="record"]').val();var ids='&ids=';if($(source).attr('data-record-id')!==''){ids=ids+$(source).attr('data-record-id');relatedId=$(source).attr('data-record-id');}
else{var inputs=document.MassUpdate.elements;for(var i=0;i<inputs.length;i++){if(inputs[i].name==='mass[]'&&inputs[i].checked){ids=ids+inputs[i].value+',';}}}
var targetModule=currentModule;if($(source).attr('data-module')!==''){targetModule=$(source).attr('data-module');}
var url='index.php?module=Emails&action=ComposeView&in_popup=1&targetModule='+targetModule+ids+'&relatedModule='+currentModule+'&relatedId='+relatedId;$.ajax({type:"GET",cache:false,url:url}).done(function(data){if(data.length===0){console.error("Unable to display ComposeView");composeBox.setBody(SUGAR.language.translate('','ERR_AJAX_LOAD'));return;}
@ -47,4 +47,4 @@ populateEmailAddress=$(this).attr('data-record-email');if(dataEmailAddress!=='')
if(populateEmailAddress!==''){if(targetCount>0){targetList=targetList+',';}
targetList=targetList+dataEmailName+' <'+populateEmailAddress+'>';targetCount++;}});if(targetCount>0){$(self.emailComposeView).find('#to_addrs_names').val(targetList);}
if(targetCount<2){$(self.emailComposeView).find('#parent_type').val(populateModule);$(self.emailComposeView).find('#parent_name').val(populateModuleName);$(self.emailComposeView).find('#parent_id').val(populateModuleRecord);}
$(self.emailComposeView).on('sentEmail',function(event,composeView){composeBox.hide();composeBox.remove();});$(self.emailComposeView).on('disregardDraft',function(event,composeView){if(typeof messageBox!=="undefined"){var mb=messageBox({size:'lg'});mb.setTitle(SUGAR.language.translate('','LBL_CONFIRM_DISREGARD_DRAFT_TITLE'));mb.setBody(SUGAR.language.translate('','LBL_CONFIRM_DISREGARD_DRAFT_BODY'));mb.on('ok',function(){mb.remove();composeBox.hide();composeBox.remove();});mb.on('cancel',function(){mb.remove();});mb.show();}else{if(confirm(self.translatedErrorMessage)){composeBox.hide();composeBox.remove();}}});composeBox.on('cancel',function(){composeBox.remove();});composeBox.on('hide.bs.modal',function(e){e.preventDefault();var mb=messageBox({size:'lg'});mb.setTitle(SUGAR.language.translate('','LBL_CONFIRM_DISREGARD_EMAIL_TITLE'));mb.setBody(SUGAR.language.translate('','LBL_CONFIRM_DISREGARD_EMAIL_BODY'));mb.on('ok',function(){mb.remove();composeBox.hide();composeBox.remove();});mb.on('cancel',function(){mb.remove();});mb.show();});}).fail(function(data){composeBox.controls.modal.content.html(SUGAR.language.translate('','LBL_EMAIL_ERROR_GENERAL_TITLE'));});return $(self);};$.fn.EmailsComposeViewModal.defaults={'selected':'INBOX','buttonSelector':'[data-action=emails-show-compose-modal]','contentSelector':'#content'};}(jQuery));
$(self.emailComposeView).on('sentEmail',function(event,composeView){composeBox.hide();composeBox.remove();});$(self.emailComposeView).on('disregardDraft',function(event,composeView){if(typeof messageBox!=="undefined"){var mb=messageBox({size:'lg'});mb.setTitle(SUGAR.language.translate('','LBL_CONFIRM_DISREGARD_DRAFT_TITLE'));mb.setBody(SUGAR.language.translate('','LBL_CONFIRM_DISREGARD_DRAFT_BODY'));mb.on('ok',function(){mb.remove();composeBox.hide();composeBox.remove();});mb.on('cancel',function(){mb.remove();});mb.show();}else{if(confirm(self.translatedErrorMessage)){composeBox.hide();composeBox.remove();}}});composeBox.on('cancel',function(){composeBox.remove();});composeBox.on('hide.bs.modal',function(e){e.preventDefault();var mb=messageBox({size:'lg'});mb.setTitle(SUGAR.language.translate('','LBL_CONFIRM_DISREGARD_EMAIL_TITLE'));mb.setBody(SUGAR.language.translate('','LBL_CONFIRM_DISREGARD_EMAIL_BODY'));mb.on('ok',function(){mb.remove();composeBox.hide();composeBox.remove();});mb.on('cancel',function(){mb.remove();});mb.show();});$("#emails_email_templates_name").change(function(){$.fn.EmailsComposeView.onTemplateChange()});}).fail(function(data){composeBox.controls.modal.content.html(SUGAR.language.translate('','LBL_EMAIL_ERROR_GENERAL_TITLE'));});return $(self);};$.fn.EmailsComposeViewModal.defaults={'selected':'INBOX','buttonSelector':'[data-action=emails-show-compose-modal]','contentSelector':'#content'};}(jQuery));

View file

@ -573,8 +573,9 @@ URL+='&create='+create;if(metadata!=''&&metadata!=undefined){URL+='&metadata='+m
if(popup_request_data.jsonObject){var request_data=popup_request_data.jsonObject;}else{var request_data=popup_request_data;}
var field_to_name_array_url='';if(request_data&&request_data.field_to_name_array!=undefined){for(var key in request_data.field_to_name_array){if(key.toLowerCase()!='id'){field_to_name_array_url+='&field_to_name[]='+encodeURIComponent(key.toLowerCase());}}}
if(field_to_name_array_url){URL+=field_to_name_array_url;}
win=SUGAR.util.openWindow(URL,windowName,windowFeatures);if(window.focus){win.focus();}
win=SUGAR.util.openWindow(URL,windowName,windowFeatures);if(win){if(win.focus){win.focus();}
win.popupCount=popupCount;return win;}
return;}
var from_popup_return=false;function replaceHTMLChars(value){return value.replace(/&amp;/gi,'&').replace(/&lt;/gi,'<').replace(/&gt;/gi,'>').replace(/&#039;/gi,'\'').replace(/&quot;/gi,'"');}
function set_return_basic(popup_reply_data,filter){var form_name=popup_reply_data.form_name;var name_to_value_array=popup_reply_data.name_to_value_array;for(var the_key in name_to_value_array){if(the_key=='toJSON'){}
else if(the_key.match(filter)){var displayValue=replaceHTMLChars(name_to_value_array[the_key]);if(window.document.forms[form_name]&&window.document.forms[form_name].elements[the_key]){if(window.document.forms[form_name].elements[the_key].tagName=='SELECT'){var selectField=window.document.forms[form_name].elements[the_key];for(var i=0;i<selectField.options.length;i++){if(selectField.options[i].text==displayValue){selectField.options[i].selected=true;SUGAR.util.callOnChangeListers(selectField);break;}}}else{window.document.forms[form_name].elements[the_key].value=displayValue;SUGAR.util.callOnChangeListers(window.document.forms[form_name].elements[the_key]);}}}}}