Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions classes/form/edit_event_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ public function definition(): void {
$supportpersons[$id] = fullname($user);
}
$supportpersonselementname = 'supportpersons';
if (!$caneditinternal && $existingevent) {
// Assigned Support may edit support persons (same gate as internal notes); others stay RO.
if (!$caneditinternal && !$caneditinternalnotes && $existingevent) {
$supportpersonselementname = 'supportpersons_readonly';
$mform->addElement(
'static',
Expand All @@ -503,7 +504,6 @@ public function definition(): void {
$userselectoroptions
);
$mform->setType('supportpersons', PARAM_TEXT);
$mform->disabledIf('supportpersons', 'editinternal', 'neq', 1);
}
$mform->addHelpButton($supportpersonselementname, 'event_supportperson', 'mod_bookit');
} else {
Expand Down Expand Up @@ -1125,7 +1125,10 @@ public function process_dynamic_submission(): array {
}

if ($currentevent && !$caneditinternal) {
$formdata->supportpersons = $currentevent->supportpersons;
// Support with notes-gate may update supportpersons; other internal fields stay locked.
if (!$caneditinternalnotes) {
$formdata->supportpersons = $currentevent->supportpersons;
}
$formdata->extratimebefore = $currentevent->extratimebefore;
$formdata->extratimeafter = $currentevent->extratimeafter;
$formdata->refcourseid = $currentevent->refcourseid;
Expand Down
7 changes: 3 additions & 4 deletions classes/local/install_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1456,12 +1456,11 @@ private static function sync_default_room(int $roomid, bool $verbose = false): a
$updaterecord = (object)['id' => $roomid];
$haschanges = false;

foreach (
[
$fields = [
'name', 'shortname', 'description', 'location', 'eventcolor', 'active', 'roommode', 'seats',
'extratimebefore', 'extratimeafter', 'preventoverlap',
] as $field
) {
];
foreach ($fields as $field) {
if (!self::baseline_values_match($roomrecord->$field ?? null, $record->$field ?? null)) {
$updaterecord->$field = $record->$field;
$haschanges = true;
Expand Down
5 changes: 4 additions & 1 deletion classes/local/manager/event_access_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,10 @@ public static function can_supportperson_view_internal_fields(
}

/**
* Check whether the user may edit only the internal notes field.
* Check whether assigned Support may edit Internal notes (and Support persons on the form).
*
* The same gate authorises Support-persons edits in edit_event_form; other internal fields
* remain read-only for Support-only users.
*
* @param stdClass $event
* @param context_module $context
Expand Down
Loading
Loading