This commit is contained in:
yuri
2015-07-09 14:55:34 +03:00
parent b2b0ed82e5
commit c064b8fa80
11 changed files with 237 additions and 2 deletions

View 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
{
}

View 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
{
}

View File

@@ -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",

View File

@@ -0,0 +1,14 @@
{
"fields": {
"name": "Name",
"body": "Body",
"entityType": "Entity Type",
"header": "Header",
"footer": "Footer"
},
"links": {
},
"labels": {
"Create Template": "Create Template"
}
}

View File

@@ -0,0 +1,18 @@
[
{
"label":"",
"rows":[
[
{
"name":"name"
},
{
"name":"entityType"
}
],
[{"name":"header","fullWidth":true}],
[{"name":"body","fullWidth":true}],
[{"name":"footer","fullWidth":true}]
]
}
]

View File

@@ -0,0 +1,12 @@
[
{
"label":"",
"rows":[
[{"name":"name"}],
[{"name":"entityType"}, false],
[{"name":"header","fullWidth":true}],
[{"name":"body","fullWidth":true}],
[{"name":"footer","fullWidth":true}]
]
}
]

View File

@@ -0,0 +1,4 @@
[
{"name": "name", "width": 50, "link": true},
{"name": "entityType"}
]

View File

@@ -0,0 +1,3 @@
{
"controller": "controllers/record"
}

View 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
}
}

View File

@@ -0,0 +1,7 @@
{
"entity": true,
"layouts": false,
"tab": false,
"acl": "recordAllTeamNo",
"customizable": false
}

View 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);
}
});
});