portal layouts

This commit is contained in:
yuri
2017-12-07 11:14:17 +02:00
parent 321d45dc86
commit 26a5e5fa33
16 changed files with 113 additions and 15 deletions
@@ -0,0 +1,12 @@
[
{
"label":"Overview",
"rows": [
[{"name":"name"}, {"name":"number"}],
[{"name":"status"}, {"name":"priority"}],
[{"name":"type"}, false],
[{"name":"description", "fullWidth": true}],
[{"name":"attachments", "fullWidth": true}]
]
}
]
@@ -0,0 +1,12 @@
[
{
"label":"",
"rows":[
[{"name":"name", "fullWidth": true}],
[{"name":"status"}, {"name":"priority"}],
[{"name":"type"}, {"name":"number"}],
[{"name":"description", "fullWidth": true}],
[{"name":"attachments", "fullWidth": true}]
]
}
]
@@ -0,0 +1,6 @@
[
{"name":"name", "link": true},
{"name":"number", "widthPx": 100},
{"name":"status", "width": 17},
{"name":"priority", "width": 17}
]
@@ -1,6 +1,6 @@
[
{"name":"name","width":35,"link":true},
{"name":"number","width":18},
{"name":"status"},
{"name":"priority"}
{"name":"name", "link": true},
{"name":"number", "width": 18},
{"name":"status", "width": 19},
{"name":"priority", "width": 19}
]
@@ -0,0 +1,9 @@
[
{
"label": "",
"rows": [
[{"name":"body", "fullWidth": true, "noLabel": true}],
[{"name":"attachments", "fullWidth": true, "noLabel": true}]
]
}
]
@@ -0,0 +1,9 @@
[
{
"label": "",
"rows": [
[{"name":"body", "fullWidth": true, "noLabel": true}],
[{"name":"attachments", "fullWidth": true, "noLabel": true}]
]
}
]
@@ -1,5 +1,5 @@
[
{"name":"name", "width": 50, "link": true},
{"name":"status"},
{"name":"createdAt"}
{"name":"name", "link": true},
{"name":"status", "width": 20},
{"name":"createdAt", "width": 20}
]
@@ -0,0 +1,3 @@
[
{"name":"name", "link": true}
]
@@ -1,5 +1,5 @@
[
{"name":"name", "width": 40, "link": true},
{"name":"status"},
{"name":"createdAt"}
{"name":"name", "link": true},
{"name":"status", "width": 22},
{"name":"createdAt", "width": 22}
]
@@ -12,7 +12,8 @@
"KnowledgeBaseArticle": {
"portals": false,
"order": false,
"status": false
"status": false,
"assignedUser": false
},
"Case": {
"status": {
@@ -65,5 +65,16 @@
"selectDefaultFilters": {
"filter": "open"
},
"allowInternalNotes": true
"allowInternalNotes": true,
"additionalLayouts": {
"detailPortal": {
"type": "detail"
},
"detailSmallPortal": {
"type": "detail"
},
"listPortal": {
"type": "list"
}
}
}
@@ -33,5 +33,16 @@
}
]
}
},
"additionalLayouts": {
"detailPortal": {
"type": "detail"
},
"detailSmallPortal": {
"type": "detail"
},
"listPortal": {
"type": "list"
}
}
}
@@ -63,6 +63,10 @@
"detail": "Detail",
"listSmall": "List (Small)",
"detailSmall": "Detail (Small)",
"detailPortal": "Detail (Portal)",
"detailSmallPortal": "Detail (Small, Portal)",
"listSmallPortal": "List (Small, Portal)",
"listPortal": "List (Portal)",
"filters": "Search Filters",
"massUpdate": "Mass Update",
"relationships": "Relationship Panels",
+5 -3
View File
@@ -29,12 +29,14 @@ Espo.define('models/user', 'model', function (Dep) {
return Dep.extend({
name: "User",
name: 'User',
isAdmin: function () {
return this.get('isAdmin');
},
isPortal: function () {
return this.get('isPortalUser');
}
});
});
+9
View File
@@ -120,6 +120,8 @@ Espo.define('views/record/detail', ['views/record/base', 'view-record-helper'],
printPdfAction: false,
portalLayoutDisabled: false,
events: {
'click .button-container .action': function (e) {
var $target = $(e.currentTarget);
@@ -641,6 +643,12 @@ Espo.define('views/record/detail', ['views/record/base', 'view-record-helper'],
}
}
if (this.getUser().isPortal() && !this.portalLayoutDisabled) {
if (this.getMetadata().get(['clientDefs', this.scope, 'additionalLayouts', this.layoutName + 'Portal'])) {
this.layoutName += 'Portal';
}
}
this.on('remove', function () {
if (this.isChanged) {
this.model.set(this.attributes);
@@ -688,6 +696,7 @@ Espo.define('views/record/detail', ['views/record/base', 'view-record-helper'],
this.inlineEditDisabled = this.options.inlineEditDisabled || this.inlineEditDisabled;
this.navigateButtonsDisabled = this.options.navigateButtonsDisabled || this.navigateButtonsDisabled;
this.portalLayoutDisabled = this.options.portalLayoutDisabled || this.portalLayoutDisabled;
this.setupActionItems();
this.setupBeforeFinal();
+9
View File
@@ -71,6 +71,8 @@ Espo.define('views/record/list', 'view', function (Dep) {
massActionsDisabled: false,
portalLayoutDisabled: false,
events: {
'click a.link': function (e) {
e.stopPropagation();
@@ -267,6 +269,7 @@ Espo.define('views/record/list', 'view', function (Dep) {
this.showMore = _.isUndefined(this.options.showMore) ? this.showMore : this.options.showMore;
this.massActionsDisabled = this.options.massActionsDisabled || this.massActionsDisabled;
this.portalLayoutDisabled = this.options.portalLayoutDisabled || this.portalLayoutDisabled;
if (this.massActionsDisabled && !this.selectable) {
this.checkboxes = false;
@@ -776,6 +779,12 @@ Espo.define('views/record/list', 'view', function (Dep) {
this.checkboxes = false;
}
if (this.getUser().isPortal() && !this.portalLayoutDisabled) {
if (this.getMetadata().get(['clientDefs', this.scope, 'additionalLayouts', this.layoutName + 'Portal'])) {
this.layoutName += 'Portal';
}
}
this.listenTo(this.collection, 'sync', function (c, r, options) {
if (this.hasView('modal') && this.getView('modal').isRendered()) return;
if (this.noRebuild) {