Add "Allow ignore conflicts" feature for resources

This commit is contained in:
Hadi Nategh 2014-01-29 13:46:30 +00:00
parent 8d0cdd068d
commit aac5309c8f
2 changed files with 41 additions and 1 deletions

View File

@ -1873,8 +1873,36 @@ class calendar_uiforms extends calendar_ui
'conflicts' => array_values($conflicts), // conflicts have id-start as key
);
$GLOBALS['egw_info']['flags']['app_header'] = lang('calendar') . ' - ' . lang('Scheduling conflict');
$resources_config = config::read('resources');
$readonlys = array();
if($event['participant_types']['r'] && $resources_config) // resources Allow ignore conflicts
{
$etpl->exec('calendar.calendar_uiforms.process_edit',$content,false,false,array_merge($event,$preserv),$preserv['no_popup'] ? 0 : 2);
switch ($resources_config['ignoreconflicts'])
{
case 'no':
$readonlys['button[ignore]'] = true;
break;
case 'allusers':
$readonlys['button[ignore]'] = false;
break;
default:
foreach ($event['participants'] as $pIds => $val)
{
if ($val != 'ACHAIR')
{
if (!$this->bo->check_status_perms($pIds, $event))
{
$readonlys['button[ignore]'] = true;
break;
}
}
}
}
}
$etpl->exec('calendar.calendar_uiforms.process_edit',$content,false,$readonlys,array_merge($event,$preserv),$preserv['no_popup'] ? 0 : 2);
}
/**

View File

@ -23,6 +23,18 @@
</select>
</td>
</tr>
<tr class="row_on">
<td>
&nbsp;{lang_Allow_ignore_conflicts}
</td>
<td>
<select name="newsettings[ignoreconflicts]">
<option value=""{selected_ignoreconflicts_directbooking}>{lang_Yes,_only_users_with_direct_booking_permission}</option>
<option value="allusers"{selected_ignoreconflicts_allusers}>{lang_Yes,_all_users_can_ignore_conflicts}</option>
<option value="no">{lang_No}</option>
</select>
</td>
</tr>
<!-- END body -->
<!-- BEGIN footer -->