import dev

This commit is contained in:
yuri
2015-03-30 13:39:14 +03:00
parent d4daef6012
commit f3bc4dbccf
6 changed files with 30 additions and 7 deletions
@@ -26,6 +26,13 @@ use Espo\ORM\Entity;
class Lead extends \Espo\Core\ORM\Repositories\RDB
{
public function afterSave(Entity $entity, array $options)
{
parent::afterSave($entity, $options);
if ($entity->has('targetListId') && $entity->isNew()) {
$this->relate($entity, 'targetLists', $entity->get('targetListId'));
}
}
}
@@ -22,7 +22,8 @@
"createdContact": "Contact",
"createdOpportunity": "Opportunity",
"campaign": "Campaign",
"targetLists": "Target Lists"
"targetLists": "Target Lists",
"targetList": "Target List"
},
"links": {
"targetLists": "Target Lists",
@@ -142,6 +142,15 @@
"layoutMassUpdateDisabled": true,
"noLoad": true,
"noSave": true
},
"targetList": {
"type": "link",
"notStorable": true,
"layoutDetailDisabled": true,
"layoutListDisabled": true,
"layoutMassUpdateDisabled": true,
"layoutSearchDisabled": true,
"entity": "TargetList"
}
},
"links": {
@@ -68,9 +68,6 @@ class Lead extends \Espo\Services\Record
$this->getEntityManager()->saveEntity($email);
}
}
if (!empty($data['targetListId'])) {
$this->getEntityManager()->getRepository('Lead')->relate($entity, 'targetLists', $data['targetListId']);
}
if ($entity->get('campaignId')) {
$campaign = $this->getEntityManager()->getEntity('Campaign', $entity->get('campaignId'));
if ($campaign) {
@@ -16,7 +16,6 @@
],
"actualFields":[
"currency",
"converted",
""
],
"fields":{
+12 -2
View File
@@ -135,6 +135,10 @@ Espo.define('Views.Import.Step2', 'View', function (Dep) {
var fieldList = [];
for (var field in defs) {
var d = defs[field];
if (d.readOnly) {
continue;
}
fieldList.push(field);
}
@@ -152,7 +156,11 @@ Espo.define('Views.Import.Step2', 'View', function (Dep) {
for (var field in fields) {
var d = fields[field];
if (['modifiedBy', 'createdBy', 'modifiedAt', 'createdAt'].indexOf(field) !== -1) {
if (d.readOnly) {
continue;
}
if (~['modifiedBy', 'createdBy', 'modifiedAt', 'createdAt'].indexOf(field)) {
continue;
}
@@ -161,7 +169,7 @@ Espo.define('Views.Import.Step2', 'View', function (Dep) {
fieldList.push(field + 'Id');
}
if (['linkMultiple', 'foreign'].indexOf(d.type) !== -1) {
if (~['linkMultiple', 'foreign'].indexOf(d.type)) {
continue;
}
@@ -178,6 +186,8 @@ Espo.define('Views.Import.Step2', 'View', function (Dep) {
}, this);
}
console.log(fieldList);
$select = $('<select>').addClass('form-control').attr('id', 'column-' + num.toString());
$option = $('<option>').val('').html('-' + this.translate('Skip', 'labels', 'Import') + '-');