meeting: do not copy acceptance status on duplicate
This commit is contained in:
@@ -56,6 +56,8 @@ class Meeting extends \Espo\Services\Record
|
||||
|
||||
protected $exportSkipFieldList = ['duration'];
|
||||
|
||||
protected $duplicateIgnoreAttributeList = ['usersColumns', 'contactsColumns', 'leadsColumns'];
|
||||
|
||||
protected function getMailSender()
|
||||
{
|
||||
return $this->getInjection('container')->get('mailSender');
|
||||
|
||||
@@ -122,6 +122,10 @@ class Record extends \Espo\Core\Services\Base
|
||||
|
||||
protected $findDuplicatesSelectAttributeList = ['id', 'name'];
|
||||
|
||||
protected $duplicateIgnoreFieldList = [];
|
||||
|
||||
protected $duplicateIgnoreAttributeList = [];
|
||||
|
||||
const MAX_SELECT_TEXT_ATTRIBUTE_LENGTH = 5000;
|
||||
|
||||
const FOLLOWERS_LIMIT = 4;
|
||||
@@ -2426,15 +2430,12 @@ class Record extends \Espo\Core\Services\Base
|
||||
$attributes = $entity->getValueMap();
|
||||
unset($attributes->id);
|
||||
|
||||
$fields = $this->getMetadata()->get(['entityDefs', $this->getEntityType(), 'fields'], array());
|
||||
$fields = $this->getMetadata()->get(['entityDefs', $this->getEntityType(), 'fields'], []);
|
||||
|
||||
$fieldManager = new \Espo\Core\Utils\FieldManagerUtil($this->getMetadata());
|
||||
|
||||
foreach ($fields as $field => $item) {
|
||||
if (empty($item['type'])) continue;
|
||||
$type = $item['type'];
|
||||
|
||||
if (!empty($item['duplicateIgnore'])) {
|
||||
if (!empty($item['duplicateIgnore']) || in_array($field, $this->duplicateIgnoreFieldList)) {
|
||||
$attributeToIgnoreList = $fieldManager->getAttributeList($this->entityType, $field);
|
||||
foreach ($attributeToIgnoreList as $attribute) {
|
||||
unset($attributes->$attribute);
|
||||
@@ -2442,6 +2443,9 @@ class Record extends \Espo\Core\Services\Base
|
||||
continue;
|
||||
}
|
||||
|
||||
if (empty($item['type'])) continue;
|
||||
$type = $item['type'];
|
||||
|
||||
if (in_array($type, ['file', 'image'])) {
|
||||
$attachment = $entity->get($field);
|
||||
if ($attachment) {
|
||||
@@ -2483,6 +2487,10 @@ class Record extends \Espo\Core\Services\Base
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->duplicateIgnoreAttributeList as $attribute) {
|
||||
unset($attributes->$attribute);
|
||||
}
|
||||
|
||||
$attributes->_duplicatingEntityId = $id;
|
||||
|
||||
return $attributes;
|
||||
|
||||
Reference in New Issue
Block a user