Compare commits

...

18 Commits

Author SHA1 Message Date
yuri 083e248f21 fix logo 2 2015-12-08 16:56:14 +02:00
yuri df422f6365 v 2015-12-08 16:51:10 +02:00
yuri 47a2fee51d fix logo 2015-12-08 16:50:35 +02:00
yuri 4b0be0137c fix user detail view 2015-12-08 16:23:12 +02:00
yuri 38514941b8 clearfix 2015-12-04 14:24:03 +02:00
yuri d79993ba11 phone field type fix 2015-12-03 14:25:37 +02:00
yuri da62759130 destroy popover on remove 2015-11-30 16:40:01 +02:00
yuri 2e04fd5a3b style 2015-11-30 14:14:29 +02:00
yuri 6174245b22 cleanup 2015-11-30 12:22:48 +02:00
yuri 9b9d3d9634 ORM: ability to join children 2015-11-30 11:15:21 +02:00
yuri e13a722dca cleanup and style fix 2015-11-27 16:03:27 +02:00
yuri dba325aa61 join conditions and alias 2015-11-27 12:21:40 +02:00
yuri 59dccbedbd fix activities queries 2015-11-27 12:05:48 +02:00
yuri df32edf85f version 2015-11-27 11:47:15 +02:00
yuri 0385513f0e rename checkPemission and fix calendar 2015-11-27 11:46:52 +02:00
yuri 710fdebbec email account small fixes 2015-11-27 11:02:49 +02:00
yuri 7b707716f9 scheduled jobs ui changes 2015-11-27 10:35:54 +02:00
yuri 8cdb2df433 email template: assignmed user not required 2015-11-27 10:28:58 +02:00
36 changed files with 227 additions and 134 deletions
+2 -2
View File
@@ -89,9 +89,9 @@ class Acl
return $this->getAclManager()->checkScope($this->getUser(), $scope, $action, $isOwner, $inTeam, $entity) ;
}
public function checkPermission($permission, User $entity)
public function checkUser($permission, User $entity)
{
return $this->getAclManager()->checkPermission($this->getUser(), $permission, $entity);
return $this->getAclManager()->checkUser($this->getUser(), $permission, $entity);
}
}
+1 -1
View File
@@ -185,7 +185,7 @@ class AclManager
return $this->getImplementation($scope)->checkScope($user, $data, $scope, $action, $isOwner, $inTeam, $entity);
}
public function checkPermission(User $user, $permission, User $entity)
public function checkUser(User $user, $permission, User $entity)
{
if ($user->isAdmin()) {
return true;
+1 -1
View File
@@ -99,7 +99,7 @@ class FieldManager
$this->setLabel($name, $fieldDefs['label'], $scope);
}
if (isset($fieldDefs['type']) && $fieldDefs['type'] == 'enum') {
if (isset($fieldDefs['type']) && ($fieldDefs['type'] == 'enum' || $fieldDefs['type'] == 'phone')) {
if (isset($fieldDefs['translatedOptions'])) {
$this->setTranslatedOptions($name, $fieldDefs['translatedOptions'], $scope);
}
+1 -1
View File
@@ -70,7 +70,7 @@ class Mentions extends \Espo\Core\Hooks\Base
$userName = substr($item, 1);
$user = $this->getEntityManager()->getRepository('User')->where(array('userName' => $userName))->findOne();
if ($user) {
if (!$this->getAcl()->checkPermission('assignmentPermission', $user)) {
if (!$this->getAcl()->checkUser('assignmentPermission', $user)) {
continue;
}
$m = array(
@@ -100,9 +100,9 @@ class Activities extends \Espo\Core\Services\Base
'status',
'createdAt'
],
'leftJoins' => ['users'],
'leftJoins' => [['users', 'usersLeft']],
'whereClause' => array(
'usersMiddle.userId' => $id
'usersLeftMiddle.userId' => $id
)
);
@@ -139,9 +139,9 @@ class Activities extends \Espo\Core\Services\Base
'status',
'createdAt'
],
'leftJoins' => ['users'],
'leftJoins' => [['users', 'usersLeft']],
'whereClause' => array(
'usersMiddle.userId' => $id
'usersLeftMiddle.userId' => $id
)
);
@@ -178,9 +178,9 @@ class Activities extends \Espo\Core\Services\Base
'status',
'createdAt'
],
'leftJoins' => ['users'],
'leftJoins' => [['users', 'usersLeft']],
'whereClause' => array(
'usersMiddle.userId' => $id
'usersLeftMiddle.userId' => $id
)
);
@@ -556,7 +556,7 @@ class Activities extends \Espo\Core\Services\Base
protected function accessCheck($entity)
{
if ($entity->getEntityType() == 'User') {
if (!$this->getAcl()->checkPermission('userPermission', $entity)) {
if (!$this->getAcl()->checkUser('userPermission', $entity)) {
throw new Forbidden();
}
@@ -742,7 +742,7 @@ class Activities extends \Espo\Core\Services\Base
if (!in_array($scope, $this->calendarScopeList)) {
continue;
}
if ($this->getAcl()->checkScope($scopeList)) {
if ($this->getAcl()->checkScope($scope)) {
$methodName = 'getCalendar' . $scope . 'Query';
if (method_exists($this, $methodName)) {
$sqlPartList[] = $this->$methodName($userId, $from, $to);
+41 -12
View File
@@ -693,22 +693,39 @@ abstract class Base
{
$joinsArr = array();
foreach ($joins as $relationName) {
$conditions = array();
if (!empty($joinConditions[$relationName])) {
$conditions = $joinConditions[$relationName];
if (is_array($relationName)) {
$arr = $relationName;
$relationName = $arr[0];
if (count($arr) > 1) {
$joinAlias = $arr[1];
} else {
$joinAlias = $relationName;
}
} else {
$joinAlias = $relationName;
}
if ($joinRelated = $this->getJoinRelated($entity, $relationName, $left, $conditions)) {
$conditions = array();
if (!empty($joinConditions[$joinAlias])) {
$conditions = $joinConditions[$joinAlias];
}
if ($joinRelated = $this->getJoinRelated($entity, $relationName, $left, $conditions, $joinAlias)) {
$joinsArr[] = $joinRelated;
}
}
return implode(' ', $joinsArr);
}
protected function getJoinRelated(IEntity $entity, $relationName, $left = false, $conditions = array())
protected function getJoinRelated(IEntity $entity, $relationName, $left = false, $conditions = array(), $joinAlias = null)
{
$relOpt = $entity->relations[$relationName];
$keySet = $this->getKeys($entity, $relationName);
if (!$joinAlias) {
$joinAlias = $relationName;
}
$joinAlias = $this->sanitize($joinAlias);
$pre = ($left) ? 'LEFT ' : '';
if ($relOpt['type'] == IEntity::MANY_MANY) {
@@ -723,7 +740,7 @@ abstract class Base
$distantTable = $this->toDb($relOpt['entity']);
$alias = $this->sanitize($relationName);
$alias = $joinAlias;
$midAlias = $alias . 'Middle';
@@ -744,14 +761,12 @@ abstract class Base
. "{$alias}.deleted = " . $this->pdo->quote(0) . "";
return $join;
}
if ($relOpt['type'] == IEntity::HAS_MANY) {
} else if ($relOpt['type'] == IEntity::HAS_MANY) {
$foreignKey = $keySet['foreignKey'];
$distantTable = $this->toDb($relOpt['entity']);
$alias = $this->sanitize($relationName);
$alias = $joinAlias;
// TODO conditions
@@ -761,9 +776,23 @@ abstract class Base
. "{$alias}.deleted = " . $this->pdo->quote(0) . "";
return $join;
}
} else if ($relOpt['type'] == IEntity::HAS_CHILDREN) {
$foreignKey = $keySet['foreignKey'];
$foreignType = $keySet['foreignType'];
$distantTable = $this->toDb($relOpt['entity']);
if ($relOpt['type'] == IEntity::BELONGS_TO) {
$alias = $joinAlias;
$join =
"{$pre}JOIN `{$distantTable}` AS `{$alias}` ON " . $this->toDb($entity->getEntityType()) . "." . $this->toDb('id') . " = {$alias}." . $this->toDb($foreignKey)
. " AND "
. "{$alias}." . $this->toDb($foreignType) . " = " . $this->pdo->quote($entity->getEntityType())
. " AND "
. "{$alias}.deleted = " . $this->pdo->quote(0) . "";
return $join;
} else if ($relOpt['type'] == IEntity::BELONGS_TO) {
return $pre . $this->getBelongsToJoin($entity, $relationName);
}
@@ -122,7 +122,8 @@
"audited": "Audited",
"trim": "Trim",
"height": "Height (px)",
"provider": "Provider"
"provider": "Provider",
"typeList": "Type List"
},
"messages": {
"upgradeVersion": "Your EspoCRM will be upgraded to version <strong>{version}</strong>. This can take some time.",
@@ -3,7 +3,7 @@
"name": "Name",
"status": "Status",
"job": "Job",
"scheduling": "Scheduling (crontab notation)"
"scheduling": "Scheduling"
},
"links": {
"log": "Log"
@@ -31,6 +31,6 @@
}
},
"tooltips": {
"scheduling": "Defines when and how often job will be run\n\n*/5 * * * * - every 5 minutes\n\n0 */2 * * * - every 2 hours\n\n30 1 * * * - at 01:30 once a day\n\n0 0 1 * * - on the first day of the month"
"scheduling": "Crontab notation. Defines frequency of job runs.\n\n*/5 * * * * - every 5 minutes\n\n0 */2 * * * - every 2 hours\n\n30 1 * * * - at 01:30 once a day\n\n0 0 1 * * - on the first day of the month"
}
}
@@ -1 +1,6 @@
[{"name":"name","width":30,"link":true},{"name":"job"},{"name":"status"}]
[
{"name":"name", "link": true},
{"name":"job"},
{"name":"status", "width": 15},
{"name":"scheduling", "width": 15}
]
@@ -59,7 +59,7 @@
"required": true
},
"fetchData": {
"type": "text",
"type": "jsonObject",
"readOnly": true
},
"createdAt": {
@@ -25,8 +25,7 @@
"view": "Fields.AttachmentMultiple"
},
"assignedUser": {
"type": "link",
"required": true
"type": "link"
},
"teams": {
"type": "linkMultiple"
@@ -47,7 +47,7 @@
"required": true
},
"fetchData": {
"type": "text",
"type": "jsonObject",
"readOnly": true
},
"assignToUser": {
@@ -8,7 +8,7 @@
{
"name":"options",
"type":"array",
"view": "Admin.FieldManager.Fields.Options"
"view": "views/admin/field-manager/fields/options"
},
{
"name":"default",
@@ -7,8 +7,9 @@
},
{
"name":"typeList",
"type":"array",
"options": ["Mobile", "Office", "Home", "Fax", "Other"]
"type":"array",
"default": ["Mobile", "Office", "Home", "Fax", "Other"],
"view": "views/admin/field-manager/fields/options"
},
{
"name":"defaultType",
+10 -6
View File
@@ -42,9 +42,11 @@ class Email extends \Espo\Core\SelectManagers\Base
);
}
$result['additionalSelectColumns']['usersMiddle.is_read'] = 'isRead';
$result['additionalSelectColumns']['usersMiddle.is_important'] = 'isImportant';
$result['additionalSelectColumns']['usersMiddle.in_trash'] = 'inTrash';
if (!isset($result['select'])) {
$result['additionalSelectColumns']['usersMiddle.is_read'] = 'isRead';
$result['additionalSelectColumns']['usersMiddle.is_important'] = 'isImportant';
$result['additionalSelectColumns']['usersMiddle.in_trash'] = 'inTrash';
}
return $result;
}
@@ -58,9 +60,11 @@ class Email extends \Espo\Core\SelectManagers\Base
'usersMiddle.userId' => $this->getUser()->id
);
$result['additionalSelectColumns']['usersMiddle.is_read'] = 'isRead';
$result['additionalSelectColumns']['usersMiddle.is_important'] = 'isImportant';
$result['additionalSelectColumns']['usersMiddle.in_trash'] = 'inTrash';
if (!isset($result['select'])) {
$result['additionalSelectColumns']['usersMiddle.is_read'] = 'isRead';
$result['additionalSelectColumns']['usersMiddle.is_important'] = 'isImportant';
$result['additionalSelectColumns']['usersMiddle.in_trash'] = 'inTrash';
}
}
protected function filterInbox(&$result)
+13 -13
View File
@@ -206,15 +206,15 @@ class EmailAccount extends Record
]
])->find();
$fetchData = json_decode($emailAccount->get('fetchData'), true);
$fetchData = $emailAccount->get('fetchData');
if (empty($fetchData)) {
$fetchData = array();
$fetchData = new \StdClass();
}
if (!array_key_exists('lastUID', $fetchData)) {
$fetchData['lastUID'] = array();
if (!property_exists($fetchData, 'lastUID')) {
$fetchData->lastUID = new \StdClass();;
}
if (!array_key_exists('lastUID', $fetchData)) {
$fetchData['lastDate'] = array();
if (!property_exists($fetchData, 'lastDate')) {
$fetchData->lastDate = new \StdClass();;
}
$storage = $this->getStorage($emailAccount);
@@ -239,11 +239,11 @@ class EmailAccount extends Record
$lastUID = 0;
$lastDate = 0;
if (!empty($fetchData['lastUID'][$folder])) {
$lastUID = $fetchData['lastUID'][$folder];
if (!empty($fetchData->lastUID->$folder)) {
$lastUID = $fetchData->lastUID->$folder;
}
if (!empty($fetchData['lastDate'][$folder])) {
$lastDate = $fetchData['lastDate'][$folder];
if (!empty($fetchData->lastDate->$folder)) {
$lastDate = $fetchData->lastDate->$folder;
}
if (!empty($lastUID)) {
@@ -322,10 +322,10 @@ class EmailAccount extends Record
$k++;
}
$fetchData['lastUID'][$folder] = $lastUID;
$fetchData['lastDate'][$folder] = $lastDate;
$fetchData->lastUID->$folder = $lastUID;
$fetchData->lastDate->$folder = $lastDate;
$emailAccount->set('fetchData', $fetchData);
$emailAccount->set('fetchData', json_encode($fetchData));
$this->getEntityManager()->saveEntity($emailAccount, array('silent' => true));
}
+13 -13
View File
@@ -197,15 +197,15 @@ class InboundEmail extends \Espo\Services\Record
]
])->find();
$fetchData = json_decode($emailAccount->get('fetchData'), true);
$fetchData = $emailAccount->get('fetchData');
if (empty($fetchData)) {
$fetchData = array();
$fetchData = new \StdClass();
}
if (!array_key_exists('lastUID', $fetchData)) {
$fetchData['lastUID'] = array();
if (!property_exists($fetchData, 'lastUID')) {
$fetchData->lastUID = new \StdClass();;
}
if (!array_key_exists('lastUID', $fetchData)) {
$fetchData['lastDate'] = array();
if (!property_exists($fetchData, 'lastDate')) {
$fetchData->lastDate = new \StdClass();;
}
$imapParams = array(
@@ -242,11 +242,11 @@ class InboundEmail extends \Espo\Services\Record
$lastUID = 0;
$lastDate = 0;
if (!empty($fetchData['lastUID'][$folder])) {
$lastUID = $fetchData['lastUID'][$folder];
if (!empty($fetchData->lastUID->$folder)) {
$lastUID = $fetchData->lastUID->$folder;
}
if (!empty($fetchData['lastDate'][$folder])) {
$lastDate = $fetchData['lastDate'][$folder];
if (!empty($fetchData->lastDate->$folder)) {
$lastDate = $fetchData->lastDate->$folder;
}
if (!empty($lastUID)) {
@@ -339,10 +339,10 @@ class InboundEmail extends \Espo\Services\Record
$k++;
}
$fetchData['lastUID'][$folder] = $lastUID;
$fetchData['lastDate'][$folder] = $lastDate;
$fetchData->lastUID->$folder = $lastUID;
$fetchData->lastDate->$folder = $lastDate;
$emailAccount->set('fetchData', $fetchData);
$emailAccount->set('fetchData', json_encode($fetchData));
$this->getEntityManager()->saveEntity($emailAccount, array('silent' => true));
}
+1 -1
View File
@@ -286,7 +286,7 @@ class Stream extends \Espo\Core\Services\Base
if (!$user) {
throw new NotFound();
}
if (!$this->getAcl()->checkPermission('userPermission', $user)) {
if (!$this->getAcl()->checkUser('userPermission', $user)) {
throw new Forbidden();
}
}
@@ -24,19 +24,19 @@
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
************************************************************************/
Espo.define('crm:controllers/lead', 'controllers/record', function (Dep) {
Espo.define('Crm:Controllers.Lead', 'Controllers.Record', function (Dep) {
return Dep.extend({
convert: function (id) {
this.main('Crm:Lead.Convert', {
this.main('crm:views/lead/convert', {
id: id
});
},
});
});
});
@@ -1,6 +1,6 @@
<div class="detail" id="{{id}}">
{{#if buttonsTop}}
<div class="detail-button-container button-container record-buttons">
<div class="detail-button-container button-container record-buttons clearfix">
<div class="btn-group" role="group">
{{#each buttonList}}{{button name scope=../../scope label=label style=style hidden=hidden}}{{/each}}
{{#if dropdownItemList}}
@@ -27,7 +27,7 @@
</div>
{{/if}}
</div>
<div class="detail-button-container button-container edit-buttons hidden">
<div class="detail-button-container button-container edit-buttons hidden clearfix">
<div class="btn-group" role="group">
{{#each buttonEditList}}{{button name scope=../../scope label=label style=style hidden=hidden}}{{/each}}
{{#if dropdownEditItemList}}
@@ -1,6 +1,6 @@
<div class="edit" id="{{id}}">
{{#if buttonsTop}}
<div class="detail-button-container button-container record-buttons">
<div class="detail-button-container button-container record-buttons clearfix">
<div class="btn-group" role="group">
{{#each buttonList}}{{button name scope=../../scope label=label style=style}}{{/each}}
{{#if dropdownItemList}}
@@ -186,19 +186,17 @@ Espo.define('views/admin/field-manager/edit', ['view', 'model'], function (Dep,
this.trigger('after:save');
}.bind(this), true);
var data = this.getLanguage().data;
if (this.scope in data) {
if (!('fields' in data[this.scope])) {
data[this.scope]['fields'] = {};
var langData = this.getLanguage().data;
if (this.scope in langData) {
if (!('fields' in langData[this.scope])) {
langData[this.scope]['fields'] = {};
}
data[this.scope]['fields'][this.model.get('name')] = this.model.get('label');
langData[this.scope]['fields'][this.model.get('name')] = this.model.get('label');
if (this.model.get('type') == 'enum' && this.model.get('translatedOptions')) {
if (!('options' in data[this.scope])) {
data[this.scope]['options'] = {};
}
data[this.scope]['options'][this.model.get('name')] = this.model.get('translatedOptions') || {};
if (~['enum', 'phone'].indexOf(this.model.get('type')) && this.model.get('translatedOptions')) {
langData[this.scope].options = langData[this.scope].options || {};
langData[this.scope]['options'][this.model.get('name')] = this.model.get('translatedOptions') || {};
}
}
}.bind(this));
@@ -33,7 +33,11 @@ Espo.define('views/admin/field-manager/fields/options', 'views/fields/array', fu
setup: function () {
Dep.prototype.setup.call(this);
this.translatedOptions = this.getLanguage().get(this.options.scope, 'options', this.options.field) || {};
this.translatedOptions = {};
var list = this.model.get(this.name) || [];
list.forEach(function (value) {
this.translatedOptions[value] = this.getLanguage().translateOption(value, this.options.field, this.options.scope);
}, this);
},
getItemHtml: function (value) {
@@ -34,16 +34,25 @@ Espo.define('views/email-account/record/detail', 'views/record/detail', function
Dep.prototype.afterRender.call(this);
this.initSslFieldListening();
if (this.wasFetched()) {
this.setFieldReadOnly('fetchSince');
}
if (this.getUser().isAdmin()) {
var fieldView = this.getFieldView('assignedUser');
if (fieldView) {
fieldView.readOnly = false;
fieldView.render();
}
}
},
wasFetched: function () {
if (!this.model.isNew()) {
return !!((this.model.get('fetchData') || {}).lastUID);
}
return false;
},
initSslFieldListening: function () {
var sslField = this.getFieldView('ssl');
@@ -35,6 +35,10 @@ Espo.define('views/email-account/record/edit', ['views/record/edit', 'views/emai
Detail.prototype.initSslFieldListening.call(this);
if (Detail.prototype.wasFetched.call(this)) {
this.setFieldReadOnly('fetchSince');
}
if (this.getUser().isAdmin()) {
var fieldView = this.getFieldView('assignedUser');
if (fieldView) {
+5 -5
View File
@@ -26,19 +26,19 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('Views.Fields.Array', ['Views.Fields.Base', 'lib!Selectize'], function (Dep) {
Espo.define('views/fields/array', ['views/fields/base', 'lib!Selectize'], function (Dep) {
return Dep.extend({
type: 'array',
listTemplate: 'fields.array.detail',
listTemplate: 'fields/array/detail',
detailTemplate: 'fields.array.detail',
detailTemplate: 'fields/array/detail',
editTemplate: 'fields.array.edit',
editTemplate: 'fields/array/edit',
searchTemplate: 'fields.array.search',
searchTemplate: 'fields/array/search',
data: function () {
var itemHtmlList = [];
+7 -1
View File
@@ -214,8 +214,9 @@ Espo.define('views/fields/base', 'view', function (Dep) {
}
if ((this.mode == 'detail' || this.mode == 'edit') && this.model.getFieldParam(this.name, 'tooltip')) {
var $a;
this.once('after:render', function () {
var $a = $('<a href="javascript:" class="text-muted"><span class="glyphicon glyphicon-info-sign"></span></a>');
$a = $('<a href="javascript:" class="text-muted"><span class="glyphicon glyphicon-info-sign"></span></a>');
var $label = this.getLabelElement();
$label.append(' ');
this.getLabelElement().append($a);
@@ -231,6 +232,11 @@ Espo.define('views/fields/base', 'view', function (Dep) {
});
});
}, this);
this.on('remove', function () {
if ($a) {
$a.popover('destroy')
}
}, this);
}
if (this.mode == 'detail') {
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('Views.InboundEmail.Record.Detail', 'Views.Record.Detail', function (Dep) {
Espo.define('views/inbound-email/record/detail', 'views/record/detail', function (Dep) {
return Dep.extend({
@@ -38,6 +38,17 @@ Espo.define('Views.InboundEmail.Record.Detail', 'Views.Record.Detail', function
afterRender: function () {
Dep.prototype.afterRender.call(this);
this.initSslFieldListening();
if (this.wasFetched()) {
this.setFieldReadOnly('fetchSince');
}
},
wasFetched: function () {
if (!this.model.isNew()) {
return !!((this.model.get('fetchData') || {}).lastUID);
}
return false;
},
handleDistributionField: function () {
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('Views.InboundEmail.Record.Edit', ['Views.Record.Edit', 'Views.InboundEmail.Record.Detail'], function (Dep, Detail) {
Espo.define('views/inbound-email/record/edit', ['views/record/edit', 'views/inbound-email/record/detail'], function (Dep, Detail) {
return Dep.extend({
@@ -34,6 +34,9 @@ Espo.define('Views.InboundEmail.Record.Edit', ['Views.Record.Edit', 'Views.Inbou
Dep.prototype.setup.call(this);
Detail.prototype.handleDistributionField.call(this);
if (Detail.prototype.wasFetched.call(this)) {
this.setFieldReadOnly('fetchSince');
}
},
afterRender: function () {
+1 -1
View File
@@ -60,7 +60,7 @@ Espo.define('views/login', 'view', function (Dep) {
if (!companyLogoId) {
return this.getThemeManager().getParam('logo') || 'client/img/logo.png';
}
return '?entryPoint=LogoImage';
return '?entryPoint=LogoImage&t=' + companyLogoId;
},
login: function () {
+1 -1
View File
@@ -86,7 +86,7 @@ Espo.define('views/site/navbar', 'view', function (Dep) {
if (!companyLogoId) {
return this.getThemeManager().getParam('logo') || 'client/img/logo.png';
}
return '?entryPoint=LogoImage';
return '?entryPoint=LogoImage&t=' + companyLogoId;
},
setup: function () {
@@ -34,7 +34,7 @@ Espo.define('views/user/record/detail', 'views/record/detail', function (Dep) {
bottomView: 'views/user/record/detail-bottom',
editModeEnabled: false,
editModeDisabled: true,
setup: function () {
Dep.prototype.setup.call(this);
+8 -4
View File
@@ -155,8 +155,12 @@ table.table > thead th {
}
.navbar img.logo {
width: 100%;
height: auto;
max-height: 100%;
max-width: 100%;
}
#login.panel .panel-heading {
border-bottom-width: 0;
}
#login .logo-container {
@@ -165,8 +169,8 @@ table.table > thead th {
}
#login .logo-container img.logo {
width: 100%;
height: auto;
max-height: 100%;
max-width: 100%;
}
#global-search-input {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "espocrm",
"version": "3.9.0",
"version": "3.9.2",
"description": "",
"main": "index.php",
"repository": {
+18 -3
View File
@@ -99,7 +99,7 @@ class QueryTest extends PHPUnit_Framework_TestCase
'limit' => 20
));
$expectedSql =
$expectedSql =
"SELECT account.id AS `id`, account.name AS `name`, account.deleted AS `deleted` FROM `account` " .
"WHERE account.deleted = '0' ORDER BY account.name ASC LIMIT 10, 20";
@@ -112,7 +112,7 @@ class QueryTest extends PHPUnit_Framework_TestCase
));
$expectedSql =
$expectedSql =
"SELECT comment.id AS `id`, comment.post_id AS `postId`, post.name AS `postName`, comment.name AS `name`, comment.deleted AS `deleted` FROM `comment` " .
"LEFT JOIN `post` AS `post` ON comment.post_id = post.id " .
"WHERE comment.deleted = '0'";
@@ -125,7 +125,7 @@ class QueryTest extends PHPUnit_Framework_TestCase
$sql = $this->query->createSelectQuery('Comment', array(
'select' => array('id', 'name')
));
$expectedSql =
$expectedSql =
"SELECT comment.id AS `id`, comment.name AS `name` FROM `comment` " .
"WHERE comment.deleted = '0'";
@@ -192,6 +192,21 @@ class QueryTest extends PHPUnit_Framework_TestCase
$this->assertEquals($expectedSql, $sql);
}
public function testSelectWithJoinChildren()
{
$sql = $this->query->createSelectQuery('Post', array(
'select' => ['id', 'name'],
'leftJoins' => [['notes', 'notesLeft']]
));
$expectedSql =
"SELECT post.id AS `id`, post.name AS `name` FROM `post` " .
"LEFT JOIN `note` AS `notesLeft` ON post.id = notesLeft.parent_id AND notesLeft.parent_type = 'Post' AND notesLeft.deleted = '0' " .
"WHERE post.deleted = '0'";
$this->assertEquals($expectedSql, $sql);
}
public function testOrderBy()
{
$sql = $this->query->createSelectQuery('Comment', array(
+24 -24
View File
@@ -14,11 +14,11 @@ class Account extends TEntity
{
public $fields = array(
'id' => array(
'type' => Entity::ID,
'type' => Entity::ID,
),
'name' => array(
'type' => Entity::VARCHAR,
'len' => 255,
'len' => 255,
),
'deleted' => array(
'type' => Entity::BOOL,
@@ -34,20 +34,20 @@ class Account extends TEntity
'entityId',
'teamId',
),
'conditions' => array('entityType' => 'Account')
'conditions' => array('entityType' => 'Account')
),
);
}
class Team extends TEntity
{
{
public $fields = array(
'id' => array(
'type' => Entity::ID,
'type' => Entity::ID,
),
'name' => array(
'type' => Entity::VARCHAR,
'len' => 255,
'len' => 255,
),
'deleted' => array(
'type' => Entity::BOOL,
@@ -58,10 +58,10 @@ class Team extends TEntity
}
class Contact extends TEntity
{
{
public $fields = array(
'id' => array(
'type' => Entity::ID,
'type' => Entity::ID,
),
'name' => array(
'type' => Entity::VARCHAR,
@@ -73,10 +73,10 @@ class Contact extends TEntity
'orderBy' => "contact.first_name {direction}, contact.last_name {direction}",
),
'firstName' => array(
'type' => Entity::VARCHAR,
'type' => Entity::VARCHAR,
),
'lastName' => array(
'type' => Entity::VARCHAR,
'type' => Entity::VARCHAR,
),
'deleted' => array(
'type' => Entity::BOOL,
@@ -87,14 +87,14 @@ class Contact extends TEntity
}
class Post extends TEntity
{
{
public $fields = array(
'id' => array(
'type' => Entity::ID,
'type' => Entity::ID,
),
'name' => array(
'type' => Entity::VARCHAR,
'len' => 255,
'len' => 255,
),
'privateField' => array(
'notStorable' => true,
@@ -111,7 +111,7 @@ class Post extends TEntity
'type' => Entity::BOOL,
'default' => 0,
),
);
);
public $relations = array(
'tags' => array(
'type' => Entity::MANY_MANY,
@@ -144,10 +144,10 @@ class Post extends TEntity
}
class Comment extends TEntity
{
{
public $fields = array(
'id' => array(
'type' => Entity::ID,
'type' => Entity::ID,
),
'postId' => array(
'type' => Entity::FOREIGN_ID,
@@ -159,14 +159,14 @@ class Comment extends TEntity
),
'name' => array(
'type' => Entity::VARCHAR,
'len' => 255,
'len' => 255,
),
'deleted' => array(
'type' => Entity::BOOL,
'default' => 0,
),
);
public $relations = array(
'post' => array(
'type' => Entity::BELONGS_TO,
@@ -178,14 +178,14 @@ class Comment extends TEntity
}
class Tag extends TEntity
{
{
public $fields = array(
'id' => array(
'type' => Entity::ID,
'type' => Entity::ID,
),
'name' => array(
'type' => Entity::VARCHAR,
'len' => 50,
'len' => 50,
),
'deleted' => array(
'type' => Entity::BOOL,
@@ -196,14 +196,14 @@ class Tag extends TEntity
class Note extends TEntity
{
{
public $fields = array(
'id' => array(
'type' => Entity::ID,
'type' => Entity::ID,
),
'name' => array(
'type' => Entity::VARCHAR,
'len' => 50,
'len' => 50,
),
'parentId' => array(
'type' => Entity::FOREIGN_ID,