Calendar: Hide actions selectbox entirely when it is readonly

This commit is contained in:
nathan 2022-10-13 09:50:54 -06:00
parent 383dfb9a04
commit 37cd32e3ef
2 changed files with 8 additions and 2 deletions

View File

@ -1906,7 +1906,12 @@ class calendar_uiforms extends calendar_ui
{
$content['exception_label'] = $this->bo->long_date(max($preserved['actual_date'], $event['start']));
}
$readonlys['button[delete]'] = !$event['id'] || $preserved['hide_delete'] || !$this->bo->check_perms(Acl::DELETE,$event);
$readonlys['button[delete]'] = !$event['id'] || $preserved['hide_delete'] || !$this->bo->check_perms(Acl::DELETE, $event);
if($readonlys['action'])
{
// Hide action entirely, not just readonly
$content['action_class'] = 'hideme';
}
if (!$event['id'] || $this->bo->check_perms(Acl::EDIT,$event)) // new event or edit rights to the event ==> allow to add alarm for all users
{

View File

@ -285,7 +285,8 @@
<button statustext="apply the changes" label="Apply" id="button[apply]" image="apply" background_image="1" onclick="app.calendar.move_edit_series"/>
<button statustext="Close the window" label="Cancel" id="button[cancel]" onclick="window.close();" image="cancel" background_image="1"/>
<menulist>
<menupopup statustext="Execute a further action for this entry" id="action" onchange="app.calendar.actions_change" options="Actions..."/>
<menupopup statustext="Execute a further action for this entry" id="action"
onchange="app.calendar.actions_change" empty_label="Actions..." class="@action_class"/>
</menulist>
<checkbox label="Do not notify" id="no_notifications" statustext="Do not notify of these changes"/>
<buttononly statustext="Find free timeslots where the selected participants are available for the given timespan" label="Freetime search" id="freetime" onclick="app.calendar.freetime_search" image="timesheet" background_image="1" span="all"/>