Starting to add support for displaying a list of alarms.

This commit is contained in:
skeeter 2001-09-04 03:17:49 +00:00
parent 4976ec2f54
commit 0732fd541e
8 changed files with 432 additions and 421 deletions

View File

@ -1808,6 +1808,11 @@
return $icalendar->build_ical($ical);
}
function get_alarms($event_id)
{
return $this->so->get_alarm($event_id);
}
function prepare_recipients(&$new_event,$old_event)
{
// Find modified and deleted users.....

View File

@ -59,7 +59,6 @@
function list_events($startYear,$startMonth,$startDay,$endYear=0,$endMonth=0,$endDay=0)
{
$this->makeobj();
$extra = '';
$extra .= (strpos($this->filter,'private')?'AND phpgw_cal.is_public=0 ':'');
$extra .= ($this->cat_id?'AND phpgw_cal.category = '.$this->cat_id.' ':'');
@ -73,7 +72,6 @@
return Array();
}
$this->makeobj();
$starttime = mktime(0,0,0,$smonth,$sday,$syear) - $this->datetime->tz_offset;
$endtime = mktime(23,59,59,$emonth,$eday,$eyear) - $this->datetime->tz_offset;
// $starttime = mktime(0,0,0,$smonth,$sday,$syear);
@ -99,8 +97,6 @@
function list_events_keyword($keywords)
{
$this->makeobj();
$sql = 'AND (phpgw_cal_user.cal_login='.$this->owner.') ';
$words = split(' ',$keywords);
@ -132,31 +128,26 @@
function get_event_ids($include_repeats=False, $sql='')
{
$this->makeobj();
return $this->cal->get_event_ids($include_repeats,$sql);
}
function add_entry(&$event)
{
$this->makeobj();
$this->cal->store_event($event);
}
function delete_entry($id)
{
$this->makeobj();
$this->cal->delete_event($id);
}
function expunge()
{
$this->makeobj();
$this->cal->expunge();
}
function delete_calendar($owner)
{
$this->makeobj();
$this->cal->delete_calendar($owner);
}
@ -171,10 +162,20 @@
function set_status($id,$status)
{
$this->makeobj();
$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 */
function get_cached_event()
{
@ -188,7 +189,6 @@
function event_init()
{
$this->makeobj();
$this->cal->event_init();
}

View File

@ -449,6 +449,24 @@ class socalendar_ extends socalendar__
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)
{
$status_code_short = Array(

View File

@ -2071,6 +2071,7 @@
);
$p->set_block('view','view_event','view_event');
$p->set_block('view','list','list');
$p->set_block('view','hr','hr');
$var = Array(
'bg_text'=> $this->theme['bg_text'],
@ -2249,6 +2250,27 @@
$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');
}

View File

@ -13,7 +13,7 @@
$setup_info['calendar']['name'] = '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']['enable'] = 1;
@ -21,7 +21,8 @@
$setup_info['calendar']['tables'][] = 'phpgw_cal_holidays';
$setup_info['calendar']['tables'][] = 'phpgw_cal_repeats';
$setup_info['calendar']['tables'][] = 'phpgw_cal_user';
$setup_info['calendar']['tables'][] = 'phpgw_cal_alarm';
/* The hooks this app includes, needed for hooks registration */
$setup_info['calendar']['hooks'] = array(
'preferences',
@ -29,7 +30,8 @@
'manual',
'deleteaccount',
'add_def_prefs',
'email'
'email',
'home'
);
/* Dependencies for this app to work */

View File

@ -73,6 +73,18 @@
'fk' => array(),
'ix' => 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

View File

@ -17,3 +17,10 @@
<td valign="top" width="70%">{data}</td>
</tr>
<!-- END list -->
<!-- BEGIN hr -->
<tr>
<td colspan="2">
{hr_text}
</td>
</tr>
<!-- END hr -->