Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 083e248f21 | |||
| df422f6365 | |||
| 47a2fee51d | |||
| 4b0be0137c | |||
| 38514941b8 | |||
| d79993ba11 | |||
| da62759130 | |||
| 2e04fd5a3b | |||
| 6174245b22 | |||
| 9b9d3d9634 | |||
| e13a722dca | |||
| dba325aa61 | |||
| 59dccbedbd | |||
| df32edf85f | |||
| 0385513f0e | |||
| 710fdebbec | |||
| 7b707716f9 | |||
| 8cdb2df433 |
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "espocrm",
|
||||
"version": "3.9.0",
|
||||
"version": "3.9.2",
|
||||
"description": "",
|
||||
"main": "index.php",
|
||||
"repository": {
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user