fix email create contact

This commit is contained in:
yuri
2016-02-01 11:04:39 +02:00
parent e94da5c189
commit bfd9b40a5b
2 changed files with 14 additions and 12 deletions
+6 -6
View File
@@ -99,15 +99,15 @@ class Email extends \Espo\Core\ORM\Repositories\RDB
}
}
$nameHash = array();
$typeHash = array();
$idHash = array();
$nameHash = (object) [];
$typeHash = (object) [];
$idHash = (object) [];
foreach ($addressList as $address) {
$p = $this->getEntityManager()->getRepository('EmailAddress')->getEntityByAddress($address);
if ($p) {
$nameHash[$address] = $p->get('name');
$typeHash[$address] = $p->getEntityName();
$idHash[$address] = $p->id;
$nameHash->$address = $p->get('name');
$typeHash->$address = $p->getEntityName();
$idHash->$address = $p->id;
}
}
@@ -165,7 +165,7 @@ Espo.define('views/email/fields/from-address-varchar', 'views/fields/varchar', f
attributes.lastName = lastName;
}
var viewName = this.getMetadata().get('clientDefs.' + scope + '.modalViews.edit') || 'Modals.Edit';
var viewName = this.getMetadata().get('clientDefs.' + scope + '.modalViews.edit') || 'views/modals/edit';
this.createView('create', viewName, {
scope: scope,
@@ -185,12 +185,14 @@ Espo.define('views/email/fields/from-address-varchar', 'views/fields/varchar', f
this.nameHash = nameHash;
this.typeHash = typeHash;
var attributes = {
nameHash: nameHash,
idHash: idHash,
typeHash: typeHash
};
setTimeout(function () {
this.model.set({
nameHash: nameHash,
idHash: idHash,
typeHash: typeHash
});
this.model.set(attributes);
}.bind(this), 50);
}, this);
}.bind(this));