Fixed wrong privileges for special days creation.

This commit is contained in:
Junichi Satoh 2016-07-15 16:16:17 +09:00
parent 11aba4ce63
commit 2882c320a9

View File

@ -40,8 +40,11 @@ $id_group = 0;
if ($id) { if ($id) {
$special_day = alerts_get_alert_special_day ($id); $special_day = alerts_get_alert_special_day ($id);
$date = str_replace('0001', '*', $special_day['date']); $date = str_replace('0001', '*', $special_day['date']);
$date_orig = $date;
$same_day = $special_day['same_day']; $same_day = $special_day['same_day'];
$description = $special_day['description']; $description = $special_day['description'];
$id_group = $special_day['id_group'];
$id_group_orig = $id_group;
} }
if ($date == '') { if ($date == '') {
@ -66,8 +69,8 @@ $table->data[0][1] .= html_print_image ("images/calendar_view_day.png", true, ar
$table->data[1][0] = __('Group'); $table->data[1][0] = __('Group');
$groups = users_get_groups (); $groups = users_get_groups ();
$own_info = get_user_info ($config['id_user']); $own_info = get_user_info ($config['id_user']);
// Only display group "All" if user is administrator or has "PM" privileges // Only display group "All" if user is administrator or has "LM" privileges
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) if (users_can_manage_group_all("LM"))
$display_all_group = true; $display_all_group = true;
else else
$display_all_group = false; $display_all_group = false;
@ -94,6 +97,8 @@ echo '<div class="action-buttons" style="width: '.$table->width.'">';
if ($id) { if ($id) {
html_print_input_hidden ('id', $id); html_print_input_hidden ('id', $id);
html_print_input_hidden ('update_special_day', 1); html_print_input_hidden ('update_special_day', 1);
html_print_input_hidden ('id_group_orig', $id_group_orig);
html_print_input_hidden ('date_orig', $date_orig);
html_print_submit_button (__('Update'), 'create', false, 'class="sub upd"'); html_print_submit_button (__('Update'), 'create', false, 'class="sub upd"');
} }
else { else {