-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLoggingExt.php
55 lines (53 loc) · 1.86 KB
/
LoggingExt.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
class LoggingExt extends INTERMediator\DB\Support\OperationLogExtension
{
public function extendingFields()
{
return ['key_value', 'edit_field', 'edit_value'];
}
public function valueForField($field)
{
$rValue = null;
$access = $_POST['access'];
switch ($field) {
case 'key_value':
if ($access == 'create' || $access == 'copy') {
$rValue = $this->result['newRecordKeyValue'] ?? NULL;
} else {
$rValue = $_POST['condition0value'] ?? NULL;
}
break;
case 'edit_field':
$cnt = 0;
$rValue = '';
if ($access == 'copy') {
while (isset($_POST["condition{$cnt}field"])) {
$rValue .= ($cnt > 0 ? '<br>' : '') . "from:" . $_POST["condition{$cnt}field"];
$cnt += 1;
}
} else {
while (isset($_POST["field_{$cnt}"])) {
$rValue .= ($cnt > 0 ? '<br>' : '') . $_POST["field_{$cnt}"];
$cnt += 1;
}
}
break;
case 'edit_value':
$cnt = 0;
$rValue = '';
if ($access == 'copy') {
while (isset($_POST["condition{$cnt}value"])) {
$rValue .= ($cnt > 0 ? '<br>' : '') . $_POST["condition{$cnt}value"];
$cnt += 1;
}
} else {
while (isset($_POST["value_{$cnt}"])) {
$rValue .= ($cnt > 0 ? '<br>' : '') . $_POST["value_{$cnt}"];
$cnt += 1;
}
}
break;
}
return $rValue;
}
}