small syntax fixes (#197)

* fix variable name

* init $number variable

* another fix
This commit is contained in:
Ayman Alkom
2016-08-23 10:08:17 +03:00
committed by yuri
parent 1f8a14aca0
commit 7ee2ee9d35
2 changed files with 5 additions and 4 deletions
+1
View File
@@ -233,6 +233,7 @@ class Importer
$reference = str_replace(array('/', '@'), " ", trim($reference, '<>'));
$parentType = $parentId = null;
$emailSent = PHP_INT_MAX;
$number = null;
$n = sscanf($reference, '%s %s %d %d espo', $parentType, $parentId, $emailSent, $number);
if ($n == 4 && $emailSent < time()) {
if (!empty($parentType) && !empty($parentId)) {
+4 -4
View File
@@ -45,7 +45,7 @@ class Email extends \Espo\Core\ORM\Repositories\RDB
return;
}
$eaRepositoty = $this->getEntityManager()->getRepository('EmailAddress');
$eaRepository = $this->getEntityManager()->getRepository('EmailAddress');
$address = $entity->get($type);
$idList = [];
@@ -54,7 +54,7 @@ class Email extends \Espo\Core\ORM\Repositories\RDB
return trim($e);
}, explode(';', $address));
$idList = $eaRepositoty->getIdListFormAddressList($arr);
$idList = $eaRepository->getIdListFormAddressList($arr);
foreach ($idList as $id) {
$this->addUserByEmailAddressId($entity, $id, $addAssignedUser);
}
@@ -124,7 +124,7 @@ class Email extends \Espo\Core\ORM\Repositories\RDB
protected function beforeSave(Entity $entity, array $options = array())
{
$eaRepositoty = $this->getEntityManager()->getRepository('EmailAddress');
$eaRepository = $this->getEntityManager()->getRepository('EmailAddress');
if ($entity->has('attachmentsIds')) {
$attachmentsIds = $entity->get('attachmentsIds');
@@ -141,7 +141,7 @@ class Email extends \Espo\Core\ORM\Repositories\RDB
if ($entity->has('from')) {
$from = trim($entity->get('from'));
if (!empty($from)) {
$ids = $eaRepositoty->getIds(array($from));
$ids = $eaRepository->getIds(array($from));
if (!empty($ids)) {
$entity->set('fromEmailAddressId', $ids[0]);
$this->addUserByEmailAddressId($entity, $ids[0], true);