Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend

This commit is contained in:
Taras Machyshyn
2018-11-12 12:16:05 +02:00
59 changed files with 355 additions and 125 deletions
+3
View File
@@ -76,7 +76,10 @@ class Cleanup extends \Espo\Core\Jobs\Base
$pdo = $this->getEntityManager()->getPDO();
$query = "DELETE FROM `job` WHERE DATE(modified_at) < ".$pdo->quote($this->getCleanupJobFromDate())." AND status <> 'Pending'";
$sth = $pdo->prepare($query);
$sth->execute();
$query = "DELETE FROM `job` WHERE DATE(modified_at) < ".$pdo->quote($this->getCleanupJobFromDate())." AND status = 'Pending' AND deleted = 1";
$sth = $pdo->prepare($query);
$sth->execute();
}
@@ -1,5 +1,6 @@
{
"layouts": {
"detailConvert": "Converti Lead",
"listForAccount": "Elenco (per Account)",
"listForContact": "Lista (per contatto)"
}
@@ -10,7 +10,6 @@
"description": "Descrizione",
"users": "Utenti",
"contacts": "Contatti",
"leads": "Comando",
"reminders": "Promemoria",
"acceptanceStatus": "Stato accettazione"
},
@@ -27,7 +27,6 @@
"excludingTargetLists": "Esclusioni da liste di destinazione",
"accounts": "Account",
"contacts": "Contatti",
"leads": "Comando",
"opportunities": "Opportunita'",
"massEmails": "Email Massiva",
"contactsTemplate": "Modello contatti",
@@ -1,7 +1,6 @@
{
"fields": {
"name": "Nome",
"title": "Titolo",
"accountRole": "Titolo",
"accounts": "Account",
"phoneNumber": "Telefono",
@@ -16,7 +16,6 @@
"accounts": "Account",
"opportunities": "Opportunita'",
"folder": "Cartella",
"leads": "Comando",
"contacts": "Contatti"
},
"options": {
@@ -1,6 +1,6 @@
{
"labels": {
"Create Lead": "Crea Guida",
"Create Lead": "Crea Lead",
"Create Contact": "Crea Contatto",
"Create Task": "Crea Compito",
"Create Case": "Crea Caso",
@@ -3,7 +3,6 @@
"parent": "Genitore",
"contacts": "Contatti",
"opportunities": "Opportunita'",
"leads": "Comando",
"meetings": "Riunioni",
"calls": "Chiamate",
"tasks": "Compiti",
@@ -16,7 +15,6 @@
},
"scopeNames": {
"Contact": "Contatti",
"Lead": "Guida",
"Opportunity": "Opportunità",
"Meeting": "Riunione",
"Calendar": "Calendario",
@@ -34,7 +32,6 @@
"scopeNamesPlural": {
"Account": "Account",
"Contact": "Contatti",
"Lead": "Comando",
"Opportunity": "Opportunita'",
"Meeting": "Riunioni",
"Calendar": "Calendario",
@@ -51,7 +48,7 @@
"KnowledgeBaseCategory": "Conoscenza di Base Categorie"
},
"dashlets": {
"Leads": "Le mie Guide",
"Leads": "I miei Lead",
"Opportunities": "Le mie Opportunità",
"Tasks": "I miei Compiti",
"Cases": "I miei Casi",
@@ -1,7 +1,7 @@
{
"labels": {
"Converted To": "Convertito in",
"Create Lead": "Crea Guida",
"Create Lead": "Crea Lead",
"Convert": "Convertire",
"convert": "convertire"
},
@@ -3,6 +3,7 @@
"name": "Nome",
"amount": "Importo",
"probability": "Probabilità, %",
"leadSource": "Sorgente Lead",
"doNotCall": "Non chiamare",
"closeDate": "Data di chiusura",
"contacts": "Contatti",
@@ -56,7 +56,14 @@
"Label Manager": "Gestione etichetta",
"Auth Log": "Auth log",
"Lead Capture": "Cattura Lead",
"Attachments": "Allegati"
"Attachments": "Allegati",
"API Users": "API Utenti",
"PHP Settings": "Impostazioni PHP",
"Database Settings": "Impostazioni Database",
"Permissions": "Permessi",
"Success": "Successo",
"Fail": "Fallito",
"is recommended": "E' raccomandato"
},
"layouts": {
"list": "Elenco",
@@ -0,0 +1 @@
{}
@@ -108,7 +108,7 @@
"archived": "Archiviato",
"drafts": "Bozze",
"trash": "Cestino",
"important": "Importantw"
"important": "Importante"
},
"massActions": {
"markAsRead": "Contrassegna come Letto",
@@ -137,9 +137,9 @@
"Actions": "Azioni",
"Delete": "Cancellare",
"Update": "Aggiorna",
"Save": "Salvare",
"Save": "Salva",
"Edit": "Modificare",
"Cancel": "Annullare",
"Cancel": "Annulla",
"Apply": "Applicare",
"Unlink": "Scollegare",
"Mass Update": "Aggiornamento Massivo",
+3 -3
View File
@@ -131,11 +131,11 @@ class App extends \Espo\Core\Services\Base
$emailAddressList = [];
foreach ($user->get('emailAddresses') as $emailAddress) {
if ($emailAddress->get('invalid')) continue;
if ($user->get('emailAddrses') === $emailAddress->get('name')) continue;
if ($user->get('emailAddress') === $emailAddress->get('name')) continue;
$emailAddressList[] = $emailAddress->get('name');
}
if ($user->get('emailAddrses')) {
array_unshift($emailAddressList, $user->get('emailAddrses'));
if ($user->get('emailAddress')) {
array_unshift($emailAddressList, $user->get('emailAddress'));
}
$entityManager = $this->getEntityManager();
@@ -457,7 +457,7 @@ Espo.define('crm:views/calendar/calendar', ['view', 'lib!full-calendar'], functi
},
getCalculatedHeight: function () {
if (this.$container && this.$container.size()) {
if (this.$container && this.$container.length) {
return this.$container.height();
}
var height = $(window).height();
@@ -727,7 +727,7 @@ Espo.define('crm:views/calendar/calendar', ['view', 'lib!full-calendar'], functi
setTimeout(function () {
$calendar.fullCalendar(options);
this.updateDate();
if (this.$container && this.$container.size()) {
if (this.$container && this.$container.length) {
this.adjustSize();
}
}.bind(this), 150);
@@ -184,7 +184,7 @@ Espo.define('crm:views/dashlets/abstract/chart', ['views/dashlets/abstract/base'
var width = Math.floor((containerWidth - dashletChartLegendBoxWidth * number) / number);
var columnNumber = this.$legendContainer.find('> table tr:first-child > td').size() / 2;
var columnNumber = this.$legendContainer.find('> table tr:first-child > td').length / 2;
var tableWidth = (width + dashletChartLegendBoxWidth) * columnNumber;
@@ -215,7 +215,7 @@ Espo.define('crm:views/dashlets/abstract/chart', ['views/dashlets/abstract/base'
this.adjustContainer();
setTimeout(function () {
if (!this.$container.size() || !this.$container.is(":visible")) return;
if (!this.$container.length || !this.$container.is(":visible")) return;
this.draw();
}.bind(this), 1);
});
@@ -40,7 +40,7 @@ Espo.define('crm:views/document/fields/file', 'views/fields/file', function (Dep
return false;
}
return '<a title="'+name+'" href="'+this.getBasePath()+'?entryPoint=download&id=' + id + '" target="_BLANK"><span class="glyphicon glyphicon-paperclip small"></span></a>';
return '<a title="'+name+'" href="'+this.getBasePath()+'?entryPoint=download&id=' + id + '" target="_BLANK"><span class="fas fa-paperclip small"></span></a>';
} else {
return Dep.prototype.getValueForDisplay.call(this);
}
@@ -1,2 +1,2 @@
<span class="glyphicon glyphicon-paperclip small"></span> <a href="{{url}}">{{{value}}}</a>
<span class="fas fa-paperclip small"></span> <a href="{{url}}">{{{value}}}</a>
@@ -1 +1 @@
{{#if value}}<span class="glyphicon glyphicon-paperclip small"></span>{{/if}}
{{#if value}}<span class="fas fa-paperclip small"></span>{{/if}}
@@ -1,6 +1,6 @@
{{#if hasAttachment}}
<span class="list-icon-container pull-right">
<span class="glyphicon glyphicon-paperclip small text-muted" title="{{translate 'hasAttachment' category='fields' scope='Email'}}"></span>
<span class="fas fa-paperclip small text-muted" title="{{translate 'hasAttachment' category='fields' scope='Email'}}"></span>
</span>
{{/if}}
{{#unless isRead}}<strong>{{/unless}}
@@ -3,7 +3,7 @@
{{#unless uploadFromFileSystemDisabled}}
<div class="pull-left">
<label class="attach-file-label" title="{{translate 'Attach File'}}">
<span class="btn btn-default btn-icon"><span class="glyphicon glyphicon-paperclip"></span></span>
<span class="btn btn-default btn-icon"><span class="fas fa-paperclip"></span></span>
<input type="file" class="file pull-right" multiple>
</label>
</div>
+1 -1
View File
@@ -2,7 +2,7 @@
<div class="attachment-button{{#if id}} hidden{{/if}}">
<div class="pull-left">
<label class="attach-file-label" title="{{translate 'Attach File'}}">
<span class="btn btn-default btn-icon"><span class="glyphicon glyphicon-paperclip"></span></span>
<span class="btn btn-default btn-icon"><span class="fas fa-paperclip"></span></span>
<input type="file" class="file pull-right" {{#if acceptAttribue}}accept="{{acceptAttribue}}"{{/if}}>
</label>
</div>
+54 -9
View File
@@ -8,14 +8,41 @@
</div>
{{/if}}
{{#if checkboxes}}
{{#if massActionList}}
{{#if displayActionsButtonGroup}}
<div class="btn-group actions">
<button type="button" class="btn btn-default dropdown-toggle actions-button" data-toggle="dropdown" disabled>
{{#if massActionList}}
<button type="button" class="btn btn-default dropdown-toggle actions-button hidden" data-toggle="dropdown">
{{translate 'Actions'}}
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
{{/if}}
{{#if buttonList.length}}
{{#each buttonList}}
{{button name scope=../../scope label=label style=style hidden=hidden}}
{{/each}}
{{/if}}
<div class="btn-group">
{{#if dropdownItemList.length}}
<button type="button" class="btn btn-default dropdown-toggle dropdown-item-list-button" data-toggle="dropdown">
<span class="fas fa-ellipsis-h"></span>
</button>
<ul class="dropdown-menu pull-left">
{{#each dropdownItemList}}
{{#if this}}
<li class="{{#if hidden}}hidden{{/if}}"><a href="javascript:" class="action" data-action="{{name}}">{{#if html}}{{{html}}}{{else}}{{translate label scope=../../../entityType}}{{/if}}</a></li>
{{else}}
{{#unless @first}}
{{#unless @last}}
<li class="divider"></li>
{{/unless}}
{{/unless}}
{{/if}}
{{/each}}
</ul>
{{/if}}
</div>
{{#if massActionList}}
<ul class="dropdown-menu actions-menu">
{{#each massActionList}}
{{#if this}}
<li><a href="javascript:" data-action="{{./this}}" class='mass-action'>{{translate this category="massActions" scope=../../scope}}</a></li>
@@ -28,8 +55,30 @@
{{/if}}
{{/each}}
</ul>
{{/if}}
</div>
<div class="sticked-bar hidden">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle actions-button hidden" data-toggle="dropdown">
{{translate 'Actions'}}
<span class="caret"></span>
</button>
<ul class="dropdown-menu actions-menu">
{{#each massActionList}}
{{#if this}}
<li><a href="javascript:" data-action="{{./this}}" class='mass-action'>{{translate this category="massActions" scope=../../scope}}</a></li>
{{else}}
{{#unless @first}}
{{#unless @last}}
<li class="divider"></li>
{{/unless}}
{{/unless}}
{{/if}}
{{/each}}
</ul>
</div>
</div>
{{/if}}
{{/if}}
{{#if displayTotalCount}}
@@ -37,10 +86,6 @@
{{translate 'Total'}}: <span class="total-count-span">{{collection.total}}</span>
</div>
{{/if}}
{{#each buttonList}}
{{button name scope=../../scope label=label style=style}}
{{/each}}
</div>
{{/if}}
+2 -1
View File
@@ -40,10 +40,11 @@
<button type="button" class="btn btn-default btn-icon-x-wide" data-action="reset" title="{{translate 'Reset'}}">
<span class="fas fa-redo-alt"></span>
</button>
<button type="button" class="btn btn-default btn-icon-wide dropdown-toggle add-filter-button" data-toggle="dropdown" tabindex="-1" title="{{translate 'Add Field'}}">
<button type="button" class="btn btn-default btn-icon-wide dropdown-toggle add-filter-button" data-toggle="dropdown" tabindex="-1">
<span class="fas fa-ellipsis-v"></span>
</button>
<ul class="dropdown-menu pull-right filter-list">
<li class="dropdown-header">{{translate 'Add Field'}}</li>
{{#each advancedFields}}
<li data-name="{{name}}" class="{{#if checked}}hide{{/if}}"><a href="javascript:" class="add-filter" data-action="addFilter" data-name="{{name}}">{{translate name scope=../entityType category='fields'}}</a></li>
{{/each}}
+10 -6
View File
@@ -72,9 +72,13 @@ Espo.define('ui', [], function () {
this.contents = '';
if (this.header) {
this.contents += '<header class="modal-header">' +
var headerClassName = '';
if (this.options.fixedHeaderHeight) {
headerClassName = ' fixed-height';
}
this.contents += '<header class="modal-header'+headerClassName+'">' +
((this.closeButton) ? '<a href="javascript:" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span></a>' : '') +
'<h4 class="modal-title">' + this.header + '</h4>' +
'<h4 class="modal-title"><span class="modal-title-text">' + this.header + '</span></h4>' +
'</header>';
}
@@ -225,7 +229,7 @@ Espo.define('ui', [], function () {
var $body = $(document.body);
this.$el.on('hidden.bs.modal', function (e) {
if ($('.modal:visible').size() > 0) {
if ($('.modal:visible').length > 0) {
$body.addClass('modal-open');
}
});
@@ -240,14 +244,14 @@ Espo.define('ui', [], function () {
var $modalBackdrop = $('.modal-backdrop');
$modalBackdrop.each(function (i, el) {
if (i < $modalBackdrop.size() - 1) {
if (i < $modalBackdrop.length - 1) {
$(el).addClass('hidden');
}
}.bind(this));
var $modalConainer = $('.modal-container');
$modalConainer.each(function (i, el) {
if (i < $modalConainer.size() - 1) {
if (i < $modalConainer.length - 1) {
$(el).addClass('overlaid');
}
}.bind(this));
@@ -272,7 +276,7 @@ Espo.define('ui', [], function () {
$modalBackdrop.last().removeClass('hidden');
var $modalConainer = $('.modal-container');
$($modalConainer.get($modalConainer.size() - 2)).removeClass('overlaid');
$($modalConainer.get($modalConainer.length - 2)).removeClass('overlaid');
this.$el.modal('hide');
$(this).trigger('dialog:close');
+1 -1
View File
@@ -140,7 +140,7 @@ Espo.define('views/admin/layouts/grid', 'views/admin/layouts/base', function (De
var count = 0;
var isEmpty = false;
if ($ul.children('li:not(.empty)').size() == 0) {
if ($ul.children('li:not(.empty)').length == 0) {
isEmpty = true;
}
+2 -3
View File
@@ -34,11 +34,10 @@ Espo.define('views/email/record/list', 'views/record/list', function (Dep) {
massActionList: ['remove', 'massUpdate'],
buttonList: [
dropdownItemList: [
{
name: 'markAllAsRead',
label: 'Mark all as read',
style: 'default'
label: 'Mark all as read'
}
],
@@ -529,7 +529,7 @@ Espo.define('views/fields/attachment-multiple', 'views/fields/base', function (D
previews.push('<div class="attachment-preview">' + this.getDetailPreview(name, type, id) + '</div>');
continue;
}
var line = '<div class="attachment-block"><span class="glyphicon glyphicon-paperclip small"></span> <a href="' + this.getDownloadUrl(id) + '" target="_BLANK">' + Handlebars.Utils.escapeExpression(name) + '</a></div>';
var line = '<div class="attachment-block"><span class="fas fa-paperclip text-soft small"></span> <a href="' + this.getDownloadUrl(id) + '" target="_BLANK">' + Handlebars.Utils.escapeExpression(name) + '</a></div>';
names.push(line);
}
var string = previews.join('') + names.join('');
+4 -4
View File
@@ -154,7 +154,7 @@ Espo.define('views/fields/base', 'view', function (Dep) {
* {jQuery}
*/
getLabelElement: function () {
if (!this.$label || !this.$label.size()) {
if (!this.$label || !this.$label.length) {
this.$label = this.$el.parent().children('label');
}
return this.$label;
@@ -351,7 +351,7 @@ Espo.define('views/fields/base', 'view', function (Dep) {
var $label = this.getLabelElement();
var $sign = $label.find('span.required-sign');
if ($label.size() && !$sign.size()) {
if ($label.length && !$sign.length) {
$text = $label.find('span.label-text');
$('<span class="required-sign"> *</span>').insertAfter($text);
$sign = $label.find('span.required-sign');
@@ -385,7 +385,7 @@ Espo.define('views/fields/base', 'view', function (Dep) {
var $cell = this.getCellElement();
var $editLink = $('<a href="javascript:" class="pull-right inline-edit-link hidden"><span class="fas fa-pencil-alt fa-sm"></span></a>');
if ($cell.size() == 0) {
if ($cell.length == 0) {
this.listenToOnce(this, 'after:render', this.initInlineEdit, this);
return;
}
@@ -552,7 +552,7 @@ Espo.define('views/fields/base', 'view', function (Dep) {
$el = $(target);
}
if (!$el.size() && this.$element) {
if (!$el.length && this.$element) {
$el = this.$element;
}
$el.popover({
+1 -1
View File
@@ -220,7 +220,7 @@ Espo.define('views/fields/duration', 'views/fields/enum', function (Dep) {
return $(el).val() >= seconds;
}).first();
if ($found.size()) {
if ($found.length) {
if ($found.val() != seconds) {
$o.insertBefore($found);
};
+5 -5
View File
@@ -155,7 +155,7 @@ Espo.define('views/fields/email', 'views/fields/varchar', function (Dep) {
'click [data-action="removeEmailAddress"]': function (e) {
var $block = $(e.currentTarget).closest('div.email-address-block');
if ($block.parent().children().size() == 1) {
if ($block.parent().children().length == 1) {
$block.find('input.email-address').val('');
} else {
this.removeEmailAddressBlock($block);
@@ -168,7 +168,7 @@ Espo.define('views/fields/email', 'views/fields/varchar', function (Dep) {
var $block = $input.closest('div.email-address-block');
if ($input.val() == '') {
if ($block.parent().children().size() == 1) {
if ($block.parent().children().length == 1) {
$block.find('input.email-address').val('');
} else {
this.removeEmailAddressBlock($block);
@@ -273,7 +273,7 @@ Espo.define('views/fields/email', 'views/fields/varchar', function (Dep) {
}
});
if (c == $input.size()) {
if (c == $input.length) {
this.$el.find('[data-action="addEmailAddress"]').removeClass('disabled').removeAttr('disabled');
} else {
this.$el.find('[data-action="addEmailAddress"]').addClass('disabled').attr('disabled', 'disabled');
@@ -283,7 +283,7 @@ Espo.define('views/fields/email', 'views/fields/varchar', function (Dep) {
manageButtonsVisibility: function () {
var $primary = this.$el.find('button[data-property-type="primary"]');
var $remove = this.$el.find('button[data-action="removeEmailAddress"]');
if ($primary.size() > 1) {
if ($primary.length > 1) {
$primary.removeClass('hidden');
$remove.removeClass('hidden');
} else {
@@ -387,7 +387,7 @@ Espo.define('views/fields/email', 'views/fields/varchar', function (Dep) {
var $list = this.$el.find('div.email-address-block');
if ($list.size()) {
if ($list.length) {
$list.each(function (i, d) {
var row = {};
var $d = $(d);
+1 -1
View File
@@ -285,7 +285,7 @@ Espo.define('views/fields/file', 'views/fields/link', function (Dep) {
if (this.showPreview && ~this.previewTypeList.indexOf(type)) {
string = '<div class="attachment-preview">' + this.getDetailPreview(name, type, id) + '</div>';
} else {
string = '<span class="glyphicon glyphicon-paperclip small"></span> <a href="'+ this.getDownloadUrl(id) +'" target="_BLANK">' + Handlebars.Utils.escapeExpression(name) + '</a>';
string = '<span class="fas fa-paperclip text-soft small"></span> <a href="'+ this.getDownloadUrl(id) +'" target="_BLANK">' + Handlebars.Utils.escapeExpression(name) + '</a>';
}
return string;
}
+1 -1
View File
@@ -89,7 +89,7 @@ Espo.define('views/fields/formula', 'views/fields/text', function (Dep) {
this.$editor = this.$el.find('#' + this.containerId);
if (this.$editor.size() && (this.mode === 'edit' || this.mode == 'detail')) {
if (this.$editor.length && (this.mode === 'edit' || this.mode == 'detail')) {
this.$editor
.css('height', this.height + 'px')
.css('fontSize', '14px');
@@ -282,7 +282,7 @@ Espo.define('views/fields/link-multiple-with-columns', 'views/fields/link-multip
if (this.mode == 'edit') {
columnFormElementJQList.forEach(function ($column) {
var fetch = function ($target) {
if (!$target || !$target.size()) return;
if (!$target || !$target.length) return;
var column = $target.data('column');
var value = $target.val().toString().trim();
var id = $target.data('id');
@@ -160,15 +160,15 @@ Espo.define('views/fields/link-multiple-with-primary', 'views/fields/link-multip
managePrimaryButton: function () {
var $primary = this.$el.find('button[data-action="switchPrimary"]');
if ($primary.size() > 1) {
if ($primary.length > 1) {
$primary.removeClass('hidden');
} else {
$primary.addClass('hidden');
}
if ($primary.filter('.active').size() == 0) {
if ($primary.filter('.active').length == 0) {
var $first = $primary.first();
if ($first.size()) {
if ($first.length) {
$first.addClass('active').children().removeClass('text-muted');
this.setPrimaryId($first.data('id'));
}
@@ -182,7 +182,7 @@ Espo.define('views/fields/link-multiple-with-role', 'views/fields/link-multiple'
if (this.mode == 'edit') {
if ($role) {
var fetch = function ($target) {
if (!$target || !$target.size()) return;
if (!$target || !$target.length) return;
var value = $target.val().toString().trim();
var id = $target.data('id');
+5 -5
View File
@@ -133,7 +133,7 @@ Espo.define('views/fields/phone', 'views/fields/varchar', function (Dep) {
'click [data-action="removePhoneNumber"]': function (e) {
var $block = $(e.currentTarget).closest('div.phone-number-block');
if ($block.parent().children().size() == 1) {
if ($block.parent().children().length == 1) {
$block.find('input.phone-number').val('');
} else {
this.removePhoneNumberBlock($block);
@@ -146,7 +146,7 @@ Espo.define('views/fields/phone', 'views/fields/varchar', function (Dep) {
var $block = $input.closest('div.phone-number-block');
if ($input.val() == '') {
if ($block.parent().children().size() == 1) {
if ($block.parent().children().length == 1) {
$block.find('input.phone-number').val('');
} else {
this.removePhoneNumberBlock($block);
@@ -214,7 +214,7 @@ Espo.define('views/fields/phone', 'views/fields/varchar', function (Dep) {
}
});
if (c == $input.size()) {
if (c == $input.length) {
this.$el.find('[data-action="addPhoneNumber"]').removeClass('disabled').removeAttr('disabled');
} else {
this.$el.find('[data-action="addPhoneNumber"]').addClass('disabled').attr('disabled', 'disabled');
@@ -224,7 +224,7 @@ Espo.define('views/fields/phone', 'views/fields/varchar', function (Dep) {
manageButtonsVisibility: function () {
var $primary = this.$el.find('button[data-property-type="primary"]');
var $remove = this.$el.find('button[data-action="removePhoneNumber"]');
if ($primary.size() > 1) {
if ($primary.length > 1) {
$primary.removeClass('hidden');
$remove.removeClass('hidden');
} else {
@@ -253,7 +253,7 @@ Espo.define('views/fields/phone', 'views/fields/varchar', function (Dep) {
var $list = this.$el.find('div.phone-number-block');
if ($list.size()) {
if ($list.length) {
$list.each(function (i, d) {
var row = {};
var $d = $(d);
+2 -2
View File
@@ -79,7 +79,7 @@ Espo.define('views/fields/wysiwyg', ['views/fields/text', 'lib!Summernote'], fun
var AttachmentButton = function (context) {
var ui = $.summernote.ui;
var button = ui.button({
contents: '<i class="glyphicon glyphicon-paperclip"></i>',
contents: '<i class="fas fa-paperclip"></i>',
tooltip: this.translate('Attach File'),
click: function () {
this.attachFile();
@@ -374,7 +374,7 @@ Espo.define('views/fields/wysiwyg', ['views/fields/text', 'lib!Summernote'], fun
options.height = this.height;
} else {
var $scrollable = this.$el.closest('.modal-body');
if (!$scrollable.size()) {
if (!$scrollable.length) {
$scrollable = $(window);
}
this.$scrollable = $scrollable;
+1 -1
View File
@@ -151,6 +151,7 @@ Espo.define('views/modal', 'view', function (Dep) {
footerAtTheTop: this.getThemeManager().getParam('modalFooterAtTheTop'),
fullHeight: this.getThemeManager().getParam('modalFullHeight'),
screenWidthXs: this.getThemeManager().getParam('screenWidthXs'),
fixedHeaderHeight: this.fixedHeaderHeight,
onRemove: function () {
this.onDialogClose();
}.bind(this)
@@ -265,4 +266,3 @@ Espo.define('views/modal', 'view', function (Dep) {
},
});
});
+1 -1
View File
@@ -59,7 +59,7 @@ Espo.define('views/modals/image-crop', ['views/modal', 'lib!Cropper'], function
];
this.on('remove', function () {
if (this.$img.size()) {
if (this.$img.length) {
this.$img.cropper('destroy');
this.$img.parent().empty();
}
+1 -1
View File
@@ -104,7 +104,7 @@ Espo.define('views/modals/mass-update', 'views/modal', function (Dep) {
this.$el.find('ul.filter-list li[data-name="'+name+'"]').addClass('hidden');
if (this.$el.find('ul.filter-list li:not(.hidden)').size() == 0) {
if (this.$el.find('ul.filter-list li:not(.hidden)').length == 0) {
this.$el.find('button.select-field').addClass('disabled').attr('disabled', 'disabled');
}
+2
View File
@@ -42,6 +42,8 @@ Espo.define('views/modals/related-list', ['views/modal', 'search-manager'], func
backdrop: true,
fixedHeaderHeight: true,
events: {
'click button[data-action="createRelated"]': function () {
this.actionCreateRelated();
+1 -1
View File
@@ -138,7 +138,7 @@ Espo.define('views/note/fields/post', ['views/fields/text', 'lib!Textcomplete'],
});
this.once('remove', function () {
if (this.$element.size()) {
if (this.$element.length) {
this.$element.textcomplete('destroy');
}
}, this);
+2 -2
View File
@@ -97,7 +97,7 @@ Espo.define('views/notification/badge', 'view', function (Dep) {
this.runCheckUpdates(true);
this.$popupContainer = $('#popup-notifications-container');
if (!$(this.$popupContainer).size()) {
if (!$(this.$popupContainer).length) {
this.$popupContainer = $('<div>').attr('id', 'popup-notifications-container').addClass('hidden').appendTo('body');
}
@@ -275,7 +275,7 @@ Espo.define('views/notification/badge', 'view', function (Dep) {
$document = $(document);
$document.on('mouseup.notification', function (e) {
if (!$container.is(e.target) && $container.has(e.target).length === 0) {
if (!$(e.target).closest('div.modal-dialog').size()) {
if (!$(e.target).closest('div.modal-dialog').length) {
this.closeNotifications();
}
}
+1 -1
View File
@@ -584,7 +584,7 @@ Espo.define('views/record/kanban', ['views/record/list'], function (Dep) {
var $item = this.$el.find('.item[data-id="'+id+'"]');
var $column = this.$el.find('.group-column[data-name="'+group+'"] .group-column-list');
if ($column.size()) {
if ($column.length) {
$column.prepend($item);
} else {
$item.remove();
+118 -14
View File
@@ -73,6 +73,8 @@ Espo.define('views/record/list', 'view', function (Dep) {
portalLayoutDisabled: false,
dropdownItemList: [],
events: {
'click a.link': function (e) {
e.stopPropagation();
@@ -147,7 +149,7 @@ Espo.define('views/record/list', 'view', function (Dep) {
'click .checkbox-dropdown [data-action="selectAllResult"]': function (e) {
this.selectAllResult();
},
'click .actions a.mass-action': function (e) {
'click .actions-menu a.mass-action': function (e) {
$el = $(e.currentTarget);
var action = $el.data('action');
@@ -181,14 +183,111 @@ Espo.define('views/record/list', 'view', function (Dep) {
this.deactivate();
},
initStickedBar: function () {
var $stickedBar = this.$stickedBar = this.$el.find('.sticked-bar');
var $middle = this.$el.find('> .list');
var $window = $(window);
var $scrollable = $window;
this.on('render', function () {
this.$stickedBar = null;
}, this);
var screenWidthXs = this.getThemeManager().getParam('screenWidthXs');
function getOffsetTop (element) {
var offsetTop = 0;
do {
if (element.classList.contains('modal-body')) break;
if (!isNaN(element.offsetTop)) {
offsetTop += element.offsetTop;
}
} while (element = element.offsetParent);
return offsetTop;
}
var top;
if (this.$el.closest('.modal-body').length) {
$scrollable = this.$el.closest('.modal-body');
top = 0;
} else {
top = getOffsetTop(this.getParentView().$el.get(0));
if ($(window.document).width() < screenWidthXs) {
top = 0;
}
}
top += this.$el.find('.list-buttons-container').height();
var topBarHeight = this.getThemeManager().getParam('navbarHeight') || 30;
$scrollable.off('scroll.list-' + this.cid);
$scrollable.on('scroll.list-' + this.cid, function (e) {
cotrolSticking();
}.bind(this));
$window.off('resize.list-' + this.cid);
$window.on('resize.list-' + this.cid, function (e) {
cotrolSticking();
}.bind(this));
this.on('check', function () {
if (this.checkedList.length === 0) return;
cotrolSticking();
}, this);
this.once('remove', function () {
$scrollable.off('scroll.list-' + this.cid);
$window.off('resize.list-' + this.cid);
});
var cotrolSticking = function () {
if (this.checkedList.length === 0) return;
var middleTop = getOffsetTop($middle.get(0));
var stickTop = middleTop - top;
var edge = middleTop + $middle.outerHeight(true);
var scrollTop = $scrollable.scrollTop();
if (scrollTop < edge) {
if (scrollTop > stickTop) {
$stickedBar.removeClass('hidden');
} else {
$stickedBar.addClass('hidden');
}
} else {
$stickedBar.removeClass('hidden');
}
}.bind(this);
},
showActions: function () {
this.$el.find('.actions-button').removeClass('hidden');
if (!this.options.stickedBarDisabled && !this.stickedBarDisabled && this.massActionList.length) {
if (!this.$stickedBar) {
this.initStickedBar();
}
}
},
hideActions: function () {
this.$el.find('.actions-button').addClass('hidden');
if (this.$stickedBar) {
this.$stickedBar.addClass('hidden');
}
},
selectAllHandler: function (isChecked) {
this.checkedList = [];
var $actionsButton = this.$el.find('.actions-button');
if (isChecked) {
this.$el.find('input.record-checkbox').prop('checked', true);
$actionsButton.removeAttr('disabled');
this.showActions();
this.collection.models.forEach(function (model) {
this.checkedList.push(model.id);
}, this);
@@ -198,7 +297,7 @@ Espo.define('views/record/list', 'view', function (Dep) {
this.unselectAllResult();
}
this.$el.find('input.record-checkbox').prop('checked', false);
$actionsButton.attr('disabled', true);
this.hideActions();
this.$el.find('.list > table tbody tr').removeClass('active');
}
@@ -242,11 +341,12 @@ Espo.define('views/record/list', 'view', function (Dep) {
allResultIsChecked: false,
data: function () {
var paginationTop = this.pagination === 'both' || this.pagination === true || this.pagination === 'top';
var paginationBottom = this.pagination === 'both' || this.pagination === true || this.pagination === 'bottom';
return {
scope: this.scope,
entityType: this.entityType,
header: this.header,
headerDefs: this._getHeaderDefs(),
paginationEnabled: this.pagination,
@@ -259,11 +359,13 @@ Espo.define('views/record/list', 'view', function (Dep) {
checkboxes: this.checkboxes,
massActionList: this.massActionList,
rowList: this.rowList,
topBar: paginationTop || this.checkboxes || (this.buttonList.length && !this.buttonsDisabled),
topBar: paginationTop || this.checkboxes || (this.buttonList.length && !this.buttonsDisabled) || (this.dropdownItemList.length && !this.buttonsDisabled),
bottomBar: paginationBottom,
checkAllResultDisabled: this.checkAllResultDisabled,
buttonList: this.buttonList,
displayTotalCount: this.displayTotalCount && this.collection.total > 0
dropdownItemList: this.dropdownItemList,
displayTotalCount: this.displayTotalCount && this.collection.total > 0,
displayActionsButtonGroup: this.checkboxes || this.massActionList || this.buttonList.length || this.dropdownItemList.length,
};
},
@@ -294,6 +396,8 @@ Espo.define('views/record/list', 'view', function (Dep) {
this.rowActionsDisabled = this.options.rowActionsDisabled || this.rowActionsDisabled;
this.dropdownItemList = Espo.Utils.cloneDeep(this.options.dropdownItemList || this.dropdownItemList);
if ('buttonsDisabled' in this.options) {
this.buttonsDisabled = this.options.buttonsDisabled;
}
@@ -315,12 +419,12 @@ Espo.define('views/record/list', 'view', function (Dep) {
this.massActionList.forEach(function(item) {
if (!~this.checkAllResultMassActionList.indexOf(item)) {
this.$el.find('div.list-buttons-container .actions li a.mass-action[data-action="'+item+'"]').parent().addClass('hidden');
this.$el.find('div.list-buttons-container .actions-menu li a.mass-action[data-action="'+item+'"]').parent().addClass('hidden');
}
}, this);
if (this.checkAllResultMassActionList.length) {
this.$el.find('.actions-button').removeAttr('disabled');
this.showActions();
}
this.$el.find('.list > table tbody tr').removeClass('active');
@@ -337,7 +441,7 @@ Espo.define('views/record/list', 'view', function (Dep) {
this.massActionList.forEach(function(item) {
if (!~this.checkAllResultMassActionList.indexOf(item)) {
this.$el.find('div.list-buttons-container .actions li a.mass-action[data-action="'+item+'"]').parent().removeClass('hidden');
this.$el.find('div.list-buttons-container .actions-menu li a.mass-action[data-action="'+item+'"]').parent().removeClass('hidden');
}
}, this);
},
@@ -1072,7 +1176,7 @@ Espo.define('views/record/list', 'view', function (Dep) {
checkRecord: function (id, $target, isSilent) {
$target = $target || this.$el.find('.record-checkbox[data-id="' + id + '"]');
if (!$target.size()) return;
if (!$target.length) return;
$target.get(0).checked = true;
@@ -1106,9 +1210,9 @@ Espo.define('views/record/list', 'view', function (Dep) {
handleAfterCheck: function (isSilent) {
if (this.checkedList.length) {
this.$el.find('.actions-button').removeAttr('disabled');
this.showActions();
} else {
this.$el.find('.actions-button').attr('disabled', true);
this.hideActions();
}
if (this.checkedList.length == this.collection.models.length) {
@@ -105,13 +105,6 @@ Espo.define('views/record/panels/relationship', ['views/record/panels/bottom', '
}
}
if (this.defs.view) {
this.actionList.unshift({
label: 'View List',
action: this.defs.viewAction || 'viewRelatedList'
});
}
if (this.defs.select) {
var data = {link: this.link};
if (this.defs.selectPrimaryFilterName) {
@@ -130,6 +123,13 @@ Espo.define('views/record/panels/relationship', ['views/record/panels/bottom', '
});
}
if (this.defs.view) {
this.actionList.unshift({
label: 'View List',
action: this.defs.viewAction || 'viewRelatedList'
});
}
this.setupActions();
var layoutName = 'listSmall';
+1 -1
View File
@@ -121,7 +121,7 @@ Espo.define('views/record/panels/side', 'view', function (Dep) {
},
afterRender: function () {
if (this.$el.children().size() === 0) {
if (this.$el.children().length === 0) {
this.$el.parent().addClass('hidden');
}
},
+1 -1
View File
@@ -462,7 +462,7 @@ Espo.define('views/record/search', 'view', function (Dep) {
updateAddFilterButton: function () {
var $ul = this.$el.find('ul.filter-list');
if ($ul.children().not('.hide').size() == 0) {
if ($ul.children().not('.hide').length == 0) {
this.$el.find('button.add-filter-button').addClass('disabled');
} else {
this.$el.find('button.add-filter-button').removeClass('disabled');
+1 -1
View File
@@ -375,7 +375,7 @@ Espo.define('views/role/record/table', 'view', function (Dep) {
var fieldObj = {};
this.fieldActionList.forEach(function (action) {
var $select = this.$el.find('select[data-scope="'+scope+'"][data-field="'+field+'"][data-action="'+action+'"]');
if (!$select.size()) return;
if (!$select.length) return;
fieldObj[action] = $select.val();
}, this);
scopeObj[field] = fieldObj;
+5 -5
View File
@@ -188,14 +188,14 @@ Espo.define('views/site/navbar', 'view', function (Dep) {
});
var hideOneTab = function () {
var count = $tabs.children().size();
var count = $tabs.children().length;
if (count <= 1) return;
var $one = $tabs.children().eq(count - 2);
$one.prependTo($more);
};
var unhideOneTab = function () {
var $one = $more.children().eq(0);
if ($one.size()) {
if ($one.length) {
$one.insertBefore($moreDropdown);
}
};
@@ -242,7 +242,7 @@ Espo.define('views/site/navbar', 'view', function (Dep) {
}
}
if ($more.children().size() > 0) {
if ($more.children().length > 0) {
$moreDropdown.removeClass('hidden');
}
}.bind(this);
@@ -265,7 +265,7 @@ Espo.define('views/site/navbar', 'view', function (Dep) {
}
};
if ($navbar.height() <= navbarNeededHeight && $more.children().size() === 0) {
if ($navbar.height() <= navbarNeededHeight && $more.children().length === 0) {
$more.parent().addClass('hidden');
}
@@ -278,7 +278,7 @@ Espo.define('views/site/navbar', 'view', function (Dep) {
var $more = $tabs.find('li.more > ul');
if ($more.children().size() === 0) {
if ($more.children().length === 0) {
$more.parent().addClass('hidden');
}
+2 -2
View File
@@ -187,7 +187,7 @@ Espo.define('views/stream/panel', ['views/record/panels/relationship', 'lib!Text
},
storeControl: function () {
if (this.$textarea && this.$textarea.size()) {
if (this.$textarea && this.$textarea.length) {
var text = this.$textarea.val();
if (text.length) {
this.getSessionStorage().set(this.storageTextKey, text);
@@ -327,7 +327,7 @@ Espo.define('views/stream/panel', ['views/record/panels/relationship', 'lib!Text
}]);
this.once('remove', function () {
if (this.$textarea.size()) {
if (this.$textarea.length) {
this.$textarea.textcomplete('destroy');
}
}, this);
+1 -1
View File
@@ -185,7 +185,7 @@ Espo.define('views/stream/record/edit', 'views/record/base', function (Dep) {
if (!this.postingMode) {
$('body').off('click.stream-create-post');
$('body').on('click.stream-create-post', function (e) {
if ($.contains(window.document.body, e.target) && !$.contains(this.$el.get(0), e.target) && !$(e.target).closest('.modal-dialog').size()) {
if ($.contains(window.document.body, e.target) && !$.contains(this.$el.get(0), e.target) && !$(e.target).closest('.modal-dialog').length) {
if (this.getFieldView('post') && this.getFieldView('post').$element.val() == '') {
if (!(this.model.get('attachmentsIds') || []).length) {
this.disablePostingMode();
+22
View File
@@ -389,3 +389,25 @@ body .stick-sub.button-container {
body.minimized .stick-sub.button-container {
width: calc(~"100% - "@navbar-minimized-width);
}
body .list-buttons-container .sticked-bar {
width: calc(~"100% - "@navbar-width);
left: @navbar-width;
top: @tob-bar-height;
padding-left: @container-padding;
}
body.minimized .list-buttons-container .sticked-bar {
width: calc(~"100% - "@navbar-minimized-width);
left: @navbar-minimized-width;
}
@media screen and (max-width: (@screen-sm-min - 1px)) {
body .list-buttons-container .sticked-bar,
body.minimized .list-buttons-container .sticked-bar {
width: 100%;
top: 0;
left: 0;
}
}
+37 -4
View File
@@ -60,6 +60,10 @@
}
}
.text-soft {
color: @gray-soft;
}
.btn {
border-radius: @button-radius;
}
@@ -538,19 +542,48 @@ ul.dropdown-menu > li.checkbox:last-child {
padding: 0 6px;
}
.modal-header.fixed-height {
height: 40px;
max-height: 40px;
overflow: hidden;
.modal-title {
width: ~"calc(100% - 20px)";
> .modal-title-text {
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: inline-block;
}
}
}
.modal-header a {
color: @text-color;
}
.list-buttons-container > div {
float: left;
margin-right: @panel-padding;
.list-buttons-container .sticked-bar {
position: fixed;
background-color: @body-bg;
z-index: 1000;
}
.modal-dialog .modal-body .list-buttons-container .sticked-bar {
top: 94px !important;
width: 100% !important;
right: 0 !important;
left: unset;
}
.list-buttons-container > .actions {
min-height: 33px;
}
.list-buttons-container > div.total-count {
margin-right: 0px;
float: right;
padding: 6px 0;
padding: 7px 0;
}
.list-container .pagination {
+16
View File
@@ -135,3 +135,19 @@ body > footer {
max-width: @container-max-width;
}
}
body .list-buttons-container .sticked-bar {
width: 100%;
left: 0;
top: @navbar-height;
padding-left: @container-padding;
}
@media screen and (max-width: (@screen-sm-min - 1px)) {
body .list-buttons-container .sticked-bar,
body.minimized .list-buttons-container .sticked-bar {
width: 100%;
top: 0;
left: 0;
}
}
+8 -3
View File
@@ -28,6 +28,11 @@
color: @gray-soft;
}
.btn-default > .fa.text-muted,
.btn-default > .fas.text-muted {
color: @gray-light;
}
.btn-default.disabled > .fa,
.btn-default.disabled > .fas {
color: @gray-light;
@@ -37,9 +42,9 @@
border-bottom-width: 0;
}
.panel-default.note-editor .panel-heading .btn-default {
background-color: @btn-default-bg;
border-color: @btn-default-border;
.panel-default.note-editor > .panel-heading .btn-default {
background-color: @btn-default-bg !important;
border-color: @btn-default-border !important;
}
.panel > .panel-heading > .btn-group > .btn {
-7
View File
@@ -27,11 +27,6 @@
"Configuration Instructions": "Istruzioni di configurazione",
"phpVersion": "versione PHP",
"requiredMysqlVersion": "Versione MySQL",
"dbHostName": "Host Name",
"dbName": "Database Name",
"dbUserName": "Nome Utente Database",
"OK": "OK",
"mysqlVersion": "Versione MySQL",
"dbUserName": "Nome Utente Database"
},
"fields": {
@@ -63,7 +58,6 @@
"Some errors occurred!": "Alcuni errori si sono verificati!",
"phpVersion": "la versione di PHP in uso non è supportata da EspoCRM, aggiornare PHP dalla versione {minVersion} in poi.",
"requiredMysqlVersion": "la versione di MySQL in uso non è supportata da EspoCRM, si raccomanda di aggiornare MySQL almeno alla versione {minVersion}.",
"requiredMariadbVersion": "la versione di MariaDB in uso non è supportata da EspoCRM, si raccomanda di aggiornare MariaDB almeno alla versione {minVersion}.",
"The PHP extension was not found...": "PHP Errore: l'Estensione <b>{extName}</b> non è stata trovata.",
"All Settings correct": "Tutte le impostazioni sono corrette",
"Failed to connect to database": "Impossibile connettersi al database",
@@ -71,7 +65,6 @@
"You must agree to the license agreement": "E' necessario accettare il contratto di licenza",
"Passwords do not match": "Le password non corrispondono",
"Enable mod_rewrite in Apache server": "Attivare mod_rewrite in server Apache",
"Ajax failed": "Ajax non è riuscita",
"Cannot create user": "Non è possibile creare un utente",
"Permission denied": "Permesso negato",
"Permission denied to": "Permesso negato",