From b456b2b6173a03eb0ae606c08e974c024cf18162 Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Fri, 17 Aug 2018 11:49:05 +0200 Subject: [PATCH 01/38] Removed wrong icons in message view --- skins/yetiforce/templates/message.html | 2 +- skins/yetiforce/templates/messagepreview.html | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/skins/yetiforce/templates/message.html b/skins/yetiforce/templates/message.html index 312b79b0..649d2109 100644 --- a/skins/yetiforce/templates/message.html +++ b/skins/yetiforce/templates/message.html @@ -76,7 +76,7 @@

:

- +
diff --git a/skins/yetiforce/templates/messagepreview.html b/skins/yetiforce/templates/messagepreview.html index 7b5ec6db..83f62313 100644 --- a/skins/yetiforce/templates/messagepreview.html +++ b/skins/yetiforce/templates/messagepreview.html @@ -44,16 +44,16 @@

< - + - +
- + From 470a64612cd197d6647b2ab23a081afac9347f7e Mon Sep 17 00:00:00 2001 From: poradz Date: Wed, 31 Oct 2018 14:08:31 +0100 Subject: [PATCH 02/38] Updated fontawesome path and lib version --- plugins/yetiforce/yetiforce.php | 2 +- version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/yetiforce/yetiforce.php b/plugins/yetiforce/yetiforce.php index 2296ca66..2533f444 100644 --- a/plugins/yetiforce/yetiforce.php +++ b/plugins/yetiforce/yetiforce.php @@ -61,7 +61,7 @@ public function init() } if ($this->rc->action === 'preview' || $this->rc->action === 'show') { $this->include_script('preview.js'); - $this->include_stylesheet($this->rc->config->get('public_URL') . 'libraries/fontawesome-web/css/fontawesome-all.css'); + $this->include_stylesheet($this->rc->config->get('public_URL') . 'libraries/@fortawesome/fontawesome-free/css/all.css'); $this->include_stylesheet('preview.css'); $this->add_hook('message_load', [$this, 'messageLoad']); } diff --git a/version.php b/version.php index b9b49dfe..9c73b319 100644 --- a/version.php +++ b/version.php @@ -1,5 +1,5 @@ '2018.08.22', - 'version' => '0.0.54' + 'version' => '0.0.55' ]; From 44b219131259ab89bc935baf27d930038979f76f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20K=C5=82os?= Date: Fri, 16 Nov 2018 15:16:33 +0100 Subject: [PATCH 03/38] Copied code from normal js to min.js --- plugins/yetiforce/list.min.js | 41 ++++- plugins/yetiforce/preview.min.js | 286 ++++++++++++++++++++++++++++++- version.php | 4 +- 3 files changed, 327 insertions(+), 4 deletions(-) diff --git a/plugins/yetiforce/list.min.js b/plugins/yetiforce/list.min.js index e774fa8c..012aa833 100644 --- a/plugins/yetiforce/list.min.js +++ b/plugins/yetiforce/list.min.js @@ -1,2 +1,41 @@ +/* {[The file is published on the basis of MIT License]} */ +window.rcmail && rcmail.addEventListener('listupdate', function (evt) { + //window.crm = getCrmWindow(); + rcmail.register_command('yetiforce.importICS', function (ics, element, e) { -window.rcmail&&rcmail.addEventListener("listupdate",function(b){rcmail.register_command("yetiforce.importICS",function(f,g,h){},true);var a=$("#messagelistcontainer");var c=a.find(".records-table.messagelist.sortheader.fixedheader.fixedcopy");var d=a.find("#messagelist")});function resizeContentTable(a,b,c){var d=[];a.find("thead th,thead td").each(function(e){d[e]=$(this).width()});b.find("th,td").each(function(e){$(this).width(d[e])});window.crm.app.moduleCacheSet("widthColumns",d);$(window).scroll()}; \ No newline at end of file + }, true); + var container = $('#messagelistcontainer'); + var headerFixed = container.find('.records-table.messagelist.sortheader.fixedheader.fixedcopy'); + var messageList = container.find('#messagelist'); + /* + var columnsWidth = window.crm.app.moduleCacheGet('widthColumns'); + if (columnsWidth != null) { + messageList.find('th,td').each(function (index) { + $(this).width(columnsWidth[index]); + }); + headerFixed.find('th,td').each(function (index) { + $(this).width(columnsWidth[index]); + }); + } + */ + /* + headerFixed.colResizable({ + onResize: function (e) { + resizeContentTable(headerFixed, messageList, e); + }, + resizeMode:'fit' + }); + */ +}); + +function resizeContentTable(headerFixed, messageList, e) { + var column_widths = []; + headerFixed.find('thead th,thead td').each(function (index) { + column_widths[index] = $(this).width(); + }); + messageList.find('th,td').each(function (index) { + $(this).width(column_widths[index]); + }); + window.crm.app.moduleCacheSet('widthColumns', column_widths); + $(window).scroll(); +} diff --git a/plugins/yetiforce/preview.min.js b/plugins/yetiforce/preview.min.js index 4a223e5b..bde82cf7 100644 --- a/plugins/yetiforce/preview.min.js +++ b/plugins/yetiforce/preview.min.js @@ -1 +1,285 @@ -window.rcmail&&rcmail.addEventListener("init",function(evt){window.crm=getCrmWindow();loadActionBar();rcmail.env.message_commands.push("yetiforce.importICS");rcmail.register_command("yetiforce.importICS",function(ics,element,e){window.crm.AppConnector.request({async:true,dataType:"json",data:{module:"Calendar",action:"ImportICS",ics:ics}}).then(function(response){window.crm.Vtiger_Helper_Js.showPnotify({text:response["result"],type:"info",animation:"show"});$(element).closest(".icalattachments").remove()})},true)});function loadActionBar(){var content=$("#ytActionBarContent");var params={module:"OSSMail",view:"MailActionBar",uid:rcmail.env.uid,folder:rcmail.env.mailbox,rcId:rcmail.env.user_id};window.crm.AppConnector.request(params).then(function(response){content.find(".ytHeader").html(response);$("#messagecontent").css("top",content.outerHeight()+$("#messageheader").outerHeight()+"px");registerEvents(content)})}function registerEvents(content){registerAddRecord(content);registerAddReletedRecord(content);registerSelectRecord(content);registerRemoveRecord(content);registerImportMail(content);var block=content.find(".ytHeader .data");content.find(".hideBtn").click(function(){var button=$(this);var icon=button.find(".glyphicon");if(button.data("type")=="0"){button.data("type","1");icon.removeClass("glyphicon-chevron-up").addClass("glyphicon-chevron-down")}else{button.data("type","0");icon.removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-up")}block.toggle();$(window).trigger("resize")})}function registerImportMail(content){content.find(".importMail").click(function(e){window.crm.Vtiger_Helper_Js.showPnotify({text:window.crm.app.vtranslate("StartedDownloadingEmail"),type:"info"});window.crm.AppConnector.request({module:"OSSMail",action:"ImportMail",params:{uid:rcmail.env.uid,folder:rcmail.env.mailbox,rcId:rcmail.env.user_id}}).then(function(data){loadActionBar();window.crm.Vtiger_Helper_Js.showPnotify({text:window.crm.app.vtranslate("AddFindEmailInRecord"),type:"success"})})})}function registerRemoveRecord(content){content.find("button.removeRecord").click(function(e){var row=$(e.currentTarget).closest(".rowRelatedRecord");removeRecord(row.data("id"))})}function registerSelectRecord(content){let id=content.find("#mailActionBarID").val();content.find("button.selectRecord").click(function(e){let relParams={mailId:id};if($(this).data("type")==0){var module=$(this).closest(".col").find(".module").val()}else{var module=$(this).data("module");relParams.crmid=$(this).closest(".rowRelatedRecord").data("id");relParams.mod=$(this).closest(".rowRelatedRecord").data("module");relParams.newModule=module}showPopup({module:module,src_module:"OSSMailView",src_record:id},relParams)})}function registerAddReletedRecord(content){var id=content.find("#mailActionBarID").val();content.find("button.addRelatedRecord").click(function(e){var targetElement=$(e.currentTarget);var row=targetElement.closest(".rowRelatedRecord");var params={sourceModule:row.data("module")};showQuickCreateForm(targetElement.data("module"),row.data("id"),params)})}function registerAddRecord(content){var id=content.find("#mailActionBarID").val();content.find("button.addRecord").click(function(e){var col=$(e.currentTarget).closest(".col");showQuickCreateForm(col.find(".module").val(),id)})}function removeRecord(crmid){var id=$("#mailActionBarID").val();var params={};params.data={module:"OSSMail",action:"ExecuteActions",mode:"removeRelated",params:{mailId:id,crmid:crmid}};params.async=false;params.dataType="json";window.crm.AppConnector.request(params).then(function(data){var response=data["result"];if(response["success"]){var notifyParams={text:response["data"],type:"info",animation:"show"}}else{var notifyParams={text:response["data"],animation:"show"}}window.crm.Vtiger_Helper_Js.showPnotify(notifyParams);loadActionBar()})}function showPopup(params,actionsParams){actionsParams["newModule"]=params["module"];window.crm.app.showRecordsList(params,(modal,instance)=>{instance.setSelectEvent((responseData,e)=>{actionsParams["newCrmId"]=responseData.id;window.crm.AppConnector.request({async:false,dataType:"json",data:{module:"OSSMail",action:"ExecuteActions",mode:"addRelated",params:actionsParams}}).then(function(data){let response=data["result"];if(response["success"]){var notifyParams={text:response["data"],type:"info",animation:"show"}}else{var notifyParams={text:response["data"],animation:"show"}}window.crm.Vtiger_Helper_Js.showPnotify(notifyParams);loadActionBar()})})})}function showQuickCreateForm(moduleName,record,params){var content=$("#ytActionBarContent");if(params==undefined){var params={}}var relatedParams={};if(params["sourceModule"]){var sourceModule=params["sourceModule"]}else{var sourceModule="OSSMailView"}var postShown=function(data){var index,queryParam,queryParamComponents;$('').appendTo(data);$('').appendTo(data);$('').appendTo(data)};var ids={link:"modulesLevel0",process:"modulesLevel1",subprocess:"modulesLevel2",linkextend:"modulesLevel3"};for(var i in ids){var element=content.find("#"+ids[i]);var value=element.length?JSON.parse(element.val()):[];if($.inArray(sourceModule,value)>=0){relatedParams[i]=record}}if(moduleName=="Leads"){relatedParams["company"]=rcmail.env.fromName}if(moduleName=="Leads"||moduleName=="Contacts"){relatedParams["lastname"]=rcmail.env.fromName}if(moduleName=="Project"){relatedParams["projectname"]=rcmail.env.subject}if(moduleName=="HelpDesk"){relatedParams["ticket_title"]=rcmail.env.subject}if(moduleName=="Products"){relatedParams["productname"]=rcmail.env.subject}if(moduleName=="Services"){relatedParams["servicename"]=rcmail.env.subject}relatedParams["email"]=rcmail.env.fromMail;relatedParams["email1"]=rcmail.env.fromMail;relatedParams["description"]=$("#messagebody").text();var postQuickCreate=function(data){loadActionBar()};relatedParams["sourceModule"]=sourceModule;relatedParams["sourceRecord"]=record;relatedParams["relationOperation"]=true;var quickCreateParams={callbackFunction:postQuickCreate,callbackPostShown:postShown,data:relatedParams,noCache:true};var headerInstance=new window.crm.Vtiger_Header_Js;headerInstance.quickCreateModule(moduleName,quickCreateParams)}function getCrmWindow(){if(opener!==null){return opener.parent}else if(typeof parent.app=="object"){return parent}else if(typeof parent.parent.app=="object"){return parent.parent}return false} \ No newline at end of file +/* {[The file is published on the basis of MIT License]} */ +window.rcmail && rcmail.addEventListener('init', function (evt) { + window.crm = getCrmWindow(); + loadActionBar(); + rcmail.env.message_commands.push('yetiforce.importICS'); + rcmail.register_command('yetiforce.importICS', function (ics, element, e) { + window.crm.AppConnector.request({ + async: true, + dataType: 'json', + data: { + module: 'Calendar', + action: 'ImportICS', + ics: ics + } + }).done(function (response) { + window.crm.Vtiger_Helper_Js.showPnotify({ + text: response['result'], + type: 'info', + animation: 'show' + }); + $(element).closest('.icalattachments').remove(); + }) + }, true); + } +); + +function loadActionBar() { + var content = $('#ytActionBarContent'); + var params = { + module: 'OSSMail', + view: 'MailActionBar', + uid: rcmail.env.uid, + folder: rcmail.env.mailbox, + rcId: rcmail.env.user_id + }; + window.crm.AppConnector.request(params).done(function (response) { + content.find('.ytHeader').html(response); + $('#messagecontent').css('top', (content.outerHeight() + $('#messageheader').outerHeight()) + 'px'); + registerEvents(content); + }); +} + +function registerEvents(content) { + registerAddRecord(content); + registerAddReletedRecord(content); + registerSelectRecord(content); + registerRemoveRecord(content); + registerImportMail(content); + + var block = content.find('.ytHeader .js-data'); + content.find('.hideBtn').click(function () { + var button = $(this); + var icon = button.find('.glyphicon'); + + if (button.data('type') == '0') { + button.data('type', '1'); + icon.removeClass("glyphicon-chevron-up").addClass("glyphicon-chevron-down"); + } else { + button.data('type', '0'); + icon.removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-up"); + } + block.toggle(); + $(window).trigger("resize"); + }); +} + +function registerImportMail(content) { + content.find('.importMail').click(function (e) { + window.crm.Vtiger_Helper_Js.showPnotify({ + text: window.crm.app.vtranslate('StartedDownloadingEmail'), + type: 'info' + }); + window.crm.AppConnector.request({ + module: 'OSSMail', + action: 'ImportMail', + params: { + uid: rcmail.env.uid, + folder: rcmail.env.mailbox, + rcId: rcmail.env.user_id + } + }).done(function (data) { + loadActionBar(); + window.crm.Vtiger_Helper_Js.showPnotify({ + text: window.crm.app.vtranslate('AddFindEmailInRecord'), + type: 'success' + }); + }) + }); +} + +function registerRemoveRecord(content) { + content.find('button.removeRecord').click(function (e) { + var row = $(e.currentTarget).closest('.rowRelatedRecord'); + removeRecord(row.data('id')); + }); +} + +function registerSelectRecord(content) { + let id = content.find('#mailActionBarID').val(); + content.find('button.selectRecord').click(function (e) { + let relParams = { + mailId: id + }; + if ($(this).data('type') == 0) { + var module = $(this).closest('.js-head-container').find('.module').val(); + } else { + var module = $(this).data('module'); + relParams.crmid = $(this).closest('.rowRelatedRecord').data('id'); + relParams.mod = $(this).closest('.rowRelatedRecord').data('module'); + relParams.newModule = module; + } + showPopup({ + module: module, + src_module: 'OSSMailView', + src_record: id, + }, relParams); + }); +} + +function registerAddReletedRecord(content) { + var id = content.find('#mailActionBarID').val(); + content.find('button.addRelatedRecord').click(function (e) { + var targetElement = $(e.currentTarget); + var row = targetElement.closest('.rowRelatedRecord'); + var params = {sourceModule: row.data('module')}; + showQuickCreateForm(targetElement.data('module'), row.data('id'), params); + }); +} + +function registerAddRecord(content) { + var id = content.find('#mailActionBarID').val(); + content.find('button.addRecord').click(function (e) { + var col = $(e.currentTarget).closest('.js-head-container'); + showQuickCreateForm(col.find('.module').val(), id); + }); +} + +function removeRecord(crmid) { + var id = $('#mailActionBarID').val(); + var params = {} + params.data = { + module: 'OSSMail', + action: 'ExecuteActions', + mode: 'removeRelated', + params: { + mailId: id, + crmid: crmid + } + } + params.async = false; + params.dataType = 'json'; + window.crm.AppConnector.request(params).done(function (data) { + var response = data['result']; + if (response['success']) { + var notifyParams = { + text: response['data'], + type: 'info', + animation: 'show' + }; + } else { + var notifyParams = { + text: response['data'], + animation: 'show' + }; + } + window.crm.Vtiger_Helper_Js.showPnotify(notifyParams); + loadActionBar(); + }); +} + +function showPopup(params, actionsParams) { + actionsParams['newModule'] = params['module']; + window.crm.app.showRecordsList(params, (modal, instance) => { + instance.setSelectEvent((responseData, e) => { + actionsParams['newCrmId'] = responseData.id; + window.crm.AppConnector.request({ + async: false, + dataType: 'json', + data: { + module: 'OSSMail', + action: 'ExecuteActions', + mode: 'addRelated', + params: actionsParams + } + }).done(function (data) { + let response = data['result']; + if (response['success']) { + var notifyParams = { + text: response['data'], + type: 'info', + animation: 'show' + }; + } else { + var notifyParams = { + text: response['data'], + animation: 'show' + }; + } + window.crm.Vtiger_Helper_Js.showPnotify(notifyParams); + loadActionBar(); + }); + }); + }); +} + +function showQuickCreateForm(moduleName, record, params) { + var content = $('#ytActionBarContent'); + if (params == undefined) { + var params = {}; + } + var relatedParams = {}; + if (params['sourceModule']) { + var sourceModule = params['sourceModule']; + } else { + var sourceModule = 'OSSMailView'; + } + var postShown = function (data) { + var index, queryParam, queryParamComponents; + $('').appendTo(data); + $('').appendTo(data); + $('').appendTo(data); + } + var ids = { + link: 'modulesLevel0', + process: 'modulesLevel1', + subprocess: 'modulesLevel2', + linkextend: 'modulesLevel3' + }; + for (var i in ids) { + var element = content.find('#' + ids[i]); + var value = element.length ? JSON.parse(element.val()) : []; + if ($.inArray(sourceModule, value) >= 0) { + relatedParams[i] = record; + } + } + if (moduleName == 'Leads') { + relatedParams['company'] = rcmail.env.fromName; + } + if (moduleName == 'Leads' || moduleName == 'Contacts') { + relatedParams['lastname'] = rcmail.env.fromName; + } + if (moduleName == 'Project') { + relatedParams['projectname'] = rcmail.env.subject; + } + if (moduleName == 'HelpDesk') { + relatedParams['ticket_title'] = rcmail.env.subject; + } + if (moduleName == 'Products') { + relatedParams['productname'] = rcmail.env.subject; + } + if (moduleName == 'Services') { + relatedParams['servicename'] = rcmail.env.subject; + } + relatedParams['email'] = rcmail.env.fromMail; + relatedParams['email1'] = rcmail.env.fromMail; + relatedParams['description'] = $('#messagebody').text(); + //relatedParams['related_to'] = record; + var postQuickCreate = function (data) { + loadActionBar(); + } + relatedParams['sourceModule'] = sourceModule; + relatedParams['sourceRecord'] = record; + relatedParams['relationOperation'] = true; + var quickCreateParams = { + callbackFunction: postQuickCreate, + callbackPostShown: postShown, + data: relatedParams, + noCache: true + }; + var headerInstance = new window.crm.Vtiger_Header_Js(); + headerInstance.quickCreateModule(moduleName, quickCreateParams); +} + +function getCrmWindow() { + if (opener !== null && opener.parent.CONFIG == "object") { + return opener.parent; + } else if (typeof parent.CONFIG == "object") { + return parent; + } else if (typeof parent.parent.CONFIG == "object") { + return parent.parent; + } else if (typeof opener.crm.CONFIG == "object") { + return opener.crm; + } + return false; +} diff --git a/version.php b/version.php index 9c73b319..cb45971a 100644 --- a/version.php +++ b/version.php @@ -1,5 +1,5 @@ '2018.08.22', - 'version' => '0.0.55' + 'patch' => '2018.11.16', + 'version' => '0.0.56' ]; From 2d2747294e28ed9fa4657c39a6e221a4373fc6f6 Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Tue, 4 Dec 2018 14:29:47 +0100 Subject: [PATCH 04/38] Improved related modules styles --- plugins/yetiforce/preview.css | 32 ++++++++++++++----------------- plugins/yetiforce/preview.min.css | 32 ++++++++++++++----------------- skins/yetiforce/yetiforce.css | 5 +++-- skins/yetiforce/yetiforce.min.css | 4 +--- 4 files changed, 32 insertions(+), 41 deletions(-) diff --git a/plugins/yetiforce/preview.css b/plugins/yetiforce/preview.css index f4345966..03f1ade9 100644 --- a/plugins/yetiforce/preview.css +++ b/plugins/yetiforce/preview.css @@ -88,7 +88,11 @@ } .rowRelatedRecord { - padding: 2px; + background: white; + margin: 2px; + border: 1px #c1c1c1 solid; + border-radius: 6px; + padding: 1px 5px; } .action-bar__head__container { @@ -96,37 +100,29 @@ flex-wrap: nowrap; } +.action-bar__data { + padding: 0 2px 2px; + align-items: center; +} + .action-bar__data a { text-decoration: none; color: #000; - font-size: 14px; line-height: 14px } .action-bar__header { - font-size: 14px; - min-width: 90px; + font-size: 13px; + margin-right: 7px } .action-bar__head { - background-color: #4a5364; height: 20px; color: #fff; - padding: 2px; + padding: 5px 2px 4px; } .action-bar__col { + background-color: #4a5364; width: 100%; } - -@media only screen and (min-width: 600px) { - #ytActionBarContent .action-bar__col { - width: 50%; - } -} - -@media only screen and (min-width: 1200px) { - #ytActionBarContent .action-bar__col { - width: 25%; - } -} diff --git a/plugins/yetiforce/preview.min.css b/plugins/yetiforce/preview.min.css index f4345966..03f1ade9 100644 --- a/plugins/yetiforce/preview.min.css +++ b/plugins/yetiforce/preview.min.css @@ -88,7 +88,11 @@ } .rowRelatedRecord { - padding: 2px; + background: white; + margin: 2px; + border: 1px #c1c1c1 solid; + border-radius: 6px; + padding: 1px 5px; } .action-bar__head__container { @@ -96,37 +100,29 @@ flex-wrap: nowrap; } +.action-bar__data { + padding: 0 2px 2px; + align-items: center; +} + .action-bar__data a { text-decoration: none; color: #000; - font-size: 14px; line-height: 14px } .action-bar__header { - font-size: 14px; - min-width: 90px; + font-size: 13px; + margin-right: 7px } .action-bar__head { - background-color: #4a5364; height: 20px; color: #fff; - padding: 2px; + padding: 5px 2px 4px; } .action-bar__col { + background-color: #4a5364; width: 100%; } - -@media only screen and (min-width: 600px) { - #ytActionBarContent .action-bar__col { - width: 50%; - } -} - -@media only screen and (min-width: 1200px) { - #ytActionBarContent .action-bar__col { - width: 25%; - } -} diff --git a/skins/yetiforce/yetiforce.css b/skins/yetiforce/yetiforce.css index 9e92f895..cabdf603 100644 --- a/skins/yetiforce/yetiforce.css +++ b/skins/yetiforce/yetiforce.css @@ -208,8 +208,9 @@ table.messagelist.fixedcopy { } .action-bar__header { - font-size: 14px; - min-width: 90px; + font-size: 13px; + align-self: center; + margin-right: 2px; } .action-bar__head { diff --git a/skins/yetiforce/yetiforce.min.css b/skins/yetiforce/yetiforce.min.css index 9e92f895..59c25ec4 100644 --- a/skins/yetiforce/yetiforce.min.css +++ b/skins/yetiforce/yetiforce.min.css @@ -203,13 +203,11 @@ table.messagelist.fixedcopy { .action-bar__data a { text-decoration: none; color: #000; - font-size: 14px; line-height: 14px } .action-bar__header { - font-size: 14px; - min-width: 90px; + font-size: 13px; } .action-bar__head { From 0428f33e1b873b0f7ad6e8ef75b2b00d62971fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Skrzypczak?= Date: Wed, 5 Dec 2018 12:08:56 +0100 Subject: [PATCH 05/38] Update identity_smtp plugin --- plugins/identity_smtp/LICENSE | 19 + plugins/identity_smtp/identity_smtp.js | 2 +- plugins/identity_smtp/identity_smtp.php | 423 +++++++++++-------- plugins/identity_smtp/localization/ca_ES.inc | 14 + plugins/identity_smtp/localization/de_DE.inc | 4 +- plugins/identity_smtp/localization/en_US.inc | 4 +- plugins/identity_smtp/localization/es_ES.inc | 14 + plugins/identity_smtp/localization/fr_FR.inc | 14 + plugins/identity_smtp/localization/ja_JP.inc | 14 + version.php | 4 +- 10 files changed, 321 insertions(+), 191 deletions(-) create mode 100644 plugins/identity_smtp/LICENSE create mode 100644 plugins/identity_smtp/localization/ca_ES.inc create mode 100644 plugins/identity_smtp/localization/es_ES.inc create mode 100644 plugins/identity_smtp/localization/fr_FR.inc create mode 100644 plugins/identity_smtp/localization/ja_JP.inc diff --git a/plugins/identity_smtp/LICENSE b/plugins/identity_smtp/LICENSE new file mode 100644 index 00000000..85406d54 --- /dev/null +++ b/plugins/identity_smtp/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/plugins/identity_smtp/identity_smtp.js b/plugins/identity_smtp/identity_smtp.js index e2f92d57..22a09dab 100644 --- a/plugins/identity_smtp/identity_smtp.js +++ b/plugins/identity_smtp/identity_smtp.js @@ -17,6 +17,6 @@ function identity_smtp_toggle_standard_server() { if (checkbox.is(':checked')) { $('.identity_smtp_form').prop('disabled', true); } else { - $('.identity_smtp_form').removeProp('disabled'); + $('.identity_smtp_form').prop('disabled', false); } } diff --git a/plugins/identity_smtp/identity_smtp.php b/plugins/identity_smtp/identity_smtp.php index 65e45a1c..cc75f774 100644 --- a/plugins/identity_smtp/identity_smtp.php +++ b/plugins/identity_smtp/identity_smtp.php @@ -15,191 +15,242 @@ class identity_smtp extends rcube_plugin { - public $task = 'mail|settings'; - private $from_identity; - - function init() - { - $this->include_script('identity_smtp.js'); - $this->add_texts('localization/', true); - - $this->add_hook('message_outgoing_headers', array($this, 'messageOutgoingHeaders')); - $this->add_hook('smtp_connect', array($this, 'smtpWillConnect')); - $this->add_hook('identity_form', array($this, 'identityFormWillBeDisplayed')); - $this->add_hook('identity_create', array($this, 'identityWasCreated')); - $this->add_hook('identity_update', array($this, 'identityWasUpdated')); - $this->add_hook('identity_delete', array($this, 'identityWasDeleted')); - $this->add_hook('template_object_identityform', array($this, 'template_object_identityform')); - } - - function smtpLog($message) - { - write_log("identity_smtp_plugin", $message); - } - - function saveSmtpSettings($args) - { - $identities = rcmail::get_instance()->config->get('identity_smtp'); - $id = intval($args['id']); - - if (!isset($identities)) - { - $identities = array(); - } - - $smtp_standard = get_input_value('_smtp_standard', RCUBE_INPUT_POST); - - $password = get_input_value('_smtp_pass', RCUBE_INPUT_POST); - - if ($password != $identities[$id]['smtp_pass']) { - $password = rcmail::get_instance()->encrypt($password); - } - - $smtpSettingsRecord = array( - 'smtp_standard' => isset($smtp_standard), - 'smtp_server' => get_input_value('_smtp_server', RCUBE_INPUT_POST), - 'smtp_port' => get_input_value('_smtp_port', RCUBE_INPUT_POST), - 'smtp_user' => get_input_value('_smtp_user', RCUBE_INPUT_POST), - 'smtp_pass' => $password - ); - - unset($identities[$id]); - $identities += array( $id => $smtpSettingsRecord ); - - rcmail::get_instance()->user->save_prefs(array('identity_smtp' => $identities)); - } - - function loadSmtpSettings($args) - { - $smtpSettings = rcmail::get_instance()->config->get('identity_smtp'); - $id = intval($args['identity_id']); - $smtpSettingsRecord = array( - 'smtp_standard' => $smtpSettings[$id]['smtp_standard'], - 'smtp_server' => $smtpSettings[$id]['smtp_server'], - 'smtp_port' => $smtpSettings[$id]['smtp_port'], - 'smtp_user' => $smtpSettings[$id]['smtp_user'], - 'smtp_pass' => $smtpSettings[$id]['smtp_pass'] - ); - - if (is_null($smtpSettingsRecord['smtp_standard'])) { - $smtpSettingsRecord['smtp_standard'] = true; - } - - return $smtpSettingsRecord; - } - - function identityFormWillBeDisplayed($args) - { - $form = $args['form']; - $record = $args['record']; - - # Load the stored smtp settings - $smtpSettingsRecord = $this->loadSmtpSettings($record); - - if (!isset($record['identity_id'])) - { - # FIX ME - $smtpSettingsForm = array('smtpSettings' => array( - 'name' => $this->gettext('smtp_settings_header'), - 'content' => array( - 'text' => array('label' => $this->gettext('smtp_settings_not_available'), 'value' => ' ') - ) - )); - } else { - $smtpSettingsForm = array('smtpSettings' => array( - 'name' => $this->gettext('smtp_settings_header'), - 'content' => array( - 'smtp_standard' => array('type' => 'checkbox', - 'label' => $this->gettext('use_default_smtp_server'), - 'onclick' => 'identity_smtp_toggle_standard_server()' - ), - 'smtp_server' => array('type' => 'text', - 'label' => $this->gettext('smtp_server'), - 'class' => 'identity_smtp_form'), - 'smtp_port' => array('type' => 'text', - 'label' => $this->gettext('smtp_port'), - 'class' => 'identity_smtp_form'), - 'smtp_user' => array('type' => 'text', - 'label' => $this->gettext('smtp_user'), - 'class' => 'identity_smtp_form'), - 'smtp_pass' => array('type' => 'password', - 'label' => $this->gettext('smtp_pass'), - 'class' => 'identity_smtp_form') - ) - )); - if ($smtpSettingsRecord['smtp_standard'] || is_null($smtpSettingsRecord['smtp_standard'])) { - foreach ($smtpSettingsForm['smtpSettings']['content'] as &$input) { - if ($input['type'] != 'checkbox') { - $input['disabled'] = 'disabled'; - } - } - } - } - - $form = $form + $smtpSettingsForm; - $record = $record + $smtpSettingsRecord; - - $OUTPUT = array('form' => $form, - 'record' => $record); - return $OUTPUT; - } - - # This function is called when a new identity is created. We want to use the default smtp server here - function identityWasCreated($args) - { - $this->saveSmtpSettings($args); - return $args; - } - - # This function is called when the users saves a changed identity. It is responsible for saving the smtp settings - function identityWasUpdated($args) - { - $this->saveSmtpSettings($args); - return $args; - } - - function identityWasDeleted($args) - { - $smtpSettings = rcmail::get_instance()->config->get('identity_smtp'); - $id = $args['id']; - unset($smtpSettings[$id]); - rcmail::get_instance()->user->save_prefs(array('identity_smtp' => $smtpSettings)); - - # Return false to not abort the deletion of the identity - return false; - } - - function messageOutgoingHeaders($args) - { - $identities = rcmail::get_instance()->user->list_identities(); - foreach ($identities as $idx => $ident) { - if ($identities[$idx]['email'] == $args['headers']['X-Sender']) { - $this->from_identity = $identities[$idx]['identity_id']; - } - } - - return $args; - } - - # This function is called when an email is sent and it should pull the correct smtp settings for the used identity and insert them - function smtpWillConnect($args) - { - $smtpSettings = $this->loadSmtpSettings(array('identity_id' => $this->from_identity)); - if (!$smtpSettings['smtp_standard'] && !is_null($smtpSettings['smtp_standard'])) { - $args['smtp_server'] = $smtpSettings['smtp_server']; - $args['smtp_port'] = $smtpSettings['smtp_port']; - $args['smtp_user'] = $smtpSettings['smtp_user']; - $args['smtp_pass'] = rcmail::get_instance()->decrypt($smtpSettings['smtp_pass']); - } - return $args; - } - - # Ugly hack to make the password field a password field... - # FIX ME: Open a bug at trac.roundcube.net - function template_object_identityform($args) - { - $args['content'] = preg_replace('##', '' , $args['content']); - return $args; - } + public $task = 'mail|settings'; + private $from_identity; + + function init() + { + $this->include_script('identity_smtp.js'); + $this->add_texts('localization/', true); + + $this->add_hook('message_before_send', array( + $this, + 'messageBeforeSend' + )); + $this->add_hook('smtp_connect', array( + $this, + 'smtpWillConnect' + )); + $this->add_hook('identity_form', array( + $this, + 'identityFormWillBeDisplayed' + )); + $this->add_hook('identity_create', array( + $this, + 'identityWasCreated' + )); + $this->add_hook('identity_update', array( + $this, + 'identityWasUpdated' + )); + $this->add_hook('identity_delete', array( + $this, + 'identityWasDeleted' + )); + } + + function smtpLog($message) + { + rcube::write_log("identity_smtp_plugin", $message); + } + + function saveSmtpSettings($args) + { + $identities = rcmail::get_instance()->config->get('identity_smtp'); + $id = intval($args['id']); + + if (!isset($identities)) { + $identities = array(); + } + + $smtp_standard = rcube_utils::get_input_value('_smtp_standard', rcube_utils::INPUT_POST); + + $password = rcube_utils::get_input_value('_smtp_pass', rcube_utils::INPUT_POST, true); + $password2 = rcube_utils::get_input_value('_smtp_pass2', rcube_utils::INPUT_POST, true); + + if ($password != $password2) { + $args['abort'] = true; + $args['result'] = false; + $args['message'] = $this->gettext('smtp_passwords_mismatch'); + return $args; + } + + if ($password != $identities[$id]['smtp_pass']) { + $password = rcmail::get_instance()->encrypt($password); + } + + $smtpSettingsRecord = array( + 'smtp_standard' => isset($smtp_standard), + 'smtp_server' => rcube_utils::get_input_value('_smtp_server', rcube_utils::INPUT_POST), + 'smtp_port' => rcube_utils::get_input_value('_smtp_port', rcube_utils::INPUT_POST), + 'smtp_user' => rcube_utils::get_input_value('_smtp_user', rcube_utils::INPUT_POST), + 'smtp_pass' => $password + ); + + unset($identities[$id]); + $identities += array( + $id => $smtpSettingsRecord + ); + rcmail::get_instance()->user->save_prefs(array( + 'identity_smtp' => $identities + )); + + return $args; + } + + function loadSmtpSettings($args) + { + $smtpSettings = rcmail::get_instance()->config->get('identity_smtp'); + $id = intval($args['identity_id']); + $smtpSettingsRecord = array( + 'smtp_standard' => $smtpSettings[$id]['smtp_standard'], + 'smtp_server' => $smtpSettings[$id]['smtp_server'], + 'smtp_port' => $smtpSettings[$id]['smtp_port'], + 'smtp_user' => $smtpSettings[$id]['smtp_user'], + 'smtp_pass' => $smtpSettings[$id]['smtp_pass'], + 'smtp_pass2' => $smtpSettings[$id]['smtp_pass'] + ); + + if (is_null($smtpSettingsRecord['smtp_standard'])) { + $smtpSettingsRecord['smtp_standard'] = true; + } + + return $smtpSettingsRecord; + } + + function identityFormWillBeDisplayed($args) + { + $form = $args['form']; + $record = $args['record']; + + // Load the stored smtp settings + $smtpSettingsRecord = $this->loadSmtpSettings($record); + + if (!isset($record['identity_id'])) { + // FIX ME + $smtpSettingsForm = array( + 'smtpSettings' => array( + 'name' => $this->gettext('smtp_settings_header'), + 'content' => array( + 'text' => array( + 'label' => $this->gettext('smtp_settings_not_available'), + 'value' => ' ' + ) + ) + ) + ); + } else { + $smtpSettingsForm = array( + 'smtpSettings' => array( + 'name' => $this->gettext('smtp_settings_header'), + 'content' => array( + 'smtp_standard' => array( + 'type' => 'checkbox', + 'label' => $this->gettext('use_default_smtp_server'), + 'onclick' => 'identity_smtp_toggle_standard_server()' + ), + 'smtp_server' => array( + 'type' => 'text', + 'label' => $this->gettext('smtp_server'), + 'class' => 'identity_smtp_form', + 'size' => 40 + ), + 'smtp_port' => array( + 'type' => 'text', + 'label' => $this->gettext('smtp_port'), + 'class' => 'identity_smtp_form' + ), + 'smtp_user' => array( + 'type' => 'text', + 'label' => $this->gettext('smtp_user'), + 'class' => 'identity_smtp_form', + 'size' => 40 + ), + 'smtp_pass' => array( + 'type' => 'password', + 'label' => $this->gettext('smtp_pass'), + 'class' => 'identity_smtp_form', + 'size' => 40 + ), + 'smtp_pass2' => array( + 'type' => 'password', + 'label' => $this->gettext('smtp_pass2'), + 'class' => 'identity_smtp_form', + 'placeholder' => 'test', + 'size' => 40 + ) + ) + ) + ); + if ($smtpSettingsRecord['smtp_standard'] || is_null($smtpSettingsRecord['smtp_standard'])) { + foreach ($smtpSettingsForm['smtpSettings']['content'] as &$input) { + if ($input['type'] != 'checkbox') { + $input['disabled'] = 'disabled'; + } + } + } + } + $form = $form + $smtpSettingsForm; + $record = $record + $smtpSettingsRecord; + + $OUTPUT = array( + 'form' => $form, + 'record' => $record + ); + return $OUTPUT; + } + + // This function is called when a new identity is created. We want to use the default smtp server here + function identityWasCreated($args) + { + $args = $this->saveSmtpSettings($args); + return $args; + } + + // This function is called when the users saves a changed identity. It is responsible for saving the smtp settings + function identityWasUpdated($args) + { + $args = $this->saveSmtpSettings($args); + return $args; + } + + function identityWasDeleted($args) + { + $smtpSettings = rcmail::get_instance()->config->get('identity_smtp'); + $id = $args['id']; + unset($smtpSettings[$id]); + rcmail::get_instance()->user->save_prefs(array( + 'identity_smtp' => $smtpSettings + )); + + // Return false to not abort the deletion of the identity + return false; + } + + function messageBeforeSend($args) + { + $identities = rcmail::get_instance()->user->list_identities(); + foreach ($identities as $idx => $ident) { + if ($identities[$idx]['email'] == $args['from']) { + $this->from_identity = $identities[$idx]['identity_id']; + } + } + return $args; + } + + // This function is called when an email is sent and it should pull the correct smtp settings for the used identity and insert them + function smtpWillConnect($args) + { + $smtpSettings = $this->loadSmtpSettings(array( + 'identity_id' => $this->from_identity + )); + if (!$smtpSettings['smtp_standard'] && !is_null($smtpSettings['smtp_standard'])) { + $args['smtp_server'] = $smtpSettings['smtp_server']; + $args['smtp_port'] = $smtpSettings['smtp_port']; + $args['smtp_user'] = $smtpSettings['smtp_user']; + $args['smtp_pass'] = rcmail::get_instance()->decrypt($smtpSettings['smtp_pass']); + } + return $args; + } } ?> diff --git a/plugins/identity_smtp/localization/ca_ES.inc b/plugins/identity_smtp/localization/ca_ES.inc new file mode 100644 index 00000000..8532bbc7 --- /dev/null +++ b/plugins/identity_smtp/localization/ca_ES.inc @@ -0,0 +1,14 @@ + diff --git a/plugins/identity_smtp/localization/de_DE.inc b/plugins/identity_smtp/localization/de_DE.inc index d68bc876..047c6335 100644 --- a/plugins/identity_smtp/localization/de_DE.inc +++ b/plugins/identity_smtp/localization/de_DE.inc @@ -3,10 +3,12 @@ $labels = array(); $labels['smtp_settings_header'] = 'SMTP Einstellungen'; $labels['use_default_smtp_server'] = 'Den voreingestellten SMTP Server verwenden'; -$labels['smtp_server'] = 'Server IP/Hostname'; +$labels['smtp_server'] = 'Server IP/Hostname. (Für Verschlüsselung Präfix ssl:// oder tls:// nutzen)'; $labels['smtp_port'] = 'Server Port'; $labels['smtp_user'] = 'Benutzername'; $labels['smtp_pass'] = 'Passwort'; +$labels['smtp_pass2'] = 'Passwort wiederholen'; $labels['smtp_settings_not_available'] = 'Bitte erst speichern, bevor die SMTP Einstellungen vorgenommen werden können.'; +$labels['smtp_passwords_mismatch'] = 'Die eingegebenen Passworte stimmen nicht überein.'; ?> diff --git a/plugins/identity_smtp/localization/en_US.inc b/plugins/identity_smtp/localization/en_US.inc index 72796ba1..31de63e4 100644 --- a/plugins/identity_smtp/localization/en_US.inc +++ b/plugins/identity_smtp/localization/en_US.inc @@ -3,10 +3,12 @@ $labels = array(); $labels['smtp_settings_header'] = 'SMTP Settings'; $labels['use_default_smtp_server'] = 'Use the default SMTP server'; -$labels['smtp_server'] = 'Server IP/Hostname'; +$labels['smtp_server'] = 'Server IP/Hostname (For encryption use prefix ssl:// or tls://)'; $labels['smtp_port'] = 'Server Port'; $labels['smtp_user'] = 'Username'; $labels['smtp_pass'] = 'Password'; +$labels['smtp_pass2'] = 'Repeat Password'; $labels['smtp_settings_not_available'] = 'Please save first to edit the SMTP settings.'; +$labels['smtp_passwords_mismatch'] = 'The passwords do not match.'; ?> diff --git a/plugins/identity_smtp/localization/es_ES.inc b/plugins/identity_smtp/localization/es_ES.inc new file mode 100644 index 00000000..a1a08d4a --- /dev/null +++ b/plugins/identity_smtp/localization/es_ES.inc @@ -0,0 +1,14 @@ + diff --git a/plugins/identity_smtp/localization/fr_FR.inc b/plugins/identity_smtp/localization/fr_FR.inc new file mode 100644 index 00000000..5f270e47 --- /dev/null +++ b/plugins/identity_smtp/localization/fr_FR.inc @@ -0,0 +1,14 @@ + diff --git a/plugins/identity_smtp/localization/ja_JP.inc b/plugins/identity_smtp/localization/ja_JP.inc new file mode 100644 index 00000000..7150e843 --- /dev/null +++ b/plugins/identity_smtp/localization/ja_JP.inc @@ -0,0 +1,14 @@ + diff --git a/version.php b/version.php index cb45971a..6b3999a0 100644 --- a/version.php +++ b/version.php @@ -1,5 +1,5 @@ '2018.11.16', - 'version' => '0.0.56' + 'patch' => '2018.12.05', + 'version' => '0.0.57' ]; From 84717e6977657081807dc6729617d90f86f6192f Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Wed, 5 Dec 2018 13:35:41 +0100 Subject: [PATCH 06/38] Improved select and buttons css --- plugins/yetiforce/preview.css | 94 ++++++++++++++++++++++++------- plugins/yetiforce/preview.js | 8 ++- plugins/yetiforce/preview.min.css | 94 ++++++++++++++++++++++++------- plugins/yetiforce/preview.min.js | 8 ++- skins/yetiforce/yetiforce.css | 8 --- skins/yetiforce/yetiforce.min.css | 5 -- 6 files changed, 160 insertions(+), 57 deletions(-) diff --git a/plugins/yetiforce/preview.css b/plugins/yetiforce/preview.css index 03f1ade9..c6fe8c41 100644 --- a/plugins/yetiforce/preview.css +++ b/plugins/yetiforce/preview.css @@ -52,10 +52,7 @@ } #ytActionBarContent .pull-right button { - line-height: 10px; margin-left: 3px; - padding: 0 6px; - height: 14px } #ytActionBarContent .relatedModuleIcon { @@ -70,10 +67,18 @@ display: none; } +.d-none { + display: none; +} + .mr-5px { margin-right: 5px; } +.mr-3px { + margin-right: 3px; +} + .ml-5px { margin-left: 5px; } @@ -88,41 +93,88 @@ } .rowRelatedRecord { - background: white; - margin: 2px; + background: #bbdde8; + margin-left: 3px; border: 1px #c1c1c1 solid; - border-radius: 6px; - padding: 1px 5px; } .action-bar__head__container { display: flex; flex-wrap: nowrap; + width: fit-content; + margin-right: 5px; } -.action-bar__data { - padding: 0 2px 2px; - align-items: center; -} - -.action-bar__data a { +.action-bar__head a { text-decoration: none; color: #000; - line-height: 14px -} - -.action-bar__header { - font-size: 13px; - margin-right: 7px } .action-bar__head { - height: 20px; color: #fff; - padding: 5px 2px 4px; + padding: 0 2px 4px; + display: flex; + flex-wrap: wrap; +} + +.action-bar__head > * { + margin-top: 4px; } .action-bar__col { background-color: #4a5364; width: 100%; } + +.action-bar__select { + margin-left: 3px; +} + +.action-bar__select:required:invalid { + color: gray; +} + +.action-bar__select optgroup { + color: black; +} + +button, select, .rowRelatedRecord { + border-radius: .25rem; + padding: 0.1rem 0.2rem; +} + +button, select { + cursor: pointer; +} + +.rowActions { + display: inline-flex; + align-items: center; +} + +.rowActions button { + padding: 0.005rem 0.2rem; + margin-left: 5px; +} + +button { + display: inline-block; + background-color: #f8f9fa; + border-color: #f8f9fa; + font-weight: 400; + text-align: center; + white-space: nowrap; + vertical-align: middle; + user-select: none; + border: 1px solid transparent; + padding: 0.2rem 0.3rem; + border-radius: 0.25rem; + transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; +} + +button:hover { + color: #212529; + background-color: #e2e6ea; + border-color: #dae0e5; +} + diff --git a/plugins/yetiforce/preview.js b/plugins/yetiforce/preview.js index bde82cf7..29a4bdbb 100644 --- a/plugins/yetiforce/preview.js +++ b/plugins/yetiforce/preview.js @@ -103,6 +103,9 @@ function registerSelectRecord(content) { }; if ($(this).data('type') == 0) { var module = $(this).closest('.js-head-container').find('.module').val(); + if (module === null) { + return; + } } else { var module = $(this).data('module'); relParams.crmid = $(this).closest('.rowRelatedRecord').data('id'); @@ -131,7 +134,10 @@ function registerAddRecord(content) { var id = content.find('#mailActionBarID').val(); content.find('button.addRecord').click(function (e) { var col = $(e.currentTarget).closest('.js-head-container'); - showQuickCreateForm(col.find('.module').val(), id); + let selectValue = col.find('.module').val(); + if (selectValue !== null) { + showQuickCreateForm(selectValue, id); + } }); } diff --git a/plugins/yetiforce/preview.min.css b/plugins/yetiforce/preview.min.css index 03f1ade9..c6fe8c41 100644 --- a/plugins/yetiforce/preview.min.css +++ b/plugins/yetiforce/preview.min.css @@ -52,10 +52,7 @@ } #ytActionBarContent .pull-right button { - line-height: 10px; margin-left: 3px; - padding: 0 6px; - height: 14px } #ytActionBarContent .relatedModuleIcon { @@ -70,10 +67,18 @@ display: none; } +.d-none { + display: none; +} + .mr-5px { margin-right: 5px; } +.mr-3px { + margin-right: 3px; +} + .ml-5px { margin-left: 5px; } @@ -88,41 +93,88 @@ } .rowRelatedRecord { - background: white; - margin: 2px; + background: #bbdde8; + margin-left: 3px; border: 1px #c1c1c1 solid; - border-radius: 6px; - padding: 1px 5px; } .action-bar__head__container { display: flex; flex-wrap: nowrap; + width: fit-content; + margin-right: 5px; } -.action-bar__data { - padding: 0 2px 2px; - align-items: center; -} - -.action-bar__data a { +.action-bar__head a { text-decoration: none; color: #000; - line-height: 14px -} - -.action-bar__header { - font-size: 13px; - margin-right: 7px } .action-bar__head { - height: 20px; color: #fff; - padding: 5px 2px 4px; + padding: 0 2px 4px; + display: flex; + flex-wrap: wrap; +} + +.action-bar__head > * { + margin-top: 4px; } .action-bar__col { background-color: #4a5364; width: 100%; } + +.action-bar__select { + margin-left: 3px; +} + +.action-bar__select:required:invalid { + color: gray; +} + +.action-bar__select optgroup { + color: black; +} + +button, select, .rowRelatedRecord { + border-radius: .25rem; + padding: 0.1rem 0.2rem; +} + +button, select { + cursor: pointer; +} + +.rowActions { + display: inline-flex; + align-items: center; +} + +.rowActions button { + padding: 0.005rem 0.2rem; + margin-left: 5px; +} + +button { + display: inline-block; + background-color: #f8f9fa; + border-color: #f8f9fa; + font-weight: 400; + text-align: center; + white-space: nowrap; + vertical-align: middle; + user-select: none; + border: 1px solid transparent; + padding: 0.2rem 0.3rem; + border-radius: 0.25rem; + transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; +} + +button:hover { + color: #212529; + background-color: #e2e6ea; + border-color: #dae0e5; +} + diff --git a/plugins/yetiforce/preview.min.js b/plugins/yetiforce/preview.min.js index bde82cf7..29a4bdbb 100644 --- a/plugins/yetiforce/preview.min.js +++ b/plugins/yetiforce/preview.min.js @@ -103,6 +103,9 @@ function registerSelectRecord(content) { }; if ($(this).data('type') == 0) { var module = $(this).closest('.js-head-container').find('.module').val(); + if (module === null) { + return; + } } else { var module = $(this).data('module'); relParams.crmid = $(this).closest('.rowRelatedRecord').data('id'); @@ -131,7 +134,10 @@ function registerAddRecord(content) { var id = content.find('#mailActionBarID').val(); content.find('button.addRecord').click(function (e) { var col = $(e.currentTarget).closest('.js-head-container'); - showQuickCreateForm(col.find('.module').val(), id); + let selectValue = col.find('.module').val(); + if (selectValue !== null) { + showQuickCreateForm(selectValue, id); + } }); } diff --git a/skins/yetiforce/yetiforce.css b/skins/yetiforce/yetiforce.css index cabdf603..81a41a5e 100644 --- a/skins/yetiforce/yetiforce.css +++ b/skins/yetiforce/yetiforce.css @@ -192,10 +192,6 @@ table.messagelist.fixedcopy { flex-wrap: wrap; } -.rowRelatedRecord { - padding: 2px; -} - .action-bar__head__container { column-width: 310px; } @@ -203,19 +199,15 @@ table.messagelist.fixedcopy { .action-bar__data a { text-decoration: none; color: #000; - font-size: 14px; line-height: 14px } .action-bar__header { font-size: 13px; - align-self: center; - margin-right: 2px; } .action-bar__head { background-color: #4a5364; - height: 20px; color: #fff; padding: 2px; } diff --git a/skins/yetiforce/yetiforce.min.css b/skins/yetiforce/yetiforce.min.css index 59c25ec4..81a41a5e 100644 --- a/skins/yetiforce/yetiforce.min.css +++ b/skins/yetiforce/yetiforce.min.css @@ -192,10 +192,6 @@ table.messagelist.fixedcopy { flex-wrap: wrap; } -.rowRelatedRecord { - padding: 2px; -} - .action-bar__head__container { column-width: 310px; } @@ -212,7 +208,6 @@ table.messagelist.fixedcopy { .action-bar__head { background-color: #4a5364; - height: 20px; color: #fff; padding: 2px; } From 7d3496da6011e068ac66bce51b501e67b3995a98 Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Fri, 4 Jan 2019 16:03:15 +0100 Subject: [PATCH 07/38] Fixed choosing email when email column is not visible --- plugins/yetiforce/compose.js | 57 ++++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 19 deletions(-) diff --git a/plugins/yetiforce/compose.js b/plugins/yetiforce/compose.js index 35757294..b83746d9 100644 --- a/plugins/yetiforce/compose.js +++ b/plugins/yetiforce/compose.js @@ -46,6 +46,7 @@ window.rcmail && rcmail.addEventListener('init', function (evt) { }, true); // Selection of email with popup $('#composeheaders #yt_adress_buttons .button').click(function () { + console.log('como'); var mailField = $(this).attr('data-input'); var module = $(this).attr('data-module'); window.crm.app.showRecordsList({ @@ -56,30 +57,45 @@ window.rcmail && rcmail.addEventListener('init', function (evt) { }, (modal, instance) => { instance.setSelectEvent((responseData, e) => { let emails = []; - if (typeof e.target !== 'undefined' && $(e.target).data('type') === 'email') { + let aDeferred = $.Deferred(); + let emailData = { + setValue(emails) { + let value = $('#' + mailField).val(); + if (value != '' && value.charAt(value.length - 1) != ',') { + value = value + ','; + } + $('#' + mailField).val(value + emails.join(',')); + } + }; + aDeferred.promise(emailData); + if (typeof e.target !== 'undefined' && ($(e.target).data('type') === 'email' || $(e.target).data('type') === 'multiEmail')) { emails.push($(e.target).text()); + aDeferred.resolve(emails); } else { - $.each(responseData, function (id, fields) { - $.each(fields, function (key, row) { - if (row.type === 'email') { - emails.push(row.value); - return false; + let i = 0; + for (let id in responseData) { + window.crm.app.getRecordDetails({ + record: id, + module: module, + fieldType: ['email', 'multiEmail'] + }).done((data) => { + i++; + emails.push(data.result.data.email); + if (i === Object.keys(responseData).length) { + aDeferred.resolve(emails); } }); - }); - } - if (emails.length === 0) { - window.crm.Vtiger_Helper_Js.showPnotify({ - text: window.crm.app.vtranslate('NoFindEmailInRecord'), - animation: 'show' - }); - } else { - let value = $('#' + mailField).val(); - if (value != '' && value.charAt(value.length - 1) != ',') { - value = value + ','; } - $('#' + mailField).val(value + emails.join(',')); } + emailData.done((emails) => { + emailData.setValue(emails); + if (emails.length === 0) { + window.crm.Vtiger_Helper_Js.showPnotify({ + text: window.crm.app.vtranslate('NoFindEmailInRecord'), + animation: 'show' + }); + } + }); }); }); }); @@ -96,7 +112,10 @@ window.rcmail && rcmail.addEventListener('init', function (evt) { $.each(data, function (index, value) { jQuery('#vtmodulemenulink').removeClass('disabled'); jQuery('#tplmenulink').removeClass('disabled'); - tmp.push({name: value.moduleName, label: value.moduleName}); + tmp.push({ + name: value.moduleName, + label: value.moduleName + }); jQuery('#tplmenu #texttplsmenu').append('
  • ' + value.name + '
  • '); }); From a54eecfb9bf97dd6c52c605ca1e3885766c1f624 Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Fri, 4 Jan 2019 17:10:27 +0100 Subject: [PATCH 08/38] Push only one e-mail address and added check for multiemail --- plugins/yetiforce/compose.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/plugins/yetiforce/compose.js b/plugins/yetiforce/compose.js index b83746d9..d41b5052 100644 --- a/plugins/yetiforce/compose.js +++ b/plugins/yetiforce/compose.js @@ -80,8 +80,26 @@ window.rcmail && rcmail.addEventListener('init', function (evt) { fieldType: ['email', 'multiEmail'] }).done((data) => { i++; - emails.push(data.result.data.email); - if (i === Object.keys(responseData).length) { + let mailObj = data.result.data; + if (mailObj.email) { + emails.push(mailObj.email); + } else if (mailObj.secondary_email) { + emails.push(mailObj.secondary_email); + } else { + for (let key in mailObj) { + if (key !== 'secondary_email' && key !== 'email' && mailObj[key]) { + let multiEmail = JSON.parse(mailObj[key]); + if (typeof multiEmail === 'object') { + for (let i in multiEmail) { + emails.push(multiEmail[i].e); + } + } else { + emails.push(multiEmail); + } + } + } + } + if (i === Object.keys(responseData).length) { //last iteration aDeferred.resolve(emails); } }); From 5d0c78c0c4e493ccd7a20a0bb5fdfd800b9ef8c2 Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Fri, 4 Jan 2019 17:18:51 +0100 Subject: [PATCH 09/38] Refactored adding other mail addresses --- plugins/yetiforce/compose.js | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/plugins/yetiforce/compose.js b/plugins/yetiforce/compose.js index d41b5052..d1a20e62 100644 --- a/plugins/yetiforce/compose.js +++ b/plugins/yetiforce/compose.js @@ -86,18 +86,7 @@ window.rcmail && rcmail.addEventListener('init', function (evt) { } else if (mailObj.secondary_email) { emails.push(mailObj.secondary_email); } else { - for (let key in mailObj) { - if (key !== 'secondary_email' && key !== 'email' && mailObj[key]) { - let multiEmail = JSON.parse(mailObj[key]); - if (typeof multiEmail === 'object') { - for (let i in multiEmail) { - emails.push(multiEmail[i].e); - } - } else { - emails.push(multiEmail); - } - } - } + emails.push(getOtherMailAddresses(mailObj)); } if (i === Object.keys(responseData).length) { //last iteration aDeferred.resolve(emails); @@ -117,6 +106,24 @@ window.rcmail && rcmail.addEventListener('init', function (evt) { }); }); }); + + function getOtherMailAddresses(mailObj) { + let emails = []; + for (let key in mailObj) { + if (key !== 'secondary_email' && key !== 'email' && mailObj[key]) { + let multiEmail = JSON.parse(mailObj[key]); + if (typeof multiEmail === 'object') { + for (let i in multiEmail) { + emails.push(multiEmail[i].e); + } + } else { + emails.push(multiEmail); + } + } + } + return emails; + } + //Loading list of modules with templates mail if (rcmail.env.isPermittedMailTemplates) { jQuery.ajax({ From dc3a802c1bcdf1f74630f19fa3b47f51acdd73df Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Fri, 4 Jan 2019 17:50:06 +0100 Subject: [PATCH 10/38] Refactored and cleaned code --- plugins/yetiforce/compose.js | 87 ++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 44 deletions(-) diff --git a/plugins/yetiforce/compose.js b/plugins/yetiforce/compose.js index d1a20e62..cde5932d 100644 --- a/plugins/yetiforce/compose.js +++ b/plugins/yetiforce/compose.js @@ -46,7 +46,6 @@ window.rcmail && rcmail.addEventListener('init', function (evt) { }, true); // Selection of email with popup $('#composeheaders #yt_adress_buttons .button').click(function () { - console.log('como'); var mailField = $(this).attr('data-input'); var module = $(this).attr('data-module'); window.crm.app.showRecordsList({ @@ -56,46 +55,12 @@ window.rcmail && rcmail.addEventListener('init', function (evt) { additionalInformations: true }, (modal, instance) => { instance.setSelectEvent((responseData, e) => { - let emails = []; - let aDeferred = $.Deferred(); - let emailData = { - setValue(emails) { - let value = $('#' + mailField).val(); - if (value != '' && value.charAt(value.length - 1) != ',') { - value = value + ','; - } - $('#' + mailField).val(value + emails.join(',')); + getEmailAddresses(responseData, e, module).done((emails) => { + let value = $('#' + mailField).val(); + if (value != '' && value.charAt(value.length - 1) != ',') { + value = value + ','; } - }; - aDeferred.promise(emailData); - if (typeof e.target !== 'undefined' && ($(e.target).data('type') === 'email' || $(e.target).data('type') === 'multiEmail')) { - emails.push($(e.target).text()); - aDeferred.resolve(emails); - } else { - let i = 0; - for (let id in responseData) { - window.crm.app.getRecordDetails({ - record: id, - module: module, - fieldType: ['email', 'multiEmail'] - }).done((data) => { - i++; - let mailObj = data.result.data; - if (mailObj.email) { - emails.push(mailObj.email); - } else if (mailObj.secondary_email) { - emails.push(mailObj.secondary_email); - } else { - emails.push(getOtherMailAddresses(mailObj)); - } - if (i === Object.keys(responseData).length) { //last iteration - aDeferred.resolve(emails); - } - }); - } - } - emailData.done((emails) => { - emailData.setValue(emails); + $('#' + mailField).val(value + emails.join(',')); if (emails.length === 0) { window.crm.Vtiger_Helper_Js.showPnotify({ text: window.crm.app.vtranslate('NoFindEmailInRecord'), @@ -107,17 +72,51 @@ window.rcmail && rcmail.addEventListener('init', function (evt) { }); }); - function getOtherMailAddresses(mailObj) { + function getEmailAddresses(responseData, e, module) { + let aDeferred = $.Deferred(), + emails = []; + if (typeof e.target !== 'undefined' && ($(e.target).data('type') === 'email' || $(e.target).data('type') === 'multiEmail')) { + emails.push($(e.target).text()); + aDeferred.resolve(emails); + } else { + let i = 0; + for (let id in responseData) { + window.crm.app.getRecordDetails({ + record: id, + module: module, + fieldType: ['email', 'multiEmail'] + }).done((data) => { + i++; + let mailObj = data.result.data; + if (mailObj.email) { + emails.push(mailObj.email); + } else if (mailObj.secondary_email) { + emails.push(mailObj.secondary_email); + } else { + emails.push(getOtherEmailAddresses(mailObj)); + } + if (i === Object.keys(responseData).length) { //last iteration + aDeferred.resolve(emails); + } + }); + } + } + return aDeferred.promise(); + } + + function getOtherEmailAddresses(mailObj) { let emails = []; for (let key in mailObj) { if (key !== 'secondary_email' && key !== 'email' && mailObj[key]) { - let multiEmail = JSON.parse(mailObj[key]); - if (typeof multiEmail === 'object') { + if (window.crm.app.isJsonString(mailObj[key])) { + let multiEmail = JSON.parse(mailObj[key]); for (let i in multiEmail) { emails.push(multiEmail[i].e); } + break; } else { - emails.push(multiEmail); + emails.push(mailObj[key]); + break; } } } From f8103bb4dc26ab070fa4d48698e7a74c1fefdd81 Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Mon, 7 Jan 2019 08:30:33 +0100 Subject: [PATCH 11/38] Changed checking email fields' names to pushing first found address --- plugins/yetiforce/compose.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/plugins/yetiforce/compose.js b/plugins/yetiforce/compose.js index cde5932d..e8fa1a82 100644 --- a/plugins/yetiforce/compose.js +++ b/plugins/yetiforce/compose.js @@ -87,14 +87,7 @@ window.rcmail && rcmail.addEventListener('init', function (evt) { fieldType: ['email', 'multiEmail'] }).done((data) => { i++; - let mailObj = data.result.data; - if (mailObj.email) { - emails.push(mailObj.email); - } else if (mailObj.secondary_email) { - emails.push(mailObj.secondary_email); - } else { - emails.push(getOtherEmailAddresses(mailObj)); - } + emails.push(getFirstEmailAddress(data.result.data)); if (i === Object.keys(responseData).length) { //last iteration aDeferred.resolve(emails); } @@ -104,10 +97,10 @@ window.rcmail && rcmail.addEventListener('init', function (evt) { return aDeferred.promise(); } - function getOtherEmailAddresses(mailObj) { + function getFirstEmailAddress(mailObj) { let emails = []; for (let key in mailObj) { - if (key !== 'secondary_email' && key !== 'email' && mailObj[key]) { + if (mailObj[key]) { if (window.crm.app.isJsonString(mailObj[key])) { let multiEmail = JSON.parse(mailObj[key]); for (let i in multiEmail) { From 6b1495e8bce849eb0cb53e317a22fb05cad27c7b Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Mon, 7 Jan 2019 08:47:28 +0100 Subject: [PATCH 12/38] Cleaned code --- plugins/yetiforce/compose.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/yetiforce/compose.js b/plugins/yetiforce/compose.js index e8fa1a82..3a395848 100644 --- a/plugins/yetiforce/compose.js +++ b/plugins/yetiforce/compose.js @@ -56,12 +56,13 @@ window.rcmail && rcmail.addEventListener('init', function (evt) { }, (modal, instance) => { instance.setSelectEvent((responseData, e) => { getEmailAddresses(responseData, e, module).done((emails) => { - let value = $('#' + mailField).val(); - if (value != '' && value.charAt(value.length - 1) != ',') { - value = value + ','; - } - $('#' + mailField).val(value + emails.join(',')); - if (emails.length === 0) { + if (emails.length) { + let value = $('#' + mailField).val(); + if (value != '' && value.charAt(value.length - 1) != ',') { + value = value + ','; + } + $('#' + mailField).val(value + emails.join(',')); + } else { window.crm.Vtiger_Helper_Js.showPnotify({ text: window.crm.app.vtranslate('NoFindEmailInRecord'), animation: 'show' From b822a584b5a4f169d81145bd29364aeac6462565 Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Mon, 7 Jan 2019 08:58:57 +0100 Subject: [PATCH 13/38] Updated and added min.js files --- plugins/yetiforce/colResizable.min.js | 4 + plugins/yetiforce/colResizable.min.js.map | 1 + plugins/yetiforce/compose.min.js | 10 + plugins/yetiforce/compose.min.js.map | 1 + plugins/yetiforce/list.min.js | 43 +--- plugins/yetiforce/list.min.js.map | 1 + plugins/yetiforce/preview.min.js | 297 +--------------------- plugins/yetiforce/preview.min.js.map | 1 + 8 files changed, 29 insertions(+), 329 deletions(-) create mode 100644 plugins/yetiforce/colResizable.min.js create mode 100644 plugins/yetiforce/colResizable.min.js.map create mode 100644 plugins/yetiforce/compose.min.js create mode 100644 plugins/yetiforce/compose.min.js.map create mode 100644 plugins/yetiforce/list.min.js.map create mode 100644 plugins/yetiforce/preview.min.js.map diff --git a/plugins/yetiforce/colResizable.min.js b/plugins/yetiforce/colResizable.min.js new file mode 100644 index 00000000..d0a98704 --- /dev/null +++ b/plugins/yetiforce/colResizable.min.js @@ -0,0 +1,4 @@ +'use strict'; + +(function($){var S,d=$(document),h=$("head"),drag=null,tables={},count=0,I=parseInt,M=Math,ie=0 .JColResizer{table-layout:fixed;} .JColResizer > tbody > tr > td, .JColResizer > tbody > tr > th{overflow:hidden;padding-left:0!important; padding-right:0!important;} .JCLRgrips{ height:0px; position:relative;} .JCLRgrip{margin-left:-5px; position:absolute; z-index:5; } .JCLRgrip .JColResizer{position:absolute;background-color:red;filter:alpha(opacity=1);opacity:0;width:10px;height:100%;cursor: e-resize;top:0px} .JCLRLastGrip{position:absolute; width:1px; } .JCLRgripDrag{ border-left:1px dotted black;\t} .JCLRFlex{width:auto!important;} .JCLRgrip.JCLRdisabledGrip .JColResizer{cursor:default; display:none;}");var init=function(tb,options){var t=$(tb);if(t.opt=options,t.mode=options.resizeMode,t.dc=t.opt.disabledColumns,t.opt.disable)return destroy(t);var id=t.id=t.attr("id")||"JColResizer"+count++;t.p=t.opt.postbackSafe,t.is("table")&&(!tables[id]||t.opt.partialRefresh)&&("e-resize"!==t.opt.hoverCursor&&h.append(""),t.addClass("JColResizer").attr("id",id).before("
    "),t.g=[],t.c=[],t.w=t.width(),t.gc=t.prev(),t.f=t.opt.fixed,options.marginLeft&&t.gc.css("marginLeft",options.marginLeft),options.marginRight&&t.gc.css("marginRight",options.marginRight),t.cs=I(ie?tb.cellSpacing||tb.currentStyle.borderSpacing:t.css("border-spacing"))||2,t.b=I(ie?tb.border||tb.currentStyle.borderLeftWidth:t.css("border-left-width"))||1,tables[id]=t,createGrips(t));},destroy=function(t){var id=t.attr("id"),t=tables[id];t&&t.is("table")&&(t.removeClass("JColResizer JCLRFlex").gc.remove(),delete tables[id]);},createGrips=function(t){var th=t.find(">thead>tr:first>th,>thead>tr:first>td");th.length||(th=t.find(">tbody>tr:first>th,>tr:first>th,>tbody>tr:first>td, >tr:first>td")),th=th.filter(":visible"),t.cg=t.find("col"),t.ln=th.length,t.p&&S&&S[t.id]&&memento(t,th),th.each(function(i){var c=$(this),dc=-1!=t.dc.indexOf(i),g=$(t.gc.append("
    ")[0].lastChild);g.append(dc?"":t.opt.gripInnerHtml).append("
    "),i==t.ln-1&&(g.addClass("JCLRLastGrip"),t.f&&g.html("")),g.bind("touchstart mousedown",onGripMouseDown),dc?g.addClass("JCLRdisabledGrip"):g.removeClass("JCLRdisabledGrip").bind("touchstart mousedown",onGripMouseDown),g.t=t,g.i=i,g.c=c,c.w=c.width(),t.g.push(g),t.c.push(c),c.width(c.w).removeAttr("width"),g.data("JColResizer",{i:i,t:t.attr("id"),last:i==t.ln-1});}),t.cg.removeAttr("width"),t.find("td, th").not(th).not("table th, table td").each(function(){$(this).removeAttr("width");}),t.f||t.removeAttr("width").addClass("JCLRFlex"),syncGrips(t);},memento=function(t,th){var w,tw,m=0,i=0,aux=[];if(th){if(t.cg.removeAttr("width"),t.opt.flush)return void(S[t.id]="");for(w=S[t.id].split(";"),tw=w[t.ln+1],!t.f&&tw&&(t.width(tw*=1),t.opt.overflow&&(t.css("min-width",tw+"px"),t.w=tw));i*{cursor:"+t.opt.dragCursor+"!important}"),g.addClass(t.opt.draggingClass),drag=g,t.c[o.i].l)for(var c,i=0;i0;\n\tvar S;\n\ttry{S = sessionStorage;}catch(e){}\t//Firefox crashes when executed as local file system\n\t\n\t//append required CSS rules \n h.append(\"\");\n\n\t\n\t/**\n\t * Function to allow column resizing for table objects. It is the starting point to apply the plugin.\n\t * @param {DOM node} tb - reference to the DOM table object to be enhanced\n\t * @param {Object} options\t- some customization values\n\t */\n\tvar init = function( tb, options){\t\n\t\tvar t = $(tb);\t\t\t\t //the table object is wrapped\n t.opt = options; //each table has its own options available at anytime\n t.mode = options.resizeMode; //shortcuts\n t.dc = t.opt.disabledColumns;\n\t\tif(t.opt.disable) return destroy(t);\t\t\t\t//the user is asking to destroy a previously colResized table\n\t\tvar\tid = t.id = t.attr(ID) || SIGNATURE+count++;\t//its id is obtained, if null new one is generated\t\t\n\t\tt.p = t.opt.postbackSafe; \t\t\t\t\t\t\t//short-cut to detect postback safe \t\t\n\t\tif(!t.is(\"table\") || tables[id] && !t.opt.partialRefresh) return; \t\t//if the object is not a table or if it was already processed then it is ignored.\n\t\tif (t.opt.hoverCursor !== 'e-resize') h.append(\"\"); //if hoverCursor has been set, append the style\n\t\tt.addClass(SIGNATURE).attr(ID, id).before('
    ');\t//the grips container object is added. Signature class forces table rendering in fixed-layout mode to prevent column's min-width\n\t\tt.g = []; t.c = []; t.w = t.width(); t.gc = t.prev(); t.f=t.opt.fixed;\t//t.c and t.g are arrays of columns and grips respectively\t\t\t\t\n\t\tif(options.marginLeft) t.gc.css(\"marginLeft\", options.marginLeft); \t//if the table contains margins, it must be specified\n\t\tif(options.marginRight) t.gc.css(\"marginRight\", options.marginRight); \t//since there is no (direct) way to obtain margin values in its original units (%, em, ...)\n\t\tt.cs = I(ie? tb.cellSpacing || tb.currentStyle.borderSpacing :t.css('border-spacing'))||2;\t//table cellspacing (not even jQuery is fully cross-browser)\n\t\tt.b = I(ie? tb.border || tb.currentStyle.borderLeftWidth :t.css('border-left-width'))||1;\t//outer border width (again cross-browser issues)\n\t\t// if(!(tb.style.width || tb.width)) t.width(t.width()); //I am not an IE fan at all, but it is a pity that only IE has the currentStyle attribute working as expected. For this reason I can not check easily if the table has an explicit width or if it is rendered as \"auto\"\n\t\ttables[id] = t; \t//the table object is stored using its id as key\t\n\t\tcreateGrips(t);\t\t//grips are created \n\t\n\t};\n\n\n\t/**\n\t * This function allows to remove any enhancements performed by this plugin on a previously processed table.\n\t * @param {jQuery ref} t - table object\n\t */\n\tvar destroy = function(t){\n\t\tvar id=t.attr(ID), t=tables[id];\t\t//its table object is found\n\t\tif(!t||!t.is(\"table\")) return;\t\t\t//if none, then it wasn't processed\t \n\t\tt.removeClass(SIGNATURE+\" \"+FLEX).gc.remove();\t//class and grips are removed\n\t\tdelete tables[id];\t\t\t\t\t\t//clean up data\n\t};\n\n\n\t/**\n\t * Function to create all the grips associated with the table given by parameters \n\t * @param {jQuery ref} t - table object\n\t */\n\tvar createGrips = function(t){\t\n\t\n var th = t.find(\">thead>tr:first>th,>thead>tr:first>td\"); //table headers are obtained\n\t\tif(!th.length) th = t.find(\">tbody>tr:first>th,>tr:first>th,>tbody>tr:first>td, >tr:first>td\");\t //but headers can also be included in different ways\n\t\tth = th.filter(\":visible\");\t\t\t\t\t//filter invisible columns\n\t\tt.cg = t.find(\"col\"); \t\t\t\t\t\t//a table can also contain a colgroup with col elements\t\t\n\t\tt.ln = th.length;\t\t\t\t\t\t\t//table length is stored\t\n\t\tif(t.p && S && S[t.id])memento(t,th);\t\t//if 'postbackSafe' is enabled and there is data for the current table, its coloumn layout is restored\n\t\tth.each(function(i){\t\t\t\t\t\t//iterate through the table column headers\t\t\t\n\t\t\tvar c = $(this); \t\t\t\t\t\t//jquery wrap for the current column\t\t\n var dc = t.dc.indexOf(i)!=-1; //is this a disabled column?\n\t\t\tvar g = $(t.gc.append('
    ')[0].lastChild); //add the visual node to be used as grip\n g.append(dc ? \"\": t.opt.gripInnerHtml).append('
    ');\n if(i == t.ln-1){ //if the current grip is the las one \n g.addClass(\"JCLRLastGrip\"); //add a different css class to stlye it in a different way if needed\n if(t.f) g.html(\"\"); //if the table resizing mode is set to fixed, the last grip is removed since table with can not change\n }\n g.bind('touchstart mousedown', onGripMouseDown); //bind the mousedown event to start dragging \n \n if (!dc){ \n //if normal column bind the mousedown event to start dragging, if disabled then apply its css class\n g.removeClass('JCLRdisabledGrip').bind('touchstart mousedown', onGripMouseDown); \n }else{\n g.addClass('JCLRdisabledGrip'); \n }\n\n\t\t\tg.t = t; g.i = i; g.c = c;\tc.w =c.width();\t\t//some values are stored in the grip's node data as shortcut\n\t\t\tt.g.push(g); t.c.push(c);\t\t\t\t\t\t//the current grip and column are added to its table object\n\t\t\tc.width(c.w).removeAttr(\"width\");\t\t\t\t//the width of the column is converted into pixel-based measurements\n\t\t\tg.data(SIGNATURE, {i:i, t:t.attr(ID), last: i == t.ln-1});\t //grip index and its table name are stored in the HTML \t\t\t\t\t\t\t\t\t\t\t\t\n\t\t}); \t\n\t\tt.cg.removeAttr(\"width\");\t//remove the width attribute from elements in the colgroup \n\n\t\tt.find('td, th').not(th).not('table th, table td').each(function(){ \n\t\t\t$(this).removeAttr('width');\t//the width attribute is removed from all table cells which are not nested in other tables and dont belong to the header\n\t\t});\t\t\n if(!t.f){\n t.removeAttr('width').addClass(FLEX); //if not fixed, let the table grow as needed\n }\n syncGrips(t); \t\t\t\t//the grips are positioned according to the current table layout\t\t\t\n //there is a small problem, some cells in the table could contain dimension values interfering with the \n //width value set by this plugin. Those values are removed\n\t\t\n\t};\n\t\n \n\t/**\n\t * Function to allow the persistence of columns dimensions after a browser postback. It is based in\n\t * the HTML5 sessionStorage object, which can be emulated for older browsers using sessionstorage.js\n\t * @param {jQuery ref} t - table object\n\t * @param {jQuery ref} th - reference to the first row elements (only set in deserialization)\n\t */\n\tvar memento = function(t, th){ \n\t\tvar w,m=0,i=0,aux =[],tw;\n\t\tif(th){\t\t\t\t\t\t\t\t\t\t//in deserialization mode (after a postback)\n\t\t\tt.cg.removeAttr(\"width\");\n\t\t\tif(t.opt.flush){ S[t.id] =\"\"; return;} \t//if flush is activated, stored data is removed\n\t\t\tw = S[t.id].split(\";\");\t\t\t\t\t//column widths is obtained\n\t\t\ttw = w[t.ln+1];\n if(!t.f && tw){\t\t\t\t\t\t\t//if not fixed and table width data available its size is restored\n t.width(tw*=1);\n if(t.opt.overflow) {\t\t\t\t//if overfolw flag is set, restore table width also as table min-width\n t.css('min-width', tw + PX);\n t.w = tw;\n }\n }\n\t\t\tfor(;i*{cursor:\"+ t.opt.dragCursor +\"!important}\"); \t//change the mouse cursor\n\t\tg.addClass(t.opt.draggingClass); \t//add the dragging class (to allow some visual feedback)\t\t\t\t\n\t\tdrag = g;\t\t\t\t\t\t\t//the current grip is stored as the current dragging object\n\t\tif(t.c[o.i].l) for(var i=0,c; i'+value.name+'');}),$.each(tmp,function(index,value){-1==jQuery.inArray(value.name,modules)&&(jQuery('#vtmodulemenu .toolbarmenu').append('
  • '+value.label+'
  • '),modules.push(value.name));});}}),jQuery('#vtmodulemenu li a').on('click',function(){var selectModule=jQuery(this).data('module');selectModule==null?jQuery('#tplmenu li').show():(jQuery('#tplmenu li.'+selectModule).show(),jQuery('#tplmenu li').not('.'+selectModule).hide());}),rcmail.env.crmModule!=null&&jQuery('#vtmodulemenu li.'+rcmail.env.crmModule+' a').trigger('click'),jQuery('#tplmenu li a').on('click',function(){var id=jQuery(this).data('tplid'),recordId=rcmail.env.crmRecord,module=rcmail.env.crmModule,view=rcmail.env.crmView;if('List'==view){var chElement=jQuery(crm.document).find('.listViewEntriesCheckBox')[0];recordId=jQuery(chElement).val();}jQuery.ajax({type:'Get',url:'?_task=mail&_action=plugin.yetiforce.getConntentEmailTemplate&_id='+rcmail.env.compose_id,data:{id:id,record_id:recordId,select_module:module},success:function success(data){data=JSON.parse(data);var oldSubject=jQuery('[name="_subject"]').val(),html=jQuery('
    ').html(data.content).html();if(jQuery('[name="_subject"]').val(oldSubject+' '+data.subject),window.tinyMCE&&(ed=tinyMCE.get(rcmail.env.composebody))){var oldBody=tinyMCE.activeEditor.getContent();tinymce.activeEditor.setContent(html+oldBody);}else{var oldBody=jQuery('#composebody').val();jQuery('#composebody').val(html+oldBody);}'undefined'!=typeof data.attachments&&null!==data.attachments&&rcmail.command('yetiforce.addFilesToMail',data.attachments);}});});});function getCrmWindow(){if(null!==opener)return opener.parent;return !('object'!=_typeof(parent.app))&&parent} +//# sourceMappingURL=compose.min.js.map diff --git a/plugins/yetiforce/compose.min.js.map b/plugins/yetiforce/compose.min.js.map new file mode 100644 index 00000000..cbd2bbd9 --- /dev/null +++ b/plugins/yetiforce/compose.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"compose.min.js","sources":["compose.js"],"sourcesContent":["/* {[The file is published on the basis of MIT License]} */\n\nwindow.rcmail && rcmail.addEventListener('init', function (evt) {\n\n\tvar crm = window.crm = getCrmWindow();\n\tvar crmPath = rcmail.env.site_URL + 'index.php?';\n\n\trcmail.env.compose_commands.push('yetiforce.addFilesToMail');\n\trcmail.env.compose_commands.push('yetiforce.addFilesFromCRM');\n\n\t// Document selection\n\trcmail.register_command('yetiforce.addFilesToMail', function (data) {\n\t\tvar ts = new Date().getTime(),\n\t\t\tframe_name = 'rcmupload' + ts,\n\t\t\tframe = rcmail.async_upload_form_frame(frame_name);\n\t\tdata._uploadid = ts;\n\t\tjQuery.ajax({\n\t\t\turl: \"?_task=mail&_action=plugin.yetiforce.addFilesToMail&_id=\" + rcmail.env.compose_id,\n\t\t\ttype: \"POST\",\n\t\t\tdata: data,\n\t\t\tsuccess: function (data) {\n\t\t\t\tvar doc = frame[0];\n\t\t\t\tvar body = $(doc);\n\t\t\t\tbody.html(data);\n\t\t\t}\n\t\t});\n\t}, true);\n\n\t// Add a document to an email crm\n\trcmail.register_command('yetiforce.addFilesFromCRM', function (data) {\n\t\tif (crm != false) {\n\t\t\twindow.crm.app.showRecordsList({\n\t\t\t\tmodule: 'Documents',\n\t\t\t\tsrc_module: 'Documents',\n\t\t\t\tmulti_select: true,\n\t\t\t\tadditionalInformations: true\n\t\t\t}, (modal, instance) => {\n\t\t\t\tinstance.setSelectEvent((responseData) => {\n\t\t\t\t\trcmail.command('yetiforce.addFilesToMail', {\n\t\t\t\t\t\tids: Object.keys(responseData),\n\t\t\t\t\t\t_uploadid: new Date().getTime()\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}, true);\n\t// Selection of email with popup\n\t$('#composeheaders #yt_adress_buttons .button').click(function () {\n\t\tvar mailField = $(this).attr('data-input');\n\t\tvar module = $(this).attr('data-module');\n\t\twindow.crm.app.showRecordsList({\n\t\t\tmodule: module,\n\t\t\tsrc_module: 'OSSMail',\n\t\t\tmulti_select: true,\n\t\t\tadditionalInformations: true\n\t\t}, (modal, instance) => {\n\t\t\tinstance.setSelectEvent((responseData, e) => {\n\t\t\t\tgetEmailAddresses(responseData, e, module).done((emails) => {\n\t\t\t\t\tif (emails.length) {\n\t\t\t\t\t\tlet value = $('#' + mailField).val();\n\t\t\t\t\t\tif (value != '' && value.charAt(value.length - 1) != ',') {\n\t\t\t\t\t\t\tvalue = value + ',';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$('#' + mailField).val(value + emails.join(','));\n\t\t\t\t\t} else {\n\t\t\t\t\t\twindow.crm.Vtiger_Helper_Js.showPnotify({\n\t\t\t\t\t\t\ttext: window.crm.app.vtranslate('NoFindEmailInRecord'),\n\t\t\t\t\t\t\tanimation: 'show'\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t});\n\n\tfunction getEmailAddresses(responseData, e, module) {\n\t\tlet aDeferred = $.Deferred(),\n\t\t\temails = [];\n\t\tif (typeof e.target !== 'undefined' && ($(e.target).data('type') === 'email' || $(e.target).data('type') === 'multiEmail')) {\n\t\t\temails.push($(e.target).text());\n\t\t\taDeferred.resolve(emails);\n\t\t} else {\n\t\t\tlet i = 0;\n\t\t\tfor (let id in responseData) {\n\t\t\t\twindow.crm.app.getRecordDetails({\n\t\t\t\t\trecord: id,\n\t\t\t\t\tmodule: module,\n\t\t\t\t\tfieldType: ['email', 'multiEmail']\n\t\t\t\t}).done((data) => {\n\t\t\t\t\ti++;\n\t\t\t\t\temails.push(getFirstEmailAddress(data.result.data));\n\t\t\t\t\tif (i === Object.keys(responseData).length) { //last iteration\n\t\t\t\t\t\taDeferred.resolve(emails);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn aDeferred.promise();\n\t}\n\n\tfunction getFirstEmailAddress(mailObj) {\n\t\tlet emails = [];\n\t\tfor (let key in mailObj) {\n\t\t\tif (mailObj[key]) {\n\t\t\t\tif (window.crm.app.isJsonString(mailObj[key])) {\n\t\t\t\t\tlet multiEmail = JSON.parse(mailObj[key]);\n\t\t\t\t\tfor (let i in multiEmail) {\n\t\t\t\t\t\temails.push(multiEmail[i].e);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\temails.push(mailObj[key]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn emails;\n\t}\n\n\t//Loading list of modules with templates mail\n\tif (rcmail.env.isPermittedMailTemplates) {\n\t\tjQuery.ajax({\n\t\t\ttype: 'Get',\n\t\t\turl: \"?_task=mail&_action=plugin.yetiforce.getEmailTemplates&_id=\" + rcmail.env.compose_id,\n\t\t\tasync: false,\n\t\t\tsuccess: function (data) {\n\t\t\t\tvar modules = [];\n\t\t\t\tvar tmp = [];\n\t\t\t\tdata = JSON.parse(data);\n\t\t\t\t$.each(data, function (index, value) {\n\t\t\t\t\tjQuery('#vtmodulemenulink').removeClass('disabled');\n\t\t\t\t\tjQuery('#tplmenulink').removeClass('disabled');\n\t\t\t\t\ttmp.push({\n\t\t\t\t\t\tname: value.moduleName,\n\t\t\t\t\t\tlabel: value.moduleName\n\t\t\t\t\t});\n\t\t\t\t\tjQuery('#tplmenu #texttplsmenu').append('
  • ' + value.name + '
  • ');\n\t\t\t\t});\n\n\t\t\t\t$.each(tmp, function (index, value) {\n\t\t\t\t\tif (jQuery.inArray(value.name, modules) == -1) {\n\t\t\t\t\t\tjQuery('#vtmodulemenu .toolbarmenu').append('
  • ' + value.label + '
  • ');\n\t\t\t\t\t\tmodules.push(value.name);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t}\n\t\t});\n\t}\n\t// Limit the list of templates\n\tjQuery('#vtmodulemenu li a').on('click', function () {\n\t\tvar selectModule = jQuery(this).data('module');\n\t\tif (selectModule == undefined) {\n\t\t\tjQuery('#tplmenu li').show();\n\t\t} else {\n\t\t\tjQuery('#tplmenu li.' + selectModule).show();\n\t\t\tjQuery('#tplmenu li').not(\".\" + selectModule).hide();\n\t\t}\n\t});\n\n\tif (rcmail.env.crmModule != undefined) {\n\t\tjQuery('#vtmodulemenu li.' + rcmail.env.crmModule + ' a').trigger(\"click\");\n\t}\n\n\t// Loading a template mail\n\tjQuery('#tplmenu li a').on('click', function () {\n\t\tvar id = jQuery(this).data('tplid');\n\t\tvar recordId = rcmail.env.crmRecord,\n\t\t\tmodule = rcmail.env.crmModule,\n\t\t\tview = rcmail.env.crmView;\n\t\tif (view == 'List') {\n\t\t\tvar chElement = jQuery(crm.document).find('.listViewEntriesCheckBox')[0];\n\t\t\trecordId = jQuery(chElement).val();\n\t\t}\n\t\tjQuery.ajax({\n\t\t\ttype: 'Get',\n\t\t\turl: \"?_task=mail&_action=plugin.yetiforce.getConntentEmailTemplate&_id=\" + rcmail.env.compose_id,\n\t\t\tdata: {\n\t\t\t\tid: id,\n\t\t\t\trecord_id: recordId,\n\t\t\t\tselect_module: module\n\t\t\t},\n\t\t\tsuccess: function (data) {\n\t\t\t\tdata = JSON.parse(data);\n\t\t\t\tvar oldSubject = jQuery('[name=\"_subject\"]').val();\n\t\t\t\tvar html = jQuery(\"
    \").html(data.content).html();\n\t\t\t\tjQuery('[name=\"_subject\"]').val(oldSubject + ' ' + data.subject);\n\t\t\t\tif (window.tinyMCE && (ed = tinyMCE.get(rcmail.env.composebody))) {\n\t\t\t\t\tvar oldBody = tinyMCE.activeEditor.getContent();\n\t\t\t\t\ttinymce.activeEditor.setContent(html + oldBody);\n\t\t\t\t} else {\n\t\t\t\t\tvar oldBody = jQuery('#composebody').val();\n\t\t\t\t\tjQuery('#composebody').val(html + oldBody);\n\t\t\t\t}\n\t\t\t\tif (typeof data.attachments !== 'undefined' && data.attachments !== null) {\n\t\t\t\t\trcmail.command('yetiforce.addFilesToMail', data.attachments);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n});\n\nfunction getCrmWindow() {\n\tif (opener !== null) {\n\t\treturn opener.parent;\n\t} else if (typeof parent.app == \"object\") {\n\t\treturn parent;\n\t}\n\treturn false;\n}\n"],"names":["window","rcmail","addEventListener","responseData","e","module","$","Deferred","emails","target","data","push","text","aDeferred","resolve","crm","app","getRecordDetails","record","id","fieldType","done","i","getFirstEmailAddress","result","Object","keys","length","promise","mailObj","key","isJsonString","JSON","parse","multiEmail","getCrmWindow","crmPath","env","site_URL","compose_commands","register_command","getTime","frame","async_upload_form_frame","ts","_uploadid","jQuery","ajax","url","compose_id","type","success","body","doc","html","showRecordsList","src_module","multi_select","additionalInformations","modal","instance","setSelectEvent","command","ids","click","attr","getEmailAddresses","mailField","val","charAt","value","join","Vtiger_Helper_Js","showPnotify","vtranslate","animation","isPermittedMailTemplates","async","tmp","each","index","removeClass","name","moduleName","label","append","inArray","modules","on","selectModule","show","not","hide","crmModule","trigger","recordId","crmRecord","view","crmView","document","find","chElement","record_id","select_module","content","oldSubject","subject","tinyMCE","ed","get","composebody","activeEditor","getContent","tinymce","setContent","oldBody","attachments","parent"],"mappings":";;;;;;;;AAEAA,OAAOC,MAAP,EAAiBA,OAAOC,gBAAP,CAAwB,MAAxB,CAAgC,UAAe,CAyE/D,0BAAA,CAA2BC,YAA3B,CAAyCC,CAAzC,CAA4CC,MAA5C,CAAoD,CACnD,cAAgBC,EAAEC,QAAF,EAAhB,CACCC,OAAS,EADV,CAqBA,OAnBwB,WAApB,WAASC,MAAT,GAAiE,OAA7B,KAAEL,EAAEK,MAAJ,EAAYC,IAAZ,CAAiB,MAAjB,GAAqE,YAA7B,KAAEN,EAAEK,MAAJ,EAAYC,IAAZ,CAAiB,MAAjB,CAA5E,CAmBJ,EAlBCF,OAAOG,IAAP,CAAYL,EAAEF,EAAEK,MAAJ,EAAYG,IAAZ,EAAZ,CAkBD,CAjBCC,UAAUC,OAAV,CAAkBN,MAAlB,CAiBD,aAfC,MAAQ,CAAR,CACA,IAAK,MAAL,gBAAA,CACCR,OAAOe,GAAP,CAAWC,GAAX,CAAeC,gBAAf,CAAgC,CAC/BC,OAAQC,EADuB,CAE/Bd,OAAQA,MAFuB,CAG/Be,UAAW,CAAC,OAAD,CAAU,YAAV,CAHoB,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BA,CAlCD,EAmCA,CAtMgB,EAwMjB,qBAAA,EAAwB,CACvB,GAAe,IAAX,SAAJ,CACC,cAAcC,MAAd,CAFsB,SAGS,QAArB,UAAOA,OAAOrG,GAAd,CAHY,GAIfqG,MAGR"} \ No newline at end of file diff --git a/plugins/yetiforce/list.min.js b/plugins/yetiforce/list.min.js index 012aa833..d2ec0e6c 100644 --- a/plugins/yetiforce/list.min.js +++ b/plugins/yetiforce/list.min.js @@ -1,41 +1,4 @@ -/* {[The file is published on the basis of MIT License]} */ -window.rcmail && rcmail.addEventListener('listupdate', function (evt) { - //window.crm = getCrmWindow(); - rcmail.register_command('yetiforce.importICS', function (ics, element, e) { +'use strict'; - }, true); - var container = $('#messagelistcontainer'); - var headerFixed = container.find('.records-table.messagelist.sortheader.fixedheader.fixedcopy'); - var messageList = container.find('#messagelist'); - /* - var columnsWidth = window.crm.app.moduleCacheGet('widthColumns'); - if (columnsWidth != null) { - messageList.find('th,td').each(function (index) { - $(this).width(columnsWidth[index]); - }); - headerFixed.find('th,td').each(function (index) { - $(this).width(columnsWidth[index]); - }); - } - */ - /* - headerFixed.colResizable({ - onResize: function (e) { - resizeContentTable(headerFixed, messageList, e); - }, - resizeMode:'fit' - }); - */ -}); - -function resizeContentTable(headerFixed, messageList, e) { - var column_widths = []; - headerFixed.find('thead th,thead td').each(function (index) { - column_widths[index] = $(this).width(); - }); - messageList.find('th,td').each(function (index) { - $(this).width(column_widths[index]); - }); - window.crm.app.moduleCacheSet('widthColumns', column_widths); - $(window).scroll(); -} +window.rcmail&&rcmail.addEventListener('listupdate',function(){rcmail.register_command('yetiforce.importICS',function(){},!0);var container=$('#messagelistcontainer'),headerFixed=container.find('.records-table.messagelist.sortheader.fixedheader.fixedcopy'),messageList=container.find('#messagelist');}); +//# sourceMappingURL=list.min.js.map diff --git a/plugins/yetiforce/list.min.js.map b/plugins/yetiforce/list.min.js.map new file mode 100644 index 00000000..512e2784 --- /dev/null +++ b/plugins/yetiforce/list.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"list.min.js","sources":["list.js"],"sourcesContent":["/* {[The file is published on the basis of MIT License]} */\nwindow.rcmail && rcmail.addEventListener('listupdate', function (evt) {\n\t//window.crm = getCrmWindow();\n\trcmail.register_command('yetiforce.importICS', function (ics, element, e) {\n\n\t}, true);\n\tvar container = $('#messagelistcontainer');\n\tvar headerFixed = container.find('.records-table.messagelist.sortheader.fixedheader.fixedcopy');\n\tvar messageList = container.find('#messagelist');\n\t/*\n\t var columnsWidth = window.crm.app.moduleCacheGet('widthColumns');\n\t if (columnsWidth != null) {\n\t messageList.find('th,td').each(function (index) {\n\t $(this).width(columnsWidth[index]);\n\t });\n\t headerFixed.find('th,td').each(function (index) {\n\t $(this).width(columnsWidth[index]);\n\t });\n\t }\n\t */\n\t/*\n\t headerFixed.colResizable({\n\t onResize: function (e) {\n\t resizeContentTable(headerFixed, messageList, e);\n\t },\n\t resizeMode:'fit'\n\t });\n\t */\n});\n\nfunction resizeContentTable(headerFixed, messageList, e)\n{\n\tvar column_widths = [];\n\theaderFixed.find('thead th,thead td').each(function (index) {\n\t\tcolumn_widths[index] = $(this).width();\n\t});\n\tmessageList.find('th,td').each(function (index) {\n\t\t$(this).width(column_widths[index]);\n\t});\n\twindow.crm.app.moduleCacheSet('widthColumns', column_widths);\n\t$(window).scroll();\n}\n"],"names":["window","rcmail","addEventListener","register_command","$","headerFixed","container","find","messageList"],"mappings":";;AACAA,OAAOC,MAAP,EAAiBA,OAAOC,gBAAP,CAAwB,YAAxB,CAAsC,UAAe,CAErED,OAAOE,gBAAP,CAAwB,qBAAxB,CAA+C,UAA2B,EAA1E,IAFqE,eAKrDC,EAAE,uBAAF,CALqD,CAMjEC,YAAcC,UAAUC,IAAV,CAAe,6DAAf,CANmD,CAOjEC,YAAcF,UAAUC,IAAV,CAAe,cAAf,EAoBlB,CA3BgB,EA6BjB"} \ No newline at end of file diff --git a/plugins/yetiforce/preview.min.js b/plugins/yetiforce/preview.min.js index 29a4bdbb..c8fd1c74 100644 --- a/plugins/yetiforce/preview.min.js +++ b/plugins/yetiforce/preview.min.js @@ -1,291 +1,10 @@ -/* {[The file is published on the basis of MIT License]} */ -window.rcmail && rcmail.addEventListener('init', function (evt) { - window.crm = getCrmWindow(); - loadActionBar(); - rcmail.env.message_commands.push('yetiforce.importICS'); - rcmail.register_command('yetiforce.importICS', function (ics, element, e) { - window.crm.AppConnector.request({ - async: true, - dataType: 'json', - data: { - module: 'Calendar', - action: 'ImportICS', - ics: ics - } - }).done(function (response) { - window.crm.Vtiger_Helper_Js.showPnotify({ - text: response['result'], - type: 'info', - animation: 'show' - }); - $(element).closest('.icalattachments').remove(); - }) - }, true); - } -); +'use strict'; -function loadActionBar() { - var content = $('#ytActionBarContent'); - var params = { - module: 'OSSMail', - view: 'MailActionBar', - uid: rcmail.env.uid, - folder: rcmail.env.mailbox, - rcId: rcmail.env.user_id - }; - window.crm.AppConnector.request(params).done(function (response) { - content.find('.ytHeader').html(response); - $('#messagecontent').css('top', (content.outerHeight() + $('#messageheader').outerHeight()) + 'px'); - registerEvents(content); - }); -} +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; +} : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; +}; -function registerEvents(content) { - registerAddRecord(content); - registerAddReletedRecord(content); - registerSelectRecord(content); - registerRemoveRecord(content); - registerImportMail(content); - - var block = content.find('.ytHeader .js-data'); - content.find('.hideBtn').click(function () { - var button = $(this); - var icon = button.find('.glyphicon'); - - if (button.data('type') == '0') { - button.data('type', '1'); - icon.removeClass("glyphicon-chevron-up").addClass("glyphicon-chevron-down"); - } else { - button.data('type', '0'); - icon.removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-up"); - } - block.toggle(); - $(window).trigger("resize"); - }); -} - -function registerImportMail(content) { - content.find('.importMail').click(function (e) { - window.crm.Vtiger_Helper_Js.showPnotify({ - text: window.crm.app.vtranslate('StartedDownloadingEmail'), - type: 'info' - }); - window.crm.AppConnector.request({ - module: 'OSSMail', - action: 'ImportMail', - params: { - uid: rcmail.env.uid, - folder: rcmail.env.mailbox, - rcId: rcmail.env.user_id - } - }).done(function (data) { - loadActionBar(); - window.crm.Vtiger_Helper_Js.showPnotify({ - text: window.crm.app.vtranslate('AddFindEmailInRecord'), - type: 'success' - }); - }) - }); -} - -function registerRemoveRecord(content) { - content.find('button.removeRecord').click(function (e) { - var row = $(e.currentTarget).closest('.rowRelatedRecord'); - removeRecord(row.data('id')); - }); -} - -function registerSelectRecord(content) { - let id = content.find('#mailActionBarID').val(); - content.find('button.selectRecord').click(function (e) { - let relParams = { - mailId: id - }; - if ($(this).data('type') == 0) { - var module = $(this).closest('.js-head-container').find('.module').val(); - if (module === null) { - return; - } - } else { - var module = $(this).data('module'); - relParams.crmid = $(this).closest('.rowRelatedRecord').data('id'); - relParams.mod = $(this).closest('.rowRelatedRecord').data('module'); - relParams.newModule = module; - } - showPopup({ - module: module, - src_module: 'OSSMailView', - src_record: id, - }, relParams); - }); -} - -function registerAddReletedRecord(content) { - var id = content.find('#mailActionBarID').val(); - content.find('button.addRelatedRecord').click(function (e) { - var targetElement = $(e.currentTarget); - var row = targetElement.closest('.rowRelatedRecord'); - var params = {sourceModule: row.data('module')}; - showQuickCreateForm(targetElement.data('module'), row.data('id'), params); - }); -} - -function registerAddRecord(content) { - var id = content.find('#mailActionBarID').val(); - content.find('button.addRecord').click(function (e) { - var col = $(e.currentTarget).closest('.js-head-container'); - let selectValue = col.find('.module').val(); - if (selectValue !== null) { - showQuickCreateForm(selectValue, id); - } - }); -} - -function removeRecord(crmid) { - var id = $('#mailActionBarID').val(); - var params = {} - params.data = { - module: 'OSSMail', - action: 'ExecuteActions', - mode: 'removeRelated', - params: { - mailId: id, - crmid: crmid - } - } - params.async = false; - params.dataType = 'json'; - window.crm.AppConnector.request(params).done(function (data) { - var response = data['result']; - if (response['success']) { - var notifyParams = { - text: response['data'], - type: 'info', - animation: 'show' - }; - } else { - var notifyParams = { - text: response['data'], - animation: 'show' - }; - } - window.crm.Vtiger_Helper_Js.showPnotify(notifyParams); - loadActionBar(); - }); -} - -function showPopup(params, actionsParams) { - actionsParams['newModule'] = params['module']; - window.crm.app.showRecordsList(params, (modal, instance) => { - instance.setSelectEvent((responseData, e) => { - actionsParams['newCrmId'] = responseData.id; - window.crm.AppConnector.request({ - async: false, - dataType: 'json', - data: { - module: 'OSSMail', - action: 'ExecuteActions', - mode: 'addRelated', - params: actionsParams - } - }).done(function (data) { - let response = data['result']; - if (response['success']) { - var notifyParams = { - text: response['data'], - type: 'info', - animation: 'show' - }; - } else { - var notifyParams = { - text: response['data'], - animation: 'show' - }; - } - window.crm.Vtiger_Helper_Js.showPnotify(notifyParams); - loadActionBar(); - }); - }); - }); -} - -function showQuickCreateForm(moduleName, record, params) { - var content = $('#ytActionBarContent'); - if (params == undefined) { - var params = {}; - } - var relatedParams = {}; - if (params['sourceModule']) { - var sourceModule = params['sourceModule']; - } else { - var sourceModule = 'OSSMailView'; - } - var postShown = function (data) { - var index, queryParam, queryParamComponents; - $('').appendTo(data); - $('').appendTo(data); - $('').appendTo(data); - } - var ids = { - link: 'modulesLevel0', - process: 'modulesLevel1', - subprocess: 'modulesLevel2', - linkextend: 'modulesLevel3' - }; - for (var i in ids) { - var element = content.find('#' + ids[i]); - var value = element.length ? JSON.parse(element.val()) : []; - if ($.inArray(sourceModule, value) >= 0) { - relatedParams[i] = record; - } - } - if (moduleName == 'Leads') { - relatedParams['company'] = rcmail.env.fromName; - } - if (moduleName == 'Leads' || moduleName == 'Contacts') { - relatedParams['lastname'] = rcmail.env.fromName; - } - if (moduleName == 'Project') { - relatedParams['projectname'] = rcmail.env.subject; - } - if (moduleName == 'HelpDesk') { - relatedParams['ticket_title'] = rcmail.env.subject; - } - if (moduleName == 'Products') { - relatedParams['productname'] = rcmail.env.subject; - } - if (moduleName == 'Services') { - relatedParams['servicename'] = rcmail.env.subject; - } - relatedParams['email'] = rcmail.env.fromMail; - relatedParams['email1'] = rcmail.env.fromMail; - relatedParams['description'] = $('#messagebody').text(); - //relatedParams['related_to'] = record; - var postQuickCreate = function (data) { - loadActionBar(); - } - relatedParams['sourceModule'] = sourceModule; - relatedParams['sourceRecord'] = record; - relatedParams['relationOperation'] = true; - var quickCreateParams = { - callbackFunction: postQuickCreate, - callbackPostShown: postShown, - data: relatedParams, - noCache: true - }; - var headerInstance = new window.crm.Vtiger_Header_Js(); - headerInstance.quickCreateModule(moduleName, quickCreateParams); -} - -function getCrmWindow() { - if (opener !== null && opener.parent.CONFIG == "object") { - return opener.parent; - } else if (typeof parent.CONFIG == "object") { - return parent; - } else if (typeof parent.parent.CONFIG == "object") { - return parent.parent; - } else if (typeof opener.crm.CONFIG == "object") { - return opener.crm; - } - return false; -} +window.rcmail&&rcmail.addEventListener('init',function(){window.crm=getCrmWindow(),loadActionBar(),rcmail.env.message_commands.push('yetiforce.importICS'),rcmail.register_command('yetiforce.importICS',function(ics,element){window.crm.AppConnector.request({async:!0,dataType:'json',data:{module:'Calendar',action:'ImportICS',ics:ics}}).done(function(response){window.crm.Vtiger_Helper_Js.showPnotify({text:response.result,type:'info',animation:'show'}),$(element).closest('.icalattachments').remove();});},!0);});function loadActionBar(){var content=$('#ytActionBarContent'),params={module:'OSSMail',view:'MailActionBar',uid:rcmail.env.uid,folder:rcmail.env.mailbox,rcId:rcmail.env.user_id};window.crm.AppConnector.request(params).done(function(response){content.find('.ytHeader').html(response),$('#messagecontent').css('top',content.outerHeight()+$('#messageheader').outerHeight()+'px'),registerEvents(content);});}function registerEvents(content){registerAddRecord(content),registerAddReletedRecord(content),registerSelectRecord(content),registerRemoveRecord(content),registerImportMail(content);var block=content.find('.ytHeader .js-data');content.find('.hideBtn').click(function(){var button=$(this),icon=button.find('.glyphicon');'0'==button.data('type')?(button.data('type','1'),icon.removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down')):(button.data('type','0'),icon.removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up')),block.toggle(),$(window).trigger('resize');});}function registerImportMail(content){content.find('.importMail').click(function(){window.crm.Vtiger_Helper_Js.showPnotify({text:window.crm.app.vtranslate('StartedDownloadingEmail'),type:'info'}),window.crm.AppConnector.request({module:'OSSMail',action:'ImportMail',params:{uid:rcmail.env.uid,folder:rcmail.env.mailbox,rcId:rcmail.env.user_id}}).done(function(){loadActionBar(),window.crm.Vtiger_Helper_Js.showPnotify({text:window.crm.app.vtranslate('AddFindEmailInRecord'),type:'success'});});});}function registerRemoveRecord(content){content.find('button.removeRecord').click(function(e){var row=$(e.currentTarget).closest('.rowRelatedRecord');removeRecord(row.data('id'));});}function registerSelectRecord(content){var id=content.find('#mailActionBarID').val();content.find('button.selectRecord').click(function(){var relParams={mailId:id};if(0==$(this).data('type')){var module=$(this).closest('.js-head-container').find('.module').val();if(null===module)return}else{var module=$(this).data('module');relParams.crmid=$(this).closest('.rowRelatedRecord').data('id'),relParams.mod=$(this).closest('.rowRelatedRecord').data('module'),relParams.newModule=module;}showPopup({module:module,src_module:'OSSMailView',src_record:id},relParams);});}function registerAddReletedRecord(content){content.find('#mailActionBarID').val();content.find('button.addRelatedRecord').click(function(e){var targetElement=$(e.currentTarget),row=targetElement.closest('.rowRelatedRecord'),params={sourceModule:row.data('module')};showQuickCreateForm(targetElement.data('module'),row.data('id'),params);});}function registerAddRecord(content){var id=content.find('#mailActionBarID').val();content.find('button.addRecord').click(function(e){var col=$(e.currentTarget).closest('.js-head-container'),selectValue=col.find('.module').val();null!==selectValue&&showQuickCreateForm(selectValue,id);});}function removeRecord(crmid){var id=$('#mailActionBarID').val(),params={};params.data={module:'OSSMail',action:'ExecuteActions',mode:'removeRelated',params:{mailId:id,crmid:crmid}},params.async=!1,params.dataType='json',window.crm.AppConnector.request(params).done(function(data){var response=data.result;if(response.success)var notifyParams={text:response.data,type:'info',animation:'show'};else var notifyParams={text:response.data,animation:'show'};window.crm.Vtiger_Helper_Js.showPnotify(notifyParams),loadActionBar();});}function showPopup(params,actionsParams){actionsParams.newModule=params.module,window.crm.app.showRecordsList(params,function(modal,instance){instance.setSelectEvent(function(responseData){actionsParams.newCrmId=responseData.id,window.crm.AppConnector.request({async:!1,dataType:'json',data:{module:'OSSMail',action:'ExecuteActions',mode:'addRelated',params:actionsParams}}).done(function(data){var response=data.result;if(response.success)var notifyParams={text:response.data,type:'info',animation:'show'};else var notifyParams={text:response.data,animation:'show'};window.crm.Vtiger_Helper_Js.showPnotify(notifyParams),loadActionBar();});});});}function showQuickCreateForm(moduleName,record,params){var content=$('#ytActionBarContent');var relatedParams={};if(false)var sourceModule=params.sourceModule;else var sourceModule='OSSMailView';var postShown=function(data){$('').appendTo(data),$('').appendTo(data),$('').appendTo(data);},ids={link:'modulesLevel0',process:'modulesLevel1',subprocess:'modulesLevel2',linkextend:'modulesLevel3'};for(var i in ids){var element=content.find('#'+ids[i]),value=element.length?JSON.parse(element.val()):[];0<=$.inArray(sourceModule,value)&&(relatedParams[i]=record);}'Leads'==moduleName&&(relatedParams.company=rcmail.env.fromName),('Leads'==moduleName||'Contacts'==moduleName)&&(relatedParams.lastname=rcmail.env.fromName),'Project'==moduleName&&(relatedParams.projectname=rcmail.env.subject),'HelpDesk'==moduleName&&(relatedParams.ticket_title=rcmail.env.subject),'Products'==moduleName&&(relatedParams.productname=rcmail.env.subject),'Services'==moduleName&&(relatedParams.servicename=rcmail.env.subject),relatedParams.email=rcmail.env.fromMail,relatedParams.email1=rcmail.env.fromMail,relatedParams.description=$('#messagebody').text();relatedParams.sourceModule=sourceModule,relatedParams.sourceRecord=record,relatedParams.relationOperation=!0;var headerInstance=new window.crm.Vtiger_Header_Js;headerInstance.quickCreateModule(moduleName,{callbackFunction:function postQuickCreate(){loadActionBar();},callbackPostShown:postShown,data:relatedParams,noCache:!0});}function getCrmWindow(){if(null!==opener&&'object'==opener.parent.CONFIG)return opener.parent;return 'object'==_typeof(parent.CONFIG)?parent:'object'==_typeof(parent.parent.CONFIG)?parent.parent:!('object'!=_typeof(opener.crm.CONFIG))&&opener.crm} +//# sourceMappingURL=preview.min.js.map diff --git a/plugins/yetiforce/preview.min.js.map b/plugins/yetiforce/preview.min.js.map new file mode 100644 index 00000000..083ed189 --- /dev/null +++ b/plugins/yetiforce/preview.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"preview.min.js","sources":["preview.js"],"sourcesContent":["/* {[The file is published on the basis of MIT License]} */\nwindow.rcmail && rcmail.addEventListener('init', function (evt) {\n\t\twindow.crm = getCrmWindow();\n\t\tloadActionBar();\n\t\trcmail.env.message_commands.push('yetiforce.importICS');\n\t\trcmail.register_command('yetiforce.importICS', function (ics, element, e) {\n\t\t\twindow.crm.AppConnector.request({\n\t\t\t\tasync: true,\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: {\n\t\t\t\t\tmodule: 'Calendar',\n\t\t\t\t\taction: 'ImportICS',\n\t\t\t\t\tics: ics\n\t\t\t\t}\n\t\t\t}).done(function (response) {\n\t\t\t\twindow.crm.Vtiger_Helper_Js.showPnotify({\n\t\t\t\t\ttext: response['result'],\n\t\t\t\t\ttype: 'info',\n\t\t\t\t\tanimation: 'show'\n\t\t\t\t});\n\t\t\t\t$(element).closest('.icalattachments').remove();\n\t\t\t})\n\t\t}, true);\n\t}\n);\n\nfunction loadActionBar() {\n\tvar content = $('#ytActionBarContent');\n\tvar params = {\n\t\tmodule: 'OSSMail',\n\t\tview: 'MailActionBar',\n\t\tuid: rcmail.env.uid,\n\t\tfolder: rcmail.env.mailbox,\n\t\trcId: rcmail.env.user_id\n\t};\n\twindow.crm.AppConnector.request(params).done(function (response) {\n\t\tcontent.find('.ytHeader').html(response);\n\t\t$('#messagecontent').css('top', (content.outerHeight() + $('#messageheader').outerHeight()) + 'px');\n\t\tregisterEvents(content);\n\t});\n}\n\nfunction registerEvents(content) {\n\tregisterAddRecord(content);\n\tregisterAddReletedRecord(content);\n\tregisterSelectRecord(content);\n\tregisterRemoveRecord(content);\n\tregisterImportMail(content);\n\n\tvar block = content.find('.ytHeader .js-data');\n\tcontent.find('.hideBtn').click(function () {\n\t\tvar button = $(this);\n\t\tvar icon = button.find('.glyphicon');\n\n\t\tif (button.data('type') == '0') {\n\t\t\tbutton.data('type', '1');\n\t\t\ticon.removeClass(\"glyphicon-chevron-up\").addClass(\"glyphicon-chevron-down\");\n\t\t} else {\n\t\t\tbutton.data('type', '0');\n\t\t\ticon.removeClass(\"glyphicon-chevron-down\").addClass(\"glyphicon-chevron-up\");\n\t\t}\n\t\tblock.toggle();\n\t\t$(window).trigger(\"resize\");\n\t});\n}\n\nfunction registerImportMail(content) {\n\tcontent.find('.importMail').click(function (e) {\n\t\twindow.crm.Vtiger_Helper_Js.showPnotify({\n\t\t\ttext: window.crm.app.vtranslate('StartedDownloadingEmail'),\n\t\t\ttype: 'info'\n\t\t});\n\t\twindow.crm.AppConnector.request({\n\t\t\tmodule: 'OSSMail',\n\t\t\taction: 'ImportMail',\n\t\t\tparams: {\n\t\t\t\tuid: rcmail.env.uid,\n\t\t\t\tfolder: rcmail.env.mailbox,\n\t\t\t\trcId: rcmail.env.user_id\n\t\t\t}\n\t\t}).done(function (data) {\n\t\t\tloadActionBar();\n\t\t\twindow.crm.Vtiger_Helper_Js.showPnotify({\n\t\t\t\ttext: window.crm.app.vtranslate('AddFindEmailInRecord'),\n\t\t\t\ttype: 'success'\n\t\t\t});\n\t\t})\n\t});\n}\n\nfunction registerRemoveRecord(content) {\n\tcontent.find('button.removeRecord').click(function (e) {\n\t\tvar row = $(e.currentTarget).closest('.rowRelatedRecord');\n\t\tremoveRecord(row.data('id'));\n\t});\n}\n\nfunction registerSelectRecord(content) {\n\tlet id = content.find('#mailActionBarID').val();\n\tcontent.find('button.selectRecord').click(function (e) {\n\t\tlet relParams = {\n\t\t\tmailId: id\n\t\t};\n\t\tif ($(this).data('type') == 0) {\n\t\t\tvar module = $(this).closest('.js-head-container').find('.module').val();\n\t\t\tif (module === null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tvar module = $(this).data('module');\n\t\t\trelParams.crmid = $(this).closest('.rowRelatedRecord').data('id');\n\t\t\trelParams.mod = $(this).closest('.rowRelatedRecord').data('module');\n\t\t\trelParams.newModule = module;\n\t\t}\n\t\tshowPopup({\n\t\t\tmodule: module,\n\t\t\tsrc_module: 'OSSMailView',\n\t\t\tsrc_record: id,\n\t\t}, relParams);\n\t});\n}\n\nfunction registerAddReletedRecord(content) {\n\tvar id = content.find('#mailActionBarID').val();\n\tcontent.find('button.addRelatedRecord').click(function (e) {\n\t\tvar targetElement = $(e.currentTarget);\n\t\tvar row = targetElement.closest('.rowRelatedRecord');\n\t\tvar params = {sourceModule: row.data('module')};\n\t\tshowQuickCreateForm(targetElement.data('module'), row.data('id'), params);\n\t});\n}\n\nfunction registerAddRecord(content) {\n\tvar id = content.find('#mailActionBarID').val();\n\tcontent.find('button.addRecord').click(function (e) {\n\t\tvar col = $(e.currentTarget).closest('.js-head-container');\n\t\tlet selectValue = col.find('.module').val();\n\t\tif (selectValue !== null) {\n\t\t\tshowQuickCreateForm(selectValue, id);\n\t\t}\n\t});\n}\n\nfunction removeRecord(crmid) {\n\tvar id = $('#mailActionBarID').val();\n\tvar params = {}\n\tparams.data = {\n\t\tmodule: 'OSSMail',\n\t\taction: 'ExecuteActions',\n\t\tmode: 'removeRelated',\n\t\tparams: {\n\t\t\tmailId: id,\n\t\t\tcrmid: crmid\n\t\t}\n\t}\n\tparams.async = false;\n\tparams.dataType = 'json';\n\twindow.crm.AppConnector.request(params).done(function (data) {\n\t\tvar response = data['result'];\n\t\tif (response['success']) {\n\t\t\tvar notifyParams = {\n\t\t\t\ttext: response['data'],\n\t\t\t\ttype: 'info',\n\t\t\t\tanimation: 'show'\n\t\t\t};\n\t\t} else {\n\t\t\tvar notifyParams = {\n\t\t\t\ttext: response['data'],\n\t\t\t\tanimation: 'show'\n\t\t\t};\n\t\t}\n\t\twindow.crm.Vtiger_Helper_Js.showPnotify(notifyParams);\n\t\tloadActionBar();\n\t});\n}\n\nfunction showPopup(params, actionsParams) {\n\tactionsParams['newModule'] = params['module'];\n\twindow.crm.app.showRecordsList(params, (modal, instance) => {\n\t\tinstance.setSelectEvent((responseData, e) => {\n\t\t\tactionsParams['newCrmId'] = responseData.id;\n\t\t\twindow.crm.AppConnector.request({\n\t\t\t\tasync: false,\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: {\n\t\t\t\t\tmodule: 'OSSMail',\n\t\t\t\t\taction: 'ExecuteActions',\n\t\t\t\t\tmode: 'addRelated',\n\t\t\t\t\tparams: actionsParams\n\t\t\t\t}\n\t\t\t}).done(function (data) {\n\t\t\t\tlet response = data['result'];\n\t\t\t\tif (response['success']) {\n\t\t\t\t\tvar notifyParams = {\n\t\t\t\t\t\ttext: response['data'],\n\t\t\t\t\t\ttype: 'info',\n\t\t\t\t\t\tanimation: 'show'\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tvar notifyParams = {\n\t\t\t\t\t\ttext: response['data'],\n\t\t\t\t\t\tanimation: 'show'\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\twindow.crm.Vtiger_Helper_Js.showPnotify(notifyParams);\n\t\t\t\tloadActionBar();\n\t\t\t});\n\t\t});\n\t});\n}\n\nfunction showQuickCreateForm(moduleName, record, params) {\n\tvar content = $('#ytActionBarContent');\n\tif (params == undefined) {\n\t\tvar params = {};\n\t}\n\tvar relatedParams = {};\n\tif (params['sourceModule']) {\n\t\tvar sourceModule = params['sourceModule'];\n\t} else {\n\t\tvar sourceModule = 'OSSMailView';\n\t}\n\tvar postShown = function (data) {\n\t\tvar index, queryParam, queryParamComponents;\n\t\t$('').appendTo(data);\n\t\t$('').appendTo(data);\n\t\t$('').appendTo(data);\n\t}\n\tvar ids = {\n\t\tlink: 'modulesLevel0',\n\t\tprocess: 'modulesLevel1',\n\t\tsubprocess: 'modulesLevel2',\n\t\tlinkextend: 'modulesLevel3'\n\t};\n\tfor (var i in ids) {\n\t\tvar element = content.find('#' + ids[i]);\n\t\tvar value = element.length ? JSON.parse(element.val()) : [];\n\t\tif ($.inArray(sourceModule, value) >= 0) {\n\t\t\trelatedParams[i] = record;\n\t\t}\n\t}\n\tif (moduleName == 'Leads') {\n\t\trelatedParams['company'] = rcmail.env.fromName;\n\t}\n\tif (moduleName == 'Leads' || moduleName == 'Contacts') {\n\t\trelatedParams['lastname'] = rcmail.env.fromName;\n\t}\n\tif (moduleName == 'Project') {\n\t\trelatedParams['projectname'] = rcmail.env.subject;\n\t}\n\tif (moduleName == 'HelpDesk') {\n\t\trelatedParams['ticket_title'] = rcmail.env.subject;\n\t}\n\tif (moduleName == 'Products') {\n\t\trelatedParams['productname'] = rcmail.env.subject;\n\t}\n\tif (moduleName == 'Services') {\n\t\trelatedParams['servicename'] = rcmail.env.subject;\n\t}\n\trelatedParams['email'] = rcmail.env.fromMail;\n\trelatedParams['email1'] = rcmail.env.fromMail;\n\trelatedParams['description'] = $('#messagebody').text();\n\t//relatedParams['related_to'] = record;\n\tvar postQuickCreate = function (data) {\n\t\tloadActionBar();\n\t}\n\trelatedParams['sourceModule'] = sourceModule;\n\trelatedParams['sourceRecord'] = record;\n\trelatedParams['relationOperation'] = true;\n\tvar quickCreateParams = {\n\t\tcallbackFunction: postQuickCreate,\n\t\tcallbackPostShown: postShown,\n\t\tdata: relatedParams,\n\t\tnoCache: true\n\t};\n\tvar headerInstance = new window.crm.Vtiger_Header_Js();\n\theaderInstance.quickCreateModule(moduleName, quickCreateParams);\n}\n\nfunction getCrmWindow() {\n\tif (opener !== null && opener.parent.CONFIG == \"object\") {\n\t\treturn opener.parent;\n\t} else if (typeof parent.CONFIG == \"object\") {\n\t\treturn parent;\n\t} else if (typeof parent.parent.CONFIG == \"object\") {\n\t\treturn parent.parent;\n\t} else if (typeof opener.crm.CONFIG == \"object\") {\n\t\treturn opener.crm;\n\t}\n\treturn false;\n}\n"],"names":["window","rcmail","addEventListener","crm","getCrmWindow","loadActionBar","env","message_commands","push","register_command","ics","element","AppConnector","request","async","dataType","data","module","action","done","response","Vtiger_Helper_Js","showPnotify","text","type","animation","$","closest","remove","params","view","uid","folder","mailbox","rcId","user_id","content","find","html","css","outerHeight","registerEvents","registerAddRecord","registerAddReletedRecord","registerSelectRecord","registerRemoveRecord","registerImportMail","click","icon","button","removeClass","addClass","block","toggle","trigger","app","vtranslate","e","currentTarget","removeRecord","row","val","mailId","id","relParams","crmid","mod","newModule","showPopup","src_module","src_record","targetElement","sourceModule","showQuickCreateForm","selectValue","col","mode","notifyParams","actionsParams","showRecordsList","modal","instance","setSelectEvent","responseData","moduleName","record","appendTo","ids","link","process","subprocess","linkextend","i","value","length","JSON","parse","inArray","relatedParams","fromName","subject","fromMail","Vtiger_Header_Js","headerInstance","quickCreateModule","callbackFunction","callbackPostShown","postShown","noCache","parent","CONFIG","opener"],"mappings":";;;;;;;;AACAA,OAAOC,MAAP,EAAiBA,OAAOC,gBAAP,CAAwB,MAAxB,CAAgC,UAAe,CAC9DF,OAAOG,GAAP,CAAaC,cADiD,CAE9DC,eAF8D,CAG9DJ,OAAOK,GAAP,CAAWC,gBAAX,CAA4BC,IAA5B,CAAiC,qBAAjC,CAH8D,CAI9DP,OAAOQ,gBAAP,CAAwB,qBAAxB,CAA+C,SAAUC,GAAV,CAAeC,OAAf,CAA2B,CACzEX,OAAOG,GAAP,CAAWS,YAAX,CAAwBC,OAAxB,CAAgC,CAC/BC,QAD+B,CAE/BC,SAAU,MAFqB,CAG/BC,KAAM,CACLC,OAAQ,UADH,CAELC,OAAQ,WAFH,CAGLR,IAAKA,GAHA,CAHyB,CAAhC,EAQGS,IARH,CAQQ,SAAUC,QAAV,CAAoB,CAC3BpB,OAAOG,GAAP,CAAWkB,gBAAX,CAA4BC,WAA5B,CAAwC,CACvCC,KAAMH,eADiC,CAEvCI,KAAM,MAFiC,CAGvCC,UAAW,MAH4B,CAAxC,CAD2B,CAM3BC,EAAEf,OAAF,EAAWgB,OAAX,CAAmB,kBAAnB,EAAuC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mBC,SAFI,CAGvB3F,KAAMkF,aAHiB,CAIvBU,UAJuB,CAOxB,EACA,CAED,qBAAA,EAAwB,CACvB,GAAe,IAAX,WAA2C,QAAxB,SAAOC,MAAP,CAAcC,MAArC,CACC,cAAcD,MAAd,CAFsB,OAGY,QAAxB,UAAOA,OAAOC,MAAd,CAHY,CAIfD,MAJe,CAKmB,QAA/B,UAAOA,OAAOA,MAAP,CAAcC,MAArB,CALY,CAMfD,OAAOA,MANQ,GAOgB,QAA5B,UAAOE,OAAO5G,GAAP,CAAW2G,MAAlB,CAPY,GAQfC,OAAO5G,GAGf"} \ No newline at end of file From 7fdb5f69650d50b99298fadd8c1b6c211ddf633b Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Mon, 7 Jan 2019 09:06:31 +0100 Subject: [PATCH 14/38] Updated min.css files --- plugins/yetiforce/preview.css | 1 - plugins/yetiforce/preview.min.css | 181 +------------------------ skins/yetiforce/yetiforce.min.css | 214 +----------------------------- 3 files changed, 2 insertions(+), 394 deletions(-) diff --git a/plugins/yetiforce/preview.css b/plugins/yetiforce/preview.css index c6fe8c41..af460fba 100644 --- a/plugins/yetiforce/preview.css +++ b/plugins/yetiforce/preview.css @@ -177,4 +177,3 @@ button:hover { background-color: #e2e6ea; border-color: #dae0e5; } - diff --git a/plugins/yetiforce/preview.min.css b/plugins/yetiforce/preview.min.css index c6fe8c41..b3a072df 100644 --- a/plugins/yetiforce/preview.min.css +++ b/plugins/yetiforce/preview.min.css @@ -1,180 +1 @@ -.pull-right { - float: right !important -} - -#ytActionBarContent select { - padding: 0 -} - -#ytActionBarContent .row:before { - display: table; - content: " " -} - -#ytActionBarContent .row:after { - clear: both; - display: table; - content: " " -} - -#ytActionBarContent .ytHeader { - position: relative; - border-bottom: 1px solid #dfdfdf; -} - -#ytActionBarContent .rowReletedRecord .rowActions { - display: none -} - -#ytActionBarContent .rowReletedRecord:hover .rowActions { - display: block -} - -#ytActionBarContent .noRecords { - background: #70a8cb; - text-align: center; - color: #fff; - padding: 2px 0 -} - -#ytActionBarContent .noRecords a.importMail { - color: #ecf6ff; - cursor: pointer; - font-weight: 800 -} - -#ytActionBarContent .rowReletedRecord { - margin: 3px 0 6px 0 -} - -#ytActionBarContent .rowReletedRecord { - margin: 3px 0 6px 0 -} - -#ytActionBarContent .pull-right button { - margin-left: 3px; -} - -#ytActionBarContent .relatedModuleIcon { - margin-right: 5px -} - -#messageheader.previewheader { - padding: 0 0 3px 30px; -} - -.rcmaddcontact { - display: none; -} - -.d-none { - display: none; -} - -.mr-5px { - margin-right: 5px; -} - -.mr-3px { - margin-right: 3px; -} - -.ml-5px { - margin-left: 5px; -} - -.w-100 { - width: 100%; -} - -.flex-wrap { - display: flex; - flex-wrap: wrap; -} - -.rowRelatedRecord { - background: #bbdde8; - margin-left: 3px; - border: 1px #c1c1c1 solid; -} - -.action-bar__head__container { - display: flex; - flex-wrap: nowrap; - width: fit-content; - margin-right: 5px; -} - -.action-bar__head a { - text-decoration: none; - color: #000; -} - -.action-bar__head { - color: #fff; - padding: 0 2px 4px; - display: flex; - flex-wrap: wrap; -} - -.action-bar__head > * { - margin-top: 4px; -} - -.action-bar__col { - background-color: #4a5364; - width: 100%; -} - -.action-bar__select { - margin-left: 3px; -} - -.action-bar__select:required:invalid { - color: gray; -} - -.action-bar__select optgroup { - color: black; -} - -button, select, .rowRelatedRecord { - border-radius: .25rem; - padding: 0.1rem 0.2rem; -} - -button, select { - cursor: pointer; -} - -.rowActions { - display: inline-flex; - align-items: center; -} - -.rowActions button { - padding: 0.005rem 0.2rem; - margin-left: 5px; -} - -button { - display: inline-block; - background-color: #f8f9fa; - border-color: #f8f9fa; - font-weight: 400; - text-align: center; - white-space: nowrap; - vertical-align: middle; - user-select: none; - border: 1px solid transparent; - padding: 0.2rem 0.3rem; - border-radius: 0.25rem; - transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; -} - -button:hover { - color: #212529; - background-color: #e2e6ea; - border-color: #dae0e5; -} - +.pull-right{float:right !important}#ytActionBarContent select{padding:0}#ytActionBarContent .row:before{display:table;content:" "}#ytActionBarContent .row:after{clear:both;display:table;content:" "}#ytActionBarContent .ytHeader{position:relative;border-bottom:1px solid #dfdfdf}#ytActionBarContent .rowReletedRecord .rowActions{display:none}#ytActionBarContent .rowReletedRecord:hover .rowActions{display:block}#ytActionBarContent .noRecords{background:#70a8cb;text-align:center;color:#fff;padding:2px 0}#ytActionBarContent .noRecords a.importMail{color:#ecf6ff;cursor:pointer;font-weight:800}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .pull-right button{margin-left:3px}#ytActionBarContent .relatedModuleIcon{margin-right:5px}#messageheader.previewheader{padding:0 0 3px 30px}.rcmaddcontact{display:none}.d-none{display:none}.mr-5px{margin-right:5px}.mr-3px{margin-right:3px}.ml-5px{margin-left:5px}.w-100{width:100%}.flex-wrap{display:flex;flex-wrap:wrap}.rowRelatedRecord{background:#bbdde8;margin-left:3px;border:1px #c1c1c1 solid}.action-bar__head__container{display:flex;flex-wrap:nowrap;width:fit-content;margin-right:5px}.action-bar__head a{text-decoration:none;color:#000}.action-bar__head{color:#fff;padding:0 2px 4px;display:flex;flex-wrap:wrap}.action-bar__head>*{margin-top:4px}.action-bar__col{background-color:#4a5364;width:100%}.action-bar__select{margin-left:3px}.action-bar__select:required:invalid{color:gray}.action-bar__select optgroup{color:black}button,select,.rowRelatedRecord{border-radius:.25rem;padding:.1rem .2rem}button,select{cursor:pointer}.rowActions{display:inline-flex;align-items:center}.rowActions button{padding:.005rem .2rem;margin-left:5px}button{display:inline-block;background-color:#f8f9fa;border-color:#f8f9fa;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;user-select:none;border:1px solid transparent;padding:.2rem .3rem;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}button:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5} \ No newline at end of file diff --git a/skins/yetiforce/yetiforce.min.css b/skins/yetiforce/yetiforce.min.css index 81a41a5e..8bacb074 100644 --- a/skins/yetiforce/yetiforce.min.css +++ b/skins/yetiforce/yetiforce.min.css @@ -1,213 +1 @@ -/** The file is published on the basis of YetiForce Public License that can be found in the following directory: licenses/License.html */ -#footer { - position: absolute; - left: 10px; - right: 10px; - bottom: 0px; - text-align: center; - color: #000; -} - -#footer a { - color: #000; - text-decoration: none; -} - -#footer a:hover { - text-decoration: underline; -} - -#footer #taskbar a { - padding: 0; - height: 20px; - background: none; -} - -#footer #taskbar a span.button-inner { - zoom: 0.8; -} - -#footer #taskbar .tooltip { - top: -16px; - display: none; -} - -#footer #taskbar a:hover .tooltip { - right: -10px; - display: block; -} - -#footer #taskbar .tooltip:after { - top: 18px; - right: 15px; - -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)"; - -webkit-transform: rotate(180deg); - -ms-transform: rotate(180deg); - transform: rotate(180deg); -} - -#taskbar .button-inner { - top: 0px; -} - -#footer #taskbar { - padding-right: 0; -} - -#footer .topleft, #footer .username { - padding-top: 3px; -} - -#mainscreen { - top: 10px !important; - left: 5px; - right: 5px; -} - -body { - background: #dadada; -} - -#yt_adress_buttons { - margin-top: 3px; - top: 0px !important; -} - -#yt_adress_buttons .button { - cursor: pointer; - color: #000; - font-weight: bold; -} - -.verticalPanel #mailview-bottom, -.verticalPanel #mailview-top { - height: 100% !important; - top: 0px !important; -} - -@media only screen and (max-width: 1040px) { - .col-4 { - float: left; - width: 100% !important; - } - - .head { - height: auto !important; - padding-bottom: 2px; - } - - .relatedName { - font-size: 12px; - } -} - -table.messagelist.fixedcopy { - position: absolute !important; -} - -.chevronBtnCube { - position: absolute; - z-index: 1; -} - -.chevronBtnCube .hideBtn { - padding-left: 2px; - padding-right: 2px; -} - -#mailpreviewtogglebtn { - position: absolute; - top: 6px; - right: 10px; -} - -.mailpreviewtoggle { - display: inline-block; - text-decoration: none; - padding: 1px 3px; - width: 16px; - height: 14px; - vertical-align: middle; - font-weight: bold; - background: #d8d8d8; - background: -moz-linear-gradient(top, #d8d8d8 0, #bababa 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #d8d8d8), color-stop(100%, #bababa)); - background: -o-linear-gradient(top, #d8d8d8 0, #bababa 100%); - background: -ms-linear-gradient(top, #d8d8d8 0, #bababa 100%); - background: linear-gradient(to bottom, #d8d8d8 0, #bababa 100%); - box-shadow: 0 1px 1px 0 #999; - -webkit-box-shadow: 0 1px 1px 0 #999; - margin: 0 2px; - color: #525252; - text-shadow: 0 1px 1px #fff; - border: 1px solid #e6e6e6; - border-radius: 4px; -} - -.mailpreviewtoggle .inner { - width: 16px; - height: 13px; - display: inline-block; - background: url(images/buttons.png?v=51d4.15699) no-repeat; -} - -.mailpreviewtoggle.verticalBtn .inner { - background-position: -6px -226px; -} - -.mailpreviewtoggle.verticalBtn.enabled .inner { - background-position: -28px -226px; -} - -.mailpreviewtoggle.horizontalBtn .inner { - background-position: -7px -241px; -} - -.mailpreviewtoggle.horizontalBtn.enabled .inner { - background-position: -28px -242px; -} - -#composeview-right { - left: 0; -} - -.action-bar { - background: #ecf6ff; -} - -.mr-5px { - margin-right: 5px; -} - -.ml-5px { - margin-left: 5px; -} - -.w-100 { - width: 100%; -} - -.flex-wrap { - display: flex; - flex-wrap: wrap; -} - -.action-bar__head__container { - column-width: 310px; -} - -.action-bar__data a { - text-decoration: none; - color: #000; - line-height: 14px -} - -.action-bar__header { - font-size: 13px; -} - -.action-bar__head { - background-color: #4a5364; - color: #fff; - padding: 2px; -} +#footer{position:absolute;left:10px;right:10px;bottom:0;text-align:center;color:#000}#footer a{color:#000;text-decoration:none}#footer a:hover{text-decoration:underline}#footer #taskbar a{padding:0;height:20px;background:0}#footer #taskbar a span.button-inner{zoom:.8}#footer #taskbar .tooltip{top:-16px;display:none}#footer #taskbar a:hover .tooltip{right:-10px;display:block}#footer #taskbar .tooltip:after{top:18px;right:15px;-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}#taskbar .button-inner{top:0}#footer #taskbar{padding-right:0}#footer .topleft,#footer .username{padding-top:3px}#mainscreen{top:10px !important;left:5px;right:5px}body{background:#dadada}#yt_adress_buttons{margin-top:3px;top:0 !important}#yt_adress_buttons .button{cursor:pointer;color:#000;font-weight:bold}.verticalPanel #mailview-bottom,.verticalPanel #mailview-top{height:100% !important;top:0 !important}@media only screen and (max-width:1040px){.col-4{float:left;width:100% !important}.head{height:auto !important;padding-bottom:2px}.relatedName{font-size:12px}}table.messagelist.fixedcopy{position:absolute !important}.chevronBtnCube{position:absolute;z-index:1}.chevronBtnCube .hideBtn{padding-left:2px;padding-right:2px}#mailpreviewtogglebtn{position:absolute;top:6px;right:10px}.mailpreviewtoggle{display:inline-block;text-decoration:none;padding:1px 3px;width:16px;height:14px;vertical-align:middle;font-weight:bold;background:#d8d8d8;background:-moz-linear-gradient(top,#d8d8d8 0,#bababa 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#d8d8d8),color-stop(100%,#bababa));background:-o-linear-gradient(top,#d8d8d8 0,#bababa 100%);background:-ms-linear-gradient(top,#d8d8d8 0,#bababa 100%);background:linear-gradient(to bottom,#d8d8d8 0,#bababa 100%);box-shadow:0 1px 1px 0 #999;-webkit-box-shadow:0 1px 1px 0 #999;margin:0 2px;color:#525252;text-shadow:0 1px 1px #fff;border:1px solid #e6e6e6;border-radius:4px}.mailpreviewtoggle .inner{width:16px;height:13px;display:inline-block;background:url(images/buttons.png?v=51d4.15699) no-repeat}.mailpreviewtoggle.verticalBtn .inner{background-position:-6px -226px}.mailpreviewtoggle.verticalBtn.enabled .inner{background-position:-28px -226px}.mailpreviewtoggle.horizontalBtn .inner{background-position:-7px -241px}.mailpreviewtoggle.horizontalBtn.enabled .inner{background-position:-28px -242px}#composeview-right{left:0}.action-bar{background:#ecf6ff}.mr-5px{margin-right:5px}.ml-5px{margin-left:5px}.w-100{width:100%}.flex-wrap{display:flex;flex-wrap:wrap}.action-bar__head__container{column-width:310px}.action-bar__data a{text-decoration:none;color:#000;line-height:14px}.action-bar__header{font-size:13px}.action-bar__head{background-color:#4a5364;color:#fff;padding:2px} \ No newline at end of file From 945f63f0c7a61d6bbd4eceecaf57416d813290d8 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Mon, 7 Jan 2019 13:09:46 +0100 Subject: [PATCH 15/38] Update version.php --- version.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.php b/version.php index 6b3999a0..dfe435fa 100644 --- a/version.php +++ b/version.php @@ -1,5 +1,5 @@ '2018.12.05', - 'version' => '0.0.57' + 'patch' => '2019.01.07', + 'version' => '0.0.58' ]; From 8beee3e6b1b8fa642f82dea918a71bb6eeb47be6 Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Thu, 10 Jan 2019 15:17:13 +0100 Subject: [PATCH 16/38] Added ics locales translations --- plugins/yetiforce/localization/de_DE.inc | 1 + plugins/yetiforce/localization/en_US.inc | 1 + plugins/yetiforce/localization/pl_PL.inc | 1 + plugins/yetiforce/localization/pt_BR.inc | 1 + plugins/yetiforce/localization/ru_RU.inc | 1 + 5 files changed, 5 insertions(+) diff --git a/plugins/yetiforce/localization/de_DE.inc b/plugins/yetiforce/localization/de_DE.inc index c8449bc6..bd6b2431 100644 --- a/plugins/yetiforce/localization/de_DE.inc +++ b/plugins/yetiforce/localization/de_DE.inc @@ -3,3 +3,4 @@ $labels = []; $labels['FileFromDesktop'] = 'File from desktop'; $labels['FileFromCRM'] = 'File from CRM'; +$labels['addicalinvitemsg'] = 'Add to my calendar'; diff --git a/plugins/yetiforce/localization/en_US.inc b/plugins/yetiforce/localization/en_US.inc index c8449bc6..bd6b2431 100644 --- a/plugins/yetiforce/localization/en_US.inc +++ b/plugins/yetiforce/localization/en_US.inc @@ -3,3 +3,4 @@ $labels = []; $labels['FileFromDesktop'] = 'File from desktop'; $labels['FileFromCRM'] = 'File from CRM'; +$labels['addicalinvitemsg'] = 'Add to my calendar'; diff --git a/plugins/yetiforce/localization/pl_PL.inc b/plugins/yetiforce/localization/pl_PL.inc index 2875ec75..806167d2 100644 --- a/plugins/yetiforce/localization/pl_PL.inc +++ b/plugins/yetiforce/localization/pl_PL.inc @@ -3,3 +3,4 @@ $labels = []; $labels['FileFromDesktop'] = 'Plik z pulpitu'; $labels['FileFromCRM'] = 'Plik z CRM-a'; +$labels['addicalinvitemsg'] = 'Dodaj do mojego kalendarza'; diff --git a/plugins/yetiforce/localization/pt_BR.inc b/plugins/yetiforce/localization/pt_BR.inc index c8449bc6..bd6b2431 100644 --- a/plugins/yetiforce/localization/pt_BR.inc +++ b/plugins/yetiforce/localization/pt_BR.inc @@ -3,3 +3,4 @@ $labels = []; $labels['FileFromDesktop'] = 'File from desktop'; $labels['FileFromCRM'] = 'File from CRM'; +$labels['addicalinvitemsg'] = 'Add to my calendar'; diff --git a/plugins/yetiforce/localization/ru_RU.inc b/plugins/yetiforce/localization/ru_RU.inc index c8449bc6..bd6b2431 100644 --- a/plugins/yetiforce/localization/ru_RU.inc +++ b/plugins/yetiforce/localization/ru_RU.inc @@ -3,3 +3,4 @@ $labels = []; $labels['FileFromDesktop'] = 'File from desktop'; $labels['FileFromCRM'] = 'File from CRM'; +$labels['addicalinvitemsg'] = 'Add to my calendar'; From 13efe670c58df5372ae3a472b56ae198ad158c6c Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Tue, 15 Jan 2019 10:11:01 +0100 Subject: [PATCH 17/38] Added ics preview to yetiforce plugin --- plugins/yetiforce/yetiforce.php | 76 +++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/plugins/yetiforce/yetiforce.php b/plugins/yetiforce/yetiforce.php index 2533f444..bebc8e06 100644 --- a/plugins/yetiforce/yetiforce.php +++ b/plugins/yetiforce/yetiforce.php @@ -12,6 +12,8 @@ class yetiforce extends rcube_plugin private $autologin; private $currentUser; private $viewData = []; + private $message; + private $icsParts = []; public function init() { @@ -64,6 +66,7 @@ public function init() $this->include_stylesheet($this->rc->config->get('public_URL') . 'libraries/@fortawesome/fontawesome-free/css/all.css'); $this->include_stylesheet('preview.css'); $this->add_hook('message_load', [$this, 'messageLoad']); + $this->add_hook('template_object_messageattachments', [$this, 'appendIcsPreview']); } if (empty($this->rc->action)) { //$this->add_hook('preferences_save', array($this, 'prefsSave')); @@ -182,6 +185,7 @@ public function messageLoad($args) } $this->rc->output->set_env('fromName', $fromName); $this->rc->output->set_env('fromMail', $fromMail); + $this->setIcsData($args); } public function messageComposeHead($args) @@ -665,4 +669,76 @@ public function getConntentEmailTemplate() chdir($currentPath); exit; } + + public function setIcsData($args) + { + $this->message = $args['object']; + foreach ((array)$this->message->attachments as $attachment) { + if ($this->isIcs($attachment)) { + $this->icsParts[] = ['part' => $attachment->mime_id, 'uid' => $this->message->uid]; + } + } + foreach ((array)$this->message->parts as $part) { + if ($this->isIcs($part)) { + $this->icsParts[] = ['part' => $attachment->mime_id, 'uid' => $this->message->uid]; + } + } + if ($this->icsParts) { + $this->add_texts('localization'); + } + } + + /** + * Append ical preview in attachments' area + * @param $args + * @return mixed + */ + public function appendIcsPreview($args) + { + $icsPartsIds = []; + foreach ($this->icsParts as $icsPart) { + $icsContent = $this->message->get_part_content($icsPart['part'], null, true); + $file_name = $icsPart['uid']; + if (in_array($file_name, $icsPartsIds)) { + continue; + } else { + array_push($icsPartsIds, $file_name); + } + $filePath = $this->rc->config->get('root_directory') . 'cache/import/' . $file_name . '.ics'; + file_put_contents($filePath, $icsContent); + $currentPath = getcwd(); + chdir($this->rc->config->get('root_directory')); + $this->loadCurrentUser(); + $icsFields = \App\Utils\iCalendar::import($filePath); + chdir($currentPath); + $eventTable = ''; + foreach ($icsFields as $key => $value) { + $eventTable .= ""; + } + $eventTable .= '
    $key$value
    '; + $args['content'] .= + html::p(['class' => ''], + html::a([ + 'href' => 'javascript:void', + 'onclick' => "return rcmail.command('yetiforce.importICS',$file_name,this,event)", + 'title' => $this->gettext('addicalinvitemsg'), + ], + html::span(null, rcube::Q($this->gettext('addicalinvitemsg')) + ) + ) + ); + $args['content'] .= html::div(null, $eventTable); + } + return $args; + } + + /** + * Check if $part is ics + * @param $part + * @return bool + */ + public function isIcs($part) + { + return $part->mimetype == 'application/ics' || $part->mimetype == 'text/calendar'; + } } From e497f3146765eaec205ca16b221aff6329d65f90 Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Tue, 15 Jan 2019 11:35:00 +0100 Subject: [PATCH 18/38] Added displaying multiple events --- plugins/yetiforce/yetiforce.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/plugins/yetiforce/yetiforce.php b/plugins/yetiforce/yetiforce.php index bebc8e06..62da6c2d 100644 --- a/plugins/yetiforce/yetiforce.php +++ b/plugins/yetiforce/yetiforce.php @@ -689,8 +689,10 @@ public function setIcsData($args) } /** - * Append ical preview in attachments' area + * Append ical preview in attachments' area. + * * @param $args + * * @return mixed */ public function appendIcsPreview($args) @@ -709,11 +711,13 @@ public function appendIcsPreview($args) $currentPath = getcwd(); chdir($this->rc->config->get('root_directory')); $this->loadCurrentUser(); - $icsFields = \App\Utils\iCalendar::import($filePath); + $icsEvents = \App\Utils\iCalendar::import($filePath); chdir($currentPath); $eventTable = ''; - foreach ($icsFields as $key => $value) { - $eventTable .= ""; + foreach ($icsEvents as $event) { + foreach ($event as $key => $value) { + $eventTable .= ""; + } } $eventTable .= '
    $key$value
    $key$value
    '; $args['content'] .= @@ -733,8 +737,10 @@ public function appendIcsPreview($args) } /** - * Check if $part is ics + * Check if $part is ics. + * * @param $part + * * @return bool */ public function isIcs($part) From ef072de6bc230508ad23e760674f9b57f9ce1090 Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Tue, 15 Jan 2019 15:30:52 +0100 Subject: [PATCH 19/38] Added ical preview template (first draft) --- plugins/yetiforce/preview.css | 24 ++++++++++++++++++++++++ plugins/yetiforce/preview.min.css | 2 +- plugins/yetiforce/yetiforce.php | 27 +++++++++++++++++++++------ 3 files changed, 46 insertions(+), 7 deletions(-) diff --git a/plugins/yetiforce/preview.css b/plugins/yetiforce/preview.css index af460fba..329b1e81 100644 --- a/plugins/yetiforce/preview.css +++ b/plugins/yetiforce/preview.css @@ -177,3 +177,27 @@ button:hover { background-color: #e2e6ea; border-color: #dae0e5; } + +.c-ical { + margin: 2px; + border-radius: 6px; + background: #dedcdc; +} + +.c-ical__card { + width: fit-content; + height: fit-content; + background: white; + border: 1px solid #d0d0d0; + border-radius: 6px; + color: #c51818; + padding: 2px; + margin: 2px; +} + +.c-ical__card__nb { + font-size: 17px; + margin: 0 auto; + width: fit-content; + color: black; +} \ No newline at end of file diff --git a/plugins/yetiforce/preview.min.css b/plugins/yetiforce/preview.min.css index b3a072df..fbc4b68d 100644 --- a/plugins/yetiforce/preview.min.css +++ b/plugins/yetiforce/preview.min.css @@ -1 +1 @@ -.pull-right{float:right !important}#ytActionBarContent select{padding:0}#ytActionBarContent .row:before{display:table;content:" "}#ytActionBarContent .row:after{clear:both;display:table;content:" "}#ytActionBarContent .ytHeader{position:relative;border-bottom:1px solid #dfdfdf}#ytActionBarContent .rowReletedRecord .rowActions{display:none}#ytActionBarContent .rowReletedRecord:hover .rowActions{display:block}#ytActionBarContent .noRecords{background:#70a8cb;text-align:center;color:#fff;padding:2px 0}#ytActionBarContent .noRecords a.importMail{color:#ecf6ff;cursor:pointer;font-weight:800}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .pull-right button{margin-left:3px}#ytActionBarContent .relatedModuleIcon{margin-right:5px}#messageheader.previewheader{padding:0 0 3px 30px}.rcmaddcontact{display:none}.d-none{display:none}.mr-5px{margin-right:5px}.mr-3px{margin-right:3px}.ml-5px{margin-left:5px}.w-100{width:100%}.flex-wrap{display:flex;flex-wrap:wrap}.rowRelatedRecord{background:#bbdde8;margin-left:3px;border:1px #c1c1c1 solid}.action-bar__head__container{display:flex;flex-wrap:nowrap;width:fit-content;margin-right:5px}.action-bar__head a{text-decoration:none;color:#000}.action-bar__head{color:#fff;padding:0 2px 4px;display:flex;flex-wrap:wrap}.action-bar__head>*{margin-top:4px}.action-bar__col{background-color:#4a5364;width:100%}.action-bar__select{margin-left:3px}.action-bar__select:required:invalid{color:gray}.action-bar__select optgroup{color:black}button,select,.rowRelatedRecord{border-radius:.25rem;padding:.1rem .2rem}button,select{cursor:pointer}.rowActions{display:inline-flex;align-items:center}.rowActions button{padding:.005rem .2rem;margin-left:5px}button{display:inline-block;background-color:#f8f9fa;border-color:#f8f9fa;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;user-select:none;border:1px solid transparent;padding:.2rem .3rem;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}button:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5} \ No newline at end of file +.pull-right{float:right !important}#ytActionBarContent select{padding:0}#ytActionBarContent .row:before{display:table;content:" "}#ytActionBarContent .row:after{clear:both;display:table;content:" "}#ytActionBarContent .ytHeader{position:relative;border-bottom:1px solid #dfdfdf}#ytActionBarContent .rowReletedRecord .rowActions{display:none}#ytActionBarContent .rowReletedRecord:hover .rowActions{display:block}#ytActionBarContent .noRecords{background:#70a8cb;text-align:center;color:#fff;padding:2px 0}#ytActionBarContent .noRecords a.importMail{color:#ecf6ff;cursor:pointer;font-weight:800}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .pull-right button{margin-left:3px}#ytActionBarContent .relatedModuleIcon{margin-right:5px}#messageheader.previewheader{padding:0 0 3px 30px}.rcmaddcontact{display:none}.d-none{display:none}.mr-5px{margin-right:5px}.mr-3px{margin-right:3px}.ml-5px{margin-left:5px}.w-100{width:100%}.flex-wrap{display:flex;flex-wrap:wrap}.rowRelatedRecord{background:#bbdde8;margin-left:3px;border:1px #c1c1c1 solid}.action-bar__head__container{display:flex;flex-wrap:nowrap;width:fit-content;margin-right:5px}.action-bar__head a{text-decoration:none;color:#000}.action-bar__head{color:#fff;padding:0 2px 4px;display:flex;flex-wrap:wrap}.action-bar__head>*{margin-top:4px}.action-bar__col{background-color:#4a5364;width:100%}.action-bar__select{margin-left:3px}.action-bar__select:required:invalid{color:gray}.action-bar__select optgroup{color:black}button,select,.rowRelatedRecord{border-radius:.25rem;padding:.1rem .2rem}button,select{cursor:pointer}.rowActions{display:inline-flex;align-items:center}.rowActions button{padding:.005rem .2rem;margin-left:5px}button{display:inline-block;background-color:#f8f9fa;border-color:#f8f9fa;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;user-select:none;border:1px solid transparent;padding:.2rem .3rem;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}button:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.c-ical{margin:2px;border-radius:6px;background:#dedcdc}.c-ical__card{width:fit-content;height:fit-content;background:white;border:1px solid #d0d0d0;border-radius:6px;color:#c51818;padding:2px;margin:2px}.c-ical__card__nb{font-size:17px;margin:0 auto;width:fit-content;color:black} \ No newline at end of file diff --git a/plugins/yetiforce/yetiforce.php b/plugins/yetiforce/yetiforce.php index 62da6c2d..3e9fe696 100644 --- a/plugins/yetiforce/yetiforce.php +++ b/plugins/yetiforce/yetiforce.php @@ -711,15 +711,30 @@ public function appendIcsPreview($args) $currentPath = getcwd(); chdir($this->rc->config->get('root_directory')); $this->loadCurrentUser(); - $icsEvents = \App\Utils\iCalendar::import($filePath); + $icsRecords = \App\Utils\iCalendar::import($filePath); chdir($currentPath); - $eventTable = ''; - foreach ($icsEvents as $event) { - foreach ($event as $key => $value) { - $eventTable .= ""; + $eventTable = '
    '; + foreach ($icsRecords as $record) { + if ($record->getValueByField('time_start') || $record->getValueByField('time_end')) { + $dateStart = strtotime($record->getDisplayValue('date_start')); + $monthName = date('M', $dateStart); + $dayName = date('w', $dateStart); + if (date('Y-m-d', $dateStart) !== ($dateEnd = date('Y-m-d', strtotime($record->getDisplayValue('due_date'))))) { + if ($monthName !== date('M', $dateEnd)) { + $monthName .= ' - ' . date('M', $dateEnd); + } + $dayName .= ' - ' . date('w', $dateEnd); + } + $eventTable .= "
    +
    + $monthName +
    $dayName
    +
    + {$record->getDisplayValue('subject')} +
    "; } } - $eventTable .= '
    $key$value
    '; + $eventTable .= '
    '; $args['content'] .= html::p(['class' => ''], html::a([ From 96051613875845523997ed3a7265c33da091ed78 Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Thu, 17 Jan 2019 14:38:02 +0100 Subject: [PATCH 20/38] Improved ical templating and styles --- plugins/yetiforce/preview.css | 124 ++++++++++++------------------ plugins/yetiforce/preview.min.css | 2 +- plugins/yetiforce/yetiforce.php | 41 ++++++---- 3 files changed, 78 insertions(+), 89 deletions(-) diff --git a/plugins/yetiforce/preview.css b/plugins/yetiforce/preview.css index 329b1e81..fff76cec 100644 --- a/plugins/yetiforce/preview.css +++ b/plugins/yetiforce/preview.css @@ -52,7 +52,10 @@ } #ytActionBarContent .pull-right button { + line-height: 10px; margin-left: 3px; + padding: 0 6px; + height: 14px } #ytActionBarContent .relatedModuleIcon { @@ -67,18 +70,10 @@ display: none; } -.d-none { - display: none; -} - .mr-5px { margin-right: 5px; } -.mr-3px { - margin-right: 3px; -} - .ml-5px { margin-left: 5px; } @@ -92,90 +87,53 @@ flex-wrap: wrap; } +.flex-nowrap { + display: flex; + flex-wrap: nowrap; +} + .rowRelatedRecord { - background: #bbdde8; - margin-left: 3px; - border: 1px #c1c1c1 solid; + padding: 2px; } .action-bar__head__container { display: flex; flex-wrap: nowrap; - width: fit-content; - margin-right: 5px; } -.action-bar__head a { +.action-bar__data a { text-decoration: none; color: #000; + font-size: 14px; + line-height: 14px } -.action-bar__head { - color: #fff; - padding: 0 2px 4px; - display: flex; - flex-wrap: wrap; +.action-bar__header { + font-size: 14px; + min-width: 90px; } -.action-bar__head > * { - margin-top: 4px; +.action-bar__head { + background-color: #4a5364; + height: 20px; + color: #fff; + padding: 2px; } .action-bar__col { - background-color: #4a5364; width: 100%; } -.action-bar__select { - margin-left: 3px; -} - -.action-bar__select:required:invalid { - color: gray; -} - -.action-bar__select optgroup { - color: black; -} - -button, select, .rowRelatedRecord { - border-radius: .25rem; - padding: 0.1rem 0.2rem; -} - -button, select { - cursor: pointer; -} - -.rowActions { - display: inline-flex; - align-items: center; +@media only screen and (min-width: 600px) { + #ytActionBarContent .action-bar__col { + width: 50%; + } } -.rowActions button { - padding: 0.005rem 0.2rem; - margin-left: 5px; -} - -button { - display: inline-block; - background-color: #f8f9fa; - border-color: #f8f9fa; - font-weight: 400; - text-align: center; - white-space: nowrap; - vertical-align: middle; - user-select: none; - border: 1px solid transparent; - padding: 0.2rem 0.3rem; - border-radius: 0.25rem; - transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; -} - -button:hover { - color: #212529; - background-color: #e2e6ea; - border-color: #dae0e5; +@media only screen and (min-width: 1200px) { + #ytActionBarContent .action-bar__col { + width: 25%; + } } .c-ical { @@ -184,6 +142,12 @@ button:hover { background: #dedcdc; } +.c-ical__wrapper { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + .c-ical__card { width: fit-content; height: fit-content; @@ -191,13 +155,27 @@ button:hover { border: 1px solid #d0d0d0; border-radius: 6px; color: #c51818; - padding: 2px; + padding: 0 2px 2px; margin: 2px; + text-align: center; } -.c-ical__card__nb { - font-size: 17px; +.c-ical__card__day { + font-size: 15px; margin: 0 auto; width: fit-content; color: black; +} + +.c-ical__card__year { + font-size: 9px; + color: #888888 +} + +.c-ical__card__arrow { + margin: auto 0; +} + +.c-ical__subject { + margin: 0 auto; } \ No newline at end of file diff --git a/plugins/yetiforce/preview.min.css b/plugins/yetiforce/preview.min.css index fbc4b68d..41a4c054 100644 --- a/plugins/yetiforce/preview.min.css +++ b/plugins/yetiforce/preview.min.css @@ -1 +1 @@ -.pull-right{float:right !important}#ytActionBarContent select{padding:0}#ytActionBarContent .row:before{display:table;content:" "}#ytActionBarContent .row:after{clear:both;display:table;content:" "}#ytActionBarContent .ytHeader{position:relative;border-bottom:1px solid #dfdfdf}#ytActionBarContent .rowReletedRecord .rowActions{display:none}#ytActionBarContent .rowReletedRecord:hover .rowActions{display:block}#ytActionBarContent .noRecords{background:#70a8cb;text-align:center;color:#fff;padding:2px 0}#ytActionBarContent .noRecords a.importMail{color:#ecf6ff;cursor:pointer;font-weight:800}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .pull-right button{margin-left:3px}#ytActionBarContent .relatedModuleIcon{margin-right:5px}#messageheader.previewheader{padding:0 0 3px 30px}.rcmaddcontact{display:none}.d-none{display:none}.mr-5px{margin-right:5px}.mr-3px{margin-right:3px}.ml-5px{margin-left:5px}.w-100{width:100%}.flex-wrap{display:flex;flex-wrap:wrap}.rowRelatedRecord{background:#bbdde8;margin-left:3px;border:1px #c1c1c1 solid}.action-bar__head__container{display:flex;flex-wrap:nowrap;width:fit-content;margin-right:5px}.action-bar__head a{text-decoration:none;color:#000}.action-bar__head{color:#fff;padding:0 2px 4px;display:flex;flex-wrap:wrap}.action-bar__head>*{margin-top:4px}.action-bar__col{background-color:#4a5364;width:100%}.action-bar__select{margin-left:3px}.action-bar__select:required:invalid{color:gray}.action-bar__select optgroup{color:black}button,select,.rowRelatedRecord{border-radius:.25rem;padding:.1rem .2rem}button,select{cursor:pointer}.rowActions{display:inline-flex;align-items:center}.rowActions button{padding:.005rem .2rem;margin-left:5px}button{display:inline-block;background-color:#f8f9fa;border-color:#f8f9fa;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;user-select:none;border:1px solid transparent;padding:.2rem .3rem;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}button:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.c-ical{margin:2px;border-radius:6px;background:#dedcdc}.c-ical__card{width:fit-content;height:fit-content;background:white;border:1px solid #d0d0d0;border-radius:6px;color:#c51818;padding:2px;margin:2px}.c-ical__card__nb{font-size:17px;margin:0 auto;width:fit-content;color:black} \ No newline at end of file +.pull-right{float:right !important}#ytActionBarContent select{padding:0}#ytActionBarContent .row:before{display:table;content:" "}#ytActionBarContent .row:after{clear:both;display:table;content:" "}#ytActionBarContent .ytHeader{position:relative;border-bottom:1px solid #dfdfdf}#ytActionBarContent .rowReletedRecord .rowActions{display:none}#ytActionBarContent .rowReletedRecord:hover .rowActions{display:block}#ytActionBarContent .noRecords{background:#70a8cb;text-align:center;color:#fff;padding:2px 0}#ytActionBarContent .noRecords a.importMail{color:#ecf6ff;cursor:pointer;font-weight:800}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .pull-right button{line-height:10px;margin-left:3px;padding:0 6px;height:14px}#ytActionBarContent .relatedModuleIcon{margin-right:5px}#messageheader.previewheader{padding:0 0 3px 30px}.rcmaddcontact{display:none}.mr-5px{margin-right:5px}.ml-5px{margin-left:5px}.w-100{width:100%}.flex-wrap{display:flex;flex-wrap:wrap}.flex-nowrap{display:flex;flex-wrap:nowrap}.rowRelatedRecord{padding:2px}.action-bar__head__container{display:flex;flex-wrap:nowrap}.action-bar__data a{text-decoration:none;color:#000;font-size:14px;line-height:14px}.action-bar__header{font-size:14px;min-width:90px}.action-bar__head{background-color:#4a5364;height:20px;color:#fff;padding:2px}.action-bar__col{width:100%}@media only screen and (min-width:600px){#ytActionBarContent .action-bar__col{width:50%}}@media only screen and (min-width:1200px){#ytActionBarContent .action-bar__col{width:25%}}.c-ical{margin:2px;border-radius:6px;background:#dedcdc}.c-ical__wrapper{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-ical__card{width:fit-content;height:fit-content;background:white;border:1px solid #d0d0d0;border-radius:6px;color:#c51818;padding:0 2px 2px;margin:2px;text-align:center}.c-ical__card__day{font-size:15px;margin:0 auto;width:fit-content;color:black}.c-ical__card__year{font-size:9px;color:#888}.c-ical__card__arrow{margin:auto 0}.c-ical__subject{margin:0 auto} \ No newline at end of file diff --git a/plugins/yetiforce/yetiforce.php b/plugins/yetiforce/yetiforce.php index 3e9fe696..346b1e2f 100644 --- a/plugins/yetiforce/yetiforce.php +++ b/plugins/yetiforce/yetiforce.php @@ -713,28 +713,26 @@ public function appendIcsPreview($args) $this->loadCurrentUser(); $icsRecords = \App\Utils\iCalendar::import($filePath); chdir($currentPath); - $eventTable = '
    '; + $evTemplate = '
    '; foreach ($icsRecords as $record) { if ($record->getValueByField('time_start') || $record->getValueByField('time_end')) { $dateStart = strtotime($record->getDisplayValue('date_start')); - $monthName = date('M', $dateStart); - $dayName = date('w', $dateStart); - if (date('Y-m-d', $dateStart) !== ($dateEnd = date('Y-m-d', strtotime($record->getDisplayValue('due_date'))))) { - if ($monthName !== date('M', $dateEnd)) { - $monthName .= ' - ' . date('M', $dateEnd); - } - $dayName .= ' - ' . date('w', $dateEnd); + $dateStartCard = $this->cardTemplate($dateStart); + $dueDate = strtotime($record->getDisplayValue('due_date')); + $dueDateCard = ''; + if (date('Y-m-d', $dateStart) !== date('Y-m-d', $dueDate)) { + $dueDateCard = '' . $this->cardTemplate($dueDate); } - $eventTable .= "
    -
    - $monthName -
    $dayName
    + $evTemplate .= "
    + $dateStartCard + $dueDateCard +
    +

    {$record->getDisplayValue('subject')}

    - {$record->getDisplayValue('subject')}
    "; } } - $eventTable .= '
    '; + $evTemplate .= '
    '; $args['content'] .= html::p(['class' => ''], html::a([ @@ -746,11 +744,24 @@ public function appendIcsPreview($args) ) ) ); - $args['content'] .= html::div(null, $eventTable); + $args['content'] .= html::div(null, $evTemplate); } return $args; } + public function cardTemplate($date) + { + $monthName = \App\Language::translate(date('M', $date)); + $yearName = date('Y', $date); + $dayName = date('w', $date); + return "
    + $yearName +
    + $monthName +
    $dayName
    +
    "; + } + /** * Check if $part is ics. * From 23a5a8063d07451a1b4963927309c3f344da768f Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Thu, 17 Jan 2019 16:09:40 +0100 Subject: [PATCH 21/38] Improved ical preview --- plugins/yetiforce/preview.css | 25 ++++++++++++++++++++++++- plugins/yetiforce/preview.min.css | 2 +- plugins/yetiforce/yetiforce.php | 22 ++++++++++++++++------ 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/plugins/yetiforce/preview.css b/plugins/yetiforce/preview.css index fff76cec..4bf28f46 100644 --- a/plugins/yetiforce/preview.css +++ b/plugins/yetiforce/preview.css @@ -138,14 +138,21 @@ .c-ical { margin: 2px; +} + +.c-ical__event { + background: #fffdfd; + margin: 2px 0; + border: 1px solid #dedede; + margin: 3px auto; border-radius: 6px; - background: #dedcdc; } .c-ical__wrapper { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; + margin: 3px; } .c-ical__card { @@ -172,10 +179,26 @@ color: #888888 } +.c-ical__card__time { + font-size: 18px; + margin: auto; +} + .c-ical__card__arrow { margin: auto 0; } .c-ical__subject { margin: 0 auto; + text-align: center; +} + +/*.justify-content-around {*/ +/*-ms-flex-pack: distribute !important;*/ +/*justify-content: space-around !important;*/ +/*}*/ + +.justify-content-center { + -ms-flex-pack: center !important; + justify-content: center !important; } \ No newline at end of file diff --git a/plugins/yetiforce/preview.min.css b/plugins/yetiforce/preview.min.css index 41a4c054..61713981 100644 --- a/plugins/yetiforce/preview.min.css +++ b/plugins/yetiforce/preview.min.css @@ -1 +1 @@ -.pull-right{float:right !important}#ytActionBarContent select{padding:0}#ytActionBarContent .row:before{display:table;content:" "}#ytActionBarContent .row:after{clear:both;display:table;content:" "}#ytActionBarContent .ytHeader{position:relative;border-bottom:1px solid #dfdfdf}#ytActionBarContent .rowReletedRecord .rowActions{display:none}#ytActionBarContent .rowReletedRecord:hover .rowActions{display:block}#ytActionBarContent .noRecords{background:#70a8cb;text-align:center;color:#fff;padding:2px 0}#ytActionBarContent .noRecords a.importMail{color:#ecf6ff;cursor:pointer;font-weight:800}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .pull-right button{line-height:10px;margin-left:3px;padding:0 6px;height:14px}#ytActionBarContent .relatedModuleIcon{margin-right:5px}#messageheader.previewheader{padding:0 0 3px 30px}.rcmaddcontact{display:none}.mr-5px{margin-right:5px}.ml-5px{margin-left:5px}.w-100{width:100%}.flex-wrap{display:flex;flex-wrap:wrap}.flex-nowrap{display:flex;flex-wrap:nowrap}.rowRelatedRecord{padding:2px}.action-bar__head__container{display:flex;flex-wrap:nowrap}.action-bar__data a{text-decoration:none;color:#000;font-size:14px;line-height:14px}.action-bar__header{font-size:14px;min-width:90px}.action-bar__head{background-color:#4a5364;height:20px;color:#fff;padding:2px}.action-bar__col{width:100%}@media only screen and (min-width:600px){#ytActionBarContent .action-bar__col{width:50%}}@media only screen and (min-width:1200px){#ytActionBarContent .action-bar__col{width:25%}}.c-ical{margin:2px;border-radius:6px;background:#dedcdc}.c-ical__wrapper{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-ical__card{width:fit-content;height:fit-content;background:white;border:1px solid #d0d0d0;border-radius:6px;color:#c51818;padding:0 2px 2px;margin:2px;text-align:center}.c-ical__card__day{font-size:15px;margin:0 auto;width:fit-content;color:black}.c-ical__card__year{font-size:9px;color:#888}.c-ical__card__arrow{margin:auto 0}.c-ical__subject{margin:0 auto} \ No newline at end of file +.pull-right{float:right !important}#ytActionBarContent select{padding:0}#ytActionBarContent .row:before{display:table;content:" "}#ytActionBarContent .row:after{clear:both;display:table;content:" "}#ytActionBarContent .ytHeader{position:relative;border-bottom:1px solid #dfdfdf}#ytActionBarContent .rowReletedRecord .rowActions{display:none}#ytActionBarContent .rowReletedRecord:hover .rowActions{display:block}#ytActionBarContent .noRecords{background:#70a8cb;text-align:center;color:#fff;padding:2px 0}#ytActionBarContent .noRecords a.importMail{color:#ecf6ff;cursor:pointer;font-weight:800}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .pull-right button{line-height:10px;margin-left:3px;padding:0 6px;height:14px}#ytActionBarContent .relatedModuleIcon{margin-right:5px}#messageheader.previewheader{padding:0 0 3px 30px}.rcmaddcontact{display:none}.mr-5px{margin-right:5px}.ml-5px{margin-left:5px}.w-100{width:100%}.flex-wrap{display:flex;flex-wrap:wrap}.flex-nowrap{display:flex;flex-wrap:nowrap}.rowRelatedRecord{padding:2px}.action-bar__head__container{display:flex;flex-wrap:nowrap}.action-bar__data a{text-decoration:none;color:#000;font-size:14px;line-height:14px}.action-bar__header{font-size:14px;min-width:90px}.action-bar__head{background-color:#4a5364;height:20px;color:#fff;padding:2px}.action-bar__col{width:100%}@media only screen and (min-width:600px){#ytActionBarContent .action-bar__col{width:50%}}@media only screen and (min-width:1200px){#ytActionBarContent .action-bar__col{width:25%}}.c-ical{margin:2px}.c-ical__event{background:#fffdfd;margin:2px 0;border:1px solid #dedede;margin:3px auto;border-radius:6px}.c-ical__wrapper{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:3px}.c-ical__card{width:fit-content;height:fit-content;background:white;border:1px solid #d0d0d0;border-radius:6px;color:#c51818;padding:0 2px 2px;margin:2px;text-align:center}.c-ical__card__day{font-size:15px;margin:0 auto;width:fit-content;color:black}.c-ical__card__year{font-size:9px;color:#888}.c-ical__card__time{font-size:18px;margin:auto}.c-ical__card__arrow{margin:auto 0}.c-ical__subject{margin:0 auto;text-align:center}.justify-content-center{-ms-flex-pack:center !important;justify-content:center !important} \ No newline at end of file diff --git a/plugins/yetiforce/yetiforce.php b/plugins/yetiforce/yetiforce.php index 346b1e2f..9f16363d 100644 --- a/plugins/yetiforce/yetiforce.php +++ b/plugins/yetiforce/yetiforce.php @@ -715,19 +715,29 @@ public function appendIcsPreview($args) chdir($currentPath); $evTemplate = '
    '; foreach ($icsRecords as $record) { + var_dump($record); if ($record->getValueByField('time_start') || $record->getValueByField('time_end')) { $dateStart = strtotime($record->getDisplayValue('date_start')); $dateStartCard = $this->cardTemplate($dateStart); $dueDate = strtotime($record->getDisplayValue('due_date')); $dueDateCard = ''; if (date('Y-m-d', $dateStart) !== date('Y-m-d', $dueDate)) { - $dueDateCard = '' . $this->cardTemplate($dueDate); + $dueDateCard = "{$this->cardTemplate($dueDate)}"; } - $evTemplate .= "
    - $dateStartCard - $dueDateCard -
    -

    {$record->getDisplayValue('subject')}

    + $fields = ''; + $evTemplate .= "
    +

    {$record->getDisplayValue('subject')}

    +
    + $dateStartCard + $dueDateCard +
    + {$record->getDisplayValue('time_start')} + + {$record->getDisplayValue('time_end')} +
    +
    +
    + $fields
    "; } From a9b94beda393e06e37c1e6c5b05f25d5879be40a Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Fri, 18 Jan 2019 11:21:34 +0100 Subject: [PATCH 22/38] Added fields to ical preview --- plugins/yetiforce/preview.css | 14 ++++-------- plugins/yetiforce/preview.min.css | 2 +- plugins/yetiforce/yetiforce.php | 37 ++++++++++++++++++++++++++----- 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/plugins/yetiforce/preview.css b/plugins/yetiforce/preview.css index 4bf28f46..c9c6e365 100644 --- a/plugins/yetiforce/preview.css +++ b/plugins/yetiforce/preview.css @@ -181,11 +181,11 @@ .c-ical__card__time { font-size: 18px; - margin: auto; + margin: auto 5px; } .c-ical__card__arrow { - margin: auto 0; + margin: auto 5px; } .c-ical__subject { @@ -193,12 +193,6 @@ text-align: center; } -/*.justify-content-around {*/ -/*-ms-flex-pack: distribute !important;*/ -/*justify-content: space-around !important;*/ -/*}*/ - -.justify-content-center { - -ms-flex-pack: center !important; - justify-content: center !important; +.mr-1 { + margin-right: 0.25rem; } \ No newline at end of file diff --git a/plugins/yetiforce/preview.min.css b/plugins/yetiforce/preview.min.css index 61713981..0379eeee 100644 --- a/plugins/yetiforce/preview.min.css +++ b/plugins/yetiforce/preview.min.css @@ -1 +1 @@ -.pull-right{float:right !important}#ytActionBarContent select{padding:0}#ytActionBarContent .row:before{display:table;content:" "}#ytActionBarContent .row:after{clear:both;display:table;content:" "}#ytActionBarContent .ytHeader{position:relative;border-bottom:1px solid #dfdfdf}#ytActionBarContent .rowReletedRecord .rowActions{display:none}#ytActionBarContent .rowReletedRecord:hover .rowActions{display:block}#ytActionBarContent .noRecords{background:#70a8cb;text-align:center;color:#fff;padding:2px 0}#ytActionBarContent .noRecords a.importMail{color:#ecf6ff;cursor:pointer;font-weight:800}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .pull-right button{line-height:10px;margin-left:3px;padding:0 6px;height:14px}#ytActionBarContent .relatedModuleIcon{margin-right:5px}#messageheader.previewheader{padding:0 0 3px 30px}.rcmaddcontact{display:none}.mr-5px{margin-right:5px}.ml-5px{margin-left:5px}.w-100{width:100%}.flex-wrap{display:flex;flex-wrap:wrap}.flex-nowrap{display:flex;flex-wrap:nowrap}.rowRelatedRecord{padding:2px}.action-bar__head__container{display:flex;flex-wrap:nowrap}.action-bar__data a{text-decoration:none;color:#000;font-size:14px;line-height:14px}.action-bar__header{font-size:14px;min-width:90px}.action-bar__head{background-color:#4a5364;height:20px;color:#fff;padding:2px}.action-bar__col{width:100%}@media only screen and (min-width:600px){#ytActionBarContent .action-bar__col{width:50%}}@media only screen and (min-width:1200px){#ytActionBarContent .action-bar__col{width:25%}}.c-ical{margin:2px}.c-ical__event{background:#fffdfd;margin:2px 0;border:1px solid #dedede;margin:3px auto;border-radius:6px}.c-ical__wrapper{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:3px}.c-ical__card{width:fit-content;height:fit-content;background:white;border:1px solid #d0d0d0;border-radius:6px;color:#c51818;padding:0 2px 2px;margin:2px;text-align:center}.c-ical__card__day{font-size:15px;margin:0 auto;width:fit-content;color:black}.c-ical__card__year{font-size:9px;color:#888}.c-ical__card__time{font-size:18px;margin:auto}.c-ical__card__arrow{margin:auto 0}.c-ical__subject{margin:0 auto;text-align:center}.justify-content-center{-ms-flex-pack:center !important;justify-content:center !important} \ No newline at end of file +.pull-right{float:right !important}#ytActionBarContent select{padding:0}#ytActionBarContent .row:before{display:table;content:" "}#ytActionBarContent .row:after{clear:both;display:table;content:" "}#ytActionBarContent .ytHeader{position:relative;border-bottom:1px solid #dfdfdf}#ytActionBarContent .rowReletedRecord .rowActions{display:none}#ytActionBarContent .rowReletedRecord:hover .rowActions{display:block}#ytActionBarContent .noRecords{background:#70a8cb;text-align:center;color:#fff;padding:2px 0}#ytActionBarContent .noRecords a.importMail{color:#ecf6ff;cursor:pointer;font-weight:800}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .pull-right button{line-height:10px;margin-left:3px;padding:0 6px;height:14px}#ytActionBarContent .relatedModuleIcon{margin-right:5px}#messageheader.previewheader{padding:0 0 3px 30px}.rcmaddcontact{display:none}.mr-5px{margin-right:5px}.ml-5px{margin-left:5px}.w-100{width:100%}.flex-wrap{display:flex;flex-wrap:wrap}.flex-nowrap{display:flex;flex-wrap:nowrap}.rowRelatedRecord{padding:2px}.action-bar__head__container{display:flex;flex-wrap:nowrap}.action-bar__data a{text-decoration:none;color:#000;font-size:14px;line-height:14px}.action-bar__header{font-size:14px;min-width:90px}.action-bar__head{background-color:#4a5364;height:20px;color:#fff;padding:2px}.action-bar__col{width:100%}@media only screen and (min-width:600px){#ytActionBarContent .action-bar__col{width:50%}}@media only screen and (min-width:1200px){#ytActionBarContent .action-bar__col{width:25%}}.c-ical{margin:2px}.c-ical__event{background:#fffdfd;margin:2px 0;border:1px solid #dedede;margin:3px auto;border-radius:6px}.c-ical__wrapper{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:3px}.c-ical__card{width:fit-content;height:fit-content;background:white;border:1px solid #d0d0d0;border-radius:6px;color:#c51818;padding:0 2px 2px;margin:2px;text-align:center}.c-ical__card__day{font-size:15px;margin:0 auto;width:fit-content;color:black}.c-ical__card__year{font-size:9px;color:#888}.c-ical__card__time{font-size:18px;margin:auto 5px}.c-ical__card__arrow{margin:auto 5px}.c-ical__subject{margin:0 auto;text-align:center}.mr-1{margin-right:.25rem} \ No newline at end of file diff --git a/plugins/yetiforce/yetiforce.php b/plugins/yetiforce/yetiforce.php index 9f16363d..e9232c0a 100644 --- a/plugins/yetiforce/yetiforce.php +++ b/plugins/yetiforce/yetiforce.php @@ -714,27 +714,54 @@ public function appendIcsPreview($args) $icsRecords = \App\Utils\iCalendar::import($filePath); chdir($currentPath); $evTemplate = '
    '; + $translationMod = 'Calendar'; foreach ($icsRecords as $record) { - var_dump($record); if ($record->getValueByField('time_start') || $record->getValueByField('time_end')) { $dateStart = strtotime($record->getDisplayValue('date_start')); $dateStartCard = $this->cardTemplate($dateStart); $dueDate = strtotime($record->getDisplayValue('due_date')); $dueDateCard = ''; if (date('Y-m-d', $dateStart) !== date('Y-m-d', $dueDate)) { - $dueDateCard = "{$this->cardTemplate($dueDate)}"; + $dueDateCard = $this->cardTemplate($dueDate); } $fields = ''; + if ($location = $record->getDisplayValue('location')) { + $locationLabel = \App\Language::translate('Location', $translationMod); + $fields .= "
    $locationLabel: $location
    "; + } + if ($status = $record->getDisplayValue('activitystatus')) { + $statusLabel = \App\Language::translate('LBL_STATUS', $translationMod); + $fields .= "
    $statusLabel: $status
    "; + } + if ($type = $record->getDisplayValue('activitytype')) { + $typeLabel = \App\Language::translate('Activity Type', $translationMod); + $fields .= "
    $typeLabel: $type
    "; + } + if ($allday = $record->getDisplayValue('allday')) { + $alldayLabel = \App\Language::translate('All day', $translationMod); + $fields .= "
    $alldayLabel: $allday
    "; + } + if ($visibility = $record->getDisplayValue('visibility')) { + $visibilityLabel = \App\Language::translate('Visibility', $translationMod); + $fields .= "
    $visibilityLabel: $visibility
    "; + } + if ($description = $record->getValueByField('description')) { + $descriptionLabel = \App\Language::translate('Description', $translationMod); + $description = \App\TextParser::textTruncate($description, 100); + $fields .= "
    $descriptionLabel: $description
    "; + } $evTemplate .= "

    {$record->getDisplayValue('subject')}

    -
    +
    $dateStartCard - $dueDateCard
    {$record->getDisplayValue('time_start')} - +
    + +
    {$record->getDisplayValue('time_end')}
    + $dueDateCard
    $fields From b82a2eaeaf8fbcbb1b5d51aaff1242d767e643fa Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Fri, 18 Jan 2019 11:56:23 +0100 Subject: [PATCH 23/38] Corrected styles and translations --- plugins/yetiforce/preview.css | 8 ++- plugins/yetiforce/preview.min.css | 2 +- plugins/yetiforce/yetiforce.php | 99 ++++++++++++------------------- 3 files changed, 45 insertions(+), 64 deletions(-) diff --git a/plugins/yetiforce/preview.css b/plugins/yetiforce/preview.css index c9c6e365..79aa24f8 100644 --- a/plugins/yetiforce/preview.css +++ b/plugins/yetiforce/preview.css @@ -149,9 +149,6 @@ } .c-ical__wrapper { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; margin: 3px; } @@ -191,6 +188,11 @@ .c-ical__subject { margin: 0 auto; text-align: center; + background: #4a5364; + color: white; + border-top-left-radius: 6px; + border-top-right-radius: 6px; + padding-bottom: 2px; } .mr-1 { diff --git a/plugins/yetiforce/preview.min.css b/plugins/yetiforce/preview.min.css index 0379eeee..0e858267 100644 --- a/plugins/yetiforce/preview.min.css +++ b/plugins/yetiforce/preview.min.css @@ -1 +1 @@ -.pull-right{float:right !important}#ytActionBarContent select{padding:0}#ytActionBarContent .row:before{display:table;content:" "}#ytActionBarContent .row:after{clear:both;display:table;content:" "}#ytActionBarContent .ytHeader{position:relative;border-bottom:1px solid #dfdfdf}#ytActionBarContent .rowReletedRecord .rowActions{display:none}#ytActionBarContent .rowReletedRecord:hover .rowActions{display:block}#ytActionBarContent .noRecords{background:#70a8cb;text-align:center;color:#fff;padding:2px 0}#ytActionBarContent .noRecords a.importMail{color:#ecf6ff;cursor:pointer;font-weight:800}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .pull-right button{line-height:10px;margin-left:3px;padding:0 6px;height:14px}#ytActionBarContent .relatedModuleIcon{margin-right:5px}#messageheader.previewheader{padding:0 0 3px 30px}.rcmaddcontact{display:none}.mr-5px{margin-right:5px}.ml-5px{margin-left:5px}.w-100{width:100%}.flex-wrap{display:flex;flex-wrap:wrap}.flex-nowrap{display:flex;flex-wrap:nowrap}.rowRelatedRecord{padding:2px}.action-bar__head__container{display:flex;flex-wrap:nowrap}.action-bar__data a{text-decoration:none;color:#000;font-size:14px;line-height:14px}.action-bar__header{font-size:14px;min-width:90px}.action-bar__head{background-color:#4a5364;height:20px;color:#fff;padding:2px}.action-bar__col{width:100%}@media only screen and (min-width:600px){#ytActionBarContent .action-bar__col{width:50%}}@media only screen and (min-width:1200px){#ytActionBarContent .action-bar__col{width:25%}}.c-ical{margin:2px}.c-ical__event{background:#fffdfd;margin:2px 0;border:1px solid #dedede;margin:3px auto;border-radius:6px}.c-ical__wrapper{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:3px}.c-ical__card{width:fit-content;height:fit-content;background:white;border:1px solid #d0d0d0;border-radius:6px;color:#c51818;padding:0 2px 2px;margin:2px;text-align:center}.c-ical__card__day{font-size:15px;margin:0 auto;width:fit-content;color:black}.c-ical__card__year{font-size:9px;color:#888}.c-ical__card__time{font-size:18px;margin:auto 5px}.c-ical__card__arrow{margin:auto 5px}.c-ical__subject{margin:0 auto;text-align:center}.mr-1{margin-right:.25rem} \ No newline at end of file +.pull-right{float:right !important}#ytActionBarContent select{padding:0}#ytActionBarContent .row:before{display:table;content:" "}#ytActionBarContent .row:after{clear:both;display:table;content:" "}#ytActionBarContent .ytHeader{position:relative;border-bottom:1px solid #dfdfdf}#ytActionBarContent .rowReletedRecord .rowActions{display:none}#ytActionBarContent .rowReletedRecord:hover .rowActions{display:block}#ytActionBarContent .noRecords{background:#70a8cb;text-align:center;color:#fff;padding:2px 0}#ytActionBarContent .noRecords a.importMail{color:#ecf6ff;cursor:pointer;font-weight:800}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .pull-right button{line-height:10px;margin-left:3px;padding:0 6px;height:14px}#ytActionBarContent .relatedModuleIcon{margin-right:5px}#messageheader.previewheader{padding:0 0 3px 30px}.rcmaddcontact{display:none}.mr-5px{margin-right:5px}.ml-5px{margin-left:5px}.w-100{width:100%}.flex-wrap{display:flex;flex-wrap:wrap}.flex-nowrap{display:flex;flex-wrap:nowrap}.rowRelatedRecord{padding:2px}.action-bar__head__container{display:flex;flex-wrap:nowrap}.action-bar__data a{text-decoration:none;color:#000;font-size:14px;line-height:14px}.action-bar__header{font-size:14px;min-width:90px}.action-bar__head{background-color:#4a5364;height:20px;color:#fff;padding:2px}.action-bar__col{width:100%}@media only screen and (min-width:600px){#ytActionBarContent .action-bar__col{width:50%}}@media only screen and (min-width:1200px){#ytActionBarContent .action-bar__col{width:25%}}.c-ical{margin:2px}.c-ical__event{background:#fffdfd;margin:2px 0;border:1px solid #dedede;margin:3px auto;border-radius:6px}.c-ical__wrapper{margin:3px}.c-ical__card{width:fit-content;height:fit-content;background:white;border:1px solid #d0d0d0;border-radius:6px;color:#c51818;padding:0 2px 2px;margin:2px;text-align:center}.c-ical__card__day{font-size:15px;margin:0 auto;width:fit-content;color:black}.c-ical__card__year{font-size:9px;color:#888}.c-ical__card__time{font-size:18px;margin:auto 5px}.c-ical__card__arrow{margin:auto 5px}.c-ical__subject{margin:0 auto;text-align:center;background:#4a5364;color:white;border-top-left-radius:6px;border-top-right-radius:6px;padding-bottom:2px}.mr-1{margin-right:.25rem} \ No newline at end of file diff --git a/plugins/yetiforce/yetiforce.php b/plugins/yetiforce/yetiforce.php index e9232c0a..d8d2db95 100644 --- a/plugins/yetiforce/yetiforce.php +++ b/plugins/yetiforce/yetiforce.php @@ -716,60 +716,52 @@ public function appendIcsPreview($args) $evTemplate = '
    '; $translationMod = 'Calendar'; foreach ($icsRecords as $record) { - if ($record->getValueByField('time_start') || $record->getValueByField('time_end')) { - $dateStart = strtotime($record->getDisplayValue('date_start')); - $dateStartCard = $this->cardTemplate($dateStart); - $dueDate = strtotime($record->getDisplayValue('due_date')); - $dueDateCard = ''; - if (date('Y-m-d', $dateStart) !== date('Y-m-d', $dueDate)) { - $dueDateCard = $this->cardTemplate($dueDate); - } - $fields = ''; - if ($location = $record->getDisplayValue('location')) { - $locationLabel = \App\Language::translate('Location', $translationMod); - $fields .= "
    $locationLabel: $location
    "; - } - if ($status = $record->getDisplayValue('activitystatus')) { - $statusLabel = \App\Language::translate('LBL_STATUS', $translationMod); - $fields .= "
    $statusLabel: $status
    "; - } - if ($type = $record->getDisplayValue('activitytype')) { - $typeLabel = \App\Language::translate('Activity Type', $translationMod); - $fields .= "
    $typeLabel: $type
    "; - } - if ($allday = $record->getDisplayValue('allday')) { - $alldayLabel = \App\Language::translate('All day', $translationMod); - $fields .= "
    $alldayLabel: $allday
    "; - } - if ($visibility = $record->getDisplayValue('visibility')) { - $visibilityLabel = \App\Language::translate('Visibility', $translationMod); - $fields .= "
    $visibilityLabel: $visibility
    "; - } - if ($description = $record->getValueByField('description')) { - $descriptionLabel = \App\Language::translate('Description', $translationMod); - $description = \App\TextParser::textTruncate($description, 100); - $fields .= "
    $descriptionLabel: $description
    "; - } - $evTemplate .= "
    + $fields = ''; + if ($dateStart = strtotime($record->getDisplayValue('date_start'))) { + $dateStart = date('Y-m-d H:i:s', $dateStart); + $dateStartLabel = \App\Language::translate('LBL_START'); + $fields .= "
    $dateStartLabel: $dateStart
    "; + } + if ($dueDate = strtotime($record->getDisplayValue('due_date'))) { + $dueDate = date('Y-m-d H:i:s', $dueDate); + $dueDateLabel = \App\Language::translate('LBL_END'); + $fields .= "
    $dueDateLabel: $dueDate
    "; + } + if ($location = $record->getDisplayValue('location')) { + $locationLabel = \App\Language::translate('Location', $translationMod); + $fields .= "
    $locationLabel: $location
    "; + } + if ($status = $record->getDisplayValue('activitystatus')) { + $statusLabel = \App\Language::translate('LBL_STATUS', $translationMod); + $fields .= "
    $statusLabel: $status
    "; + } + if ($type = $record->getDisplayValue('activitytype')) { + $typeLabel = \App\Language::translate('Activity Type', $translationMod); + $type = \App\Language::translate('LBL_' . strtoupper($type), $translationMod); + $fields .= "
    $typeLabel: $type
    "; + } + if ($allday = $record->getDisplayValue('allday')) { + $alldayLabel = \App\Language::translate('All day', $translationMod); + $fields .= "
    $alldayLabel: $allday
    "; + } + if ($visibility = $record->getDisplayValue('visibility')) { + $visibilityLabel = \App\Language::translate('Visibility', $translationMod); + $fields .= "
    $visibilityLabel: $visibility
    "; + } + if ($description = $record->getValueByField('description')) { + $descriptionLabel = \App\Language::translate('Description', $translationMod); + $description = \App\TextParser::textTruncate($description, 100); + $fields .= "
    $descriptionLabel: $description
    "; + } + $evTemplate .= "

    {$record->getDisplayValue('subject')}

    -
    - $dateStartCard -
    - {$record->getDisplayValue('time_start')} -
    - -
    - {$record->getDisplayValue('time_end')} -
    - $dueDateCard -
    $fields
    "; - } } $evTemplate .= '
    '; + $args['content'] .= html::p(['class' => ''], html::a([ @@ -786,19 +778,6 @@ public function appendIcsPreview($args) return $args; } - public function cardTemplate($date) - { - $monthName = \App\Language::translate(date('M', $date)); - $yearName = date('Y', $date); - $dayName = date('w', $date); - return "
    - $yearName -
    - $monthName -
    $dayName
    -
    "; - } - /** * Check if $part is ics. * From 581cb7d6853118d2db8031da2aa1b3340f576cd5 Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Fri, 18 Jan 2019 13:32:26 +0100 Subject: [PATCH 24/38] Cleaned code --- plugins/yetiforce/yetiforce.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/plugins/yetiforce/yetiforce.php b/plugins/yetiforce/yetiforce.php index d8d2db95..ef0cd842 100644 --- a/plugins/yetiforce/yetiforce.php +++ b/plugins/yetiforce/yetiforce.php @@ -12,7 +12,13 @@ class yetiforce extends rcube_plugin private $autologin; private $currentUser; private $viewData = []; - private $message; + /** + * @var array + */ + private $message = []; + /** + * @var array + */ private $icsParts = []; public function init() @@ -670,7 +676,11 @@ public function getConntentEmailTemplate() exit; } - public function setIcsData($args) + /** + * Set ics data + * @param array $args + */ + public function setIcsData(array $args) { $this->message = $args['object']; foreach ((array)$this->message->attachments as $attachment) { @@ -712,6 +722,7 @@ public function appendIcsPreview($args) chdir($this->rc->config->get('root_directory')); $this->loadCurrentUser(); $icsRecords = \App\Utils\iCalendar::import($filePath); + unlink($filePath); chdir($currentPath); $evTemplate = '
    '; $translationMod = 'Calendar'; From 9f249740d2164da6ddf01dc6fbbe638876e4a1c6 Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Mon, 21 Jan 2019 08:28:51 +0100 Subject: [PATCH 25/38] Refactored adding translations --- plugins/yetiforce/yetiforce.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/yetiforce/yetiforce.php b/plugins/yetiforce/yetiforce.php index ef0cd842..dd9d763e 100644 --- a/plugins/yetiforce/yetiforce.php +++ b/plugins/yetiforce/yetiforce.php @@ -33,6 +33,7 @@ public function init() $this->register_action('plugin.yetiforce.getConntentEmailTemplate', [$this, 'getConntentEmailTemplate']); $this->rc->output->set_env('site_URL', $this->rc->config->get('site_URL')); $this->include_stylesheet($this->rc->config->get('public_URL') . 'layouts/resources/icons/userIcons.css'); + $this->add_texts('localization/', false); $currentPath = getcwd(); chdir($this->rc->config->get('root_directory')); @@ -48,7 +49,6 @@ public function init() $this->viewData['compose']['composeAddressModules'] = $composeAddressModules; $this->rc->output->set_env('isPermittedMailTemplates', \App\Privilege::isPermitted('EmailTemplates')); - $this->add_texts('localization/', false); $this->include_script('compose.js'); $this->add_hook('message_compose_body', [$this, 'messageComposeBody']); @@ -693,9 +693,6 @@ public function setIcsData(array $args) $this->icsParts[] = ['part' => $attachment->mime_id, 'uid' => $this->message->uid]; } } - if ($this->icsParts) { - $this->add_texts('localization'); - } } /** From b81ba3a42b9ef728e222ea011da47378f41cb7a5 Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Mon, 21 Jan 2019 10:21:33 +0100 Subject: [PATCH 26/38] Added minor corrections --- plugins/yetiforce/yetiforce.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/yetiforce/yetiforce.php b/plugins/yetiforce/yetiforce.php index dd9d763e..52fe8ec1 100644 --- a/plugins/yetiforce/yetiforce.php +++ b/plugins/yetiforce/yetiforce.php @@ -698,7 +698,7 @@ public function setIcsData(array $args) /** * Append ical preview in attachments' area. * - * @param $args + * @param array $args * * @return mixed */ @@ -725,12 +725,12 @@ public function appendIcsPreview($args) $translationMod = 'Calendar'; foreach ($icsRecords as $record) { $fields = ''; - if ($dateStart = strtotime($record->getDisplayValue('date_start'))) { + if ($dateStart = strtotime($record->get('date_start'))) { $dateStart = date('Y-m-d H:i:s', $dateStart); $dateStartLabel = \App\Language::translate('LBL_START'); $fields .= "
    $dateStartLabel: $dateStart
    "; } - if ($dueDate = strtotime($record->getDisplayValue('due_date'))) { + if ($dueDate = strtotime($record->get('due_date'))) { $dueDate = date('Y-m-d H:i:s', $dueDate); $dueDateLabel = \App\Language::translate('LBL_END'); $fields .= "
    $dueDateLabel: $dueDate
    "; From e252337de7fcd00da1f5c6d5bcb6090fbbe1794d Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Mon, 21 Jan 2019 10:29:37 +0100 Subject: [PATCH 27/38] Update version.php --- version.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.php b/version.php index dfe435fa..0ce7b13e 100644 --- a/version.php +++ b/version.php @@ -1,5 +1,5 @@ '2019.01.07', - 'version' => '0.0.58' + 'patch' => '2019.01.21', + 'version' => '0.0.59' ]; From 58c243c39f24d8269b2a8e30e47e6e3128163999 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Mon, 21 Jan 2019 12:22:53 +0100 Subject: [PATCH 28/38] Improved translation Unnecessary plugin has been removed --- plugins/ical_attachments/ical_attachments.php | 86 ------------------ plugins/ical_attachments/localization/ar.inc | 14 --- .../ical_attachments/localization/ar_SA.inc | 14 --- .../ical_attachments/localization/az_AZ.inc | 14 --- .../ical_attachments/localization/be_BE.inc | 14 --- .../ical_attachments/localization/bg_BG.inc | 14 --- .../ical_attachments/localization/bs_BA.inc | 14 --- .../ical_attachments/localization/ca_ES.inc | 14 --- .../ical_attachments/localization/cs_CZ.inc | 14 --- .../ical_attachments/localization/cy_GB.inc | 14 --- .../ical_attachments/localization/da_DK.inc | 14 --- .../ical_attachments/localization/de_CH.inc | 14 --- .../ical_attachments/localization/de_DE.inc | 14 --- .../ical_attachments/localization/el_GR.inc | 14 --- .../ical_attachments/localization/en_CA.inc | 14 --- .../ical_attachments/localization/en_GB.inc | 14 --- .../ical_attachments/localization/en_US.inc | 14 --- plugins/ical_attachments/localization/eo.inc | 14 --- .../ical_attachments/localization/es_419.inc | 14 --- .../ical_attachments/localization/es_AR.inc | 14 --- .../ical_attachments/localization/es_ES.inc | 14 --- .../ical_attachments/localization/et_EE.inc | 14 --- .../ical_attachments/localization/eu_ES.inc | 14 --- .../ical_attachments/localization/fa_IR.inc | 14 --- .../ical_attachments/localization/fi_FI.inc | 14 --- .../ical_attachments/localization/fo_FO.inc | 14 --- .../ical_attachments/localization/fr_FR.inc | 14 --- .../ical_attachments/localization/gl_ES.inc | 14 --- .../ical_attachments/localization/he_IL.inc | 14 --- .../ical_attachments/localization/hr_HR.inc | 14 --- .../ical_attachments/localization/hu_HU.inc | 14 --- .../ical_attachments/localization/hy_AM.inc | 14 --- .../ical_attachments/localization/id_ID.inc | 14 --- .../ical_attachments/localization/it_IT.inc | 14 --- .../ical_attachments/localization/ja_JP.inc | 14 --- .../ical_attachments/localization/km_KH.inc | 14 --- .../ical_attachments/localization/ko_KR.inc | 14 --- .../ical_attachments/localization/lb_LU.inc | 14 --- .../ical_attachments/localization/lt_LT.inc | 14 --- .../ical_attachments/localization/lv_LV.inc | 14 --- .../ical_attachments/localization/ml_IN.inc | 14 --- .../ical_attachments/localization/mr_IN.inc | 14 --- .../ical_attachments/localization/nb_NO.inc | 14 --- .../ical_attachments/localization/nl_NL.inc | 14 --- .../ical_attachments/localization/nn_NO.inc | 14 --- .../ical_attachments/localization/pl_PL.inc | 13 --- .../ical_attachments/localization/pt_BR.inc | 14 --- .../ical_attachments/localization/pt_PT.inc | 14 --- .../ical_attachments/localization/ro_RO.inc | 14 --- .../ical_attachments/localization/ru_RU.inc | 14 --- .../ical_attachments/localization/si_LK.inc | 14 --- .../ical_attachments/localization/sk_SK.inc | 14 --- .../ical_attachments/localization/sl_SI.inc | 14 --- .../ical_attachments/localization/sr_CS.inc | 14 --- .../ical_attachments/localization/sv_SE.inc | 14 --- .../ical_attachments/localization/tr_TR.inc | 14 --- .../ical_attachments/localization/uk_UA.inc | 14 --- .../ical_attachments/localization/vi_VN.inc | 14 --- .../ical_attachments/localization/zh_CN.inc | 14 --- .../ical_attachments/localization/zh_TW.inc | 14 --- .../skins/larry/ical_add_invite.png | Bin 18659 -> 0 bytes .../ical_attachments/skins/larry/style.css | 18 ---- .../skins/larry/style.min.css | 1 - plugins/yetiforce/yetiforce.php | 8 +- version.php | 2 +- 65 files changed, 6 insertions(+), 934 deletions(-) delete mode 100644 plugins/ical_attachments/ical_attachments.php delete mode 100644 plugins/ical_attachments/localization/ar.inc delete mode 100644 plugins/ical_attachments/localization/ar_SA.inc delete mode 100644 plugins/ical_attachments/localization/az_AZ.inc delete mode 100644 plugins/ical_attachments/localization/be_BE.inc delete mode 100644 plugins/ical_attachments/localization/bg_BG.inc delete mode 100644 plugins/ical_attachments/localization/bs_BA.inc delete mode 100644 plugins/ical_attachments/localization/ca_ES.inc delete mode 100644 plugins/ical_attachments/localization/cs_CZ.inc delete mode 100644 plugins/ical_attachments/localization/cy_GB.inc delete mode 100644 plugins/ical_attachments/localization/da_DK.inc delete mode 100644 plugins/ical_attachments/localization/de_CH.inc delete mode 100644 plugins/ical_attachments/localization/de_DE.inc delete mode 100644 plugins/ical_attachments/localization/el_GR.inc delete mode 100644 plugins/ical_attachments/localization/en_CA.inc delete mode 100644 plugins/ical_attachments/localization/en_GB.inc delete mode 100644 plugins/ical_attachments/localization/en_US.inc delete mode 100644 plugins/ical_attachments/localization/eo.inc delete mode 100644 plugins/ical_attachments/localization/es_419.inc delete mode 100644 plugins/ical_attachments/localization/es_AR.inc delete mode 100644 plugins/ical_attachments/localization/es_ES.inc delete mode 100644 plugins/ical_attachments/localization/et_EE.inc delete mode 100644 plugins/ical_attachments/localization/eu_ES.inc delete mode 100644 plugins/ical_attachments/localization/fa_IR.inc delete mode 100644 plugins/ical_attachments/localization/fi_FI.inc delete mode 100644 plugins/ical_attachments/localization/fo_FO.inc delete mode 100644 plugins/ical_attachments/localization/fr_FR.inc delete mode 100644 plugins/ical_attachments/localization/gl_ES.inc delete mode 100644 plugins/ical_attachments/localization/he_IL.inc delete mode 100644 plugins/ical_attachments/localization/hr_HR.inc delete mode 100644 plugins/ical_attachments/localization/hu_HU.inc delete mode 100644 plugins/ical_attachments/localization/hy_AM.inc delete mode 100644 plugins/ical_attachments/localization/id_ID.inc delete mode 100644 plugins/ical_attachments/localization/it_IT.inc delete mode 100644 plugins/ical_attachments/localization/ja_JP.inc delete mode 100644 plugins/ical_attachments/localization/km_KH.inc delete mode 100644 plugins/ical_attachments/localization/ko_KR.inc delete mode 100644 plugins/ical_attachments/localization/lb_LU.inc delete mode 100644 plugins/ical_attachments/localization/lt_LT.inc delete mode 100644 plugins/ical_attachments/localization/lv_LV.inc delete mode 100644 plugins/ical_attachments/localization/ml_IN.inc delete mode 100644 plugins/ical_attachments/localization/mr_IN.inc delete mode 100644 plugins/ical_attachments/localization/nb_NO.inc delete mode 100644 plugins/ical_attachments/localization/nl_NL.inc delete mode 100644 plugins/ical_attachments/localization/nn_NO.inc delete mode 100644 plugins/ical_attachments/localization/pl_PL.inc delete mode 100644 plugins/ical_attachments/localization/pt_BR.inc delete mode 100644 plugins/ical_attachments/localization/pt_PT.inc delete mode 100644 plugins/ical_attachments/localization/ro_RO.inc delete mode 100644 plugins/ical_attachments/localization/ru_RU.inc delete mode 100644 plugins/ical_attachments/localization/si_LK.inc delete mode 100644 plugins/ical_attachments/localization/sk_SK.inc delete mode 100644 plugins/ical_attachments/localization/sl_SI.inc delete mode 100644 plugins/ical_attachments/localization/sr_CS.inc delete mode 100644 plugins/ical_attachments/localization/sv_SE.inc delete mode 100644 plugins/ical_attachments/localization/tr_TR.inc delete mode 100644 plugins/ical_attachments/localization/uk_UA.inc delete mode 100644 plugins/ical_attachments/localization/vi_VN.inc delete mode 100644 plugins/ical_attachments/localization/zh_CN.inc delete mode 100644 plugins/ical_attachments/localization/zh_TW.inc delete mode 100644 plugins/ical_attachments/skins/larry/ical_add_invite.png delete mode 100644 plugins/ical_attachments/skins/larry/style.css delete mode 100644 plugins/ical_attachments/skins/larry/style.min.css diff --git a/plugins/ical_attachments/ical_attachments.php b/plugins/ical_attachments/ical_attachments.php deleted file mode 100644 index bd1c6aa7..00000000 --- a/plugins/ical_attachments/ical_attachments.php +++ /dev/null @@ -1,86 +0,0 @@ -action == 'show' || $rcmail->action == 'preview') { - $this->add_hook('message_load', array($this, 'message_load')); - $this->add_hook('template_object_messageattachments', array($this, 'html_output')); - } - } - - /** - * Check message bodies and attachments for ical - */ - function message_load($p) - { - $this->message = $p['object']; - - // handle attachments vcard attachments - foreach ((array) $this->message->attachments as $attachment) { - if ($this->is_ics($attachment)) { - $this->ics_parts[] = array('part' => $attachment->mime_id, 'uid' => $this->message->uid); - } - } - // the same with message bodies - foreach ((array) $this->message->parts as $part) { - if ($this->is_ics($part)) { - $this->ics_parts[] = array('part' => $attachment->mime_id, 'uid' => $this->message->uid); - $this->ics_bodies[] = $part->mime_id; - } - } - if ($this->ics_parts) - $this->add_texts('localization'); - } - - /** - * This callback function adds a box below the message content - * if there is a vcard attachment available - */ - function html_output($p) - { - $attach_script = false; - - foreach ($this->ics_parts as $part) { - $icscontent = $this->message->get_part_content($part['part'], null, true); - $file_name = $part['uid']; - $file = '../../../cache/import/' . $file_name . '.ics'; - file_put_contents($file, $icscontent); - - // add box below message body - $p['content'] .= html::p(array('class' => 'icalattachments'), html::a(array( - 'href' => "javascript:void", - 'onclick' => "return rcmail.command('yetiforce.importICS',$file_name,this,event)", - 'title' => $this->gettext('addicalinvitemsg'), - ), html::span(null, rcube::Q($this->gettext('addicalinvitemsg'))) - ) - ); - $attach_script = true; - } - if ($attach_script) { - $this->include_stylesheet($this->local_skin_path() . '/style.css'); - } - return $p; - } - - function is_ics($part) - { - //return ( $part->mimetype == 'application/ics' || $part->mimetype == 'text/calendar' ); - return ( $part->mimetype == 'application/ics' ); - } -} diff --git a/plugins/ical_attachments/localization/ar.inc b/plugins/ical_attachments/localization/ar.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/ar.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/ar_SA.inc b/plugins/ical_attachments/localization/ar_SA.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/ar_SA.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/az_AZ.inc b/plugins/ical_attachments/localization/az_AZ.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/az_AZ.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/be_BE.inc b/plugins/ical_attachments/localization/be_BE.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/be_BE.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/bg_BG.inc b/plugins/ical_attachments/localization/bg_BG.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/bg_BG.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/bs_BA.inc b/plugins/ical_attachments/localization/bs_BA.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/bs_BA.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/ca_ES.inc b/plugins/ical_attachments/localization/ca_ES.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/ca_ES.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/cs_CZ.inc b/plugins/ical_attachments/localization/cs_CZ.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/cs_CZ.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/cy_GB.inc b/plugins/ical_attachments/localization/cy_GB.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/cy_GB.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/da_DK.inc b/plugins/ical_attachments/localization/da_DK.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/da_DK.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/de_CH.inc b/plugins/ical_attachments/localization/de_CH.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/de_CH.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/de_DE.inc b/plugins/ical_attachments/localization/de_DE.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/de_DE.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/el_GR.inc b/plugins/ical_attachments/localization/el_GR.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/el_GR.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/en_CA.inc b/plugins/ical_attachments/localization/en_CA.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/en_CA.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/en_GB.inc b/plugins/ical_attachments/localization/en_GB.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/en_GB.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/en_US.inc b/plugins/ical_attachments/localization/en_US.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/en_US.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/eo.inc b/plugins/ical_attachments/localization/eo.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/eo.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/es_419.inc b/plugins/ical_attachments/localization/es_419.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/es_419.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/es_AR.inc b/plugins/ical_attachments/localization/es_AR.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/es_AR.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/es_ES.inc b/plugins/ical_attachments/localization/es_ES.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/es_ES.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/et_EE.inc b/plugins/ical_attachments/localization/et_EE.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/et_EE.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/eu_ES.inc b/plugins/ical_attachments/localization/eu_ES.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/eu_ES.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/fa_IR.inc b/plugins/ical_attachments/localization/fa_IR.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/fa_IR.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/fi_FI.inc b/plugins/ical_attachments/localization/fi_FI.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/fi_FI.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/fo_FO.inc b/plugins/ical_attachments/localization/fo_FO.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/fo_FO.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/fr_FR.inc b/plugins/ical_attachments/localization/fr_FR.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/fr_FR.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/gl_ES.inc b/plugins/ical_attachments/localization/gl_ES.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/gl_ES.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/he_IL.inc b/plugins/ical_attachments/localization/he_IL.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/he_IL.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/hr_HR.inc b/plugins/ical_attachments/localization/hr_HR.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/hr_HR.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/hu_HU.inc b/plugins/ical_attachments/localization/hu_HU.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/hu_HU.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/hy_AM.inc b/plugins/ical_attachments/localization/hy_AM.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/hy_AM.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/id_ID.inc b/plugins/ical_attachments/localization/id_ID.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/id_ID.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/it_IT.inc b/plugins/ical_attachments/localization/it_IT.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/it_IT.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/ja_JP.inc b/plugins/ical_attachments/localization/ja_JP.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/ja_JP.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/km_KH.inc b/plugins/ical_attachments/localization/km_KH.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/km_KH.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/ko_KR.inc b/plugins/ical_attachments/localization/ko_KR.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/ko_KR.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/lb_LU.inc b/plugins/ical_attachments/localization/lb_LU.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/lb_LU.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/lt_LT.inc b/plugins/ical_attachments/localization/lt_LT.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/lt_LT.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/lv_LV.inc b/plugins/ical_attachments/localization/lv_LV.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/lv_LV.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/ml_IN.inc b/plugins/ical_attachments/localization/ml_IN.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/ml_IN.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/mr_IN.inc b/plugins/ical_attachments/localization/mr_IN.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/mr_IN.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/nb_NO.inc b/plugins/ical_attachments/localization/nb_NO.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/nb_NO.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/nl_NL.inc b/plugins/ical_attachments/localization/nl_NL.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/nl_NL.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/nn_NO.inc b/plugins/ical_attachments/localization/nn_NO.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/nn_NO.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/pl_PL.inc b/plugins/ical_attachments/localization/pl_PL.inc deleted file mode 100644 index 8ff8fa57..00000000 --- a/plugins/ical_attachments/localization/pl_PL.inc +++ /dev/null @@ -1,13 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/pt_BR.inc b/plugins/ical_attachments/localization/pt_BR.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/pt_BR.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/pt_PT.inc b/plugins/ical_attachments/localization/pt_PT.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/pt_PT.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/ro_RO.inc b/plugins/ical_attachments/localization/ro_RO.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/ro_RO.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/ru_RU.inc b/plugins/ical_attachments/localization/ru_RU.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/ru_RU.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/si_LK.inc b/plugins/ical_attachments/localization/si_LK.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/si_LK.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/sk_SK.inc b/plugins/ical_attachments/localization/sk_SK.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/sk_SK.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/sl_SI.inc b/plugins/ical_attachments/localization/sl_SI.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/sl_SI.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/sr_CS.inc b/plugins/ical_attachments/localization/sr_CS.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/sr_CS.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/sv_SE.inc b/plugins/ical_attachments/localization/sv_SE.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/sv_SE.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/tr_TR.inc b/plugins/ical_attachments/localization/tr_TR.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/tr_TR.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/uk_UA.inc b/plugins/ical_attachments/localization/uk_UA.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/uk_UA.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/vi_VN.inc b/plugins/ical_attachments/localization/vi_VN.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/vi_VN.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/zh_CN.inc b/plugins/ical_attachments/localization/zh_CN.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/zh_CN.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/localization/zh_TW.inc b/plugins/ical_attachments/localization/zh_TW.inc deleted file mode 100644 index 390ade57..00000000 --- a/plugins/ical_attachments/localization/zh_TW.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/plugins/ical_attachments/skins/larry/ical_add_invite.png b/plugins/ical_attachments/skins/larry/ical_add_invite.png deleted file mode 100644 index 5b902455ef7f2710684ef3bb37f9fa89ebd46134..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18659 zcmeI3c{o(<|HqFMvZQ^Jp0O0ktj029j2QbGMrc1~&WwpMV`gM~@=%eMM@h0pT5YAG zlu%M>MQB&4kmQMP)T0gGGt?pJ`OWwGeSiP_t~u8==HtHKpU>yqulsY~=bX8&vvsM9 zt%~AYMF0R)?Cq@F;qU3E3=cNlqkX1X@3Z%oj&V_Y9C_|D6j1J#+oPr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0Sa9%q z0!RO;ZM5E7e0>TC9@HBXaPWb}i~oLe9oaqF)#smGM|O{P9rpALmaDFXeWy7NMcBFNkR$HNO2)3Br&A8B%y?8q__|ik{D84l2Af4 zQd|fMNen42Nhl#2DJ}$sB!(21B$N=16c>U*5<`kh5=w|hiVHy@i6O-$2_-}$#f6}d z#P~;Cio-7)LxJ#H#v$>tRuqmCe{^-d+bGZQix#761oaLx>$K5B} z)yK_=n5rj$&4P6c*517tQ=Jsmsg2>^?yFgzlkoLLQ(5fPP(t&&*%3rvv-z`D*CxxI zhZ>FQ{OBKTF62H75~NMYVu;-6D%SU2&wiTfU>>{y>>Bs47w@*VCC3(F_Ug3=eY#8Z zuex7-=iG4kLB}WA-rn^$R_!zOKlH^~FBO&KbSL1currentUser = \App\User::getUserModel($_SESSION['crm']['id']); App\User::setCurrentUserId($_SESSION['crm']['id']); + \App\Language::setTemporaryLanguage($this->currentUser->getDetail('language')); return true; } @@ -677,18 +678,19 @@ public function getConntentEmailTemplate() } /** - * Set ics data + * Set ics data. + * * @param array $args */ public function setIcsData(array $args) { $this->message = $args['object']; - foreach ((array)$this->message->attachments as $attachment) { + foreach ((array) $this->message->attachments as $attachment) { if ($this->isIcs($attachment)) { $this->icsParts[] = ['part' => $attachment->mime_id, 'uid' => $this->message->uid]; } } - foreach ((array)$this->message->parts as $part) { + foreach ((array) $this->message->parts as $part) { if ($this->isIcs($part)) { $this->icsParts[] = ['part' => $attachment->mime_id, 'uid' => $this->message->uid]; } diff --git a/version.php b/version.php index 0ce7b13e..e8fdfe75 100644 --- a/version.php +++ b/version.php @@ -1,5 +1,5 @@ '2019.01.21', - 'version' => '0.0.59' + 'version' => '0.0.60' ]; From 150298a45fc1859a287f515d4c6c4e8f61836212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Skrzypczak?= Date: Mon, 28 Jan 2019 16:38:51 +0100 Subject: [PATCH 29/38] Fixed reading config files --- config/config.inc.php | 2 +- version.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/config.inc.php b/config/config.inc.php index d4c40981..808b89c2 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -6,5 +6,5 @@ $currentPath = getcwd(); chdir(dirname(__FILE__) . '/../../../../../'); include_once('include/ConfigUtils.php'); -include_once('config/modules/OSSMail.php'); +$config = \App\Config::module('OSSMail'); chdir($currentPath); diff --git a/version.php b/version.php index e8fdfe75..bac485a3 100644 --- a/version.php +++ b/version.php @@ -1,5 +1,5 @@ '2019.01.21', - 'version' => '0.0.60' + 'patch' => '2019.01.28', + 'version' => '0.0.61' ]; From fd393b5c13fab182e5eb5b20d63a2e1118658ed3 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Wed, 30 Jan 2019 10:09:35 +0100 Subject: [PATCH 30/38] ICS import has been rebuilt --- plugins/yetiforce/list.js | 42 ----- plugins/yetiforce/list.min.js | 4 - plugins/yetiforce/localization/de_DE.inc | 1 - plugins/yetiforce/localization/en_US.inc | 1 - plugins/yetiforce/localization/pl_PL.inc | 1 - plugins/yetiforce/localization/pt_BR.inc | 1 - plugins/yetiforce/localization/ru_RU.inc | 1 - plugins/yetiforce/preview.js | 29 ++-- plugins/yetiforce/yetiforce.php | 204 ++++++++++++++--------- version.php | 4 +- 10 files changed, 136 insertions(+), 152 deletions(-) delete mode 100644 plugins/yetiforce/list.js delete mode 100644 plugins/yetiforce/list.min.js diff --git a/plugins/yetiforce/list.js b/plugins/yetiforce/list.js deleted file mode 100644 index bdfd01a6..00000000 --- a/plugins/yetiforce/list.js +++ /dev/null @@ -1,42 +0,0 @@ -/* {[The file is published on the basis of MIT License]} */ -window.rcmail && rcmail.addEventListener('listupdate', function (evt) { - //window.crm = getCrmWindow(); - rcmail.register_command('yetiforce.importICS', function (ics, element, e) { - - }, true); - var container = $('#messagelistcontainer'); - var headerFixed = container.find('.records-table.messagelist.sortheader.fixedheader.fixedcopy'); - var messageList = container.find('#messagelist'); - /* - var columnsWidth = window.crm.app.moduleCacheGet('widthColumns'); - if (columnsWidth != null) { - messageList.find('th,td').each(function (index) { - $(this).width(columnsWidth[index]); - }); - headerFixed.find('th,td').each(function (index) { - $(this).width(columnsWidth[index]); - }); - } - */ - /* - headerFixed.colResizable({ - onResize: function (e) { - resizeContentTable(headerFixed, messageList, e); - }, - resizeMode:'fit' - }); - */ -}); - -function resizeContentTable(headerFixed, messageList, e) -{ - var column_widths = []; - headerFixed.find('thead th,thead td').each(function (index) { - column_widths[index] = $(this).width(); - }); - messageList.find('th,td').each(function (index) { - $(this).width(column_widths[index]); - }); - window.crm.app.moduleCacheSet('widthColumns', column_widths); - $(window).scroll(); -} diff --git a/plugins/yetiforce/list.min.js b/plugins/yetiforce/list.min.js deleted file mode 100644 index d2ec0e6c..00000000 --- a/plugins/yetiforce/list.min.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -window.rcmail&&rcmail.addEventListener('listupdate',function(){rcmail.register_command('yetiforce.importICS',function(){},!0);var container=$('#messagelistcontainer'),headerFixed=container.find('.records-table.messagelist.sortheader.fixedheader.fixedcopy'),messageList=container.find('#messagelist');}); -//# sourceMappingURL=list.min.js.map diff --git a/plugins/yetiforce/localization/de_DE.inc b/plugins/yetiforce/localization/de_DE.inc index bd6b2431..c8449bc6 100644 --- a/plugins/yetiforce/localization/de_DE.inc +++ b/plugins/yetiforce/localization/de_DE.inc @@ -3,4 +3,3 @@ $labels = []; $labels['FileFromDesktop'] = 'File from desktop'; $labels['FileFromCRM'] = 'File from CRM'; -$labels['addicalinvitemsg'] = 'Add to my calendar'; diff --git a/plugins/yetiforce/localization/en_US.inc b/plugins/yetiforce/localization/en_US.inc index bd6b2431..c8449bc6 100644 --- a/plugins/yetiforce/localization/en_US.inc +++ b/plugins/yetiforce/localization/en_US.inc @@ -3,4 +3,3 @@ $labels = []; $labels['FileFromDesktop'] = 'File from desktop'; $labels['FileFromCRM'] = 'File from CRM'; -$labels['addicalinvitemsg'] = 'Add to my calendar'; diff --git a/plugins/yetiforce/localization/pl_PL.inc b/plugins/yetiforce/localization/pl_PL.inc index 806167d2..2875ec75 100644 --- a/plugins/yetiforce/localization/pl_PL.inc +++ b/plugins/yetiforce/localization/pl_PL.inc @@ -3,4 +3,3 @@ $labels = []; $labels['FileFromDesktop'] = 'Plik z pulpitu'; $labels['FileFromCRM'] = 'Plik z CRM-a'; -$labels['addicalinvitemsg'] = 'Dodaj do mojego kalendarza'; diff --git a/plugins/yetiforce/localization/pt_BR.inc b/plugins/yetiforce/localization/pt_BR.inc index bd6b2431..c8449bc6 100644 --- a/plugins/yetiforce/localization/pt_BR.inc +++ b/plugins/yetiforce/localization/pt_BR.inc @@ -3,4 +3,3 @@ $labels = []; $labels['FileFromDesktop'] = 'File from desktop'; $labels['FileFromCRM'] = 'File from CRM'; -$labels['addicalinvitemsg'] = 'Add to my calendar'; diff --git a/plugins/yetiforce/localization/ru_RU.inc b/plugins/yetiforce/localization/ru_RU.inc index bd6b2431..c8449bc6 100644 --- a/plugins/yetiforce/localization/ru_RU.inc +++ b/plugins/yetiforce/localization/ru_RU.inc @@ -3,4 +3,3 @@ $labels = []; $labels['FileFromDesktop'] = 'File from desktop'; $labels['FileFromCRM'] = 'File from CRM'; -$labels['addicalinvitemsg'] = 'Add to my calendar'; diff --git a/plugins/yetiforce/preview.js b/plugins/yetiforce/preview.js index 29a4bdbb..e433ca9c 100644 --- a/plugins/yetiforce/preview.js +++ b/plugins/yetiforce/preview.js @@ -3,23 +3,20 @@ window.rcmail && rcmail.addEventListener('init', function (evt) { window.crm = getCrmWindow(); loadActionBar(); rcmail.env.message_commands.push('yetiforce.importICS'); - rcmail.register_command('yetiforce.importICS', function (ics, element, e) { - window.crm.AppConnector.request({ - async: true, - dataType: 'json', - data: { - module: 'Calendar', - action: 'ImportICS', - ics: ics + rcmail.register_command('yetiforce.importICS', function (part, type) { + jQuery.ajax({ + type: 'POST', + url: "./?_task=mail&_action=plugin.yetiforce.importIcs&_mbox=" + urlencode(rcmail.env.mailbox) + '&_uid=' + urlencode(rcmail.env.uid) + '&_part=' + part + '&_type=' + type, + async: false, + success: function (data) { + data = JSON.parse(data); + window.crm.Vtiger_Helper_Js.showPnotify({ + text: data['message'], + type: 'info', + animation: 'show' + }); } - }).done(function (response) { - window.crm.Vtiger_Helper_Js.showPnotify({ - text: response['result'], - type: 'info', - animation: 'show' - }); - $(element).closest('.icalattachments').remove(); - }) + }); }, true); } ); diff --git a/plugins/yetiforce/yetiforce.php b/plugins/yetiforce/yetiforce.php index 4e64b918..33ab9a03 100644 --- a/plugins/yetiforce/yetiforce.php +++ b/plugins/yetiforce/yetiforce.php @@ -31,6 +31,7 @@ public function init() $this->register_action('plugin.yetiforce.addFilesToMail', [$this, 'addFilesToMail']); $this->register_action('plugin.yetiforce.getEmailTemplates', [$this, 'getEmailTemplates']); $this->register_action('plugin.yetiforce.getConntentEmailTemplate', [$this, 'getConntentEmailTemplate']); + $this->register_action('plugin.yetiforce.importIcs', [$this, 'importIcs']); $this->rc->output->set_env('site_URL', $this->rc->config->get('site_URL')); $this->include_stylesheet($this->rc->config->get('public_URL') . 'layouts/resources/icons/userIcons.css'); $this->add_texts('localization/', false); @@ -76,9 +77,7 @@ public function init() } if (empty($this->rc->action)) { //$this->add_hook('preferences_save', array($this, 'prefsSave')); - $this->include_script('colResizable.js'); - $this->include_script('list.js'); } chdir($currentPath); } @@ -686,13 +685,13 @@ public function setIcsData(array $args) { $this->message = $args['object']; foreach ((array) $this->message->attachments as $attachment) { - if ($this->isIcs($attachment)) { - $this->icsParts[] = ['part' => $attachment->mime_id, 'uid' => $this->message->uid]; + if ($attachment->mimetype === 'application/ics' || $attachment->mimetype === 'text/calendar') { + $this->icsParts[] = ['part' => $attachment->mime_id, 'uid' => $this->message->uid, 'type' => 'attachments']; } } foreach ((array) $this->message->parts as $part) { - if ($this->isIcs($part)) { - $this->icsParts[] = ['part' => $attachment->mime_id, 'uid' => $this->message->uid]; + if ($part->mimetype === 'application/ics' || $part->mimetype === 'text/calendar') { + $this->icsParts[] = ['part' => $part->mime_id, 'uid' => $this->message->uid, 'type' => 'parts']; } } } @@ -706,97 +705,136 @@ public function setIcsData(array $args) */ public function appendIcsPreview($args) { - $icsPartsIds = []; + $ics = []; + $currentPath = getcwd(); + chdir($this->rc->config->get('root_directory')); + $this->loadCurrentUser(); + $counterBtn = $counterList = []; foreach ($this->icsParts as $icsPart) { $icsContent = $this->message->get_part_content($icsPart['part'], null, true); - $file_name = $icsPart['uid']; - if (in_array($file_name, $icsPartsIds)) { - continue; - } else { - array_push($icsPartsIds, $file_name); + $calendar = \App\Integrations\Dav\Calendar::loadFromContent($icsContent); + foreach ($calendar->getRecordInstance() as $key => $recordModel) { + if (!isset($ics[$key])) { + $ics[$key] = [$recordModel, $icsPart]; + if (isset($counterBtn[$icsPart['part']])) { + $counterBtn[$icsPart['part']]++; + } else { + $counterBtn[$icsPart['part']] = 1; + } + } } - $filePath = $this->rc->config->get('root_directory') . 'cache/import/' . $file_name . '.ics'; - file_put_contents($filePath, $icsContent); - $currentPath = getcwd(); - chdir($this->rc->config->get('root_directory')); - $this->loadCurrentUser(); - $icsRecords = \App\Utils\iCalendar::import($filePath); - unlink($filePath); - chdir($currentPath); + } + $showPart = []; + $translationMod = 'Calendar'; + $showMore = false; + foreach ($ics as $data) { $evTemplate = '
    '; - $translationMod = 'Calendar'; - foreach ($icsRecords as $record) { - $fields = ''; - if ($dateStart = strtotime($record->get('date_start'))) { - $dateStart = date('Y-m-d H:i:s', $dateStart); - $dateStartLabel = \App\Language::translate('LBL_START'); - $fields .= "
    $dateStartLabel: $dateStart
    "; - } - if ($dueDate = strtotime($record->get('due_date'))) { - $dueDate = date('Y-m-d H:i:s', $dueDate); - $dueDateLabel = \App\Language::translate('LBL_END'); - $fields .= "
    $dueDateLabel: $dueDate
    "; - } - if ($location = $record->getDisplayValue('location')) { - $locationLabel = \App\Language::translate('Location', $translationMod); - $fields .= "
    $locationLabel: $location
    "; - } - if ($status = $record->getDisplayValue('activitystatus')) { - $statusLabel = \App\Language::translate('LBL_STATUS', $translationMod); - $fields .= "
    $statusLabel: $status
    "; - } - if ($type = $record->getDisplayValue('activitytype')) { - $typeLabel = \App\Language::translate('Activity Type', $translationMod); - $type = \App\Language::translate('LBL_' . strtoupper($type), $translationMod); - $fields .= "
    $typeLabel: $type
    "; - } - if ($allday = $record->getDisplayValue('allday')) { - $alldayLabel = \App\Language::translate('All day', $translationMod); - $fields .= "
    $alldayLabel: $allday
    "; - } - if ($visibility = $record->getDisplayValue('visibility')) { - $visibilityLabel = \App\Language::translate('Visibility', $translationMod); - $fields .= "
    $visibilityLabel: $visibility
    "; - } - if ($description = $record->getValueByField('description')) { - $descriptionLabel = \App\Language::translate('Description', $translationMod); - $description = \App\TextParser::textTruncate($description, 100); - $fields .= "
    $descriptionLabel: $description
    "; - } - $evTemplate .= "
    + [$record, $icsPart] = $data; + $fields = ''; + if (!$record->isEmpty('date_start')) { + $dateStart = $record->getDisplayValue('date_start'); + $dateStartLabel = \App\Language::translate('LBL_START'); + $fields .= "
    $dateStartLabel: $dateStart
    "; + } + if (!$record->isEmpty('due_date')) { + $dueDate = $record->getDisplayValue('due_date'); + $dueDateLabel = \App\Language::translate('LBL_END'); + $fields .= "
    $dueDateLabel: $dueDate
    "; + } + if ($location = $record->getDisplayValue('location', false, false, 100)) { + $locationLabel = \App\Language::translate('Location', $translationMod); + $fields .= "
    $locationLabel: $location
    "; + } + if ($status = $record->getDisplayValue('activitystatus')) { + $statusLabel = \App\Language::translate('LBL_STATUS', $translationMod); + $fields .= "
    $statusLabel: $status
    "; + } + if ($type = $record->getDisplayValue('activitytype')) { + $typeLabel = \App\Language::translate('Activity Type', $translationMod); + $fields .= "
    $typeLabel: $type
    "; + } + if ($allday = $record->getDisplayValue('allday')) { + $alldayLabel = \App\Language::translate('All day', $translationMod); + $fields .= "
    $alldayLabel: $allday
    "; + } + if ($visibility = $record->getDisplayValue('visibility')) { + $visibilityLabel = \App\Language::translate('Visibility', $translationMod); + $fields .= "
    $visibilityLabel: $visibility
    "; + } + if ($priority = $record->getDisplayValue('taskpriority')) { + $label = \App\Language::translate('Priority', $translationMod); + $fields .= "
    $label: $priority
    "; + } + if ($state = $record->getDisplayValue('state')) { + $label = \App\Language::translate('LBL_STATE', $translationMod); + $fields .= "
    $label: $state
    "; + } + if ($description = $record->getDisplayValue('description', false, false, 100)) { + $descriptionLabel = \App\Language::translate('Description', $translationMod); + $fields .= "
    $descriptionLabel: $description
    "; + } + $evTemplate .= "

    {$record->getDisplayValue('subject')}

    $fields
    "; - } $evTemplate .= '
    '; - - $args['content'] .= - html::p(['class' => ''], - html::a([ - 'href' => 'javascript:void', - 'onclick' => "return rcmail.command('yetiforce.importICS',$file_name,this,event)", - 'title' => $this->gettext('addicalinvitemsg'), - ], - html::span(null, rcube::Q($this->gettext('addicalinvitemsg')) - ) - ) - ); - $args['content'] .= html::div(null, $evTemplate); + if (!isset($showPart[$icsPart['part']])) { + $showPart[$icsPart['part']] = $icsPart['part']; + $title = \App\Language::translate('LBL_ADD_TO_MY_CALENDAR', 'OSSMail'); + $counterText = empty($counterBtn[$icsPart['part']]) ? '' : ($counterBtn[$icsPart['part']] > 1 ? " ({$counterBtn[$icsPart['part']]})" : ''); + $args['content'] .= + html::p(['class' => ''], + html::a([ + 'href' => 'javascript:void', + 'class' => 'button', + 'onclick' => "return rcmail.command('yetiforce.importICS',{$icsPart['part']},'{$icsPart['type']}')", + 'title' => $title, + ], html::span(null, "{$title}{$counterText}")) + ) . html::div(null, $evTemplate); + } elseif ($counterList[$icsPart['part']] < 4) { + $args['content'] .= html::div(null, $evTemplate); + } else { + $showMore = true; + } + if (isset($counterList[$icsPart['part']])) { + $counterList[$icsPart['part']]++; + } else { + $counterList[$icsPart['part']] = 1; + } } + if ($showMore) { + $args['content'] .= html::div(null, '...'); + } + chdir($currentPath); return $args; } - /** - * Check if $part is ics. - * - * @param $part - * - * @return bool - */ - public function isIcs($part) + public function importIcs() { - return $part->mimetype == 'application/ics' || $part->mimetype == 'text/calendar'; + $uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GPC); + $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GPC); + $mime_id = rcube_utils::get_input_value('_part', rcube_utils::INPUT_GPC); + $status = 0; + if ($uid && $mbox && $mime_id) { + $currentPath = getcwd(); + chdir($this->rc->config->get('root_directory')); + $this->loadCurrentUser(); + $message = new rcube_message($uid, $mbox); + $calendar = \App\Integrations\Dav\Calendar::loadFromContent($message->get_part_body($mime_id)); + foreach ($calendar->getRecordInstance() as $key => $recordModel) { + $recordModel->set('assigned_user_id', $this->currentUser->getId()); + $recordModel->save(); + if ($recordModel->getId()) { + $status++; + } + } + chdir($currentPath); + } + echo App\Json::encode([ + 'message' => $status ? \App\Language::translateArgs('LBL_FILE_HAS_BEEN_IMPORTED', 'OSSMail', $status) : \App\Language::translate('LBL_ERROR_OCCURRED_DURING_IMPORT', 'OSSMail'), + ]); + exit; } } diff --git a/version.php b/version.php index bac485a3..74e62530 100644 --- a/version.php +++ b/version.php @@ -1,5 +1,5 @@ '2019.01.28', - 'version' => '0.0.61' + 'patch' => '2019.01.30', + 'version' => '0.0.62' ]; From 4b1cf64a6cc81b0af54bd8491331cd37412712a8 Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Wed, 30 Jan 2019 10:22:58 +0100 Subject: [PATCH 31/38] Added preview.min.js file --- plugins/yetiforce/preview.min.js | 2 +- plugins/yetiforce/preview.min.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/yetiforce/preview.min.js b/plugins/yetiforce/preview.min.js index c8fd1c74..d832defb 100644 --- a/plugins/yetiforce/preview.min.js +++ b/plugins/yetiforce/preview.min.js @@ -6,5 +6,5 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; -window.rcmail&&rcmail.addEventListener('init',function(){window.crm=getCrmWindow(),loadActionBar(),rcmail.env.message_commands.push('yetiforce.importICS'),rcmail.register_command('yetiforce.importICS',function(ics,element){window.crm.AppConnector.request({async:!0,dataType:'json',data:{module:'Calendar',action:'ImportICS',ics:ics}}).done(function(response){window.crm.Vtiger_Helper_Js.showPnotify({text:response.result,type:'info',animation:'show'}),$(element).closest('.icalattachments').remove();});},!0);});function loadActionBar(){var content=$('#ytActionBarContent'),params={module:'OSSMail',view:'MailActionBar',uid:rcmail.env.uid,folder:rcmail.env.mailbox,rcId:rcmail.env.user_id};window.crm.AppConnector.request(params).done(function(response){content.find('.ytHeader').html(response),$('#messagecontent').css('top',content.outerHeight()+$('#messageheader').outerHeight()+'px'),registerEvents(content);});}function registerEvents(content){registerAddRecord(content),registerAddReletedRecord(content),registerSelectRecord(content),registerRemoveRecord(content),registerImportMail(content);var block=content.find('.ytHeader .js-data');content.find('.hideBtn').click(function(){var button=$(this),icon=button.find('.glyphicon');'0'==button.data('type')?(button.data('type','1'),icon.removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down')):(button.data('type','0'),icon.removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up')),block.toggle(),$(window).trigger('resize');});}function registerImportMail(content){content.find('.importMail').click(function(){window.crm.Vtiger_Helper_Js.showPnotify({text:window.crm.app.vtranslate('StartedDownloadingEmail'),type:'info'}),window.crm.AppConnector.request({module:'OSSMail',action:'ImportMail',params:{uid:rcmail.env.uid,folder:rcmail.env.mailbox,rcId:rcmail.env.user_id}}).done(function(){loadActionBar(),window.crm.Vtiger_Helper_Js.showPnotify({text:window.crm.app.vtranslate('AddFindEmailInRecord'),type:'success'});});});}function registerRemoveRecord(content){content.find('button.removeRecord').click(function(e){var row=$(e.currentTarget).closest('.rowRelatedRecord');removeRecord(row.data('id'));});}function registerSelectRecord(content){var id=content.find('#mailActionBarID').val();content.find('button.selectRecord').click(function(){var relParams={mailId:id};if(0==$(this).data('type')){var module=$(this).closest('.js-head-container').find('.module').val();if(null===module)return}else{var module=$(this).data('module');relParams.crmid=$(this).closest('.rowRelatedRecord').data('id'),relParams.mod=$(this).closest('.rowRelatedRecord').data('module'),relParams.newModule=module;}showPopup({module:module,src_module:'OSSMailView',src_record:id},relParams);});}function registerAddReletedRecord(content){content.find('#mailActionBarID').val();content.find('button.addRelatedRecord').click(function(e){var targetElement=$(e.currentTarget),row=targetElement.closest('.rowRelatedRecord'),params={sourceModule:row.data('module')};showQuickCreateForm(targetElement.data('module'),row.data('id'),params);});}function registerAddRecord(content){var id=content.find('#mailActionBarID').val();content.find('button.addRecord').click(function(e){var col=$(e.currentTarget).closest('.js-head-container'),selectValue=col.find('.module').val();null!==selectValue&&showQuickCreateForm(selectValue,id);});}function removeRecord(crmid){var id=$('#mailActionBarID').val(),params={};params.data={module:'OSSMail',action:'ExecuteActions',mode:'removeRelated',params:{mailId:id,crmid:crmid}},params.async=!1,params.dataType='json',window.crm.AppConnector.request(params).done(function(data){var response=data.result;if(response.success)var notifyParams={text:response.data,type:'info',animation:'show'};else var notifyParams={text:response.data,animation:'show'};window.crm.Vtiger_Helper_Js.showPnotify(notifyParams),loadActionBar();});}function showPopup(params,actionsParams){actionsParams.newModule=params.module,window.crm.app.showRecordsList(params,function(modal,instance){instance.setSelectEvent(function(responseData){actionsParams.newCrmId=responseData.id,window.crm.AppConnector.request({async:!1,dataType:'json',data:{module:'OSSMail',action:'ExecuteActions',mode:'addRelated',params:actionsParams}}).done(function(data){var response=data.result;if(response.success)var notifyParams={text:response.data,type:'info',animation:'show'};else var notifyParams={text:response.data,animation:'show'};window.crm.Vtiger_Helper_Js.showPnotify(notifyParams),loadActionBar();});});});}function showQuickCreateForm(moduleName,record,params){var content=$('#ytActionBarContent');var relatedParams={};if(false)var sourceModule=params.sourceModule;else var sourceModule='OSSMailView';var postShown=function(data){$('').appendTo(data),$('').appendTo(data),$('').appendTo(data);},ids={link:'modulesLevel0',process:'modulesLevel1',subprocess:'modulesLevel2',linkextend:'modulesLevel3'};for(var i in ids){var element=content.find('#'+ids[i]),value=element.length?JSON.parse(element.val()):[];0<=$.inArray(sourceModule,value)&&(relatedParams[i]=record);}'Leads'==moduleName&&(relatedParams.company=rcmail.env.fromName),('Leads'==moduleName||'Contacts'==moduleName)&&(relatedParams.lastname=rcmail.env.fromName),'Project'==moduleName&&(relatedParams.projectname=rcmail.env.subject),'HelpDesk'==moduleName&&(relatedParams.ticket_title=rcmail.env.subject),'Products'==moduleName&&(relatedParams.productname=rcmail.env.subject),'Services'==moduleName&&(relatedParams.servicename=rcmail.env.subject),relatedParams.email=rcmail.env.fromMail,relatedParams.email1=rcmail.env.fromMail,relatedParams.description=$('#messagebody').text();relatedParams.sourceModule=sourceModule,relatedParams.sourceRecord=record,relatedParams.relationOperation=!0;var headerInstance=new window.crm.Vtiger_Header_Js;headerInstance.quickCreateModule(moduleName,{callbackFunction:function postQuickCreate(){loadActionBar();},callbackPostShown:postShown,data:relatedParams,noCache:!0});}function getCrmWindow(){if(null!==opener&&'object'==opener.parent.CONFIG)return opener.parent;return 'object'==_typeof(parent.CONFIG)?parent:'object'==_typeof(parent.parent.CONFIG)?parent.parent:!('object'!=_typeof(opener.crm.CONFIG))&&opener.crm} +window.rcmail&&rcmail.addEventListener('init',function(){window.crm=getCrmWindow(),loadActionBar(),rcmail.env.message_commands.push('yetiforce.importICS'),rcmail.register_command('yetiforce.importICS',function(part,type){jQuery.ajax({type:'POST',url:'./?_task=mail&_action=plugin.yetiforce.importIcs&_mbox='+urlencode(rcmail.env.mailbox)+'&_uid='+urlencode(rcmail.env.uid)+'&_part='+part+'&_type='+type,async:!1,success:function success(data){data=JSON.parse(data),window.crm.Vtiger_Helper_Js.showPnotify({text:data.message,type:'info',animation:'show'});}});},!0);});function loadActionBar(){var content=$('#ytActionBarContent'),params={module:'OSSMail',view:'MailActionBar',uid:rcmail.env.uid,folder:rcmail.env.mailbox,rcId:rcmail.env.user_id};window.crm.AppConnector.request(params).done(function(response){content.find('.ytHeader').html(response),$('#messagecontent').css('top',content.outerHeight()+$('#messageheader').outerHeight()+'px'),registerEvents(content);});}function registerEvents(content){registerAddRecord(content),registerAddReletedRecord(content),registerSelectRecord(content),registerRemoveRecord(content),registerImportMail(content);var block=content.find('.ytHeader .js-data');content.find('.hideBtn').click(function(){var button=$(this),icon=button.find('.glyphicon');'0'==button.data('type')?(button.data('type','1'),icon.removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down')):(button.data('type','0'),icon.removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up')),block.toggle(),$(window).trigger('resize');});}function registerImportMail(content){content.find('.importMail').click(function(){window.crm.Vtiger_Helper_Js.showPnotify({text:window.crm.app.vtranslate('StartedDownloadingEmail'),type:'info'}),window.crm.AppConnector.request({module:'OSSMail',action:'ImportMail',params:{uid:rcmail.env.uid,folder:rcmail.env.mailbox,rcId:rcmail.env.user_id}}).done(function(){loadActionBar(),window.crm.Vtiger_Helper_Js.showPnotify({text:window.crm.app.vtranslate('AddFindEmailInRecord'),type:'success'});});});}function registerRemoveRecord(content){content.find('button.removeRecord').click(function(e){var row=$(e.currentTarget).closest('.rowRelatedRecord');removeRecord(row.data('id'));});}function registerSelectRecord(content){var id=content.find('#mailActionBarID').val();content.find('button.selectRecord').click(function(){var relParams={mailId:id};if(0==$(this).data('type')){var module=$(this).closest('.js-head-container').find('.module').val();if(null===module)return}else{var module=$(this).data('module');relParams.crmid=$(this).closest('.rowRelatedRecord').data('id'),relParams.mod=$(this).closest('.rowRelatedRecord').data('module'),relParams.newModule=module;}showPopup({module:module,src_module:'OSSMailView',src_record:id},relParams);});}function registerAddReletedRecord(content){content.find('#mailActionBarID').val();content.find('button.addRelatedRecord').click(function(e){var targetElement=$(e.currentTarget),row=targetElement.closest('.rowRelatedRecord'),params={sourceModule:row.data('module')};showQuickCreateForm(targetElement.data('module'),row.data('id'),params);});}function registerAddRecord(content){var id=content.find('#mailActionBarID').val();content.find('button.addRecord').click(function(e){var col=$(e.currentTarget).closest('.js-head-container'),selectValue=col.find('.module').val();null!==selectValue&&showQuickCreateForm(selectValue,id);});}function removeRecord(crmid){var id=$('#mailActionBarID').val(),params={};params.data={module:'OSSMail',action:'ExecuteActions',mode:'removeRelated',params:{mailId:id,crmid:crmid}},params.async=!1,params.dataType='json',window.crm.AppConnector.request(params).done(function(data){var response=data.result;if(response.success)var notifyParams={text:response.data,type:'info',animation:'show'};else var notifyParams={text:response.data,animation:'show'};window.crm.Vtiger_Helper_Js.showPnotify(notifyParams),loadActionBar();});}function showPopup(params,actionsParams){actionsParams.newModule=params.module,window.crm.app.showRecordsList(params,function(modal,instance){instance.setSelectEvent(function(responseData){actionsParams.newCrmId=responseData.id,window.crm.AppConnector.request({async:!1,dataType:'json',data:{module:'OSSMail',action:'ExecuteActions',mode:'addRelated',params:actionsParams}}).done(function(data){var response=data.result;if(response.success)var notifyParams={text:response.data,type:'info',animation:'show'};else var notifyParams={text:response.data,animation:'show'};window.crm.Vtiger_Helper_Js.showPnotify(notifyParams),loadActionBar();});});});}function showQuickCreateForm(moduleName,record,params){var content=$('#ytActionBarContent');var relatedParams={};if(false)var sourceModule=params.sourceModule;else var sourceModule='OSSMailView';var postShown=function(data){$('').appendTo(data),$('').appendTo(data),$('').appendTo(data);},ids={link:'modulesLevel0',process:'modulesLevel1',subprocess:'modulesLevel2',linkextend:'modulesLevel3'};for(var i in ids){var element=content.find('#'+ids[i]),value=element.length?JSON.parse(element.val()):[];0<=$.inArray(sourceModule,value)&&(relatedParams[i]=record);}'Leads'==moduleName&&(relatedParams.company=rcmail.env.fromName),('Leads'==moduleName||'Contacts'==moduleName)&&(relatedParams.lastname=rcmail.env.fromName),'Project'==moduleName&&(relatedParams.projectname=rcmail.env.subject),'HelpDesk'==moduleName&&(relatedParams.ticket_title=rcmail.env.subject),'Products'==moduleName&&(relatedParams.productname=rcmail.env.subject),'Services'==moduleName&&(relatedParams.servicename=rcmail.env.subject),relatedParams.email=rcmail.env.fromMail,relatedParams.email1=rcmail.env.fromMail,relatedParams.description=$('#messagebody').text();relatedParams.sourceModule=sourceModule,relatedParams.sourceRecord=record,relatedParams.relationOperation=!0;var headerInstance=new window.crm.Vtiger_Header_Js;headerInstance.quickCreateModule(moduleName,{callbackFunction:function postQuickCreate(){loadActionBar();},callbackPostShown:postShown,data:relatedParams,noCache:!0});}function getCrmWindow(){if(null!==opener&&'object'==opener.parent.CONFIG)return opener.parent;return 'object'==_typeof(parent.CONFIG)?parent:'object'==_typeof(parent.parent.CONFIG)?parent.parent:!('object'!=_typeof(opener.crm.CONFIG))&&opener.crm} //# sourceMappingURL=preview.min.js.map diff --git a/plugins/yetiforce/preview.min.js.map b/plugins/yetiforce/preview.min.js.map index 083ed189..e7cfa8f0 100644 --- a/plugins/yetiforce/preview.min.js.map +++ b/plugins/yetiforce/preview.min.js.map @@ -1 +1 @@ -{"version":3,"file":"preview.min.js","sources":["preview.js"],"sourcesContent":["/* {[The file is published on the basis of MIT License]} */\nwindow.rcmail && rcmail.addEventListener('init', function (evt) {\n\t\twindow.crm = getCrmWindow();\n\t\tloadActionBar();\n\t\trcmail.env.message_commands.push('yetiforce.importICS');\n\t\trcmail.register_command('yetiforce.importICS', function (ics, element, e) {\n\t\t\twindow.crm.AppConnector.request({\n\t\t\t\tasync: true,\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: {\n\t\t\t\t\tmodule: 'Calendar',\n\t\t\t\t\taction: 'ImportICS',\n\t\t\t\t\tics: ics\n\t\t\t\t}\n\t\t\t}).done(function (response) {\n\t\t\t\twindow.crm.Vtiger_Helper_Js.showPnotify({\n\t\t\t\t\ttext: response['result'],\n\t\t\t\t\ttype: 'info',\n\t\t\t\t\tanimation: 'show'\n\t\t\t\t});\n\t\t\t\t$(element).closest('.icalattachments').remove();\n\t\t\t})\n\t\t}, true);\n\t}\n);\n\nfunction loadActionBar() {\n\tvar content = $('#ytActionBarContent');\n\tvar params = {\n\t\tmodule: 'OSSMail',\n\t\tview: 'MailActionBar',\n\t\tuid: rcmail.env.uid,\n\t\tfolder: rcmail.env.mailbox,\n\t\trcId: rcmail.env.user_id\n\t};\n\twindow.crm.AppConnector.request(params).done(function (response) {\n\t\tcontent.find('.ytHeader').html(response);\n\t\t$('#messagecontent').css('top', (content.outerHeight() + $('#messageheader').outerHeight()) + 'px');\n\t\tregisterEvents(content);\n\t});\n}\n\nfunction registerEvents(content) {\n\tregisterAddRecord(content);\n\tregisterAddReletedRecord(content);\n\tregisterSelectRecord(content);\n\tregisterRemoveRecord(content);\n\tregisterImportMail(content);\n\n\tvar block = content.find('.ytHeader .js-data');\n\tcontent.find('.hideBtn').click(function () {\n\t\tvar button = $(this);\n\t\tvar icon = button.find('.glyphicon');\n\n\t\tif (button.data('type') == '0') {\n\t\t\tbutton.data('type', '1');\n\t\t\ticon.removeClass(\"glyphicon-chevron-up\").addClass(\"glyphicon-chevron-down\");\n\t\t} else {\n\t\t\tbutton.data('type', '0');\n\t\t\ticon.removeClass(\"glyphicon-chevron-down\").addClass(\"glyphicon-chevron-up\");\n\t\t}\n\t\tblock.toggle();\n\t\t$(window).trigger(\"resize\");\n\t});\n}\n\nfunction registerImportMail(content) {\n\tcontent.find('.importMail').click(function (e) {\n\t\twindow.crm.Vtiger_Helper_Js.showPnotify({\n\t\t\ttext: window.crm.app.vtranslate('StartedDownloadingEmail'),\n\t\t\ttype: 'info'\n\t\t});\n\t\twindow.crm.AppConnector.request({\n\t\t\tmodule: 'OSSMail',\n\t\t\taction: 'ImportMail',\n\t\t\tparams: {\n\t\t\t\tuid: rcmail.env.uid,\n\t\t\t\tfolder: rcmail.env.mailbox,\n\t\t\t\trcId: rcmail.env.user_id\n\t\t\t}\n\t\t}).done(function (data) {\n\t\t\tloadActionBar();\n\t\t\twindow.crm.Vtiger_Helper_Js.showPnotify({\n\t\t\t\ttext: window.crm.app.vtranslate('AddFindEmailInRecord'),\n\t\t\t\ttype: 'success'\n\t\t\t});\n\t\t})\n\t});\n}\n\nfunction registerRemoveRecord(content) {\n\tcontent.find('button.removeRecord').click(function (e) {\n\t\tvar row = $(e.currentTarget).closest('.rowRelatedRecord');\n\t\tremoveRecord(row.data('id'));\n\t});\n}\n\nfunction registerSelectRecord(content) {\n\tlet id = content.find('#mailActionBarID').val();\n\tcontent.find('button.selectRecord').click(function (e) {\n\t\tlet relParams = {\n\t\t\tmailId: id\n\t\t};\n\t\tif ($(this).data('type') == 0) {\n\t\t\tvar module = $(this).closest('.js-head-container').find('.module').val();\n\t\t\tif (module === null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tvar module = $(this).data('module');\n\t\t\trelParams.crmid = $(this).closest('.rowRelatedRecord').data('id');\n\t\t\trelParams.mod = $(this).closest('.rowRelatedRecord').data('module');\n\t\t\trelParams.newModule = module;\n\t\t}\n\t\tshowPopup({\n\t\t\tmodule: module,\n\t\t\tsrc_module: 'OSSMailView',\n\t\t\tsrc_record: id,\n\t\t}, relParams);\n\t});\n}\n\nfunction registerAddReletedRecord(content) {\n\tvar id = content.find('#mailActionBarID').val();\n\tcontent.find('button.addRelatedRecord').click(function (e) {\n\t\tvar targetElement = $(e.currentTarget);\n\t\tvar row = targetElement.closest('.rowRelatedRecord');\n\t\tvar params = {sourceModule: row.data('module')};\n\t\tshowQuickCreateForm(targetElement.data('module'), row.data('id'), params);\n\t});\n}\n\nfunction registerAddRecord(content) {\n\tvar id = content.find('#mailActionBarID').val();\n\tcontent.find('button.addRecord').click(function (e) {\n\t\tvar col = $(e.currentTarget).closest('.js-head-container');\n\t\tlet selectValue = col.find('.module').val();\n\t\tif (selectValue !== null) {\n\t\t\tshowQuickCreateForm(selectValue, id);\n\t\t}\n\t});\n}\n\nfunction removeRecord(crmid) {\n\tvar id = $('#mailActionBarID').val();\n\tvar params = {}\n\tparams.data = {\n\t\tmodule: 'OSSMail',\n\t\taction: 'ExecuteActions',\n\t\tmode: 'removeRelated',\n\t\tparams: {\n\t\t\tmailId: id,\n\t\t\tcrmid: crmid\n\t\t}\n\t}\n\tparams.async = false;\n\tparams.dataType = 'json';\n\twindow.crm.AppConnector.request(params).done(function (data) {\n\t\tvar response = data['result'];\n\t\tif (response['success']) {\n\t\t\tvar notifyParams = {\n\t\t\t\ttext: response['data'],\n\t\t\t\ttype: 'info',\n\t\t\t\tanimation: 'show'\n\t\t\t};\n\t\t} else {\n\t\t\tvar notifyParams = {\n\t\t\t\ttext: response['data'],\n\t\t\t\tanimation: 'show'\n\t\t\t};\n\t\t}\n\t\twindow.crm.Vtiger_Helper_Js.showPnotify(notifyParams);\n\t\tloadActionBar();\n\t});\n}\n\nfunction showPopup(params, actionsParams) {\n\tactionsParams['newModule'] = params['module'];\n\twindow.crm.app.showRecordsList(params, (modal, instance) => {\n\t\tinstance.setSelectEvent((responseData, e) => {\n\t\t\tactionsParams['newCrmId'] = responseData.id;\n\t\t\twindow.crm.AppConnector.request({\n\t\t\t\tasync: false,\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: {\n\t\t\t\t\tmodule: 'OSSMail',\n\t\t\t\t\taction: 'ExecuteActions',\n\t\t\t\t\tmode: 'addRelated',\n\t\t\t\t\tparams: actionsParams\n\t\t\t\t}\n\t\t\t}).done(function (data) {\n\t\t\t\tlet response = data['result'];\n\t\t\t\tif (response['success']) {\n\t\t\t\t\tvar notifyParams = {\n\t\t\t\t\t\ttext: response['data'],\n\t\t\t\t\t\ttype: 'info',\n\t\t\t\t\t\tanimation: 'show'\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tvar notifyParams = {\n\t\t\t\t\t\ttext: response['data'],\n\t\t\t\t\t\tanimation: 'show'\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\twindow.crm.Vtiger_Helper_Js.showPnotify(notifyParams);\n\t\t\t\tloadActionBar();\n\t\t\t});\n\t\t});\n\t});\n}\n\nfunction showQuickCreateForm(moduleName, record, params) {\n\tvar content = $('#ytActionBarContent');\n\tif (params == undefined) {\n\t\tvar params = {};\n\t}\n\tvar relatedParams = {};\n\tif (params['sourceModule']) {\n\t\tvar sourceModule = params['sourceModule'];\n\t} else {\n\t\tvar sourceModule = 'OSSMailView';\n\t}\n\tvar postShown = function (data) {\n\t\tvar index, queryParam, queryParamComponents;\n\t\t$('').appendTo(data);\n\t\t$('').appendTo(data);\n\t\t$('').appendTo(data);\n\t}\n\tvar ids = {\n\t\tlink: 'modulesLevel0',\n\t\tprocess: 'modulesLevel1',\n\t\tsubprocess: 'modulesLevel2',\n\t\tlinkextend: 'modulesLevel3'\n\t};\n\tfor (var i in ids) {\n\t\tvar element = content.find('#' + ids[i]);\n\t\tvar value = element.length ? JSON.parse(element.val()) : [];\n\t\tif ($.inArray(sourceModule, value) >= 0) {\n\t\t\trelatedParams[i] = record;\n\t\t}\n\t}\n\tif (moduleName == 'Leads') {\n\t\trelatedParams['company'] = rcmail.env.fromName;\n\t}\n\tif (moduleName == 'Leads' || moduleName == 'Contacts') {\n\t\trelatedParams['lastname'] = rcmail.env.fromName;\n\t}\n\tif (moduleName == 'Project') {\n\t\trelatedParams['projectname'] = rcmail.env.subject;\n\t}\n\tif (moduleName == 'HelpDesk') {\n\t\trelatedParams['ticket_title'] = rcmail.env.subject;\n\t}\n\tif (moduleName == 'Products') {\n\t\trelatedParams['productname'] = rcmail.env.subject;\n\t}\n\tif (moduleName == 'Services') {\n\t\trelatedParams['servicename'] = rcmail.env.subject;\n\t}\n\trelatedParams['email'] = rcmail.env.fromMail;\n\trelatedParams['email1'] = rcmail.env.fromMail;\n\trelatedParams['description'] = $('#messagebody').text();\n\t//relatedParams['related_to'] = record;\n\tvar postQuickCreate = function (data) {\n\t\tloadActionBar();\n\t}\n\trelatedParams['sourceModule'] = sourceModule;\n\trelatedParams['sourceRecord'] = record;\n\trelatedParams['relationOperation'] = true;\n\tvar quickCreateParams = {\n\t\tcallbackFunction: postQuickCreate,\n\t\tcallbackPostShown: postShown,\n\t\tdata: relatedParams,\n\t\tnoCache: true\n\t};\n\tvar headerInstance = new window.crm.Vtiger_Header_Js();\n\theaderInstance.quickCreateModule(moduleName, quickCreateParams);\n}\n\nfunction getCrmWindow() {\n\tif (opener !== null && opener.parent.CONFIG == \"object\") {\n\t\treturn opener.parent;\n\t} else if (typeof parent.CONFIG == \"object\") {\n\t\treturn parent;\n\t} else if (typeof parent.parent.CONFIG == \"object\") {\n\t\treturn parent.parent;\n\t} else if (typeof opener.crm.CONFIG == \"object\") {\n\t\treturn opener.crm;\n\t}\n\treturn false;\n}\n"],"names":["window","rcmail","addEventListener","crm","getCrmWindow","loadActionBar","env","message_commands","push","register_command","ics","element","AppConnector","request","async","dataType","data","module","action","done","response","Vtiger_Helper_Js","showPnotify","text","type","animation","$","closest","remove","params","view","uid","folder","mailbox","rcId","user_id","content","find","html","css","outerHeight","registerEvents","registerAddRecord","registerAddReletedRecord","registerSelectRecord","registerRemoveRecord","registerImportMail","click","icon","button","removeClass","addClass","block","toggle","trigger","app","vtranslate","e","currentTarget","removeRecord","row","val","mailId","id","relParams","crmid","mod","newModule","showPopup","src_module","src_record","targetElement","sourceModule","showQuickCreateForm","selectValue","col","mode","notifyParams","actionsParams","showRecordsList","modal","instance","setSelectEvent","responseData","moduleName","record","appendTo","ids","link","process","subprocess","linkextend","i","value","length","JSON","parse","inArray","relatedParams","fromName","subject","fromMail","Vtiger_Header_Js","headerInstance","quickCreateModule","callbackFunction","callbackPostShown","postShown","noCache","parent","CONFIG","opener"],"mappings":";;;;;;;;AACAA,OAAOC,MAAP,EAAiBA,OAAOC,gBAAP,CAAwB,MAAxB,CAAgC,UAAe,CAC9DF,OAAOG,GAAP,CAAaC,cADiD,CAE9DC,eAF8D,CAG9DJ,OAAOK,GAAP,CAAWC,gBAAX,CAA4BC,IAA5B,CAAiC,qBAAjC,CAH8D,CAI9DP,OAAOQ,gBAAP,CAAwB,qBAAxB,CAA+C,SAAUC,GAAV,CAAeC,OAAf,CAA2B,CACzEX,OAAOG,GAAP,CAAWS,YAAX,CAAwBC,OAAxB,CAAgC,CAC/BC,QAD+B,CAE/BC,SAAU,MAFqB,CAG/BC,KAAM,CACLC,OAA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QAjDmB,CAkDxDH,0BAA+BxE,EAAE,cAAF,EAAkBH,IAAlB,EAlDyB,CAuDxD2E,2BAAgC1B,YAvDwB,CAwDxD0B,2BAAgCb,MAxDwB,CAyDxDa,kCAzDwD,oBAgEnC,WAAW/F,GAAP,CAAWmG,gBAhEoB,CAiExDC,eAAeC,iBAAf,CAAiCpB,UAAjC,CAPwB,CACvBqB,iBAPqB,wBAAA,EAAgB,CACrCpG,gBACA,CAIuB,CAEvBqG,kBAAmBC,SAFI,CAGvB3F,KAAMkF,aAHiB,CAIvBU,UAJuB,CAOxB,EACA,CAED,qBAAA,EAAwB,CACvB,GAAe,IAAX,WAA2C,QAAxB,SAAOC,MAAP,CAAcC,MAArC,CACC,cAAcD,MAAd,CAFsB,OAGY,QAAxB,UAAOA,OAAOC,MAAd,CAHY,CAIfD,MAJe,CAKmB,QAA/B,UAAOA,OAAOA,MAAP,CAAcC,MAArB,CALY,CAMfD,OAAOA,MANQ,GAOgB,QAA5B,UAAOE,OAAO5G,GAAP,CAAW2G,MAAlB,CAPY,GAQfC,OAAO5G,GAGf"} \ No newline at end of file +{"version":3,"file":"preview.min.js","sources":["preview.js"],"sourcesContent":["/* {[The file is published on the basis of MIT License]} */\nwindow.rcmail && rcmail.addEventListener('init', function (evt) {\n\t\twindow.crm = getCrmWindow();\n\t\tloadActionBar();\n\t\trcmail.env.message_commands.push('yetiforce.importICS');\n\t\trcmail.register_command('yetiforce.importICS', function (part, type) {\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: 'POST',\n\t\t\t\turl: \"./?_task=mail&_action=plugin.yetiforce.importIcs&_mbox=\" + urlencode(rcmail.env.mailbox) + '&_uid=' + urlencode(rcmail.env.uid) + '&_part=' + part + '&_type=' + type,\n\t\t\t\tasync: false,\n\t\t\t\tsuccess: function (data) {\n\t\t\t\t\tdata = JSON.parse(data);\n\t\t\t\t\twindow.crm.Vtiger_Helper_Js.showPnotify({\n\t\t\t\t\t\ttext: data['message'],\n\t\t\t\t\t\ttype: 'info',\n\t\t\t\t\t\tanimation: 'show'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}, true);\n\t}\n);\n\nfunction loadActionBar() {\n\tvar content = $('#ytActionBarContent');\n\tvar params = {\n\t\tmodule: 'OSSMail',\n\t\tview: 'MailActionBar',\n\t\tuid: rcmail.env.uid,\n\t\tfolder: rcmail.env.mailbox,\n\t\trcId: rcmail.env.user_id\n\t};\n\twindow.crm.AppConnector.request(params).done(function (response) {\n\t\tcontent.find('.ytHeader').html(response);\n\t\t$('#messagecontent').css('top', (content.outerHeight() + $('#messageheader').outerHeight()) + 'px');\n\t\tregisterEvents(content);\n\t});\n}\n\nfunction registerEvents(content) {\n\tregisterAddRecord(content);\n\tregisterAddReletedRecord(content);\n\tregisterSelectRecord(content);\n\tregisterRemoveRecord(content);\n\tregisterImportMail(content);\n\n\tvar block = content.find('.ytHeader .js-data');\n\tcontent.find('.hideBtn').click(function () {\n\t\tvar button = $(this);\n\t\tvar icon = button.find('.glyphicon');\n\n\t\tif (button.data('type') == '0') {\n\t\t\tbutton.data('type', '1');\n\t\t\ticon.removeClass(\"glyphicon-chevron-up\").addClass(\"glyphicon-chevron-down\");\n\t\t} else {\n\t\t\tbutton.data('type', '0');\n\t\t\ticon.removeClass(\"glyphicon-chevron-down\").addClass(\"glyphicon-chevron-up\");\n\t\t}\n\t\tblock.toggle();\n\t\t$(window).trigger(\"resize\");\n\t});\n}\n\nfunction registerImportMail(content) {\n\tcontent.find('.importMail').click(function (e) {\n\t\twindow.crm.Vtiger_Helper_Js.showPnotify({\n\t\t\ttext: window.crm.app.vtranslate('StartedDownloadingEmail'),\n\t\t\ttype: 'info'\n\t\t});\n\t\twindow.crm.AppConnector.request({\n\t\t\tmodule: 'OSSMail',\n\t\t\taction: 'ImportMail',\n\t\t\tparams: {\n\t\t\t\tuid: rcmail.env.uid,\n\t\t\t\tfolder: rcmail.env.mailbox,\n\t\t\t\trcId: rcmail.env.user_id\n\t\t\t}\n\t\t}).done(function (data) {\n\t\t\tloadActionBar();\n\t\t\twindow.crm.Vtiger_Helper_Js.showPnotify({\n\t\t\t\ttext: window.crm.app.vtranslate('AddFindEmailInRecord'),\n\t\t\t\ttype: 'success'\n\t\t\t});\n\t\t})\n\t});\n}\n\nfunction registerRemoveRecord(content) {\n\tcontent.find('button.removeRecord').click(function (e) {\n\t\tvar row = $(e.currentTarget).closest('.rowRelatedRecord');\n\t\tremoveRecord(row.data('id'));\n\t});\n}\n\nfunction registerSelectRecord(content) {\n\tlet id = content.find('#mailActionBarID').val();\n\tcontent.find('button.selectRecord').click(function (e) {\n\t\tlet relParams = {\n\t\t\tmailId: id\n\t\t};\n\t\tif ($(this).data('type') == 0) {\n\t\t\tvar module = $(this).closest('.js-head-container').find('.module').val();\n\t\t\tif (module === null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tvar module = $(this).data('module');\n\t\t\trelParams.crmid = $(this).closest('.rowRelatedRecord').data('id');\n\t\t\trelParams.mod = $(this).closest('.rowRelatedRecord').data('module');\n\t\t\trelParams.newModule = module;\n\t\t}\n\t\tshowPopup({\n\t\t\tmodule: module,\n\t\t\tsrc_module: 'OSSMailView',\n\t\t\tsrc_record: id,\n\t\t}, relParams);\n\t});\n}\n\nfunction registerAddReletedRecord(content) {\n\tvar id = content.find('#mailActionBarID').val();\n\tcontent.find('button.addRelatedRecord').click(function (e) {\n\t\tvar targetElement = $(e.currentTarget);\n\t\tvar row = targetElement.closest('.rowRelatedRecord');\n\t\tvar params = {sourceModule: row.data('module')};\n\t\tshowQuickCreateForm(targetElement.data('module'), row.data('id'), params);\n\t});\n}\n\nfunction registerAddRecord(content) {\n\tvar id = content.find('#mailActionBarID').val();\n\tcontent.find('button.addRecord').click(function (e) {\n\t\tvar col = $(e.currentTarget).closest('.js-head-container');\n\t\tlet selectValue = col.find('.module').val();\n\t\tif (selectValue !== null) {\n\t\t\tshowQuickCreateForm(selectValue, id);\n\t\t}\n\t});\n}\n\nfunction removeRecord(crmid) {\n\tvar id = $('#mailActionBarID').val();\n\tvar params = {}\n\tparams.data = {\n\t\tmodule: 'OSSMail',\n\t\taction: 'ExecuteActions',\n\t\tmode: 'removeRelated',\n\t\tparams: {\n\t\t\tmailId: id,\n\t\t\tcrmid: crmid\n\t\t}\n\t}\n\tparams.async = false;\n\tparams.dataType = 'json';\n\twindow.crm.AppConnector.request(params).done(function (data) {\n\t\tvar response = data['result'];\n\t\tif (response['success']) {\n\t\t\tvar notifyParams = {\n\t\t\t\ttext: response['data'],\n\t\t\t\ttype: 'info',\n\t\t\t\tanimation: 'show'\n\t\t\t};\n\t\t} else {\n\t\t\tvar notifyParams = {\n\t\t\t\ttext: response['data'],\n\t\t\t\tanimation: 'show'\n\t\t\t};\n\t\t}\n\t\twindow.crm.Vtiger_Helper_Js.showPnotify(notifyParams);\n\t\tloadActionBar();\n\t});\n}\n\nfunction showPopup(params, actionsParams) {\n\tactionsParams['newModule'] = params['module'];\n\twindow.crm.app.showRecordsList(params, (modal, instance) => {\n\t\tinstance.setSelectEvent((responseData, e) => {\n\t\t\tactionsParams['newCrmId'] = responseData.id;\n\t\t\twindow.crm.AppConnector.request({\n\t\t\t\tasync: false,\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: {\n\t\t\t\t\tmodule: 'OSSMail',\n\t\t\t\t\taction: 'ExecuteActions',\n\t\t\t\t\tmode: 'addRelated',\n\t\t\t\t\tparams: actionsParams\n\t\t\t\t}\n\t\t\t}).done(function (data) {\n\t\t\t\tlet response = data['result'];\n\t\t\t\tif (response['success']) {\n\t\t\t\t\tvar notifyParams = {\n\t\t\t\t\t\ttext: response['data'],\n\t\t\t\t\t\ttype: 'info',\n\t\t\t\t\t\tanimation: 'show'\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tvar notifyParams = {\n\t\t\t\t\t\ttext: response['data'],\n\t\t\t\t\t\tanimation: 'show'\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\twindow.crm.Vtiger_Helper_Js.showPnotify(notifyParams);\n\t\t\t\tloadActionBar();\n\t\t\t});\n\t\t});\n\t});\n}\n\nfunction showQuickCreateForm(moduleName, record, params) {\n\tvar content = $('#ytActionBarContent');\n\tif (params == undefined) {\n\t\tvar params = {};\n\t}\n\tvar relatedParams = {};\n\tif (params['sourceModule']) {\n\t\tvar sourceModule = params['sourceModule'];\n\t} else {\n\t\tvar sourceModule = 'OSSMailView';\n\t}\n\tvar postShown = function (data) {\n\t\tvar index, queryParam, queryParamComponents;\n\t\t$('').appendTo(data);\n\t\t$('').appendTo(data);\n\t\t$('').appendTo(data);\n\t}\n\tvar ids = {\n\t\tlink: 'modulesLevel0',\n\t\tprocess: 'modulesLevel1',\n\t\tsubprocess: 'modulesLevel2',\n\t\tlinkextend: 'modulesLevel3'\n\t};\n\tfor (var i in ids) {\n\t\tvar element = content.find('#' + ids[i]);\n\t\tvar value = element.length ? JSON.parse(element.val()) : [];\n\t\tif ($.inArray(sourceModule, value) >= 0) {\n\t\t\trelatedParams[i] = record;\n\t\t}\n\t}\n\tif (moduleName == 'Leads') {\n\t\trelatedParams['company'] = rcmail.env.fromName;\n\t}\n\tif (moduleName == 'Leads' || moduleName == 'Contacts') {\n\t\trelatedParams['lastname'] = rcmail.env.fromName;\n\t}\n\tif (moduleName == 'Project') {\n\t\trelatedParams['projectname'] = rcmail.env.subject;\n\t}\n\tif (moduleName == 'HelpDesk') {\n\t\trelatedParams['ticket_title'] = rcmail.env.subject;\n\t}\n\tif (moduleName == 'Products') {\n\t\trelatedParams['productname'] = rcmail.env.subject;\n\t}\n\tif (moduleName == 'Services') {\n\t\trelatedParams['servicename'] = rcmail.env.subject;\n\t}\n\trelatedParams['email'] = rcmail.env.fromMail;\n\trelatedParams['email1'] = rcmail.env.fromMail;\n\trelatedParams['description'] = $('#messagebody').text();\n\t//relatedParams['related_to'] = record;\n\tvar postQuickCreate = function (data) {\n\t\tloadActionBar();\n\t}\n\trelatedParams['sourceModule'] = sourceModule;\n\trelatedParams['sourceRecord'] = record;\n\trelatedParams['relationOperation'] = true;\n\tvar quickCreateParams = {\n\t\tcallbackFunction: postQuickCreate,\n\t\tcallbackPostShown: postShown,\n\t\tdata: relatedParams,\n\t\tnoCache: true\n\t};\n\tvar headerInstance = new window.crm.Vtiger_Header_Js();\n\theaderInstance.quickCreateModule(moduleName, quickCreateParams);\n}\n\nfunction getCrmWindow() {\n\tif (opener !== null && opener.parent.CONFIG == \"object\") {\n\t\treturn opener.parent;\n\t} else if (typeof parent.CONFIG == \"object\") {\n\t\treturn parent;\n\t} else if (typeof parent.parent.CONFIG == \"object\") {\n\t\treturn parent.parent;\n\t} else if (typeof opener.crm.CONFIG == \"object\") {\n\t\treturn opener.crm;\n\t}\n\treturn false;\n}\n"],"names":["window","rcmail","addEventListener","crm","getCrmWindow","loadActionBar","env","message_commands","push","register_command","part","type","jQuery","ajax","url","urlencode","mailbox","uid","async","success","data","JSON","parse","Vtiger_Helper_Js","showPnotify","text","animation","$","params","module","view","folder","rcId","user_id","AppConnector","request","done","response","content","find","html","css","outerHeight","registerEvents","registerAddRecord","registerAddReletedRecord","registerSelectRecord","registerRemoveRecord","registerImportMail","click","icon","button","removeClass","addClass","block","toggle","trigger","app","vtranslate","action","e","currentTarget","closest","removeRecord","row","val","mailId","id","relParams","crmid","mod","newModule","showPopup","src_module","src_record","targetElement","sourceModule","showQuickCreateForm","selectValue","col","mode","dataType","notifyParams","actionsParams","showRecordsList","modal","instance","setSelectEvent","responseData","moduleName","record","appendTo","ids","link","process","subprocess","linkextend","i","value","element","length","inArray","relatedParams","fromName","subject","fromMail","Vtiger_Header_Js","headerInstance","quickCreateModule","callbackFunction","callbackPostShown","postShown","noCache","parent","CONFIG","opener"],"mappings":";;;;;;;;AACAA,OAAOC,MAAP,EAAiBA,OAAOC,gBAAP,CAAwB,MAAxB,CAAgC,UAAe,CAC9DF,OAAOG,GAAP,CAAaC,cADiD,CAE9DC,eAF8D,CAG9DJ,OAAOK,GAAP,CAAWC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a,EAuCtC,UAAd,YAvCoD,GAwCvDF,2BAAgCrG,OAAOK,GAAP,CAAWkG,OAxCY,EA0CtC,UAAd,YA1CoD,GA2CvDF,0BAA+BrG,OAAOK,GAAP,CAAWkG,OA3Ca,EA6CtC,UAAd,YA7CoD,GA8CvDF,0BAA+BrG,OAAOK,GAAP,CAAWkG,OA9Ca,EAgDxDF,oBAAyBrG,OAAOK,GAAP,CAAWmG,QAhDoB,CAiDxDH,qBAA0BrG,OAAOK,GAAP,CAAWmG,QAjDmB,CAkDxDH,0BAA+B3E,EAAE,cAAF,EAAkBF,IAAlB,EAlDyB,CAuDxD6E,2BAAgC1B,YAvDwB,CAwDxD0B,2BAAgCZ,MAxDwB,CAyDxDY,kCAzDwD,oBAgEnC,WAAWnG,GAAP,CAAWuG,gBAhEoB,CAiExDC,eAAeC,iBAAf,CAAiCnB,UAAjC,CAPwB,CACvBoB,iBAPqB,wBAAA,EAAgB,CACrCxG,gBACA,CAIuB,CAEvByG,kBAAmBC,SAFI,CAGvB3F,KAAMkF,aAHiB,CAIvBU,UAJuB,CAOxB,EACA,CAED,qBAAA,EAAwB,CACvB,GAAe,IAAX,WAA2C,QAAxB,SAAOC,MAAP,CAAcC,MAArC,CACC,cAAcD,MAAd,CAFsB,OAGY,QAAxB,UAAOA,OAAOC,MAAd,CAHY,CAIfD,MAJe,CAKmB,QAA/B,UAAOA,OAAOA,MAAP,CAAcC,MAArB,CALY,CAMfD,OAAOA,MANQ,GAOgB,QAA5B,UAAOE,OAAOhH,GAAP,CAAW+G,MAAlB,CAPY,GAQfC,OAAOhH,GAGf"} \ No newline at end of file From 491ea541ea8f3b9d76cb64116245d2699b922add Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Wed, 30 Jan 2019 11:32:04 +0100 Subject: [PATCH 32/38] Corrected css files' paths --- plugins/yetiforce/yetiforce.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/yetiforce/yetiforce.php b/plugins/yetiforce/yetiforce.php index 33ab9a03..d7f57d9e 100644 --- a/plugins/yetiforce/yetiforce.php +++ b/plugins/yetiforce/yetiforce.php @@ -33,7 +33,7 @@ public function init() $this->register_action('plugin.yetiforce.getConntentEmailTemplate', [$this, 'getConntentEmailTemplate']); $this->register_action('plugin.yetiforce.importIcs', [$this, 'importIcs']); $this->rc->output->set_env('site_URL', $this->rc->config->get('site_URL')); - $this->include_stylesheet($this->rc->config->get('public_URL') . 'layouts/resources/icons/userIcons.css'); + $this->include_stylesheet('../../../../../layouts/resources/icons/userIcons.css'); $this->add_texts('localization/', false); $currentPath = getcwd(); @@ -70,7 +70,7 @@ public function init() } if ($this->rc->action === 'preview' || $this->rc->action === 'show') { $this->include_script('preview.js'); - $this->include_stylesheet($this->rc->config->get('public_URL') . 'libraries/@fortawesome/fontawesome-free/css/all.css'); + $this->include_stylesheet('../../../../../libraries/@fortawesome/fontawesome-free/css/all.css'); $this->include_stylesheet('preview.css'); $this->add_hook('message_load', [$this, 'messageLoad']); $this->add_hook('template_object_messageattachments', [$this, 'appendIcsPreview']); From ceaf62ed1f7e683422c0a2849870c9e336973e45 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Wed, 30 Jan 2019 11:35:59 +0100 Subject: [PATCH 33/38] Update version.php --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index 74e62530..a00175d3 100644 --- a/version.php +++ b/version.php @@ -1,5 +1,5 @@ '2019.01.30', - 'version' => '0.0.62' + 'version' => '0.0.63' ]; From e64a5036b4489ef4cbdc3b26a9f8cdc5ae266018 Mon Sep 17 00:00:00 2001 From: adudekyeti Date: Tue, 5 Feb 2019 14:56:57 +0100 Subject: [PATCH 34/38] Add checking privileges on button and import action --- plugins/yetiforce/yetiforce.php | 44 ++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/plugins/yetiforce/yetiforce.php b/plugins/yetiforce/yetiforce.php index d7f57d9e..df94a6b4 100644 --- a/plugins/yetiforce/yetiforce.php +++ b/plugins/yetiforce/yetiforce.php @@ -780,7 +780,7 @@ public function appendIcsPreview($args)
    "; $evTemplate .= '
    '; - if (!isset($showPart[$icsPart['part']])) { + if (!isset($showPart[$icsPart['part']]) && \App\Privilege::isPermitted('Calendar', 'CreateView')) { $showPart[$icsPart['part']] = $icsPart['part']; $title = \App\Language::translate('LBL_ADD_TO_MY_CALENDAR', 'OSSMail'); $counterText = empty($counterBtn[$icsPart['part']]) ? '' : ($counterBtn[$icsPart['part']] > 1 ? " ({$counterBtn[$icsPart['part']]})" : ''); @@ -813,28 +813,32 @@ public function appendIcsPreview($args) public function importIcs() { - $uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GPC); - $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GPC); - $mime_id = rcube_utils::get_input_value('_part', rcube_utils::INPUT_GPC); - $status = 0; - if ($uid && $mbox && $mime_id) { - $currentPath = getcwd(); - chdir($this->rc->config->get('root_directory')); - $this->loadCurrentUser(); - $message = new rcube_message($uid, $mbox); - $calendar = \App\Integrations\Dav\Calendar::loadFromContent($message->get_part_body($mime_id)); - foreach ($calendar->getRecordInstance() as $key => $recordModel) { - $recordModel->set('assigned_user_id', $this->currentUser->getId()); - $recordModel->save(); - if ($recordModel->getId()) { - $status++; + if (\App\Privilege::isPermitted('Calendar', 'CreateView')) { + $uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GPC); + $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GPC); + $mime_id = rcube_utils::get_input_value('_part', rcube_utils::INPUT_GPC); + $status = 0; + if ($uid && $mbox && $mime_id) { + $currentPath = getcwd(); + chdir($this->rc->config->get('root_directory')); + $this->loadCurrentUser(); + $message = new rcube_message($uid, $mbox); + $calendar = \App\Integrations\Dav\Calendar::loadFromContent($message->get_part_body($mime_id)); + foreach ($calendar->getRecordInstance() as $key => $recordModel) { + $recordModel->set('assigned_user_id', $this->currentUser->getId()); + $recordModel->save(); + if ($recordModel->getId()) { + $status++; + } } + chdir($currentPath); } - chdir($currentPath); + $message = ['message' => $status ? \App\Language::translateArgs('LBL_FILE_HAS_BEEN_IMPORTED', 'OSSMail', $status) : \App\Language::translate('LBL_ERROR_OCCURRED_DURING_IMPORT', 'OSSMail'), + ]; + } else { + $message = ['message' => \App\Language::translate('LBL_PERMISSION_DENIED')]; } - echo App\Json::encode([ - 'message' => $status ? \App\Language::translateArgs('LBL_FILE_HAS_BEEN_IMPORTED', 'OSSMail', $status) : \App\Language::translate('LBL_ERROR_OCCURRED_DURING_IMPORT', 'OSSMail'), - ]); + echo App\Json::encode($message); exit; } } From 2fff7b5e9514a8014743f8a7581f4948511deeac Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Tue, 5 Feb 2019 15:03:17 +0100 Subject: [PATCH 35/38] Update version.php --- version.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.php b/version.php index a00175d3..8ff8cf47 100644 --- a/version.php +++ b/version.php @@ -1,5 +1,5 @@ '2019.01.30', - 'version' => '0.0.63' + 'patch' => '2019.02.05', + 'version' => '0.0.64' ]; From a046c4a156d730803c857ad2f6d26f649d41119e Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Wed, 6 Feb 2019 14:16:20 +0100 Subject: [PATCH 36/38] Reverted changes in import action bar's styles --- plugins/yetiforce/preview.css | 90 ++++++++++++++++++++++++------- plugins/yetiforce/preview.min.css | 2 +- 2 files changed, 71 insertions(+), 21 deletions(-) diff --git a/plugins/yetiforce/preview.css b/plugins/yetiforce/preview.css index 79aa24f8..ac52a232 100644 --- a/plugins/yetiforce/preview.css +++ b/plugins/yetiforce/preview.css @@ -70,10 +70,18 @@ display: none; } +.d-none { + display: none; +} + .mr-5px { margin-right: 5px; } +.mr-3px { + margin-right: 3px; +} + .ml-5px { margin-left: 5px; } @@ -93,47 +101,89 @@ } .rowRelatedRecord { - padding: 2px; + background: #bbdde8; + margin-left: 3px; + border: 1px #c1c1c1 solid; } .action-bar__head__container { display: flex; flex-wrap: nowrap; + width: fit-content; + margin-right: 5px; } -.action-bar__data a { +.action-bar__head a { text-decoration: none; color: #000; - font-size: 14px; - line-height: 14px -} - -.action-bar__header { - font-size: 14px; - min-width: 90px; } .action-bar__head { - background-color: #4a5364; - height: 20px; color: #fff; - padding: 2px; + padding: 0 2px 4px; + display: flex; + flex-wrap: wrap; +} + +.action-bar__head > * { + margin-top: 4px; } .action-bar__col { + background-color: #4a5364; width: 100%; } -@media only screen and (min-width: 600px) { - #ytActionBarContent .action-bar__col { - width: 50%; - } +.action-bar__select { + margin-left: 3px; } -@media only screen and (min-width: 1200px) { - #ytActionBarContent .action-bar__col { - width: 25%; - } +.action-bar__select:required:invalid { + color: gray; +} + +.action-bar__select optgroup { + color: black; +} + +button, select, .rowRelatedRecord { + border-radius: .25rem; + padding: 0.1rem 0.2rem; +} + +button, select { + cursor: pointer; +} + +.rowActions { + display: inline-flex; + align-items: center; +} + +.rowActions button { + padding: 0.005rem 0.2rem; + margin-left: 5px; +} + +button { + display: inline-block; + background-color: #f8f9fa; + border-color: #f8f9fa; + font-weight: 400; + text-align: center; + white-space: nowrap; + vertical-align: middle; + user-select: none; + border: 1px solid transparent; + padding: 0.2rem 0.3rem; + border-radius: 0.25rem; + transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; +} + +button:hover { + color: #212529; + background-color: #e2e6ea; + border-color: #dae0e5; } .c-ical { diff --git a/plugins/yetiforce/preview.min.css b/plugins/yetiforce/preview.min.css index 0e858267..320569ba 100644 --- a/plugins/yetiforce/preview.min.css +++ b/plugins/yetiforce/preview.min.css @@ -1 +1 @@ -.pull-right{float:right !important}#ytActionBarContent select{padding:0}#ytActionBarContent .row:before{display:table;content:" "}#ytActionBarContent .row:after{clear:both;display:table;content:" "}#ytActionBarContent .ytHeader{position:relative;border-bottom:1px solid #dfdfdf}#ytActionBarContent .rowReletedRecord .rowActions{display:none}#ytActionBarContent .rowReletedRecord:hover .rowActions{display:block}#ytActionBarContent .noRecords{background:#70a8cb;text-align:center;color:#fff;padding:2px 0}#ytActionBarContent .noRecords a.importMail{color:#ecf6ff;cursor:pointer;font-weight:800}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .pull-right button{line-height:10px;margin-left:3px;padding:0 6px;height:14px}#ytActionBarContent .relatedModuleIcon{margin-right:5px}#messageheader.previewheader{padding:0 0 3px 30px}.rcmaddcontact{display:none}.mr-5px{margin-right:5px}.ml-5px{margin-left:5px}.w-100{width:100%}.flex-wrap{display:flex;flex-wrap:wrap}.flex-nowrap{display:flex;flex-wrap:nowrap}.rowRelatedRecord{padding:2px}.action-bar__head__container{display:flex;flex-wrap:nowrap}.action-bar__data a{text-decoration:none;color:#000;font-size:14px;line-height:14px}.action-bar__header{font-size:14px;min-width:90px}.action-bar__head{background-color:#4a5364;height:20px;color:#fff;padding:2px}.action-bar__col{width:100%}@media only screen and (min-width:600px){#ytActionBarContent .action-bar__col{width:50%}}@media only screen and (min-width:1200px){#ytActionBarContent .action-bar__col{width:25%}}.c-ical{margin:2px}.c-ical__event{background:#fffdfd;margin:2px 0;border:1px solid #dedede;margin:3px auto;border-radius:6px}.c-ical__wrapper{margin:3px}.c-ical__card{width:fit-content;height:fit-content;background:white;border:1px solid #d0d0d0;border-radius:6px;color:#c51818;padding:0 2px 2px;margin:2px;text-align:center}.c-ical__card__day{font-size:15px;margin:0 auto;width:fit-content;color:black}.c-ical__card__year{font-size:9px;color:#888}.c-ical__card__time{font-size:18px;margin:auto 5px}.c-ical__card__arrow{margin:auto 5px}.c-ical__subject{margin:0 auto;text-align:center;background:#4a5364;color:white;border-top-left-radius:6px;border-top-right-radius:6px;padding-bottom:2px}.mr-1{margin-right:.25rem} \ No newline at end of file +.pull-right{float:right !important}#ytActionBarContent select{padding:0}#ytActionBarContent .row:before{display:table;content:" "}#ytActionBarContent .row:after{clear:both;display:table;content:" "}#ytActionBarContent .ytHeader{position:relative;border-bottom:1px solid #dfdfdf}#ytActionBarContent .rowReletedRecord .rowActions{display:none}#ytActionBarContent .rowReletedRecord:hover .rowActions{display:block}#ytActionBarContent .noRecords{background:#70a8cb;text-align:center;color:#fff;padding:2px 0}#ytActionBarContent .noRecords a.importMail{color:#ecf6ff;cursor:pointer;font-weight:800}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .rowReletedRecord{margin:3px 0 6px 0}#ytActionBarContent .pull-right button{line-height:10px;margin-left:3px;padding:0 6px;height:14px}#ytActionBarContent .relatedModuleIcon{margin-right:5px}#messageheader.previewheader{padding:0 0 3px 30px}.rcmaddcontact{display:none}.d-none{display:none}.mr-5px{margin-right:5px}.mr-3px{margin-right:3px}.ml-5px{margin-left:5px}.w-100{width:100%}.flex-wrap{display:flex;flex-wrap:wrap}.flex-nowrap{display:flex;flex-wrap:nowrap}.rowRelatedRecord{background:#bbdde8;margin-left:3px;border:1px #c1c1c1 solid}.action-bar__head__container{display:flex;flex-wrap:nowrap;width:fit-content;margin-right:5px}.action-bar__head a{text-decoration:none;color:#000}.action-bar__head{color:#fff;padding:0 2px 4px;display:flex;flex-wrap:wrap}.action-bar__head>*{margin-top:4px}.action-bar__col{background-color:#4a5364;width:100%}.action-bar__select{margin-left:3px}.action-bar__select:required:invalid{color:gray}.action-bar__select optgroup{color:black}button,select,.rowRelatedRecord{border-radius:.25rem;padding:.1rem .2rem}button,select{cursor:pointer}.rowActions{display:inline-flex;align-items:center}.rowActions button{padding:.005rem .2rem;margin-left:5px}button{display:inline-block;background-color:#f8f9fa;border-color:#f8f9fa;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;user-select:none;border:1px solid transparent;padding:.2rem .3rem;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}button:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.c-ical{margin:2px}.c-ical__event{background:#fffdfd;margin:2px 0;border:1px solid #dedede;margin:3px auto;border-radius:6px}.c-ical__wrapper{margin:3px}.c-ical__card{width:fit-content;height:fit-content;background:white;border:1px solid #d0d0d0;border-radius:6px;color:#c51818;padding:0 2px 2px;margin:2px;text-align:center}.c-ical__card__day{font-size:15px;margin:0 auto;width:fit-content;color:black}.c-ical__card__year{font-size:9px;color:#888}.c-ical__card__time{font-size:18px;margin:auto 5px}.c-ical__card__arrow{margin:auto 5px}.c-ical__subject{margin:0 auto;text-align:center;background:#4a5364;color:white;border-top-left-radius:6px;border-top-right-radius:6px;padding-bottom:2px}.mr-1{margin-right:.25rem} \ No newline at end of file From 0611231a5c7bfb3c7380b7510c8787c225369273 Mon Sep 17 00:00:00 2001 From: Tomasz Poradzewski Date: Wed, 6 Feb 2019 14:17:31 +0100 Subject: [PATCH 37/38] Updated version.php --- version.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.php b/version.php index 8ff8cf47..86ed0684 100644 --- a/version.php +++ b/version.php @@ -1,5 +1,5 @@ '2019.02.05', - 'version' => '0.0.64' + 'patch' => '2019.02.06', + 'version' => '0.0.65' ]; From 2638f652a4d3f38155f91960c43e826c7bf9d76f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Skrzypczak?= Date: Wed, 6 Feb 2019 16:37:11 +0100 Subject: [PATCH 38/38] Added minor improvements --- plugins/yetiforce/preview.js | 8 +++----- plugins/yetiforce/preview.min.js | 2 +- plugins/yetiforce/preview.min.js.map | 2 +- version.php | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/plugins/yetiforce/preview.js b/plugins/yetiforce/preview.js index e433ca9c..acdafce2 100644 --- a/plugins/yetiforce/preview.js +++ b/plugins/yetiforce/preview.js @@ -70,11 +70,9 @@ function registerImportMail(content) { window.crm.AppConnector.request({ module: 'OSSMail', action: 'ImportMail', - params: { - uid: rcmail.env.uid, - folder: rcmail.env.mailbox, - rcId: rcmail.env.user_id - } + uid: rcmail.env.uid, + folder: rcmail.env.mailbox, + rcId: rcmail.env.user_id }).done(function (data) { loadActionBar(); window.crm.Vtiger_Helper_Js.showPnotify({ diff --git a/plugins/yetiforce/preview.min.js b/plugins/yetiforce/preview.min.js index d832defb..3efcfbc8 100644 --- a/plugins/yetiforce/preview.min.js +++ b/plugins/yetiforce/preview.min.js @@ -6,5 +6,5 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; -window.rcmail&&rcmail.addEventListener('init',function(){window.crm=getCrmWindow(),loadActionBar(),rcmail.env.message_commands.push('yetiforce.importICS'),rcmail.register_command('yetiforce.importICS',function(part,type){jQuery.ajax({type:'POST',url:'./?_task=mail&_action=plugin.yetiforce.importIcs&_mbox='+urlencode(rcmail.env.mailbox)+'&_uid='+urlencode(rcmail.env.uid)+'&_part='+part+'&_type='+type,async:!1,success:function success(data){data=JSON.parse(data),window.crm.Vtiger_Helper_Js.showPnotify({text:data.message,type:'info',animation:'show'});}});},!0);});function loadActionBar(){var content=$('#ytActionBarContent'),params={module:'OSSMail',view:'MailActionBar',uid:rcmail.env.uid,folder:rcmail.env.mailbox,rcId:rcmail.env.user_id};window.crm.AppConnector.request(params).done(function(response){content.find('.ytHeader').html(response),$('#messagecontent').css('top',content.outerHeight()+$('#messageheader').outerHeight()+'px'),registerEvents(content);});}function registerEvents(content){registerAddRecord(content),registerAddReletedRecord(content),registerSelectRecord(content),registerRemoveRecord(content),registerImportMail(content);var block=content.find('.ytHeader .js-data');content.find('.hideBtn').click(function(){var button=$(this),icon=button.find('.glyphicon');'0'==button.data('type')?(button.data('type','1'),icon.removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down')):(button.data('type','0'),icon.removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up')),block.toggle(),$(window).trigger('resize');});}function registerImportMail(content){content.find('.importMail').click(function(){window.crm.Vtiger_Helper_Js.showPnotify({text:window.crm.app.vtranslate('StartedDownloadingEmail'),type:'info'}),window.crm.AppConnector.request({module:'OSSMail',action:'ImportMail',params:{uid:rcmail.env.uid,folder:rcmail.env.mailbox,rcId:rcmail.env.user_id}}).done(function(){loadActionBar(),window.crm.Vtiger_Helper_Js.showPnotify({text:window.crm.app.vtranslate('AddFindEmailInRecord'),type:'success'});});});}function registerRemoveRecord(content){content.find('button.removeRecord').click(function(e){var row=$(e.currentTarget).closest('.rowRelatedRecord');removeRecord(row.data('id'));});}function registerSelectRecord(content){var id=content.find('#mailActionBarID').val();content.find('button.selectRecord').click(function(){var relParams={mailId:id};if(0==$(this).data('type')){var module=$(this).closest('.js-head-container').find('.module').val();if(null===module)return}else{var module=$(this).data('module');relParams.crmid=$(this).closest('.rowRelatedRecord').data('id'),relParams.mod=$(this).closest('.rowRelatedRecord').data('module'),relParams.newModule=module;}showPopup({module:module,src_module:'OSSMailView',src_record:id},relParams);});}function registerAddReletedRecord(content){content.find('#mailActionBarID').val();content.find('button.addRelatedRecord').click(function(e){var targetElement=$(e.currentTarget),row=targetElement.closest('.rowRelatedRecord'),params={sourceModule:row.data('module')};showQuickCreateForm(targetElement.data('module'),row.data('id'),params);});}function registerAddRecord(content){var id=content.find('#mailActionBarID').val();content.find('button.addRecord').click(function(e){var col=$(e.currentTarget).closest('.js-head-container'),selectValue=col.find('.module').val();null!==selectValue&&showQuickCreateForm(selectValue,id);});}function removeRecord(crmid){var id=$('#mailActionBarID').val(),params={};params.data={module:'OSSMail',action:'ExecuteActions',mode:'removeRelated',params:{mailId:id,crmid:crmid}},params.async=!1,params.dataType='json',window.crm.AppConnector.request(params).done(function(data){var response=data.result;if(response.success)var notifyParams={text:response.data,type:'info',animation:'show'};else var notifyParams={text:response.data,animation:'show'};window.crm.Vtiger_Helper_Js.showPnotify(notifyParams),loadActionBar();});}function showPopup(params,actionsParams){actionsParams.newModule=params.module,window.crm.app.showRecordsList(params,function(modal,instance){instance.setSelectEvent(function(responseData){actionsParams.newCrmId=responseData.id,window.crm.AppConnector.request({async:!1,dataType:'json',data:{module:'OSSMail',action:'ExecuteActions',mode:'addRelated',params:actionsParams}}).done(function(data){var response=data.result;if(response.success)var notifyParams={text:response.data,type:'info',animation:'show'};else var notifyParams={text:response.data,animation:'show'};window.crm.Vtiger_Helper_Js.showPnotify(notifyParams),loadActionBar();});});});}function showQuickCreateForm(moduleName,record,params){var content=$('#ytActionBarContent');var relatedParams={};if(false)var sourceModule=params.sourceModule;else var sourceModule='OSSMailView';var postShown=function(data){$('').appendTo(data),$('').appendTo(data),$('').appendTo(data);},ids={link:'modulesLevel0',process:'modulesLevel1',subprocess:'modulesLevel2',linkextend:'modulesLevel3'};for(var i in ids){var element=content.find('#'+ids[i]),value=element.length?JSON.parse(element.val()):[];0<=$.inArray(sourceModule,value)&&(relatedParams[i]=record);}'Leads'==moduleName&&(relatedParams.company=rcmail.env.fromName),('Leads'==moduleName||'Contacts'==moduleName)&&(relatedParams.lastname=rcmail.env.fromName),'Project'==moduleName&&(relatedParams.projectname=rcmail.env.subject),'HelpDesk'==moduleName&&(relatedParams.ticket_title=rcmail.env.subject),'Products'==moduleName&&(relatedParams.productname=rcmail.env.subject),'Services'==moduleName&&(relatedParams.servicename=rcmail.env.subject),relatedParams.email=rcmail.env.fromMail,relatedParams.email1=rcmail.env.fromMail,relatedParams.description=$('#messagebody').text();relatedParams.sourceModule=sourceModule,relatedParams.sourceRecord=record,relatedParams.relationOperation=!0;var headerInstance=new window.crm.Vtiger_Header_Js;headerInstance.quickCreateModule(moduleName,{callbackFunction:function postQuickCreate(){loadActionBar();},callbackPostShown:postShown,data:relatedParams,noCache:!0});}function getCrmWindow(){if(null!==opener&&'object'==opener.parent.CONFIG)return opener.parent;return 'object'==_typeof(parent.CONFIG)?parent:'object'==_typeof(parent.parent.CONFIG)?parent.parent:!('object'!=_typeof(opener.crm.CONFIG))&&opener.crm} +window.rcmail&&rcmail.addEventListener('init',function(){window.crm=getCrmWindow(),loadActionBar(),rcmail.env.message_commands.push('yetiforce.importICS'),rcmail.register_command('yetiforce.importICS',function(part,type){jQuery.ajax({type:'POST',url:'./?_task=mail&_action=plugin.yetiforce.importIcs&_mbox='+urlencode(rcmail.env.mailbox)+'&_uid='+urlencode(rcmail.env.uid)+'&_part='+part+'&_type='+type,async:!1,success:function success(data){data=JSON.parse(data),window.crm.Vtiger_Helper_Js.showPnotify({text:data.message,type:'info',animation:'show'});}});},!0);});function loadActionBar(){var content=$('#ytActionBarContent'),params={module:'OSSMail',view:'MailActionBar',uid:rcmail.env.uid,folder:rcmail.env.mailbox,rcId:rcmail.env.user_id};window.crm.AppConnector.request(params).done(function(response){content.find('.ytHeader').html(response),$('#messagecontent').css('top',content.outerHeight()+$('#messageheader').outerHeight()+'px'),registerEvents(content);});}function registerEvents(content){registerAddRecord(content),registerAddReletedRecord(content),registerSelectRecord(content),registerRemoveRecord(content),registerImportMail(content);var block=content.find('.ytHeader .js-data');content.find('.hideBtn').click(function(){var button=$(this),icon=button.find('.glyphicon');'0'==button.data('type')?(button.data('type','1'),icon.removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down')):(button.data('type','0'),icon.removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up')),block.toggle(),$(window).trigger('resize');});}function registerImportMail(content){content.find('.importMail').click(function(){window.crm.Vtiger_Helper_Js.showPnotify({text:window.crm.app.vtranslate('StartedDownloadingEmail'),type:'info'}),window.crm.AppConnector.request({module:'OSSMail',action:'ImportMail',uid:rcmail.env.uid,folder:rcmail.env.mailbox,rcId:rcmail.env.user_id}).done(function(){loadActionBar(),window.crm.Vtiger_Helper_Js.showPnotify({text:window.crm.app.vtranslate('AddFindEmailInRecord'),type:'success'});});});}function registerRemoveRecord(content){content.find('button.removeRecord').click(function(e){var row=$(e.currentTarget).closest('.rowRelatedRecord');removeRecord(row.data('id'));});}function registerSelectRecord(content){var id=content.find('#mailActionBarID').val();content.find('button.selectRecord').click(function(){var relParams={mailId:id};if(0==$(this).data('type')){var module=$(this).closest('.js-head-container').find('.module').val();if(null===module)return}else{var module=$(this).data('module');relParams.crmid=$(this).closest('.rowRelatedRecord').data('id'),relParams.mod=$(this).closest('.rowRelatedRecord').data('module'),relParams.newModule=module;}showPopup({module:module,src_module:'OSSMailView',src_record:id},relParams);});}function registerAddReletedRecord(content){content.find('#mailActionBarID').val();content.find('button.addRelatedRecord').click(function(e){var targetElement=$(e.currentTarget),row=targetElement.closest('.rowRelatedRecord'),params={sourceModule:row.data('module')};showQuickCreateForm(targetElement.data('module'),row.data('id'),params);});}function registerAddRecord(content){var id=content.find('#mailActionBarID').val();content.find('button.addRecord').click(function(e){var col=$(e.currentTarget).closest('.js-head-container'),selectValue=col.find('.module').val();null!==selectValue&&showQuickCreateForm(selectValue,id);});}function removeRecord(crmid){var id=$('#mailActionBarID').val(),params={};params.data={module:'OSSMail',action:'ExecuteActions',mode:'removeRelated',params:{mailId:id,crmid:crmid}},params.async=!1,params.dataType='json',window.crm.AppConnector.request(params).done(function(data){var response=data.result;if(response.success)var notifyParams={text:response.data,type:'info',animation:'show'};else var notifyParams={text:response.data,animation:'show'};window.crm.Vtiger_Helper_Js.showPnotify(notifyParams),loadActionBar();});}function showPopup(params,actionsParams){actionsParams.newModule=params.module,window.crm.app.showRecordsList(params,function(modal,instance){instance.setSelectEvent(function(responseData){actionsParams.newCrmId=responseData.id,window.crm.AppConnector.request({async:!1,dataType:'json',data:{module:'OSSMail',action:'ExecuteActions',mode:'addRelated',params:actionsParams}}).done(function(data){var response=data.result;if(response.success)var notifyParams={text:response.data,type:'info',animation:'show'};else var notifyParams={text:response.data,animation:'show'};window.crm.Vtiger_Helper_Js.showPnotify(notifyParams),loadActionBar();});});});}function showQuickCreateForm(moduleName,record,params){var content=$('#ytActionBarContent');var relatedParams={};if(false)var sourceModule=params.sourceModule;else var sourceModule='OSSMailView';var postShown=function(data){$('').appendTo(data),$('').appendTo(data),$('').appendTo(data);},ids={link:'modulesLevel0',process:'modulesLevel1',subprocess:'modulesLevel2',linkextend:'modulesLevel3'};for(var i in ids){var element=content.find('#'+ids[i]),value=element.length?JSON.parse(element.val()):[];0<=$.inArray(sourceModule,value)&&(relatedParams[i]=record);}'Leads'==moduleName&&(relatedParams.company=rcmail.env.fromName),('Leads'==moduleName||'Contacts'==moduleName)&&(relatedParams.lastname=rcmail.env.fromName),'Project'==moduleName&&(relatedParams.projectname=rcmail.env.subject),'HelpDesk'==moduleName&&(relatedParams.ticket_title=rcmail.env.subject),'Products'==moduleName&&(relatedParams.productname=rcmail.env.subject),'Services'==moduleName&&(relatedParams.servicename=rcmail.env.subject),relatedParams.email=rcmail.env.fromMail,relatedParams.email1=rcmail.env.fromMail,relatedParams.description=$('#messagebody').text();relatedParams.sourceModule=sourceModule,relatedParams.sourceRecord=record,relatedParams.relationOperation=!0;var headerInstance=new window.crm.Vtiger_Header_Js;headerInstance.quickCreateModule(moduleName,{callbackFunction:function postQuickCreate(){loadActionBar();},callbackPostShown:postShown,data:relatedParams,noCache:!0});}function getCrmWindow(){if(null!==opener&&'object'==opener.parent.CONFIG)return opener.parent;return 'object'==_typeof(parent.CONFIG)?parent:'object'==_typeof(parent.parent.CONFIG)?parent.parent:!('object'!=_typeof(opener.crm.CONFIG))&&opener.crm} //# sourceMappingURL=preview.min.js.map diff --git a/plugins/yetiforce/preview.min.js.map b/plugins/yetiforce/preview.min.js.map index e7cfa8f0..28175f24 100644 --- a/plugins/yetiforce/preview.min.js.map +++ b/plugins/yetiforce/preview.min.js.map @@ -1 +1 @@ -{"version":3,"file":"preview.min.js","sources":["preview.js"],"sourcesContent":["/* {[The file is published on the basis of MIT License]} */\nwindow.rcmail && rcmail.addEventListener('init', function (evt) {\n\t\twindow.crm = getCrmWindow();\n\t\tloadActionBar();\n\t\trcmail.env.message_commands.push('yetiforce.importICS');\n\t\trcmail.register_command('yetiforce.importICS', function (part, type) {\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: 'POST',\n\t\t\t\turl: \"./?_task=mail&_action=plugin.yetiforce.importIcs&_mbox=\" + urlencode(rcmail.env.mailbox) + '&_uid=' + urlencode(rcmail.env.uid) + '&_part=' + part + '&_type=' + type,\n\t\t\t\tasync: false,\n\t\t\t\tsuccess: function (data) {\n\t\t\t\t\tdata = JSON.parse(data);\n\t\t\t\t\twindow.crm.Vtiger_Helper_Js.showPnotify({\n\t\t\t\t\t\ttext: data['message'],\n\t\t\t\t\t\ttype: 'info',\n\t\t\t\t\t\tanimation: 'show'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}, true);\n\t}\n);\n\nfunction loadActionBar() {\n\tvar content = $('#ytActionBarContent');\n\tvar params = {\n\t\tmodule: 'OSSMail',\n\t\tview: 'MailActionBar',\n\t\tuid: rcmail.env.uid,\n\t\tfolder: rcmail.env.mailbox,\n\t\trcId: rcmail.env.user_id\n\t};\n\twindow.crm.AppConnector.request(params).done(function (response) {\n\t\tcontent.find('.ytHeader').html(response);\n\t\t$('#messagecontent').css('top', (content.outerHeight() + $('#messageheader').outerHeight()) + 'px');\n\t\tregisterEvents(content);\n\t});\n}\n\nfunction registerEvents(content) {\n\tregisterAddRecord(content);\n\tregisterAddReletedRecord(content);\n\tregisterSelectRecord(content);\n\tregisterRemoveRecord(content);\n\tregisterImportMail(content);\n\n\tvar block = content.find('.ytHeader .js-data');\n\tcontent.find('.hideBtn').click(function () {\n\t\tvar button = $(this);\n\t\tvar icon = button.find('.glyphicon');\n\n\t\tif (button.data('type') == '0') {\n\t\t\tbutton.data('type', '1');\n\t\t\ticon.removeClass(\"glyphicon-chevron-up\").addClass(\"glyphicon-chevron-down\");\n\t\t} else {\n\t\t\tbutton.data('type', '0');\n\t\t\ticon.removeClass(\"glyphicon-chevron-down\").addClass(\"glyphicon-chevron-up\");\n\t\t}\n\t\tblock.toggle();\n\t\t$(window).trigger(\"resize\");\n\t});\n}\n\nfunction registerImportMail(content) {\n\tcontent.find('.importMail').click(function (e) {\n\t\twindow.crm.Vtiger_Helper_Js.showPnotify({\n\t\t\ttext: window.crm.app.vtranslate('StartedDownloadingEmail'),\n\t\t\ttype: 'info'\n\t\t});\n\t\twindow.crm.AppConnector.request({\n\t\t\tmodule: 'OSSMail',\n\t\t\taction: 'ImportMail',\n\t\t\tparams: {\n\t\t\t\tuid: rcmail.env.uid,\n\t\t\t\tfolder: rcmail.env.mailbox,\n\t\t\t\trcId: rcmail.env.user_id\n\t\t\t}\n\t\t}).done(function (data) {\n\t\t\tloadActionBar();\n\t\t\twindow.crm.Vtiger_Helper_Js.showPnotify({\n\t\t\t\ttext: window.crm.app.vtranslate('AddFindEmailInRecord'),\n\t\t\t\ttype: 'success'\n\t\t\t});\n\t\t})\n\t});\n}\n\nfunction registerRemoveRecord(content) {\n\tcontent.find('button.removeRecord').click(function (e) {\n\t\tvar row = $(e.currentTarget).closest('.rowRelatedRecord');\n\t\tremoveRecord(row.data('id'));\n\t});\n}\n\nfunction registerSelectRecord(content) {\n\tlet id = content.find('#mailActionBarID').val();\n\tcontent.find('button.selectRecord').click(function (e) {\n\t\tlet relParams = {\n\t\t\tmailId: id\n\t\t};\n\t\tif ($(this).data('type') == 0) {\n\t\t\tvar module = $(this).closest('.js-head-container').find('.module').val();\n\t\t\tif (module === null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tvar module = $(this).data('module');\n\t\t\trelParams.crmid = $(this).closest('.rowRelatedRecord').data('id');\n\t\t\trelParams.mod = $(this).closest('.rowRelatedRecord').data('module');\n\t\t\trelParams.newModule = module;\n\t\t}\n\t\tshowPopup({\n\t\t\tmodule: module,\n\t\t\tsrc_module: 'OSSMailView',\n\t\t\tsrc_record: id,\n\t\t}, relParams);\n\t});\n}\n\nfunction registerAddReletedRecord(content) {\n\tvar id = content.find('#mailActionBarID').val();\n\tcontent.find('button.addRelatedRecord').click(function (e) {\n\t\tvar targetElement = $(e.currentTarget);\n\t\tvar row = targetElement.closest('.rowRelatedRecord');\n\t\tvar params = {sourceModule: row.data('module')};\n\t\tshowQuickCreateForm(targetElement.data('module'), row.data('id'), params);\n\t});\n}\n\nfunction registerAddRecord(content) {\n\tvar id = content.find('#mailActionBarID').val();\n\tcontent.find('button.addRecord').click(function (e) {\n\t\tvar col = $(e.currentTarget).closest('.js-head-container');\n\t\tlet selectValue = col.find('.module').val();\n\t\tif (selectValue !== null) {\n\t\t\tshowQuickCreateForm(selectValue, id);\n\t\t}\n\t});\n}\n\nfunction removeRecord(crmid) {\n\tvar id = $('#mailActionBarID').val();\n\tvar params = {}\n\tparams.data = {\n\t\tmodule: 'OSSMail',\n\t\taction: 'ExecuteActions',\n\t\tmode: 'removeRelated',\n\t\tparams: {\n\t\t\tmailId: id,\n\t\t\tcrmid: crmid\n\t\t}\n\t}\n\tparams.async = false;\n\tparams.dataType = 'json';\n\twindow.crm.AppConnector.request(params).done(function (data) {\n\t\tvar response = data['result'];\n\t\tif (response['success']) {\n\t\t\tvar notifyParams = {\n\t\t\t\ttext: response['data'],\n\t\t\t\ttype: 'info',\n\t\t\t\tanimation: 'show'\n\t\t\t};\n\t\t} else {\n\t\t\tvar notifyParams = {\n\t\t\t\ttext: response['data'],\n\t\t\t\tanimation: 'show'\n\t\t\t};\n\t\t}\n\t\twindow.crm.Vtiger_Helper_Js.showPnotify(notifyParams);\n\t\tloadActionBar();\n\t});\n}\n\nfunction showPopup(params, actionsParams) {\n\tactionsParams['newModule'] = params['module'];\n\twindow.crm.app.showRecordsList(params, (modal, instance) => {\n\t\tinstance.setSelectEvent((responseData, e) => {\n\t\t\tactionsParams['newCrmId'] = responseData.id;\n\t\t\twindow.crm.AppConnector.request({\n\t\t\t\tasync: false,\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: {\n\t\t\t\t\tmodule: 'OSSMail',\n\t\t\t\t\taction: 'ExecuteActions',\n\t\t\t\t\tmode: 'addRelated',\n\t\t\t\t\tparams: actionsParams\n\t\t\t\t}\n\t\t\t}).done(function (data) {\n\t\t\t\tlet response = data['result'];\n\t\t\t\tif (response['success']) {\n\t\t\t\t\tvar notifyParams = {\n\t\t\t\t\t\ttext: response['data'],\n\t\t\t\t\t\ttype: 'info',\n\t\t\t\t\t\tanimation: 'show'\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tvar notifyParams = {\n\t\t\t\t\t\ttext: response['data'],\n\t\t\t\t\t\tanimation: 'show'\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\twindow.crm.Vtiger_Helper_Js.showPnotify(notifyParams);\n\t\t\t\tloadActionBar();\n\t\t\t});\n\t\t});\n\t});\n}\n\nfunction showQuickCreateForm(moduleName, record, params) {\n\tvar content = $('#ytActionBarContent');\n\tif (params == undefined) {\n\t\tvar params = {};\n\t}\n\tvar relatedParams = {};\n\tif (params['sourceModule']) {\n\t\tvar sourceModule = params['sourceModule'];\n\t} else {\n\t\tvar sourceModule = 'OSSMailView';\n\t}\n\tvar postShown = function (data) {\n\t\tvar index, queryParam, queryParamComponents;\n\t\t$('').appendTo(data);\n\t\t$('').appendTo(data);\n\t\t$('').appendTo(data);\n\t}\n\tvar ids = {\n\t\tlink: 'modulesLevel0',\n\t\tprocess: 'modulesLevel1',\n\t\tsubprocess: 'modulesLevel2',\n\t\tlinkextend: 'modulesLevel3'\n\t};\n\tfor (var i in ids) {\n\t\tvar element = content.find('#' + ids[i]);\n\t\tvar value = element.length ? JSON.parse(element.val()) : [];\n\t\tif ($.inArray(sourceModule, value) >= 0) {\n\t\t\trelatedParams[i] = record;\n\t\t}\n\t}\n\tif (moduleName == 'Leads') {\n\t\trelatedParams['company'] = rcmail.env.fromName;\n\t}\n\tif (moduleName == 'Leads' || moduleName == 'Contacts') {\n\t\trelatedParams['lastname'] = rcmail.env.fromName;\n\t}\n\tif (moduleName == 'Project') {\n\t\trelatedParams['projectname'] = rcmail.env.subject;\n\t}\n\tif (moduleName == 'HelpDesk') {\n\t\trelatedParams['ticket_title'] = rcmail.env.subject;\n\t}\n\tif (moduleName == 'Products') {\n\t\trelatedParams['productname'] = rcmail.env.subject;\n\t}\n\tif (moduleName == 'Services') {\n\t\trelatedParams['servicename'] = rcmail.env.subject;\n\t}\n\trelatedParams['email'] = rcmail.env.fromMail;\n\trelatedParams['email1'] = rcmail.env.fromMail;\n\trelatedParams['description'] = $('#messagebody').text();\n\t//relatedParams['related_to'] = record;\n\tvar postQuickCreate = function (data) {\n\t\tloadActionBar();\n\t}\n\trelatedParams['sourceModule'] = sourceModule;\n\trelatedParams['sourceRecord'] = record;\n\trelatedParams['relationOperation'] = true;\n\tvar quickCreateParams = {\n\t\tcallbackFunction: postQuickCreate,\n\t\tcallbackPostShown: postShown,\n\t\tdata: relatedParams,\n\t\tnoCache: true\n\t};\n\tvar headerInstance = new window.crm.Vtiger_Header_Js();\n\theaderInstance.quickCreateModule(moduleName, quickCreateParams);\n}\n\nfunction getCrmWindow() {\n\tif (opener !== null && opener.parent.CONFIG == \"object\") {\n\t\treturn opener.parent;\n\t} else if (typeof parent.CONFIG == \"object\") {\n\t\treturn parent;\n\t} else if (typeof parent.parent.CONFIG == \"object\") {\n\t\treturn parent.parent;\n\t} else if (typeof opener.crm.CONFIG == \"object\") {\n\t\treturn opener.crm;\n\t}\n\treturn false;\n}\n"],"names":["window","rcmail","addEventListener","crm","getCrmWindow","loadActionBar","env","message_commands","push","register_command","part","type","jQuery","ajax","url","urlencode","mailbox","uid","async","success","data","JSON","parse","Vtiger_Helper_Js","showPnotify","text","animation","$","params","module","view","folder","rcId","user_id","AppConnector","request","done","response","content","find","html","css","outerHeight","registerEvents","registerAddRecord","registerAddReletedRecord","registerSelectRecord","registerRemoveRecord","registerImportMail","click","icon","button","removeClass","addClass","block","toggle","trigger","app","vtranslate","action","e","currentTarget","closest","removeRecord","row","val","mailId","id","relParams","crmid","mod","newModule","showPopup","src_module","src_record","targetElement","sourceModule","showQuickCreateForm","selectValue","col","mode","dataType","notifyParams","actionsParams","showRecordsList","modal","instance","setSelectEvent","responseData","moduleName","record","appendTo","ids","link","process","subprocess","linkextend","i","value","element","length","inArray","relatedParams","fromName","subject","fromMail","Vtiger_Header_Js","headerInstance","quickCreateModule","callbackFunction","callbackPostShown","postShown","noCache","parent","CONFIG","opener"],"mappings":";;;;;;;;AACAA,OAAOC,MAAP,EAAiBA,OAAOC,gBAAP,CAAwB,MAAxB,CAAgC,UAAe,CAC9DF,OAAOG,GAAP,CAAaC,cADiD,CAE9DC,eAF8D,CAG9DJ,OAAOK,GAAP,CAAWC,gBAAX,CAA4BC,IAA5B,CAAiC,qBAAjC,CAH8D,CAI9DP,OAAOQ,gBAAP,CAAwB,qBAAxB,CAA+C,SAAUC,IAAV,CAAgBC,IAAhB,CAAsB,CACpEC,OAAOC,IAAP,CAAY,CACXF,KAAM,MADK,CAEXG,IAAK,0DAA4DC,UAAUd,OAAOK,GAAP,CAAWU,OAArB,CAA5D,CAA4F,QAA5F,CAAuGD,UAAUd,OAAOK,GAAP,CAAWW,GAArB,CAAvG,CAAmI,SAAnI,CAA+IP,IAA/I,CAAsJ,SAAtJ,CAAkKC,IAF5J,CAGXO,QAHW,CAIXC,QAAS,iBAAUC,IAAV,CAAgB,CACxBA,KAAOC,KAAKC,KAAL,CAAWF,IAAX,CADiB,CAExBpB,OAAOG,GAAP,CAAWoB,gBAAX,CAA4BC,WAA5B,CAAwC,CACvCC,KAAML,YADiC,CAEvCT,KAAM,MAFiC,CAGvCe,UAAW,MAH4B,CAAxC,EAKA,CAXU,CAAZ,EAaA,CAdD,KAeA,CAnBe,EAsBjB,sBAAA,EAAyB,aACVC,EAAE,qBAAF,CADU,CAEpBC,OAAS,CACZC,OAAQ,SADI,CAEZC,KAAM,eAFM,CAGZb,IAAKhB,OAAOK,GAAP,CAAWW,GAHJ,CAIZc,OAAQ9B,OAAOK,GAAP,CAAWU,OAJP,CAKZgB,KAAM/B,OAAOK,GAAP,CAAW2B,OALL,CAFW,CASxBjC,OAAOG,GAAP,CAAW+B,YAAX,CAAwBC,OAAxB,CAA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AAOE,OAAOhH,GAAP,CAAW+G,MAAlB,CAPY,GAQfC,OAAOhH,GAGf"} \ No newline at end of file +{"version":3,"file":"preview.min.js","sources":["preview.js"],"sourcesContent":["/* {[The file is published on the basis of MIT License]} */\nwindow.rcmail && rcmail.addEventListener('init', function (evt) {\n\t\twindow.crm = getCrmWindow();\n\t\tloadActionBar();\n\t\trcmail.env.message_commands.push('yetiforce.importICS');\n\t\trcmail.register_command('yetiforce.importICS', function (part, type) {\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: 'POST',\n\t\t\t\turl: \"./?_task=mail&_action=plugin.yetiforce.importIcs&_mbox=\" + urlencode(rcmail.env.mailbox) + '&_uid=' + urlencode(rcmail.env.uid) + '&_part=' + part + '&_type=' + type,\n\t\t\t\tasync: false,\n\t\t\t\tsuccess: function (data) {\n\t\t\t\t\tdata = JSON.parse(data);\n\t\t\t\t\twindow.crm.Vtiger_Helper_Js.showPnotify({\n\t\t\t\t\t\ttext: data['message'],\n\t\t\t\t\t\ttype: 'info',\n\t\t\t\t\t\tanimation: 'show'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}, true);\n\t}\n);\n\nfunction loadActionBar() {\n\tvar content = $('#ytActionBarContent');\n\tvar params = {\n\t\tmodule: 'OSSMail',\n\t\tview: 'MailActionBar',\n\t\tuid: rcmail.env.uid,\n\t\tfolder: rcmail.env.mailbox,\n\t\trcId: rcmail.env.user_id\n\t};\n\twindow.crm.AppConnector.request(params).done(function (response) {\n\t\tcontent.find('.ytHeader').html(response);\n\t\t$('#messagecontent').css('top', (content.outerHeight() + $('#messageheader').outerHeight()) + 'px');\n\t\tregisterEvents(content);\n\t});\n}\n\nfunction registerEvents(content) {\n\tregisterAddRecord(content);\n\tregisterAddReletedRecord(content);\n\tregisterSelectRecord(content);\n\tregisterRemoveRecord(content);\n\tregisterImportMail(content);\n\n\tvar block = content.find('.ytHeader .js-data');\n\tcontent.find('.hideBtn').click(function () {\n\t\tvar button = $(this);\n\t\tvar icon = button.find('.glyphicon');\n\n\t\tif (button.data('type') == '0') {\n\t\t\tbutton.data('type', '1');\n\t\t\ticon.removeClass(\"glyphicon-chevron-up\").addClass(\"glyphicon-chevron-down\");\n\t\t} else {\n\t\t\tbutton.data('type', '0');\n\t\t\ticon.removeClass(\"glyphicon-chevron-down\").addClass(\"glyphicon-chevron-up\");\n\t\t}\n\t\tblock.toggle();\n\t\t$(window).trigger(\"resize\");\n\t});\n}\n\nfunction registerImportMail(content) {\n\tcontent.find('.importMail').click(function (e) {\n\t\twindow.crm.Vtiger_Helper_Js.showPnotify({\n\t\t\ttext: window.crm.app.vtranslate('StartedDownloadingEmail'),\n\t\t\ttype: 'info'\n\t\t});\n\t\twindow.crm.AppConnector.request({\n\t\t\tmodule: 'OSSMail',\n\t\t\taction: 'ImportMail',\n\t\t\tuid: rcmail.env.uid,\n\t\t\tfolder: rcmail.env.mailbox,\n\t\t\trcId: rcmail.env.user_id\n\t\t}).done(function (data) {\n\t\t\tloadActionBar();\n\t\t\twindow.crm.Vtiger_Helper_Js.showPnotify({\n\t\t\t\ttext: window.crm.app.vtranslate('AddFindEmailInRecord'),\n\t\t\t\ttype: 'success'\n\t\t\t});\n\t\t})\n\t});\n}\n\nfunction registerRemoveRecord(content) {\n\tcontent.find('button.removeRecord').click(function (e) {\n\t\tvar row = $(e.currentTarget).closest('.rowRelatedRecord');\n\t\tremoveRecord(row.data('id'));\n\t});\n}\n\nfunction registerSelectRecord(content) {\n\tlet id = content.find('#mailActionBarID').val();\n\tcontent.find('button.selectRecord').click(function (e) {\n\t\tlet relParams = {\n\t\t\tmailId: id\n\t\t};\n\t\tif ($(this).data('type') == 0) {\n\t\t\tvar module = $(this).closest('.js-head-container').find('.module').val();\n\t\t\tif (module === null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tvar module = $(this).data('module');\n\t\t\trelParams.crmid = $(this).closest('.rowRelatedRecord').data('id');\n\t\t\trelParams.mod = $(this).closest('.rowRelatedRecord').data('module');\n\t\t\trelParams.newModule = module;\n\t\t}\n\t\tshowPopup({\n\t\t\tmodule: module,\n\t\t\tsrc_module: 'OSSMailView',\n\t\t\tsrc_record: id,\n\t\t}, relParams);\n\t});\n}\n\nfunction registerAddReletedRecord(content) {\n\tvar id = content.find('#mailActionBarID').val();\n\tcontent.find('button.addRelatedRecord').click(function (e) {\n\t\tvar targetElement = $(e.currentTarget);\n\t\tvar row = targetElement.closest('.rowRelatedRecord');\n\t\tvar params = {sourceModule: row.data('module')};\n\t\tshowQuickCreateForm(targetElement.data('module'), row.data('id'), params);\n\t});\n}\n\nfunction registerAddRecord(content) {\n\tvar id = content.find('#mailActionBarID').val();\n\tcontent.find('button.addRecord').click(function (e) {\n\t\tvar col = $(e.currentTarget).closest('.js-head-container');\n\t\tlet selectValue = col.find('.module').val();\n\t\tif (selectValue !== null) {\n\t\t\tshowQuickCreateForm(selectValue, id);\n\t\t}\n\t});\n}\n\nfunction removeRecord(crmid) {\n\tvar id = $('#mailActionBarID').val();\n\tvar params = {}\n\tparams.data = {\n\t\tmodule: 'OSSMail',\n\t\taction: 'ExecuteActions',\n\t\tmode: 'removeRelated',\n\t\tparams: {\n\t\t\tmailId: id,\n\t\t\tcrmid: crmid\n\t\t}\n\t}\n\tparams.async = false;\n\tparams.dataType = 'json';\n\twindow.crm.AppConnector.request(params).done(function (data) {\n\t\tvar response = data['result'];\n\t\tif (response['success']) {\n\t\t\tvar notifyParams = {\n\t\t\t\ttext: response['data'],\n\t\t\t\ttype: 'info',\n\t\t\t\tanimation: 'show'\n\t\t\t};\n\t\t} else {\n\t\t\tvar notifyParams = {\n\t\t\t\ttext: response['data'],\n\t\t\t\tanimation: 'show'\n\t\t\t};\n\t\t}\n\t\twindow.crm.Vtiger_Helper_Js.showPnotify(notifyParams);\n\t\tloadActionBar();\n\t});\n}\n\nfunction showPopup(params, actionsParams) {\n\tactionsParams['newModule'] = params['module'];\n\twindow.crm.app.showRecordsList(params, (modal, instance) => {\n\t\tinstance.setSelectEvent((responseData, e) => {\n\t\t\tactionsParams['newCrmId'] = responseData.id;\n\t\t\twindow.crm.AppConnector.request({\n\t\t\t\tasync: false,\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: {\n\t\t\t\t\tmodule: 'OSSMail',\n\t\t\t\t\taction: 'ExecuteActions',\n\t\t\t\t\tmode: 'addRelated',\n\t\t\t\t\tparams: actionsParams\n\t\t\t\t}\n\t\t\t}).done(function (data) {\n\t\t\t\tlet response = data['result'];\n\t\t\t\tif (response['success']) {\n\t\t\t\t\tvar notifyParams = {\n\t\t\t\t\t\ttext: response['data'],\n\t\t\t\t\t\ttype: 'info',\n\t\t\t\t\t\tanimation: 'show'\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tvar notifyParams = {\n\t\t\t\t\t\ttext: response['data'],\n\t\t\t\t\t\tanimation: 'show'\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\twindow.crm.Vtiger_Helper_Js.showPnotify(notifyParams);\n\t\t\t\tloadActionBar();\n\t\t\t});\n\t\t});\n\t});\n}\n\nfunction showQuickCreateForm(moduleName, record, params) {\n\tvar content = $('#ytActionBarContent');\n\tif (params == undefined) {\n\t\tvar params = {};\n\t}\n\tvar relatedParams = {};\n\tif (params['sourceModule']) {\n\t\tvar sourceModule = params['sourceModule'];\n\t} else {\n\t\tvar sourceModule = 'OSSMailView';\n\t}\n\tvar postShown = function (data) {\n\t\tvar index, queryParam, queryParamComponents;\n\t\t$('').appendTo(data);\n\t\t$('').appendTo(data);\n\t\t$('').appendTo(data);\n\t}\n\tvar ids = {\n\t\tlink: 'modulesLevel0',\n\t\tprocess: 'modulesLevel1',\n\t\tsubprocess: 'modulesLevel2',\n\t\tlinkextend: 'modulesLevel3'\n\t};\n\tfor (var i in ids) {\n\t\tvar element = content.find('#' + ids[i]);\n\t\tvar value = element.length ? JSON.parse(element.val()) : [];\n\t\tif ($.inArray(sourceModule, value) >= 0) {\n\t\t\trelatedParams[i] = record;\n\t\t}\n\t}\n\tif (moduleName == 'Leads') {\n\t\trelatedParams['company'] = rcmail.env.fromName;\n\t}\n\tif (moduleName == 'Leads' || moduleName == 'Contacts') {\n\t\trelatedParams['lastname'] = rcmail.env.fromName;\n\t}\n\tif (moduleName == 'Project') {\n\t\trelatedParams['projectname'] = rcmail.env.subject;\n\t}\n\tif (moduleName == 'HelpDesk') {\n\t\trelatedParams['ticket_title'] = rcmail.env.subject;\n\t}\n\tif (moduleName == 'Products') {\n\t\trelatedParams['productname'] = rcmail.env.subject;\n\t}\n\tif (moduleName == 'Services') {\n\t\trelatedParams['servicename'] = rcmail.env.subject;\n\t}\n\trelatedParams['email'] = rcmail.env.fromMail;\n\trelatedParams['email1'] = rcmail.env.fromMail;\n\trelatedParams['description'] = $('#messagebody').text();\n\t//relatedParams['related_to'] = record;\n\tvar postQuickCreate = function (data) {\n\t\tloadActionBar();\n\t}\n\trelatedParams['sourceModule'] = sourceModule;\n\trelatedParams['sourceRecord'] = record;\n\trelatedParams['relationOperation'] = true;\n\tvar quickCreateParams = {\n\t\tcallbackFunction: postQuickCreate,\n\t\tcallbackPostShown: postShown,\n\t\tdata: relatedParams,\n\t\tnoCache: true\n\t};\n\tvar headerInstance = new window.crm.Vtiger_Header_Js();\n\theaderInstance.quickCreateModule(moduleName, quickCreateParams);\n}\n\nfunction getCrmWindow() {\n\tif (opener !== null && opener.parent.CONFIG == \"object\") {\n\t\treturn opener.parent;\n\t} else if (typeof parent.CONFIG == \"object\") {\n\t\treturn parent;\n\t} else if (typeof parent.parent.CONFIG == \"object\") {\n\t\treturn parent.parent;\n\t} else if (typeof opener.crm.CONFIG == \"object\") {\n\t\treturn opener.crm;\n\t}\n\treturn false;\n}\n"],"names":["window","rcmail","addEventListener","crm","getCrmWindow","loadActionBar","env","message_commands","push","register_command","part","type","jQuery","ajax","url","urlencode","mailbox","uid","async","success","data","JSON","parse","Vtiger_Helper_Js","showPnotify","text","animation","$","params","module","view","folder","rcId","user_id","AppConnector","request","done","response","content","find","html","css","outerHeight","registerEvents","registerAddRecord","registerAddReletedRecord","registerSelectRecord","registerRemoveRecord","registerImportMail","click","icon","button","removeClass","addClass","block","toggle","trigger","app","vtranslate","action","e","currentTarget","closest","removeRecord","row","val","mailId","id","relParams","crmid","mod","newModule","showPopup","src_module","src_record","targetElement","sourceModule","showQuickCreateForm","selectValue","col","mode","dataType","notifyParams","actionsParams","showRecordsList","modal","instance","setSelectEvent","responseData","moduleName","record","appendTo","ids","link","process","subprocess","linkextend","i","value","element","length","inArray","relatedParams","fromName","subject","fromMail","Vtiger_Header_Js","headerInstance","quickCreateModule","callbackFunction","callbackPostShown","postShown","noCache","parent","CONFIG","opener"],"mappings":";;;;;;;;AACAA,OAAOC,MAAP,EAAiBA,OAAOC,gBAAP,CAAwB,MAAxB,CAAgC,UAAe,CAC9DF,OAAOG,GAAP,CAAaC,cADiD,CAE9DC,eAF8D,CAG9DJ,OAAOK,GAAP,CAAWC,gBAAX,CAA4BC,IAA5B,CAAiC,qBAAjC,CAH8D,CAI9DP,OAAOQ,gBAAP,CAAwB,qBAAxB,CAA+C,SAAUC,IAAV,CAAgBC,IAAhB,CAAsB,CACpEC,OAAOC,IAAP,CAAY,CACXF,KAAM,MADK,CAEXG,IAAK,0DAA4DC,UAAUd,OAAOK,GAAP,CAAWU,OAArB,CAA5D,CAA4F,QAA5F,CAAuGD,UAAUd,OAAOK,GAAP,CAAWW,GAArB,CAAvG,CAAmI,SAAnI,CAA+IP,IAA/I,CAAsJ,SAAtJ,CAAkKC,IAF5J,CAGXO,QAHW,CAIXC,QAAS,iBAAUC,IAAV,CAAgB,CACxBA,KAAOC,KAAKC,KAAL,CAAWF,IAAX,CADiB,CAExBpB,OAAOG,GAAP,CAAWoB,gBAAX,CAA4BC,WAA5B,CAAwC,CACvCC,KAAML,YADiC,CAEvCT,KAAM,MAFiC,CAGvCe,UAAW,MAH4B,CAAxC,EAKA,CAXU,CAAZ,EAaA,CAdD,KAeA,CAnBe,EAsBjB,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UAJuB,CAOxB,EACA,CAED,qBAAA,EAAwB,CACvB,GAAe,IAAX,WAA2C,QAAxB,SAAOC,MAAP,CAAcC,MAArC,CACC,cAAcD,MAAd,CAFsB,OAGY,QAAxB,UAAOA,OAAOC,MAAd,CAHY,CAIfD,MAJe,CAKmB,QAA/B,UAAOA,OAAOA,MAAP,CAAcC,MAArB,CALY,CAMfD,OAAOA,MANQ,GAOgB,QAA5B,UAAOE,OAAOhH,GAAP,CAAW+G,MAAlB,CAPY,GAQfC,OAAOhH,GAGf"} \ No newline at end of file diff --git a/version.php b/version.php index 86ed0684..7624355d 100644 --- a/version.php +++ b/version.php @@ -1,5 +1,5 @@ '2019.02.06', - 'version' => '0.0.65' + 'version' => '0.0.66' ];