Fix some missed details and simplifications in resource search options

This commit is contained in:
Nathan Gray 2015-03-12 16:50:47 +00:00
parent 255494fc20
commit 047ee13253
2 changed files with 9 additions and 10 deletions

View File

@ -965,9 +965,12 @@ app.classes.calendar = AppJS.extend(
duration: values.duration, duration: values.duration,
participants: values.participants, participants: values.participants,
recur_type: values.recur_type, recur_type: values.recur_type,
whole_day: values.whole_day,
event_id: values.link_to.to_id, // cal_id, if available event_id: values.link_to.to_id, // cal_id, if available
show_conflict: (egw.preference('defaultresource_sel','calendar') == 'resources_without_conflict') ? '0' : '1' show_conflict: (egw.preference('defaultresource_sel','calendar') == 'resources_without_conflict') ? '0' : '1'
};
if(values.whole_day)
{
request.options.exec.whole_date = true;
} }
} }
return true; return true;

View File

@ -601,18 +601,14 @@ class resources_bo
require_once(EGW_INCLUDE_ROOT.'/calendar/inc/class.calendar_bo.inc.php'); require_once(EGW_INCLUDE_ROOT.'/calendar/inc/class.calendar_bo.inc.php');
$this->bocal =& CreateObject('calendar.calendar_bo'); $this->bocal =& CreateObject('calendar.calendar_bo');
} }
$start = new egw_time($cal_info['start']);
$startarr= getdate(strtotime($cal_info['start'])); $startarr= getdate($start->format('ts'));
if (isset($cal_info['whole_day'])) { if (isset($cal_info['whole_day'])) {
$startarr['hour'] = $startarr['minute'] = 0; $startarr['hour'] = $startarr['minute'] = 0;
unset($startarr['raw']); $start = new egw_time($startarr);
$start = $this->bocal->date2ts($startarr); $end = $start->format('ts') + 86399;
$end = $start + 86399;
} else { } else {
$startarr['hour'] = $cal_info['start']['H']; $start = $start->format('ts');
$startarr['minute'] = $cal_info['start']['i'];
unset($startarr['raw']);
$start = $this->bocal->date2ts($startarr);
$end = $start + ($cal_info['duration']); $end = $start + ($cal_info['duration']);
} }