aboutsummaryrefslogtreecommitdiff
path: root/lib/models/MvvContact.php
diff options
context:
space:
mode:
authorPeter Thienel <thienel@data-quest.de>2024-01-03 15:08:46 +0000
committerPeter Thienel <thienel@data-quest.de>2024-01-03 15:08:46 +0000
commit1e7019538a8ee3985bfc0a19960dca9737688a26 (patch)
tree34273dce8a30276db9d9719fe8aa270512278f0b /lib/models/MvvContact.php
parentc3d34bc3c6fbd408e7232918a61bde0211d0ce4e (diff)
Resolve "MVV: Logging von Personen und Dateizuordnungen"
Closes #3384 Merge request studip/studip!2302
Diffstat (limited to 'lib/models/MvvContact.php')
-rw-r--r--lib/models/MvvContact.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/models/MvvContact.php b/lib/models/MvvContact.php
index a174bd6..075acf9 100644
--- a/lib/models/MvvContact.php
+++ b/lib/models/MvvContact.php
@@ -452,4 +452,26 @@ class MvvContact extends ModuleManagementModel
];
}
+ protected function logChanges($action = null)
+ {
+ $log_action = 'MVV_CONTACT_' . mb_strtoupper($action);
+ $affected = $this->id;
+ $info = ['mvv_contacts.*'];
+ $debug_info = $this->getDisplayName();
+ if ($action === 'update') {
+ if ($this->isFieldDirty('contact_status')) {
+ $info[] = 'contatct_status: '
+ . ($this->contact_status ?? '-')
+ . ' (' . ($this->getPristineValue('contact_status') ?? '-')
+ . ')';
+ }
+ if ($this->isFieldDirty('alt_mail')) {
+ $info[] = 'alt_mail: '
+ . ($this->alt_mail ?? '-')
+ . ' (' . ($this->getPristineValue('alt_mail') ?? '-')
+ . ')';
+ }
+ }
+ StudipLog::log($log_action, $affected, '', implode(' | ', $info), $debug_info);
+ }
}