Add "Allow ignore conflicts" feature for resources

This commit is contained in:
Hadi Nategh 2014-01-28 16:26:18 +00:00
parent 6f74c42111
commit 8147adcb95
2 changed files with 40 additions and 1 deletions

View File

@ -1793,8 +1793,35 @@ 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)
{
$etpl->exec('calendar.calendar_uiforms.process_edit',$content,array(),array(),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;
case 'directbooking':
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,array(),$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="no">{lang_No}</option>
<option value="allusers"{selected_ignoreconflicts_allusers}>{lang_Yes,_all_users_ignore_conflicts}</option>
<option value="directbooking"{selected_ignoreconflicts_directbooking}>{lang_Yes,_only_users_with_direct_booking_permission}</option>
</select>
</td>
</tr>
<!-- END body -->
<!-- BEGIN footer -->