Skip to content

Commit 6b82bf5

Browse files
committed
add help questions for RGPD's - refs #2763
1 parent 9643d2b commit 6b82bf5

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

main/admin/legal_add.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
$extraField = new ExtraField('terms_and_condition');
3030

3131
$types = LegalManager::getTreatmentTypeList();
32+
3233
foreach ($types as $variable => $name) {
3334
$label = 'PersonalData'.ucfirst($name).'Title';
3435
$params = [
@@ -40,7 +41,7 @@
4041
'changeable' => true,
4142
'filter' => true,
4243
'visible_to_self' => true,
43-
'visible_to_others' => true,
44+
'visible_to_others' => true
4445
];
4546
$extraField->save($params);
4647
}
@@ -153,9 +154,18 @@
153154
[],
154155
[],
155156
false,
157+
true,
158+
[],
159+
[],
160+
false,
161+
[],
162+
[],
163+
false,
156164
true
165+
157166
);
158167

168+
159169
$jqueryReady = $returnParams['jquery_ready_content'];
160170

161171
$form->addElement('textarea', 'changes', get_lang('ExplainChanges'), ['width' => '20']);

main/inc/lib/extra_field.lib.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class ExtraField extends Model
5151
'extra_field_type',
5252
//Enable this when field_loggeable is introduced as a table field (2.0)
5353
//'field_loggeable',
54-
'created_at',
54+
'created_at'
5555
];
5656

5757
public $ops = [
@@ -514,7 +514,8 @@ public function addElements(
514514
$addEmptyOptionSelects = false,
515515
$introductionTextList = [],
516516
$requiredFields = [],
517-
$hideGeoLocalizationDetails = false
517+
$hideGeoLocalizationDetails = false,
518+
$help = false
518519
) {
519520
if (empty($form)) {
520521
return false;
@@ -562,7 +563,8 @@ public function addElements(
562563
$customLabelsExtraMultipleSelect,
563564
$addEmptyOptionSelects,
564565
$introductionTextList,
565-
$hideGeoLocalizationDetails
566+
$hideGeoLocalizationDetails,
567+
$help
566568
);
567569

568570
if (!empty($requiredFields)) {
@@ -1038,7 +1040,8 @@ public function set_extra_fields_in_form(
10381040
$customLabelsExtraMultipleSelect = [],
10391041
$addEmptyOptionSelects = false,
10401042
$introductionTextList = [],
1041-
$hideGeoLocalizationDetails = false
1043+
$hideGeoLocalizationDetails = false,
1044+
$help = false
10421045
) {
10431046
$jquery_ready_content = null;
10441047
if (!empty($extra)) {
@@ -1102,8 +1105,13 @@ public function set_extra_fields_in_form(
11021105
}
11031106

11041107
$translatedDisplayText = get_lang($field_details['display_text'], true);
1108+
$translatedDisplayHelpText = '';
1109+
if ($help) {
1110+
$translatedDisplayHelpText .= get_lang($field_details['display_text'] . 'Help');
1111+
}
1112+
$label = [$translatedDisplayText, $translatedDisplayHelpText];
11051113
if (!empty($translatedDisplayText)) {
1106-
$field_details['display_text'] = $translatedDisplayText;
1114+
$field_details['display_text'] = $label;
11071115
}
11081116

11091117
switch ($field_details['field_type']) {
@@ -1129,6 +1137,7 @@ public function set_extra_fields_in_form(
11291137
}
11301138
break;
11311139
case self::FIELD_TYPE_TEXTAREA:
1140+
11321141
$form->addHtmlEditor(
11331142
'extra_'.$field_details['variable'],
11341143
$field_details['display_text'],
@@ -1139,6 +1148,7 @@ public function set_extra_fields_in_form(
11391148
'Width' => '100%',
11401149
'Height' => '130',
11411150
'id' => 'extra_'.$field_details['variable'],
1151+
11421152
]
11431153
);
11441154
$form->applyFilter('extra_'.$field_details['variable'], 'stripslashes');

0 commit comments

Comments
 (0)