mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-20 18:08:02 +02:00
Starting to add support for displaying a list of alarms.
This commit is contained in:
parent
4976ec2f54
commit
0732fd541e
@ -1808,6 +1808,11 @@
|
|||||||
return $icalendar->build_ical($ical);
|
return $icalendar->build_ical($ical);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_alarms($event_id)
|
||||||
|
{
|
||||||
|
return $this->so->get_alarm($event_id);
|
||||||
|
}
|
||||||
|
|
||||||
function prepare_recipients(&$new_event,$old_event)
|
function prepare_recipients(&$new_event,$old_event)
|
||||||
{
|
{
|
||||||
// Find modified and deleted users.....
|
// Find modified and deleted users.....
|
||||||
|
@ -59,7 +59,6 @@
|
|||||||
|
|
||||||
function list_events($startYear,$startMonth,$startDay,$endYear=0,$endMonth=0,$endDay=0)
|
function list_events($startYear,$startMonth,$startDay,$endYear=0,$endMonth=0,$endDay=0)
|
||||||
{
|
{
|
||||||
$this->makeobj();
|
|
||||||
$extra = '';
|
$extra = '';
|
||||||
$extra .= (strpos($this->filter,'private')?'AND phpgw_cal.is_public=0 ':'');
|
$extra .= (strpos($this->filter,'private')?'AND phpgw_cal.is_public=0 ':'');
|
||||||
$extra .= ($this->cat_id?'AND phpgw_cal.category = '.$this->cat_id.' ':'');
|
$extra .= ($this->cat_id?'AND phpgw_cal.category = '.$this->cat_id.' ':'');
|
||||||
@ -73,7 +72,6 @@
|
|||||||
return Array();
|
return Array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->makeobj();
|
|
||||||
$starttime = mktime(0,0,0,$smonth,$sday,$syear) - $this->datetime->tz_offset;
|
$starttime = mktime(0,0,0,$smonth,$sday,$syear) - $this->datetime->tz_offset;
|
||||||
$endtime = mktime(23,59,59,$emonth,$eday,$eyear) - $this->datetime->tz_offset;
|
$endtime = mktime(23,59,59,$emonth,$eday,$eyear) - $this->datetime->tz_offset;
|
||||||
// $starttime = mktime(0,0,0,$smonth,$sday,$syear);
|
// $starttime = mktime(0,0,0,$smonth,$sday,$syear);
|
||||||
@ -99,8 +97,6 @@
|
|||||||
|
|
||||||
function list_events_keyword($keywords)
|
function list_events_keyword($keywords)
|
||||||
{
|
{
|
||||||
$this->makeobj();
|
|
||||||
|
|
||||||
$sql = 'AND (phpgw_cal_user.cal_login='.$this->owner.') ';
|
$sql = 'AND (phpgw_cal_user.cal_login='.$this->owner.') ';
|
||||||
|
|
||||||
$words = split(' ',$keywords);
|
$words = split(' ',$keywords);
|
||||||
@ -132,31 +128,26 @@
|
|||||||
|
|
||||||
function get_event_ids($include_repeats=False, $sql='')
|
function get_event_ids($include_repeats=False, $sql='')
|
||||||
{
|
{
|
||||||
$this->makeobj();
|
|
||||||
return $this->cal->get_event_ids($include_repeats,$sql);
|
return $this->cal->get_event_ids($include_repeats,$sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
function add_entry(&$event)
|
function add_entry(&$event)
|
||||||
{
|
{
|
||||||
$this->makeobj();
|
|
||||||
$this->cal->store_event($event);
|
$this->cal->store_event($event);
|
||||||
}
|
}
|
||||||
|
|
||||||
function delete_entry($id)
|
function delete_entry($id)
|
||||||
{
|
{
|
||||||
$this->makeobj();
|
|
||||||
$this->cal->delete_event($id);
|
$this->cal->delete_event($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
function expunge()
|
function expunge()
|
||||||
{
|
{
|
||||||
$this->makeobj();
|
|
||||||
$this->cal->expunge();
|
$this->cal->expunge();
|
||||||
}
|
}
|
||||||
|
|
||||||
function delete_calendar($owner)
|
function delete_calendar($owner)
|
||||||
{
|
{
|
||||||
$this->makeobj();
|
|
||||||
$this->cal->delete_calendar($owner);
|
$this->cal->delete_calendar($owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,10 +162,20 @@
|
|||||||
|
|
||||||
function set_status($id,$status)
|
function set_status($id,$status)
|
||||||
{
|
{
|
||||||
$this->makeobj();
|
|
||||||
$this->cal->set_status($id,$this->owner,$status);
|
$this->cal->set_status($id,$this->owner,$status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_alarm($id)
|
||||||
|
{
|
||||||
|
if($GLOBALS['phpgw_info']['server']['calendar_type'] == 'sql')
|
||||||
|
{
|
||||||
|
return $this->cal->get_alarm($id);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Begin mcal equiv functions */
|
/* Begin mcal equiv functions */
|
||||||
function get_cached_event()
|
function get_cached_event()
|
||||||
{
|
{
|
||||||
@ -188,7 +189,6 @@
|
|||||||
|
|
||||||
function event_init()
|
function event_init()
|
||||||
{
|
{
|
||||||
$this->makeobj();
|
|
||||||
$this->cal->event_init();
|
$this->cal->event_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -449,6 +449,24 @@ class socalendar_ extends socalendar__
|
|||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_alarm($id)
|
||||||
|
{
|
||||||
|
$this->stream->query('SELECT cal_time, cal_text FROM phpgw_cal_alarm WHERE cal_id='.$id,__LINE__,__FILE__);
|
||||||
|
if($this->stream->num_rows())
|
||||||
|
{
|
||||||
|
while($this->stream->next_record())
|
||||||
|
{
|
||||||
|
$alarm[$this->stream->f('cal_time')] = $this->stream->f('cal_text');
|
||||||
|
}
|
||||||
|
@reset($alarm);
|
||||||
|
return $alarm;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function set_status($id,$owner,$status)
|
function set_status($id,$owner,$status)
|
||||||
{
|
{
|
||||||
$status_code_short = Array(
|
$status_code_short = Array(
|
||||||
|
@ -2071,6 +2071,7 @@
|
|||||||
);
|
);
|
||||||
$p->set_block('view','view_event','view_event');
|
$p->set_block('view','view_event','view_event');
|
||||||
$p->set_block('view','list','list');
|
$p->set_block('view','list','list');
|
||||||
|
$p->set_block('view','hr','hr');
|
||||||
|
|
||||||
$var = Array(
|
$var = Array(
|
||||||
'bg_text'=> $this->theme['bg_text'],
|
'bg_text'=> $this->theme['bg_text'],
|
||||||
@ -2249,6 +2250,27 @@
|
|||||||
$this->output_template_array($p,'row','list',$var[$i]);
|
$this->output_template_array($p,'row','list',$var[$i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($alarms = $this->bo->get_alarms($event['id']))
|
||||||
|
{
|
||||||
|
$p->set_var('hr_text','<hr>');
|
||||||
|
$p->parse('row','hr',True);
|
||||||
|
$p->set_var('hr_text','<center><b>'.lang('Alarms').'</b></center><br>');
|
||||||
|
$p->parse('row','hr',True);
|
||||||
|
|
||||||
|
@reset($alarms);
|
||||||
|
while(list($time,$text) = each($alarms))
|
||||||
|
{
|
||||||
|
$var = Array(
|
||||||
|
'field' => $GLOBALS['phpgw']->common->show_date($time),
|
||||||
|
'data' => $text
|
||||||
|
);
|
||||||
|
$this->output_template_array($p,'row','list',$var);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$p->set_var('hr_text','<hr>');
|
||||||
|
$p->parse('row','hr',True);
|
||||||
|
|
||||||
return $p->fp('out','view_event');
|
return $p->fp('out','view_event');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
$setup_info['calendar']['name'] = 'calendar';
|
$setup_info['calendar']['name'] = 'calendar';
|
||||||
$setup_info['calendar']['title'] = 'Calendar';
|
$setup_info['calendar']['title'] = 'Calendar';
|
||||||
$setup_info['calendar']['version'] = '0.9.13.003';
|
$setup_info['calendar']['version'] = '0.9.13.004';
|
||||||
$setup_info['calendar']['app_order'] = 3;
|
$setup_info['calendar']['app_order'] = 3;
|
||||||
$setup_info['calendar']['enable'] = 1;
|
$setup_info['calendar']['enable'] = 1;
|
||||||
|
|
||||||
@ -21,6 +21,7 @@
|
|||||||
$setup_info['calendar']['tables'][] = 'phpgw_cal_holidays';
|
$setup_info['calendar']['tables'][] = 'phpgw_cal_holidays';
|
||||||
$setup_info['calendar']['tables'][] = 'phpgw_cal_repeats';
|
$setup_info['calendar']['tables'][] = 'phpgw_cal_repeats';
|
||||||
$setup_info['calendar']['tables'][] = 'phpgw_cal_user';
|
$setup_info['calendar']['tables'][] = 'phpgw_cal_user';
|
||||||
|
$setup_info['calendar']['tables'][] = 'phpgw_cal_alarm';
|
||||||
|
|
||||||
/* The hooks this app includes, needed for hooks registration */
|
/* The hooks this app includes, needed for hooks registration */
|
||||||
$setup_info['calendar']['hooks'] = array(
|
$setup_info['calendar']['hooks'] = array(
|
||||||
@ -29,7 +30,8 @@
|
|||||||
'manual',
|
'manual',
|
||||||
'deleteaccount',
|
'deleteaccount',
|
||||||
'add_def_prefs',
|
'add_def_prefs',
|
||||||
'email'
|
'email',
|
||||||
|
'home'
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Dependencies for this app to work */
|
/* Dependencies for this app to work */
|
||||||
|
@ -73,6 +73,18 @@
|
|||||||
'fk' => array(),
|
'fk' => array(),
|
||||||
'ix' => array(),
|
'ix' => array(),
|
||||||
'uc' => array()
|
'uc' => array()
|
||||||
|
),
|
||||||
|
'phpgw_cal_alarm' => array(
|
||||||
|
'fd' => array(
|
||||||
|
'alarm_id' => array('type' => 'auto','nullable' => False),
|
||||||
|
'cal_id' => array('type' => 'int', 'precision' => 8, 'nullable' => False),
|
||||||
|
'cal_time' => array('type' => 'int', 'precision' => 8, 'nullable' => False),
|
||||||
|
'cal_text' => array('type' => 'varchar', 'precision' => 50, 'nullable' => False)
|
||||||
|
),
|
||||||
|
'pk' => array('alarm_id'),
|
||||||
|
'fk' => array(),
|
||||||
|
'ix' => array(),
|
||||||
|
'uc' => array()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -17,3 +17,10 @@
|
|||||||
<td valign="top" width="70%">{data}</td>
|
<td valign="top" width="70%">{data}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- END list -->
|
<!-- END list -->
|
||||||
|
<!-- BEGIN hr -->
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
{hr_text}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<!-- END hr -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user