Compare commits

...

21 Commits

Author SHA1 Message Date
yuri 344da24b5e fix stream fetched twice 2015-06-12 14:50:54 +03:00
yuri 23ef028cb4 fix varchar search 2015-06-12 12:06:19 +03:00
yuri 492d4869c2 disable cut param for text 2015-06-12 11:02:02 +03:00
yuri 56e45c32f8 fix draft 2015-06-12 10:24:00 +03:00
yuri cb41c55e7a bottom mode 2015-06-11 16:42:58 +03:00
yuri 7d63eaf3e0 fix bottom panels 2015-06-11 16:34:03 +03:00
yuri 1538b08fd9 version 2015-06-11 14:06:11 +03:00
yuri 82a8914848 fix entity manager 2015-06-11 14:03:28 +03:00
yuri 2d5bf843d5 fix css 2015-06-11 12:22:37 +03:00
yuri f22f6d54aa edit bottom 2015-06-11 12:20:11 +03:00
yuri d609e4f70b fix merge and mass u pdate 2015-06-11 11:49:32 +03:00
yuri 8f56769e14 change document layout 2015-06-11 10:58:04 +03:00
yuri fa5b2da69e change documnts 2015-06-11 10:52:14 +03:00
yuri 937202784d autocomplete category tree 2015-06-11 10:49:34 +03:00
yuri 07424df41a document mass update 2015-06-11 10:47:46 +03:00
yuri e960ac472e version 2015-06-10 17:45:40 +03:00
yuri 84113356b5 fix mass update 2015-06-10 17:45:03 +03:00
yuri 3844946dc0 fix parent 2015-06-10 17:40:14 +03:00
yuri 9ecdf5713c fix create 2015-06-10 17:32:56 +03:00
yuri f1abd22512 fix email template 2015-06-10 15:40:26 +03:00
yuri c963058571 improve field hide/show 2015-06-10 12:04:23 +03:00
32 changed files with 167 additions and 88 deletions
+1 -1
View File
@@ -224,7 +224,7 @@ class Record extends Base
public function actionMassUpdate($params, $data, $request)
{
if (!$request->isPost()) {
if (!$request->isPut()) {
throw new BadRequest();
}
@@ -129,7 +129,7 @@ class EntityManager
$filePath = "application/Espo/Core/Templates/Metadata/{$type}/scopes.json";
$scopesDataContents = $this->getFileManager()->getContents($filePath);
$scopesDataContents = str_replace('{entityType}', $name, $scopesDataContents);
$scopesData = Json::decode($entityDefsDataContents, true);
$scopesData = Json::decode($scopesDataContents, true);
$scopesData['stream'] = $stream;
$scopesData['type'] = $type;
@@ -4,5 +4,6 @@
"createdAt",
"emailAddress",
"industry",
"type"
"type",
"name"
]
@@ -1,7 +1,6 @@
[
{"name":"name","width":35,"link":true},
{"name":"name","width":40,"link":true},
{"name":"file","width":10, "notSortable": true},
{"name":"type"},
{"name":"status"},
{"name":"createdAt"}
]
@@ -1,6 +1,6 @@
[
{"name":"name","width":40,"link":true},
{"name":"file","width":10, "notSortable": true},
{"name":"type"},
{"name":"folder"},
{"name":"createdAt"}
]
@@ -0,0 +1,5 @@
[
"assignedUser",
"teams",
"folder"
]
@@ -1,3 +1,4 @@
[
"children"
"children",
"documents"
]
@@ -61,7 +61,7 @@
},
"documents": {
"type": "hasMany",
"foreign": "folders",
"foreign": "folder",
"entity": "Document"
}
},
@@ -104,7 +104,8 @@
"translation": "Translation",
"previewSize": "Preview Size",
"noEmptyString": "No Empty String",
"defaultType": "Default Type"
"defaultType": "Default Type",
"seeMoreDisabled": "Disable Text Cut"
},
"messages": {
"upgradeVersion": "Your EspoCRM will be upgraded to version <strong>{version}</strong>. This can take some time.",
@@ -101,11 +101,13 @@
},
"bodyPlain": {
"type": "text",
"readOnly": true
"readOnly": true,
"seeMoreDisabled": true
},
"body": {
"type": "text",
"view": "Fields.Wysiwyg"
"view": "Fields.Wysiwyg",
"seeMoreDisabled": true
},
"isHtml": {
"type": "bool",
@@ -12,6 +12,10 @@
{
"name":"maxLength",
"type":"int"
},
{
"name":"seeMoreDisabled",
"type":"bool"
}
],
"filter": true
+7 -23
View File
@@ -69,30 +69,14 @@ class EmailTemplate extends Record
'lower' => $params['emailAddress']
))->findOne();
$entity = $this->getEntityManager()->getRepository('EmailAddress')->getEntityByAddress($params['emailAddress']);
if (!empty($emailAddress)) {
$pdo = $this->getEntityManager()->getPDO();
$sql = "
SELECT * FROM `entity_email_address`
WHERE
`primary` = 1 AND `deleted` = 0 AND `email_address_id` = " . $pdo->quote($emailAddress->id). "
";
$sth = $pdo->prepare($sql);
$sth->execute();
while ($row = $sth->fetch()) {
if (!empty($row['entity_id'])) {
$entity = $this->getEntityManager()->getEntity($row['entity_type'], $row['entity_id']);
if ($entity) {
if ($entity instanceof Person) {
$entityList['Person'] = $entity;
}
if (empty($entityList[$entity->getEntityName()])) {
$entityList[$entity->getEntityName()] = $entity;
}
break;
}
}
if ($entity) {
if ($entity instanceof Person) {
$entityList['Person'] = $entity;
}
if (empty($entityList[$entity->getEntityType()])) {
$entityList[$entity->getEntityType()] = $entity;
}
}
}
@@ -1,6 +1,6 @@
<select class="form-control search-type input-sm" name="{{name}}-type">
{{options searchParams.typeOptions searchParams.typeFront field='varcharSearchRanges'}}
{{options searchParams.typeOptions searchParams.type field='varcharSearchRanges'}}
</select>
<input type="text" class="main-element form-control input-sm" name="{{name}}" value="{{searchParams.value}}" {{#if params.maxLength}} maxlength="{{params.maxLength}}"{{/if}}{{#if params.size}} size="{{params.size}}"{{/if}} autocomplete="off" placeholder="{{translate 'Value'}}">
+15 -13
View File
@@ -36,7 +36,9 @@ Espo.define('Views.Email.Detail', ['Views.Detail', 'EmailHelper'], function (Dep
"style": "danger",
"acl": "edit"
}
]
],
'dropdown': [],
'actions': []
};
} else {
if (status == 'Archived' || status == 'Recieved') {
@@ -55,22 +57,22 @@ Espo.define('Views.Email.Detail', ['Views.Detail', 'EmailHelper'], function (Dep
});
}
}
}
this.menu.dropdown.push({
label: 'Create Task',
action: 'createTask',
acl: 'edit',
aclScope: 'Task'
});
if (this.model.get('parentType') !== 'Case' || !this.model.get('parentId')) {
this.menu.dropdown.push({
label: 'Create Case',
action: 'createCase',
label: 'Create Task',
action: 'createTask',
acl: 'edit',
aclScope: 'Case'
aclScope: 'Task'
});
if (this.model.get('parentType') !== 'Case' || !this.model.get('parentId')) {
this.menu.dropdown.push({
label: 'Create Case',
action: 'createCase',
acl: 'edit',
aclScope: 'Case'
});
}
}
},
+13 -9
View File
@@ -92,16 +92,20 @@ Espo.define('Views.Fields.Base', 'View', function (Dep) {
* Hide field and label. Works only after rendered.
*/
hide: function () {
this.$el.hide();
this.getCellElement().children('label').hide();
this.$el.addClass('hidden');
var $cell = this.getCellElement();
$cell.children('label').addClass('hidden');
$cell.addClass('hidden-cell');
},
/**
* Show field and label. Works only after rendered.
*/
show: function () {
this.$el.show();
this.getCellElement().children('label').show();
this.$el.removeClass('hidden');
var $cell = this.getCellElement();
$cell.children('label').removeClass('hidden');
$cell.removeClass('hidden-cell');
},
data: function () {
@@ -231,7 +235,7 @@ Espo.define('Views.Fields.Base', 'View', function (Dep) {
var initInlineEdit = function () {
var $cell = this.getCellElement();
var $editLink = $('<a href="javascript:" class="pull-right inline-edit-link hide"><span class="glyphicon glyphicon-pencil"></span></a>');
var $editLink = $('<a href="javascript:" class="pull-right inline-edit-link hidden"><span class="glyphicon glyphicon-pencil"></span></a>');
// sometimes field is being re-rendered in this time so need to init once again
if ($cell.size() == 0) {
@@ -251,12 +255,12 @@ Espo.define('Views.Fields.Base', 'View', function (Dep) {
return;
}
if (this.mode == 'detail') {
$editLink.removeClass('hide');
$editLink.removeClass('hidden');
}
}.bind(this)).on('mouseleave', function (e) {
e.stopPropagation();
if (this.mode == 'detail') {
$editLink.addClass('hide');
$editLink.addClass('hidden');
}
}.bind(this));
}.bind(this);
@@ -367,7 +371,7 @@ Espo.define('Views.Fields.Base', 'View', function (Dep) {
var $cell = this.getCellElement();
$cell.find('.inline-save-link').remove();
$cell.find('.inline-cancel-link').remove();
$cell.find('.inline-edit-link').addClass('hide');
$cell.find('.inline-edit-link').addClass('hidden');
},
addInlineEditLinks: function () {
@@ -376,7 +380,7 @@ Espo.define('Views.Fields.Base', 'View', function (Dep) {
var $cancelLink = $('<a href="javascript:" class="pull-right inline-cancel-link">' + this.translate('Cancel') + '</a>').css('margin-left', '8px');
$cell.prepend($saveLink);
$cell.prepend($cancelLink);
$cell.find('.inline-edit-link').addClass('hide');
$cell.find('.inline-edit-link').addClass('hidden');
$saveLink.click(function () {
this.inlineEditSave();
}.bind(this));
@@ -25,7 +25,7 @@ Espo.define('Views.Fields.LinkCategoryTree', 'Views.Fields.Link', function (Dep)
selectRecordsViewName: 'Modals.SelectCategoryTreeRecords',
autocompleteDisabled: true,
autocompleteDisabled: false,
fetchSearch: function () {
var data = Dep.prototype.fetchSearch.call(this);
@@ -25,7 +25,7 @@ Espo.define('Views.Fields.LinkMultipleCategoryTree', 'Views.Fields.LinkMultiple'
selectRecordsViewName: 'Modals.SelectCategoryTreeRecords',
autocompleteDisabled: true,
autocompleteDisabled: false,
fetchSearch: function () {
var data = Dep.prototype.fetchSearch.call(this);
@@ -43,7 +43,7 @@ Espo.define('Views.Fields.LinkParent', 'Views.Fields.Base', function (Dep) {
autocompleteDisabled: false,
selectRecordsViewName: '',
selectRecordsViewName: 'Modals.SelectRecords',
data: function () {
return _.extend({
@@ -88,7 +88,7 @@ Espo.define('Views.Fields.LinkParent', 'Views.Fields.Base', function (Dep) {
this.addActionHandler('selectLink', function () {
this.notify('Loading...');
var viewName = this.getMetadata().get('clientDefs.' + scope + '.modalViews.select') || this.selectRecordsViewName;
var viewName = this.getMetadata().get('clientDefs.' + this.foreignScope + '.modalViews.select') || this.selectRecordsViewName;
this.createView('dialog', viewName, {
scope: this.foreignScope,
+2 -1
View File
@@ -56,7 +56,8 @@ Espo.define('Views.Fields.Text', 'Views.Fields.Base', function (Dep) {
getValueForDisplay: function () {
var text = this.model.get(this.name);
if (text && (this.mode == 'detail' || this.mode == 'list') && !this.seeMoreText) {
if (text && (this.mode == 'detail' || this.mode == 'list') && !this.seeMoreText && !this.params.seeMoreDisabled) {
var maxLength = this.detailMaxLength;
var isCut = false;
+1 -1
View File
@@ -37,7 +37,7 @@ Espo.define('Views.Fields.Varchar', 'Views.Fields.Base', function (Dep) {
if (value) {
var data = {
value: value,
type: type,
type: type
}
return data;
}
@@ -23,8 +23,6 @@ Espo.define('Views.Fields.Wysiwyg', ['Views.Fields.Text', 'lib!Summernote'], fun
return Dep.extend({
type: 'wysiwyg',
detailTemplate: 'fields.wysiwyg.detail',
editTemplate: 'fields.wysiwyg.edit',
+1 -2
View File
@@ -200,8 +200,7 @@ Espo.define('Views.List', ['Views.Main', 'SearchManager'], function (Dep, Search
var attributes = this.getCreateAttributes() || {};
router.dispatch(this.scope, 'create', {
attributes: attributes,
returnUrl: Backbone.history.fragment,
attributes: attributes
});
router.navigate(url, {trigger: false});
}
@@ -81,7 +81,14 @@ Espo.define('Views.Modals.MassUpdate', 'Views.Modal', function (Dep) {
this.getModelFactory().create(this.scope, function (model) {
this.model = model;
this.getHelper().layoutManager.get(this.scope, 'massUpdate', function (layout) {
this.fields = layout;
layout = layout || [];
this.fields = [];
layout.forEach(function (field) {
if (model.hasField(field)) {
this.fields.push(field);
}
}, this);
this.wait(false);
}.bind(this));
}.bind(this));
@@ -102,7 +109,10 @@ Espo.define('Views.Modals.MassUpdate', 'Views.Modal', function (Dep) {
this.$el.find('.fields-container').append(html);
var type = Espo.Utils.upperCaseFirst(this.model.getFieldParam(name, 'type'));
this.createView(name, this.getFieldManager().getViewName(type), {
var viewName = this.model.getFieldParam(name, 'view') || this.getFieldManager().getViewName(type);
this.createView(name, viewName, {
model: this.model,
el: this.$el.selector + ' .field-' + name,
defs: {
+13 -4
View File
@@ -36,8 +36,13 @@ Espo.define('Views.Record.Base', 'View', function (Dep) {
fieldList: null,
hideField: function (name) {
this.$el.find('label.field-label-' + name).addClass('hide');
this.$el.find('div.field-' + name).addClass('hide');
var $field = this.$el.find('div.field-' + name);
var $label = this.$el.find('label.field-label-' + name);
$field.addClass('hidden');
$label.addClass('hidden');
$field.closest('.cell-' + name).addClass('hidden-cell');
var view = this.getFieldView(name);
if (view) {
view.enabled = false;
@@ -45,8 +50,12 @@ Espo.define('Views.Record.Base', 'View', function (Dep) {
},
showField: function (name) {
this.$el.find('label.field-label-' + name).removeClass('hide');
this.$el.find('div.field-' + name).removeClass('hide');
var $field = this.$el.find('div.field-' + name);
var $label = this.$el.find('label.field-label-' + name);
$field.removeClass('hidden');
$label.removeClass('hidden');
$field.closest('.cell-' + name).removeClass('hidden-cell');
var view = this.getFieldView(name);
if (view) {
view.enabled = true;
@@ -27,6 +27,10 @@ Espo.define('Views.Record.DetailBottom', 'View', function (Dep) {
mode: 'detail',
streamPanel: true,
relationshipPanels: true,
data: function () {
return {
panelList: this.panelList
@@ -57,7 +61,7 @@ Espo.define('Views.Record.DetailBottom', 'View', function (Dep) {
var panelList = Espo.Utils.clone(this.getMetadata().get('clientDefs.' + scope + '.bottomPanels.' + this.mode) || []);
if (this.mode == 'detail' && this.getMetadata().get('scopes.' + scope + '.stream')) {
if (this.streamPanel && this.getMetadata().get('scopes.' + scope + '.stream')) {
panelList.push({
"name":"stream",
"label":"Stream",
@@ -73,7 +77,8 @@ Espo.define('Views.Record.DetailBottom', 'View', function (Dep) {
model: this.model,
panelName: name,
el: this.options.el + ' .panel-body-' + Espo.Utils.toDom(name),
defs: p
defs: p,
mode: this.mode
}, function (view) {
if ('getActionList' in view) {
p.actionList = this.filterActions(view.getActionList());
@@ -92,12 +97,19 @@ Espo.define('Views.Record.DetailBottom', 'View', function (Dep) {
setup: function () {
this.panelList = [];
var scope = this.scope = this.model.name;
this.scope = this.model.name;
this.setupPanels();
this.wait(true);
if (this.relationshipPanels) {
this.setupRelationshipPanels();
}
},
setupRelationshipPanels: function () {
var scope = this.scope;
this.wait(true);
this._helper.layoutManager.get(this.model.name, 'relationships', function (layout) {
var panelList = layout;
panelList.forEach(function (item) {
@@ -0,0 +1,35 @@
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* EspoCRM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
Espo.define('Views.Record.EditBottom', 'Views.Record.DetailBottom', function (Dep) {
return Dep.extend({
mode: 'edit',
streamPanel: false,
relationshipPanels: false,
});
});
+1 -1
View File
@@ -49,7 +49,7 @@ Espo.define('Views.Record.Edit', 'Views.Record.Detail', function (Dep) {
sideView: 'Record.EditSide',
bottomView: null,
bottomView: 'Record.EditBottom',
actionSave: function () {
this.save();
+3 -1
View File
@@ -169,7 +169,9 @@ Espo.define('Views.Record.Merge', 'View', function (Dep) {
var type = Espo.Utils.upperCaseFirst(this.models[0].getFieldParam(field, 'type'));
this.models.forEach(function (model) {
this.createView(model.id + '-' + field, this.getFieldManager().getViewName(type), {
var viewName = model.getFieldParam(name, 'view') || this.getFieldManager().getViewName(type);
this.createView(model.id + '-' + field, viewName, {
model: model,
el: '.merge .' + model.id + ' .field-' + field,
defs: {
@@ -29,6 +29,8 @@ Espo.define('Views.Record.Panels.Bottom', 'View', function (Dep) {
defs: null,
mode: 'detail',
events: {
'click .action': function (e) {
$el = $(e.currentTarget);
@@ -57,6 +59,7 @@ Espo.define('Views.Record.Panels.Bottom', 'View', function (Dep) {
setup: function () {
this.buttonList = _.clone(this.defs.buttonList || this.buttonList || []);
this.actionList = _.clone(this.defs.actionList || this.actionList || []);
this.mode = this.options.mode || this.mode;
},
getButtonList: function () {
+9 -6
View File
@@ -114,9 +114,7 @@ Espo.define('Views.Stream.Panel', ['Views.Record.Panels.Relationship', 'lib!Text
var collection = this.collection;
this.listenTo(this.model, 'sync', function () {
collection.fetchNew();
}.bind(this));
this.listenToOnce(collection, 'sync', function () {
this.createView('list', 'Stream.List', {
@@ -126,10 +124,15 @@ Espo.define('Views.Stream.Panel', ['Views.Record.Panels.Relationship', 'lib!Text
}, function (view) {
view.render();
});
}.bind(this));
collection.fetch();
var self = this;
setTimeout(function () {
this.listenTo(this.model, 'sync', function () {
collection.fetchNew();
}, this);
}.bind(this), 500);
}, this);
collection.fetch();
this.$textarea.textcomplete([{
match: /(^|\s)@(\w*)$/,
+6 -2
View File
@@ -48,6 +48,10 @@ blockquote {
margin-bottom: 12px;
}
.form-group.hidden-cell {
margin-bottom: 0;
}
.panel-group .panel + .panel {
margin-top: 4px;
}
@@ -722,8 +726,8 @@ body > footer > p a:visited {
margin-top: -1 * @line-height-computed - 2;
}
.detail .bottom > .panel.sticked,
.detail .side > .panel.sticked {
.bottom > .panel.sticked,
.side > .panel.sticked {
margin-top: -1 * @line-height-computed - 2;
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "espocrm",
"version": "3.4.0",
"version": "3.4.2",
"description": "",
"main": "index.php",
"repository": {