mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 23:16:03 +00:00
template
This commit is contained in:
31
application/Espo/Controllers/Template.php
Normal file
31
application/Espo/Controllers/Template.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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/.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
|
||||
class Template extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
28
application/Espo/Entities/Template.php
Normal file
28
application/Espo/Entities/Template.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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/.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Entities;
|
||||
|
||||
class Template extends \Espo\Core\ORM\Entity
|
||||
{
|
||||
|
||||
}
|
||||
@@ -14,7 +14,8 @@
|
||||
"Dashboard": "Dashboard",
|
||||
"InboundEmail": "Inbound Email Account",
|
||||
"Stream": "Stream",
|
||||
"Import": "Import"
|
||||
"Import": "Import",
|
||||
"Template": "Template"
|
||||
},
|
||||
"scopeNamesPlural": {
|
||||
"Email": "Emails",
|
||||
@@ -31,7 +32,8 @@
|
||||
"Dashboard": "Dashboard",
|
||||
"InboundEmail": "Inbound Email Accounts",
|
||||
"Stream": "Stream",
|
||||
"Import": "Import Results"
|
||||
"Import": "Import Results",
|
||||
"Template": "Templates"
|
||||
},
|
||||
"labels": {
|
||||
"Misc": "Misc",
|
||||
|
||||
14
application/Espo/Resources/i18n/en_US/Template.json
Normal file
14
application/Espo/Resources/i18n/en_US/Template.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"fields": {
|
||||
"name": "Name",
|
||||
"body": "Body",
|
||||
"entityType": "Entity Type",
|
||||
"header": "Header",
|
||||
"footer": "Footer"
|
||||
},
|
||||
"links": {
|
||||
},
|
||||
"labels": {
|
||||
"Create Template": "Create Template"
|
||||
}
|
||||
}
|
||||
18
application/Espo/Resources/layouts/Template/detail.json
Normal file
18
application/Espo/Resources/layouts/Template/detail.json
Normal file
@@ -0,0 +1,18 @@
|
||||
[
|
||||
{
|
||||
"label":"",
|
||||
"rows":[
|
||||
[
|
||||
{
|
||||
"name":"name"
|
||||
},
|
||||
{
|
||||
"name":"entityType"
|
||||
}
|
||||
],
|
||||
[{"name":"header","fullWidth":true}],
|
||||
[{"name":"body","fullWidth":true}],
|
||||
[{"name":"footer","fullWidth":true}]
|
||||
]
|
||||
}
|
||||
]
|
||||
12
application/Espo/Resources/layouts/Template/detailSmall.json
Normal file
12
application/Espo/Resources/layouts/Template/detailSmall.json
Normal file
@@ -0,0 +1,12 @@
|
||||
[
|
||||
{
|
||||
"label":"",
|
||||
"rows":[
|
||||
[{"name":"name"}],
|
||||
[{"name":"entityType"}, false],
|
||||
[{"name":"header","fullWidth":true}],
|
||||
[{"name":"body","fullWidth":true}],
|
||||
[{"name":"footer","fullWidth":true}]
|
||||
]
|
||||
}
|
||||
]
|
||||
4
application/Espo/Resources/layouts/Template/list.json
Normal file
4
application/Espo/Resources/layouts/Template/list.json
Normal file
@@ -0,0 +1,4 @@
|
||||
[
|
||||
{"name": "name", "width": 50, "link": true},
|
||||
{"name": "entityType"}
|
||||
]
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"controller": "controllers/record"
|
||||
}
|
||||
64
application/Espo/Resources/metadata/entityDefs/Template.json
Normal file
64
application/Espo/Resources/metadata/entityDefs/Template.json
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"fields": {
|
||||
"name": {
|
||||
"type": "varchar",
|
||||
"required": true
|
||||
},
|
||||
"body": {
|
||||
"type": "text",
|
||||
"view": "Fields.Wysiwyg"
|
||||
},
|
||||
"header": {
|
||||
"type": "text",
|
||||
"view": "Fields.Wysiwyg"
|
||||
},
|
||||
"footer": {
|
||||
"type": "text",
|
||||
"view": "Fields.Wysiwyg"
|
||||
},
|
||||
"entityType": {
|
||||
"type": "enum",
|
||||
"required": true,
|
||||
"translation": "Global.scopeNames",
|
||||
"view": "Fields.EntityType"
|
||||
},
|
||||
"teams": {
|
||||
"type": "linkMultiple"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "datetime",
|
||||
"readOnly": true
|
||||
},
|
||||
"modifiedAt": {
|
||||
"type": "datetime",
|
||||
"readOnly": true
|
||||
},
|
||||
"createdBy": {
|
||||
"type": "link",
|
||||
"readOnly": true
|
||||
},
|
||||
"modifiedBy": {
|
||||
"type": "link",
|
||||
"readOnly": true
|
||||
}
|
||||
},
|
||||
"links": {
|
||||
"teams": {
|
||||
"type": "hasMany",
|
||||
"entity": "Team",
|
||||
"relationName": "entityTeam"
|
||||
},
|
||||
"createdBy": {
|
||||
"type": "belongsTo",
|
||||
"entity": "User"
|
||||
},
|
||||
"modifiedBy": {
|
||||
"type": "belongsTo",
|
||||
"entity": "User"
|
||||
}
|
||||
},
|
||||
"collection": {
|
||||
"sortBy": "name",
|
||||
"asc": true
|
||||
}
|
||||
}
|
||||
7
application/Espo/Resources/metadata/scopes/Template.json
Normal file
7
application/Espo/Resources/metadata/scopes/Template.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"entity": true,
|
||||
"layouts": false,
|
||||
"tab": false,
|
||||
"acl": "recordAllTeamNo",
|
||||
"customizable": false
|
||||
}
|
||||
52
frontend/client/src/views/fields/entity-type.js
Normal file
52
frontend/client/src/views/fields/entity-type.js
Normal file
@@ -0,0 +1,52 @@
|
||||
/************************************************************************
|
||||
* 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/fields/entity-type', 'views/fields/enum', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
checkAvailability: function (entityType) {
|
||||
if (this.scopesMetadataDefs[entityType].entity) {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
setupOptions: function () {
|
||||
var scopes = this.scopesMetadataDefs = this.getMetadata().get('scopes');
|
||||
this.params.options = Object.keys(scopes).filter(function (scope) {
|
||||
if (this.checkAvailability(scope)) {
|
||||
return true;
|
||||
}
|
||||
}.bind(this)).sort(function (v1, v2) {
|
||||
return this.translate(v1, 'scopeNames').localeCompare(this.translate(v2, 'scopeNames'));
|
||||
}.bind(this));
|
||||
this.params.options.unshift('');
|
||||
},
|
||||
|
||||
setup: function () {
|
||||
this.params.translation = 'Global.scopeNames';
|
||||
this.setupOptions();
|
||||
Dep.prototype.setup.call(this);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user