diff --git a/application/Espo/Controllers/Preferences.php b/application/Espo/Controllers/Preferences.php index 7abd11e464..61b5cadf40 100644 --- a/application/Espo/Controllers/Preferences.php +++ b/application/Espo/Controllers/Preferences.php @@ -51,8 +51,10 @@ class Preferences extends \Espo\Core\Controllers\Base $userId = $params['id']; $this->handleUserAccess($userId); - $entity = $this->getEntityManager()->getEntity('Preferences', $userId); - $entity->set('name', $this->getUser()->get('name')); + $entity = $this->getEntityManager()->getEntity('Preferences', $userId); + $user = $this->getEntityManager()->getEntity('User', $userId); + + $entity->set('name', $user->get('name')); if ($entity) { return $entity->toArray(); } diff --git a/application/Espo/Resources/i18n/en_US/Preferences.json b/application/Espo/Resources/i18n/en_US/Preferences.json index 16612a1408..26203807b0 100644 --- a/application/Espo/Resources/i18n/en_US/Preferences.json +++ b/application/Espo/Resources/i18n/en_US/Preferences.json @@ -19,5 +19,11 @@ "smtpPassword": "Password" }, "links": { + }, + "options": { + "weekStart": { + "0": "Sunday", + "1": "Monday" + } } } diff --git a/application/Espo/Resources/i18n/en_US/Settings.json b/application/Espo/Resources/i18n/en_US/Settings.json index 7ca790f678..4abd1f26b5 100644 --- a/application/Espo/Resources/i18n/en_US/Settings.json +++ b/application/Espo/Resources/i18n/en_US/Settings.json @@ -26,6 +26,10 @@ "tabList": "Tab List", "quickCreateList": "Quick Create List" }, - "links": { + "options": { + "weekStart": { + "0": "Sunday", + "1": "Monday" + } } } diff --git a/application/Espo/Services/Stream.php b/application/Espo/Services/Stream.php index 561075b41b..a40879e361 100644 --- a/application/Espo/Services/Stream.php +++ b/application/Espo/Services/Stream.php @@ -385,15 +385,18 @@ class Stream extends \Espo\Core\Services\Base $became = array(); foreach ($auditedFields as $field => $attrs) { - foreach ($attrs as $attr) { - $updated = false; + $updated = false; + foreach ($attrs as $attr) { if ($entity->get($attr) != $entity->getFetched($attr)) { - $was[$attr] = $entity->getFetched($attr); - $became[$attr] = $entity->get($attr); + $updated = true; } - if ($updated) { - $updatedFields[] = $field; + } + if ($updated) { + $updatedFields[] = $field; + foreach ($attrs as $attr) { + $was[$attr] = $entity->getFetched($attr); + $became[$attr] = $entity->get($attr); } } }