This should provide all neccessary functions to the calendar in n-tier layout. Just need to debug it out for any minor problems.

This commit is contained in:
skeeter 2001-07-28 13:17:30 +00:00
parent 2c726647f5
commit 9472646729
11 changed files with 2560 additions and 1173 deletions

View File

@ -19,9 +19,9 @@
var $public_functions = Array(
'read_entries' => True,
'read_entry' => True,
'add_entry' => True,
'delete_entry' => True,
'update_entry' => True
'update' => True,
'preferences' => True
);
var $debug = False;
@ -53,7 +53,7 @@
function bocalendar($session=0)
{
global $phpgw, $phpgw_info, $date, $year, $month, $day, $owner, $filter, $fcat_id, $friendly;
global $phpgw, $phpgw_info, $date, $year, $month, $day, $owner, $filter, $cat_id, $friendly;
$phpgw->nextmatchs = CreateObject('phpgwapi.nextmatchs');
@ -96,10 +96,7 @@
$this->holiday_color = (substr($phpgw_info['theme']['bg07'],0,1)=='#'?'':'#').$phpgw_info['theme']['bg07'];
if($friendly == 1)
{
$this->printer_friendly = True;
}
$this->printer_friendly = ($friendly == 1?True:False);
if(isset($filter)) { $this->filter = $filter; }
if(isset($cat_id)) { $this->cat_id = $cat_id; }
@ -158,6 +155,7 @@
if ($this->use_session)
{
global $phpgw;
if($this->debug) { echo '<br>Save:'; _debug_array($data); }
$phpgw->session->appsession('session_data','calendar',$data);
}
@ -186,35 +184,22 @@
}
}
function add_entry($event)
{
if($this->check_perms(PHPGW_ACL_ADD))
{
$this->so->add_entry($event);
$this->send_update(MSG_ADDED,$event->participants,'',$this->get_cached_event());
}
}
function update_entry($event)
{
if($this->check_perms(PHPGW_ACL_EDIT))
{
if($event->id != 0)
{
$new_event = $event;
$old_event = $this->read_entry($new_event->id);
$this->prepare_recipients($new_event,$old_event);
}
$this->so->add_entry($event);
}
}
function delete_entry($id)
{
if($this->check_perms(PHPGW_ACL_DELETE))
{
$this->so->delete_entry($id);
$temp_event = $this->read_entry($id);
if($this->owner == $temp_event->owner)
{
$this->so->delete_entry($id);
$cd = 16;
}
else
{
$cd = 60;
}
}
return $cd;
}
function expunge()
@ -230,11 +215,285 @@
$this->so->expunge();
}
}
/* Private functions */
function search_keywords($keywords)
{
return $this->so->list_events_keyword($keywords);
/*
$event_ids = $this->so->list_events_keyword($keywords);
$event_ids_repeating = $this->so->list_repeated_events_keyword($keywords);
$c_event_ids = count($cached_event_ids);
$c_event_ids_repeating = count($cached_event_ids_repeating);
if($this->debug)
{
echo "events cached : $c_event_ids : for : ".sprintf("%04d%02d%02d",$syear,$smonth,$sday)."<br>\n";
echo "repeating events cached : $c_event_ids_repeating : for : ".sprintf("%04d%02d%02d",$syear,$smonth,$sday)."<br>\n";
}
if($c_cached_ids)
{
for($i=0;$i<$c_cached_ids;$i++)
{
$cached_events[] = $this->so->read_entry($event_ids[$i]);
}
}
if($c_event_ids_repeating)
{
for($i=0;$i<$c_event_ids_repeating;$i++)
{
$cached_events[] = $this->so->read_entry($event_ids_repeating[$i]);
}
}
*/
}
function update($p_cal=Array(),$p_start=Array(),$p_end=Array(),$p_recur_enddata=Array())
{
global $phpgw, $phpgw_info, $readsess, $cal, $participants, $start, $end, $recur_enddate;
$cal = ($p_cal?$p_cal:$cal);
$start = ($p_start?$p_start:$start);
$end = ($p_end?$p_end:$end);
$recur_enddate = ($p_recur_enddate?$p_recur_enddate:$recur_enddate);
$overlapping_events = False;
$ui = CreateObject('calendar.uicalendar');
if(isset($readsess))
{
$event = $this->restore_from_appsession();
$datetime_check = $this->validate_update($event);
if($datetime_check)
{
$ui->edit($datetime_check,True);
}
}
else
{
if(!$cal['id'] && !$this->check_perms(PHPGW_ACL_ADD))
{
$ui->index();
}
elseif($cal['id'] && !$this->check_perms(PHPGW_ACL_EDIT))
{
$ui->index();
}
$this->fix_update_time($start);
$this->fix_update_time($end);
if(!isset($cal['private']))
{
$cal['private'] = 'public';
}
$is_public = ($cal['private'] == 'public'?1:0);
$this->so->event_init();
$this->so->set_category($cal['category']);
$this->so->set_title($cal['title']);
$this->so->set_description($cal['description']);
$this->so->set_start($start['year'],$start['month'],$start['mday'],$start['hour'],$start['min'],0);
$this->so->set_end($end['year'],$end['month'],$end['mday'],$end['hour'],$end['min'],0);
$this->so->set_class($is_public);
if($cal['id'])
{
$this->so->add_attribute('id',$cal['id']);
}
if($cal['rpt_use_end'] != 'y')
{
$recur_enddate['year'] = 0;
$recur_enddate['month'] = 0;
$recur_enddate['mday'] = 0;
}
$cal['recur_data'] = $cal['rpt_sun'] + $cal['rpt_mon'] + $cal['rpt_tue'] + $cal['rpt_wed'] + $cal['rpt_thu'] + $cal['rpt_fri'] + $cal['rpt_sat'];
switch($cal['recur_type'])
{
case MCAL_RECUR_NONE:
$this->so->set_recur_none();
break;
case MCAL_RECUR_DAILY:
$this->so->set_recur_daily($recur_enddate['year'],$recur_enddate['month'],$recur_enddate['mday'],$cal['recur_interval']);
break;
case MCAL_RECUR_WEEKLY:
$this->so->set_recur_weekly($recur_enddate['year'],$recur_enddate['month'],$recur_enddate['mday'],$cal['recur_interval'],$cal['recur_data']);
break;
case MCAL_RECUR_MONTHLY_MDAY:
$this->so->set_recur_monthly_mday($recur_enddate['year'],$recur_enddate['month'],$recur_enddate['mday'],$cal['recur_interval']);
break;
case MCAL_RECUR_MONTHLY_WDAY:
$this->so->set_recur_monthly_wday($recur_enddate['year'],$recur_enddate['month'],$recur_enddate['mday'],$cal['recur_interval']);
break;
case MCAL_RECUR_YEARLY:
$this->so->set_recur_yearly($recur_enddate['year'],$recur_enddate['month'],$recur_enddate['mday'],$cal['recur_interval']);
break;
}
$parts = $participants;
$minparts = min($participants);
$part = Array();
for($i=0;$i<count($parts);$i++)
{
$acct_type = $phpgw->accounts->get_type(intval($parts[$i]));
if($acct_type == 'u')
{
$part[$parts[$i]] = 1;
}
elseif($acct_type == 'g')
{
/* This pulls ALL users of a group and makes them as participants to the event */
/* I would like to turn this back into a group thing. */
$acct = CreateObject('phpgwapi.accounts',intval($parts[$i]));
$members = $acct->members(intval($parts[$i]));
unset($acct);
if($members == False)
{
continue;
}
while($member = each($members))
{
$part[$member[1]['account_id']] = 1;
}
}
}
@reset($part);
while(list($key,$value) = each($part))
{
$this->so->add_attribute('participants['.$key.']','U');
}
reset($participants);
$event = $this->get_cached_event();
if(!@$event->participants[$cal['owner']])
{
$this->so->add_attribute('owner',$minparts);
}
$this->so->add_attribute('priority',$cal['priority']);
$event = $this->get_cached_event();
$this->store_to_appsession($event);
$datetime_check = $this->validate_update($event);
if($datetime_check)
{
$ui = CreateObject('calendar.uicalendar');
$ui->edit($datetime_check,True);
}
settype($start,'integer');
settype($end,'integer');
$start = mktime($event->start->hour,$event->start->min,$event->start->sec,$event->start->month,$event->start->mday,$event->start->year) - $this->datetime->tz_offset;
$end = mktime($event->end->hour,$event->end->min,$event->end->sec,$event->end->month,$event->end->mday,$event->end->year) - $this->datetime->tz_offset;
$overlapping_events = $this->overlap($start,$end,$event->participants,$event->owner,$event->id);
}
if($overlapping_events)
{
$ui->overlap($overlapping_events,$event);
}
else
{
if(!$event->id)
{
$this->so->add_entry($event);
$this->send_update(MSG_ADDED,$event->participants,'',$this->get_cached_event());
}
else
{
$new_event = $event;
$old_event = $this->read_entry($new_event->id);
$this->prepare_recipients($new_event,$old_event);
$this->so->add_entry($event);
}
$date = sprintf("%04d%02d%02d",$event->start->year,$event->start->month,$event->start->mday);
$ui->index();
}
}
function preferences()
{
global $phpgw, $phpgw_info, $submit, $prefs;
if ($submit)
{
$phpgw->preferences->read_repository();
$phpgw->preferences->add('calendar','weekdaystarts',$prefs['weekdaystarts']);
$phpgw->preferences->add('calendar','workdaystarts',$prefs['workdaystarts']);
$phpgw->preferences->add('calendar','workdayends',$prefs['workdayends']);
$phpgw->preferences->add('calendar','defaultcalendar',$prefs['defaultcalendar']);
$phpgw->preferences->add('calendar','defaultfilter',$prefs['defaultfilter']);
$phpgw->preferences->add('calendar','interval',$prefs['interval']);
if ($prefs['mainscreen_showevents'] == True)
{
$phpgw->preferences->add('calendar','mainscreen_showevents',$prefs['mainscreen_showevents']);
}
else
{
$phpgw->preferences->delete('calendar','mainscreen_showevents');
}
if ($prefs['send_updates'] == True)
{
$phpgw->preferences->add('calendar','send_updates',$prefs['send_updates']);
}
else
{
$phpgw->preferences->delete('calendar','send_updates');
}
if ($prefs['display_status'] == True)
{
$phpgw->preferences->add('calendar','display_status',$prefs['display_status']);
}
else
{
$phpgw->preferences->delete('calendar','display_status');
}
if ($prefs['default_private'] == True)
{
$phpgw->preferences->add('calendar','default_private',$prefs['default_private']);
}
else
{
$phpgw->preferences->delete('calendar','default_private');
}
if ($prefs['display_minicals'] == True)
{
$phpgw->preferences->add('calendar','display_minicals',$prefs['display_minicals']);
}
else
{
$phpgw->preferences->delete('calendar','display_minicals');
}
if ($prefs['print_black_white'] == True)
{
$phpgw->preferences->add('calendar','print_black_white',$prefs['print_black_white']);
}
else
{
$phpgw->preferences->delete('calendar','print_black_white');
}
$phpgw->preferences->save_repository(True);
Header('Location: '.$phpgw->link('/preferences/index.php'));
$phpgw->common->phpgw_exit();
}
}
/* Private functions */
function read_holidays()
{
$holiday = CreateObject('calendar.boholiday',$this->year,$this->owner);
$holiday = CreateObject('calendar.boholiday');
$holiday->prepare_read_holidays($this->year,$this->owner);
$this->cached_holidays = $holiday->read_holiday();
unset($holiday);
}
@ -262,28 +521,26 @@
function fix_update_time(&$time_param)
{
global $phpgw_info;
if ($this->prefs['common']['timeformat'] == '12')
{
if ($time_param[ampm] == 'pm')
if ($time_param['ampm'] == 'pm')
{
if ($time_param[hour] <> 12)
if ($time_param['hour'] <> 12)
{
$time_param[hour] += 12;
$time_param['hour'] += 12;
}
}
elseif ($time_param[ampm] == 'am')
elseif ($time_param['ampm'] == 'am')
{
if ($time_param[hour] == 12)
if ($time_param['hour'] == 12)
{
$time_param[hour] -= 12;
$time_param['hour'] -= 12;
}
}
if($time_param[hour] > 24)
if($time_param['hour'] > 24)
{
$time_param[hour] -= 12;
$time_param['hour'] -= 12;
}
}
}
@ -472,30 +729,33 @@
{
global $phpgw, $phpgw_info;
if($owner == 0) { $owner = $this->owner; }
if ($owner == $phpgw_info['user']['account_id'] || ($this->check_perms(PHPGW_ACL_PRIVATE,$owner) && $event->public==0) || ($event->public == 1))
if($owner == 0)
{
$is_private = False;
$owner = $this->owner;
}
if ($owner == $phpgw_info['user']['account_id'] || ($event->public==1) || ($this->check_perms(PHPGW_ACL_PRIVATE,$owner) && $event->public==0))
{
return False;
}
elseif($event->public == 0)
{
$is_private = True;
return True;
}
elseif($event->public == 2)
{
$is_private = True;
$groups = $phpgw->accounts->memberships($owner);
while ($group = each($groups))
while (list($key,$group) = each($groups))
{
if (strpos(' '.implode($event->groups,',').' ',$group[1]['account_id']))
if (strpos(' '.implode($event->groups,',').' ',$group['account_id']))
{
$is_private = False;
return False;
}
}
}
else
{
$is_private = False;
return False;
}
return $is_private;
@ -505,18 +765,37 @@
{
if ($is_private)
{
$str = 'private';
return 'private';
}
elseif (strlen($event->$field) > 19)
{
$str = substr($event->$field, 0 , 19) . '...';
return substr($event->$field, 0 , 19) . '...';
}
else
{
$str = $event->$field;
return $event->$field;
}
}
return $str;
function get_week_label()
{
$first = $this->datetime->gmtdate($this->datetime->get_weekday_start($this->year, $this->month, $this->day));
$last = $this->datetime->gmtdate($first['raw'] + 518400);
// Week Label
$week_id = lang(strftime("%B",$first['raw'])).' '.$first['day'];
if($first['month'] <> $last['month'] && $first['year'] <> $last['year'])
{
$week_id .= ', '.$first['year'];
}
$week_id .= ' - ';
if($first['month'] <> $last['month'])
{
$week_id .= lang(strftime("%B",$last['raw'])).' ';
}
$week_id .= $last['day'].', '.$last['year'];
return $week_id;
}
function normalizeminutes(&$minutes)
@ -574,8 +853,7 @@
global $phpgw_info;
$time = $this->splittime($fixed_time);
$str = '';
$str .= $time['hour'].':'.((int)$time['minute']<=9?'0':'').$time['minute'];
$str = $time['hour'].':'.((int)$time['minute']<=9?'0':'').$time['minute'];
if ($this->prefs['common']['timeformat'] == '12')
{
@ -1285,12 +1563,18 @@
{
if(isset($new_event->participants[$old_userid]))
{
// echo "Modifying event for user ".$old_userid."<br>\n";
if($this->debug)
{
echo "Modifying event for user ".$old_userid."<br>\n";
}
$this->modified[intval($old_userid)] = $new_status;
}
else
{
// echo "Deleting user ".$old_userid." from the event<br>\n";
if($this->debug)
{
echo "Deleting user ".$old_userid." from the event<br>\n";
}
$this->deleted[intval($old_userid)] = $old_status;
}
}
@ -1299,7 +1583,10 @@
{
if(!isset($old_event->participants[$new_userid]))
{
// echo "Adding event for user ".$new_userid."<br>\n";
if($this->debug)
{
echo "Adding event for user ".$new_userid."<br>\n";
}
$this->added[$new_userid] = 'U';
$new_event->participants[$new_userid] = 'U';
}
@ -1322,8 +1609,6 @@
}
}
function _debug_array($data)
{
echo '<br>UI:';

View File

@ -15,6 +15,11 @@
class boholiday
{
var $public_functions = Array(
'add' => True,
'delete_holiday' => True,
'delete_locale' => True,
'accept_holiday' => True,
'read_entries' => True,
'read_entry' => True,
'add_entry' => True,
@ -22,24 +27,196 @@
);
var $debug = False;
var $base_url = '/index.php';
var $ui;
var $so;
var $owner;
var $year;
var $id;
var $total;
var $start;
var $query;
var $sort;
var $locales = Array();
var $holidays;
var $cached_holidays;
function boholiday($year,$owner=0)
function boholiday()
{
global $phpgw_info;
global $phpgw_info, $locale, $start, $query, $sort, $order, $id;
$this->so = CreateObject('calendar.soholiday');
$this->year = $year;
if(isset($locale)) { $this->locales[] = $locale; }
if(isset($start)) { $this->start = $start; } else { $this->start = 0; }
if(isset($query)) { $this->query = $query; }
if(isset($sort)) { $this->sort = $sort; }
if(isset($order)) { $this->order = $order; }
if(isset($id)) { $this->id = $id; }
if($this->debug)
{
echo "Locale = ".$this->locales[0]."<br>\n";
}
$this->total = $this->so->holiday_total($this->locales[0],$this->query);
}
/* Begin Calendar functions */
function read_entry($id=0)
{
if($this->debug)
{
echo "BO : Reading Holiday ID : ".$id."<br>\n";
}
if(!$id)
{
if(!$this->id)
{
return Array();
}
else
{
$id = $this->id;
}
}
return $this->so->read_holiday($id);
}
function delete_holiday($id=0)
{
if(!$id)
{
if($this->id)
{
$id = $this->id;
}
}
$this->ui = CreateObject('calendar.uiholiday');
if($id)
{
$this->so->delete_holiday($id);
$this->ui->edit_locale();
}
else
{
$this->ui->admin();
}
}
function delete_locale($locale='')
{
if(!$locale)
{
if($this->locales[0])
{
$locale = $this->locales[0];
}
}
if($locale)
{
$this->so->delete_locale($locale);
}
$this->ui = CreateObject('calendar.uiholiday');
$this->ui->admin();
}
function accept_holiday()
{
global $HTTP_REFERER;
global $name, $day, $month, $occurence, $dow, $observance;
$send_back_to = str_replace('submitlocale','holiday_admin',$HTTP_REFERER);
if(!@$this->locales[0])
{
Header('Location: '.$send_back_to);
}
$send_back_to = str_replace('&locale='.$this->locales[0],'',$send_back_to);
$file = './holidays.'.$this->locales[0];
if(!file_exists($file) && count($name))
{
$c_holidays = count($name);
$fp = fopen($file,'w');
for($i=0;$i<$c_holidays;$i++)
{
fwrite($fp,$this->locales[0]."\t".$name[$i]."\t".$day[$i]."\t".$month[$i]."\t".$occurence[$i]."\t".$dow[$i]."\t".$observance[$i]."\n");
}
fclose($fp);
}
Header('Location: '.$send_back_to);
}
function get_holiday_list($locale='', $sort='', $order='', $query='', $total='')
{
if(!$locale)
{
$locale = $this->locales[0];
}
if(!$sort)
{
$sort = $this->sort;
}
if(!$order)
{
$order = $this->order;
}
if(!$query)
{
$query = $this->query;
}
return $this->so->read_holidays($locale,$query,$order);
}
function get_locale_list($sort='', $order='', $query='')
{
if(!$sort)
{
$sort = $this->sort;
}
if(!$order)
{
$order = $this->order;
}
if(!$query)
{
$query = $this->query;
}
return $this->so->get_locale_list($sort,$order,$query);
}
function prepare_read_holidays($year=0,$owner=0)
{
global $phpgw_info;
if($year==0)
{
$this->year = date('Y');
}
else
{
$this->year = $year;
}
if($owner == 0)
{
@ -48,8 +225,8 @@
else
{
$this->owner = $owner;
}
}
if(@$phpgw_info['user']['preferences']['common']['country'])
{
$this->locales[] = $phpgw_info['user']['preferences']['common']['country'];
@ -83,11 +260,10 @@
}
}
}
/* Begin Calendar functions */
function auto_load_holidays($locale)
{
if($this->so->count_of_holidays($locale) == 0)
if($this->so->holiday_total($locale) == 0)
{
global $phpgw_info, $HTTP_HOST, $SERVER_PORT;
@ -149,6 +325,49 @@
}
}
function save_holiday($holiday)
{
$this->so->save_holiday($holiday);
}
function add()
{
global $phpgw, $submit, $holiday, $locale;
if(@$submit)
{
if(empty($holiday['mday']))
{
$holiday['mday'] = 0;
}
if(!isset($this->bo->locales[0]) || $this->bo->locales[0]=='')
{
$this->bo->locales[0] = $holiday['locale'];
}
elseif(!isset($holiday['locale']) || $holiday['locale']=='')
{
$holiday['locale'] = $this->bo->locales[0];
}
if(!isset($holiday['hol_id']))
{
$holiday['hol_id'] = $this->bo->id;
}
// Still need to put some validation in here.....
$this->ui = CreateObject('calendar.uiholiday');
if (is_array($errors))
{
$this->ui->add($errors,$holiday);
}
else
{
$this->so->save_holiday($holiday);
$this->ui->edit_locale();
}
}
}
function sort_holidays_by_date($holidays)
{
$c_holidays = count($holidays);

View File

@ -124,9 +124,47 @@
echo "SO list_repeated_events : SQL : ".$sql."<br>\n";
}
$events = $this->get_event_ids(True,$sql);
return $this->get_event_ids(True,$sql);
}
return $events;
function list_events_keyword($keywords)
{
$this->makeobj();
$sql = 'AND (phpgw_cal_user.cal_login='.$this->owner.') ';
$words = split(' ',$keywords);
for ($i=0;$i<count($words);$i++)
{
if($i==0)
{
$sql .= ' AND (';
}
if($i>0)
{
$sql .= ' OR ';
}
$sql .= "(UPPER(phpgw_cal.title) LIKE UPPER('%".$words[$i]."%') OR "
. "UPPER(phpgw_cal.description) LIKE UPPER('%".$words[$i]."%'))";
if($i==count($words) - 1)
{
$sql .= ') ';
}
}
if(strpos($this->filter,'private'))
{
$sql .= 'AND phpgw_cal.is_public=0 ';
}
if($this->cat_id)
{
$sql .= 'AND phpgw_cal.category = '.$this->cat_id.' ';
}
$sql .= 'ORDER BY phpgw_cal.datetime ASC, phpgw_cal.edatetime ASC, phpgw_cal.priority ASC';
return $this->get_event_ids(False,$sql);
}
function read_from_store($startYear,$startMonth,$startDay,$endYear='',$endMonth='',$endDay='')

View File

@ -14,6 +14,7 @@
class soholiday
{
var $debug = False;
var $db;
function soholiday()
@ -26,21 +27,50 @@
/* Begin Holiday functions */
function save_holiday($holiday)
{
if(isset($holiday['hol_id']) && $holiday['hol_id'])
if(@$holiday['hol_id'])
{
// echo "Updating LOCALE='".$holiday['locale']."' NAME='".$holiday['name']."' extra=(".$holiday['mday'].'/'.$holiday['month_num'].'/'.$holiday['occurence'].'/'.$holiday['dow'].'/'.$holiday['observance_rule'].")<br>\n";
if($this->debug)
{
echo "Updating LOCALE='".$holiday['locale']."' NAME='".$holiday['name']."' extra=(".$holiday['mday'].'/'.$holiday['month_num'].'/'.$holiday['occurence'].'/'.$holiday['dow'].'/'.$holiday['observance_rule'].")<br>\n";
}
$sql = "UPDATE phpgw_cal_holidays SET name='".$holiday['name']."', mday=".$holiday['mday'].', month_num='.$holiday['month_num'].', occurence='.$holiday['occurence'].', dow='.$holiday['dow'].', observance_rule='.intval($holiday['observance_rule']).' WHERE hol_id='.$holiday['hol_id'];
}
else
{
// echo "Inserting LOCALE='".$holiday['locale']."' NAME='".$holiday['name']."' extra=(".$holiday['mday'].'/'.$holiday['month_num'].'/'.$holiday['occurence'].'/'.$holiday['dow'].'/'.$holiday['observance_rule'].")<br>\n";
if($this->debug)
{
echo "Inserting LOCALE='".$holiday['locale']."' NAME='".$holiday['name']."' extra=(".$holiday['mday'].'/'.$holiday['month_num'].'/'.$holiday['occurence'].'/'.$holiday['dow'].'/'.$holiday['observance_rule'].")<br>\n";
}
$sql = 'INSERT INTO phpgw_cal_holidays(locale,name,mday,month_num,occurence,dow,observance_rule) '
. "VALUES('".strtoupper($holiday['locale'])."','".$holiday['name']."',".$holiday['mday'].','.$holiday['month_num'].','.$holiday['occurence'].','.$holiday['dow'].','.intval($holiday['observance_rule']).")";
}
$this->db->query($sql,__LINE__,__FILE__);
}
function read_holidays($locales='')
function store_to_array(&$holidays)
{
global $phpgw;
while($this->db->next_record())
{
$holidays[] = Array(
'index' => $this->db->f('hol_id'),
'locale' => $this->db->f('locale'),
'name' => $phpgw->strip_html($this->db->f('name')),
'day' => intval($this->db->f('mday')),
'month' => intval($this->db->f('month_num')),
'occurence' => intval($this->db->f('occurence')),
'dow' => intval($this->db->f('dow')),
'observance_rule' => $this->db->f('observance_rule')
);
if($this->debug)
{
echo "Holiday ID: ".$this->db->f("hol_id")."<br>\n";
}
}
}
function read_holidays($locales='',$query='',$order='')
{
global $phpgw;
@ -50,7 +80,46 @@
{
return $holidays;
}
$sql = $this->build_query($locales,$query,$order);
if($this->debug)
{
echo "Read Holidays : ".$sql."<br>\n";
}
$this->db->query($sql,__LINE__,__FILE__);
$this->store_to_array($holidays);
return $holidays;
}
function read_holiday($id)
{
$holidays = Array();
if($this->debug)
{
echo "Reading Holiday ID : ".$id."<br>\n";
}
$this->db->query('SELECT * FROM phpgw_cal_holidays WHERE hol_id='.$id,__LINE__,__FILE__);
$this->store_to_array($holidays);
@reset($holidays);
return $holidays[0];
}
function delete_holiday($id)
{
$this->db->query('DELETE FROM phpgw_cal_holidays WHERE hol_id='.$id,__LINE__,__FILE__);
}
function delete_locale($locale)
{
$this->db->query("DELETE FROM phpgw_cal_holidays WHERE locale='".$locale."'",__LINE__,__FILE__);
}
/* Private functions */
function build_query($locales,$query='',$order='')
{
if(is_string($locales))
{
$find = "'".$locales."'";
@ -68,32 +137,62 @@
}
}
$sql = 'SELECT * FROM phpgw_cal_holidays WHERE locale in ('.$find.')';
$this->db->query($sql,__LINE__,__FILE__);
while($this->db->next_record())
$querymethod = '';
if($query)
{
$holidays[] = Array(
'index' => $this->db->f('hol_id'),
'locale' => $this->db->f('locale'),
'name' => $phpgw->strip_html($this->db->f('name')),
'day' => intval($this->db->f('mday')),
'month' => intval($this->db->f('month_num')),
'occurence' => intval($this->db->f('occurence')),
'dow' => intval($this->db->f('dow')),
'observance_rule' => $this->db->f('observance_rule')
);
$querymethod = " AND name like '%".$query."%'";
}
return $holidays;
if($order)
{
$querymethod .= ' ORDER BY '.$order;
}
return 'SELECT * FROM phpgw_cal_holidays WHERE locale in ('.$find.')'.$querymethod;
}
/* Private functions */
function count_of_holidays($locale)
function get_locale_list($sort='', $order='', $query='')
{
$sql = "SELECT count(*) FROM phpgw_cal_holidays WHERE locale='".$locale."'";
$querymethod = '';
if($query)
{
$querymethod .= " WHERE locale like '%".$query."%'";
}
if($order)
{
$querymethod .= ' ORDER BY '.$order;
}
$this->db->query("SELECT DISTINCT locale FROM phpgw_cal_holidays".$querymethod,__LINE__,__FILE__);
while($this->db->next_record())
{
$locale[] = $this->db->f('locale');
}
return $locale;
}
function holiday_total($locale,$query='')
{
$querymethod='';
if($query)
{
$querymethod = " AND name like '%".$query."%'";
}
$sql = "SELECT count(*) FROM phpgw_cal_holidays WHERE locale='".$locale."'".$querymethod;
if($this->debug)
{
echo "HOLIDAY_TOTAL : ".$sql."<br>\n";
}
$this->db->query($sql,__LINE__,__FILE__);
$this->db->next_record();
return $this->db->f(0);
$retval = intval($this->db->f(0));
if($this->debug)
{
echo 'Total Holidays for : '.$locale.' : '.$retval."<br>\n";
}
return $retval;
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,559 @@
<?php
/**************************************************************************\
* phpGroupWare - Calendar *
* http://www.phpgroupware.org *
* Based on Webcalendar by Craig Knudsen <cknudsen@radix.net> *
* http://www.radix.net/~cknudsen *
* Modified by Mark Peters <skeeter@phpgroupware.org> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
class uiholiday
{
var $debug = False;
var $base_url;
var $bo;
var $template_dir;
var $holidays;
var $cat_id;
var $public_functions = array(
'admin' => True,
'edit_locale' => True,
'edit_holiday' => True,
'add_holiday' => True,
'delete_holiday' => True,
'delete_locale' => True
);
function uiholiday()
{
global $phpgw, $phpgw_info;
$phpgw->nextmatchs = CreateObject('phpgwapi.nextmatchs');
$this->bo = CreateObject('calendar.boholiday');
$this->base_url = $this->bo->base_url;
$this->template_dir = $phpgw->common->get_tpl_dir('calendar');
}
function admin()
{
global $phpgw, $phpgw_info;
unset($phpgw_info['flags']['noheader']);
unset($phpgw_info['flags']['nonavbar']);
$phpgw_info['flags']['noappfooter'] = True;
$phpgw->common->phpgw_header();
$p = CreateObject('phpgwapi.Template',$this->template_dir);
$p->set_file(Array('locales'=>'locales.tpl'));
$p->set_block('locales','list','list');
$p->set_block('locales','row','row');
$p->set_block('locales','row_empty','row_empty');
$p->set_block('locales','submit_column','submit_column');
$var = Array(
'th_bg' => $phpgw_info['theme']['th_bg'],
'left_next_matchs' => $phpgw->nextmatchs->left('/calendar/'.basename($SCRIPT_FILENAME),$this->bo->start,$this->bo->total),
'right_next_matchs' => $phpgw->nextmatchs->right('/calendar/'.basename($SCRIPT_FILENAME),$this->bo->start,$this->bo->total),
'lang_groups' => lang('Countries'),
'sort_name' => $phpgw->nextmatchs->show_sort_order($this->bo->sort,'locale',$this->bo->order,'/calendar/'.basename($SCRIPT_FILENAME),lang('Country')),
'header_edit' => lang('Edit'),
'header_delete' => lang('Delete'),
'submit_extra' => '',
'submit_link' => lang('Submit to Repository'),
'back_button' => ''
);
$p->set_var($var);
$p->parse('header_submit','submit_column',False);
$locales = $this->bo->get_locale_list($this->bo->sort, $this->bo->order, $this->bo->query, $this->bo->total);
@reset($locales);
if (!$locales)
{
$p->set_var('message',lang('No matchs found'));
$p->parse('rows','row_empty',True);
}
else
{
$p->set_var('submit_extra',' width="5%"');
while (list(,$value) = each($locales))
{
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
if (! $value) $value = '&nbsp;';
$var = Array(
'tr_color' => $tr_color,
'group_name' => $value,
'edit_link' => '<a href="'.$phpgw->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.edit_locale','locale'=>$value)) . '"> '.lang('Edit').' </a>',
'delete_link' => '<a href="'.$phpgw->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.delete_locale','locale'=>$value)).'"> '.lang('Delete').' </a>',
'submit_link' => '<a href="'.$phpgw->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.submit','locale'=>$value)).'"> '.lang('Submit').' </a>'
);
$p->set_var($var);
$p->parse('submit_link_column','submit_column',False);
$p->parse('rows','row',True);
}
}
$var = Array(
'new_action' => $phpgw->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.add_holiday','id'=>0)),
'lang_add' => lang('add'),
'search_action' => $phpgw->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.admin')),
'lang_search' => lang('search')
);
$p->set_var($var);
$p->pparse('out','list');
}
function edit_locale()
{
global $phpgw, $phpgw_info;
if(!$this->bo->total && !isset($this->bo->query))
{
$link_params = Array(
'menuaction' => 'calendar.uiholiday.admin'
);
Header('Location: ' . $phpgw->link($this->base_url,$link_params));
}
unset($phpgw_info['flags']['noheader']);
unset($phpgw_info['flags']['nonavbar']);
$phpgw_info['flags']['noappfooter'] = True;
$phpgw->common->phpgw_header();
$p = CreateObject('phpgwapi.Template',$this->template_dir);
$p->set_file(Array('locale'=>'locales.tpl'));
$p->set_block('locale','list','list');
$p->set_block('locale','row','row');
$p->set_block('locale','row_empty','row_empty');
$p->set_block('locale','back_button_form','back_button_form');
$var = Array(
'th_bg' => $phpgw_info['theme']['th_bg'],
'left_next_matchs' => $phpgw->nextmatchs->left('/calendar/'.basename($SCRIPT_FILENAME),$this->bo->start,$this->bo->total,'&locale='.$this->bo->locales[0]),
'right_next_matchs' => $phpgw->nextmatchs->right('/calendar/'.basename($SCRIPT_FILENAME),$this->bo->start,$this->bo->total,'&locale='.$this->bo->locales[0]),
'lang_groups' => lang('Holidays').' ('.$this->bo->locales[0].')',
'sort_name' => $phpgw->nextmatchs->show_sort_order($this->bo->sort,'name',$this->bo->order,'/calendar/'.basename($SCRIPT_FILENAME),lang('Holiday'),'&locale='.$this->bo->locales[0]),
'header_edit' => lang('Edit'),
'header_delete' => lang('Delete'),
'header_submit' => '',
'submit_link_column' => ''
);
$p->set_var($var);
$holidays = $this->bo->get_holiday_list();
if (!count($holidays))
{
$p->set_var('message',lang('No matchs found'));
$p->parse('rows','row_empty',True);
}
else
{
for($i=0;$i<count($holidays);$i++)
{
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
if (!$holidays[$i]['name'])
{
$holidays[$i]['name'] = '&nbsp;';
}
$var = Array(
'tr_color' => $tr_color,
'header_delete'=> lang('Delete'),
'group_name' => $holidays[$i]['name'],
'edit_link' => '<a href="'.$phpgw->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.edit_holiday','locale'=>$this->bo->locales[0],'id'=>$holidays[$i]['index'])).'"> '.lang('Edit').' </a>',
'delete_link' => '<a href="'.$phpgw->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.delete_holiday','locale'=>$this->bo->locales[0],'id'=>$holidays[$i]['index'])).'"> '.lang('Delete').' </a>'
);
$p->set_var($var);
$p->parse('rows','row',True);
}
}
$var = Array(
'new_action' => $phpgw->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.add_holiday','locale'=>$this->bo->locales[0],'id'=>0)),
'lang_add' => lang('add'),
'back_action' => $phpgw->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.admin')),
'lang_back' => lang('Back'),
'search_action'=> $phpgw->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.edit_locale','locale'=>$this->bo->locales[0])),
'lang_search' => lang('search')
);
$p->set_var($var);
$p->parse('back_button','back_button_form',False);
$p->pparse('out','list');
}
function edit_holiday()
{
global $phpgw, $phpgw_info;
if(@$this->bo->id)
{
$holiday = $this->bo->read_entry($this->bo->id);
}
if(!$holiday || !@$this->bo->id)
{
Header('Location: ' . $phpgw->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.edit_locale','locale'=>$this->bo->locales[0])));
}
unset($phpgw_info['flags']['noheader']);
unset($phpgw_info['flags']['nonavbar']);
$phpgw_info['flags']['noappfooter'] = True;
$phpgw->common->phpgw_header();
$sb = CreateObject('phpgwapi.sbox');
$t = CreateObject('phpgwapi.Template',$this->template_dir);
$t->set_file(Array('holiday'=>'holiday.tpl','form_button'=>'form_button_script.tpl'));
$t->set_block('holiday','form','form');
$t->set_block('holiday','list','list');
if (@$errorcount)
{
$message = $phpgw->common->error_list($error);
}
else
{
$message = '';
}
$var = Array(
'title_holiday'=> lang('Edit').' '.lang('Holiday'),
'message' => $message,
'actionurl' => $phpgw->link($this->base_url,'menuaction=calendar.boholiday.add'),
'hidden_vars' => '<input type="hidden" name="holiday[hol_id]" value="'.$this->bo->id.'">'."\n"
. '<input type="hidden" name="holiday[locales]" value="'.$this->bo->locales[0].'">'."\n"
);
$t->set_var($var);
// Locale
$this->display_item($t,lang('Country'),'<input name="holiday[locale]" size="2" maxlength="2" value="'.$holiday[locale].'">');
// Title/Name
$this->display_item($t,lang('title'),'<input name="holiday[name]" size="25" maxlength="50" value="'.$holiday['name'].'">');
// Date
$this->display_item($t,lang('Date'),$phpgw->common->dateformatorder('',$sb->getMonthText('holiday[month_num]',$holiday['month']),$sb->getDays('holiday[mday]',$holiday['day'])));
// Occurence
$occur = Array(
0 => '0',
1 => '1st',
2 => '2nd',
3 => '3rd',
4 => '4th',
5 => '5th',
99 => 'Last'
);
$out = '';
while(list($key,$value) = each($occur))
{
$out .= '<option value="'.$key.'"'.($holiday['occurence']==$key?' selected':'').'>'.$value.'</option>'."\n";
}
$occurence_html = '<select name="holiday[occurence]">'."\n".$out.'</select>'."\n";
$dow = Array(
0 => lang('Sun'),
1 => lang('Mon'),
2 => lang('Tue'),
3 => lang('Wed'),
4 => lang('Thu'),
5 => lang('Fri'),
6 => lang('Sat')
);
$out = '';
for($i=0;$i<7;$i++)
{
$out .= '<option value="'.$i.'"'.($holiday['dow']==$i?' selected':'').'>'.$dow[$i].'</option>'."\n";
}
$dow_html = '<select name="holiday[dow]">'."\n".$out.'</select>'."\n";
$this->display_item($t,lang('Occurence'),$occurence_html.'&nbsp;'.$dow_html);
$this->display_item($t,lang('Observance Rule'),'<input type="checkbox" name="holiday[observance_rule]" value="True"'.($holiday['observance_rule']?' checked':'').'>');
$t->set_var('lang_add',lang('Save'));
$t->set_var('lang_reset',lang('Reset'));
if(@$this->bo->locales[0])
{
$link_params = Array(
'menuaction' => 'calendar.uiholiday.edit_locale',
'locale' => $this->bo->locales[0]
);
}
else
{
$link_params = Array(
'menuaction' => 'calendar.uiholiday.admin'
);
}
$var = Array(
'action_url_button' => $phpgw->link($this->base_url,$link_params),
'action_text_button' => lang('Cancel'),
'action_confirm_button' => '',
'action_extra_field' => ''
);
$t->set_var($var);
$t->parse('cancel_button','form_button');
$t->pparse('out','form');
}
function add_holiday($messages='',$holiday='')
{
global $phpgw, $phpgw_info;
unset($phpgw_info['flags']['noheader']);
unset($phpgw_info['flags']['nonavbar']);
$phpgw_info['flags']['noappfooter'] = True;
$phpgw->common->phpgw_header();
$sb = CreateObject('phpgwapi.sbox');
$t = CreateObject('phpgwapi.Template',$this->template_dir);
$t->set_file(Array('holiday'=>'holiday.tpl','form_button'=>'form_button_script.tpl'));
$t->set_block('holiday','form','form');
$t->set_block('holiday','list','list');
if($messages)
{
if (is_array($messages))
{
$message = $phpgw->common->error_list($messages);
}
else
{
$message = '';
}
}
$var = Array(
'title_holiday' => lang('Add').' '.lang('Holiday'),
'message' => $message,
'actionurl' => $phpgw->link($this->base_url,'menuaction=calendar.boholiday.add'),
'hidden_vars' => '<input type="hidden" name="locale" value="'.$this->bo->locales[0].'">'."\n"
. '<input type="hidden" name="id" value="'.$this->bo->id.'">'."\n"
. '<input type="hidden" name="holiday[hol_id]" value="'.$this->bo->id.'">'."\n"
. '<input type="hidden" name="holiday[locales]" value="'.$this->bo->locales[0].'">'."\n"
);
$t->set_var($var);
// Locale
if($this->bo->locales[0])
{
$holiday['locale'] = $this->bo->locales[0];
}
$this->display_item($t,lang('Country'),'<input name="holiday[locale]" size="2" maxlength="2" value="'.$holiday[locale].'">');
// Title/Name
$this->display_item($t,lang('title'),'<input name="holiday[name]" size="25" maxlength="50" value="'.$holiday['name'].'">');
// Date
$day_html = $sb->getDays('holiday[mday]',$holiday['day']);
$month_html = $sb->getMonthText('holiday[month_num]',$holiday['month']);
$year_html = '';
$this->display_item($t,lang('Date'),$phpgw->common->dateformatorder($year_html,$month_html,$day_html));
// Occurence
$occur = Array(
0 => '0',
1 => '1st',
2 => '2nd',
3 => '3rd',
4 => '4th',
5 => '5th',
99 => 'Last'
);
$out = '';
while(list($key,$value) = each($occur))
{
$out .= '<option value="'.$key.'"'.($holiday['occurence']==$key?' selected':'').'>'.$value.'</option>'."\n";
}
$occurence_html = '<select name="holiday[occurence]">'."\n".$out.'</select>'."\n";
$dow = Array(
0 => lang('Sun'),
1 => lang('Mon'),
2 => lang('Tue'),
3 => lang('Wed'),
4 => lang('Thu'),
5 => lang('Fri'),
6 => lang('Sat')
);
$out = '';
for($i=0;$i<7;$i++)
{
$out .= '<option value="'.$i.'"'.($holiday['dow']==$i?' selected':'').'>'.$dow[$i].'</option>'."\n";
}
$dow_html = '<select name="holiday[dow]">'."\n".$out.'</select>'."\n";
$this->display_item($t,lang('Occurence'),$occurence_html.'&nbsp;'.$dow_html);
$this->display_item($t,lang('Observance Rule'),'<input type="checkbox" name="holiday[observance_rule]" value="True"'.($holiday['observance_rule']?' checked':'').'>');
$t->set_var('lang_add',lang('Save'));
$t->set_var('lang_reset',lang('Reset'));
if(@$this->bo->locales[0])
{
$link_params = Array(
'menuaction' => 'calendar.uiholiday.edit_locale',
'locale' => $this->bo->locales[0]
);
}
else
{
$link_params = Array(
'menuaction' => 'calendar.uiholiday.admin'
);
}
$var = Array(
'action_url_button' => $phpgw->link($this->base_url,$link_params),
'action_text_button' => lang('Cancel'),
'action_confirm_button' => '',
'action_extra_field' => ''
);
$t->set_var($var);
$t->parse('cancel_button','form_button');
$t->pparse('out','form');
}
function delete_locale()
{
global $phpgw, $phpgw_info;
if(!$this->bo->total)
{
$this->admin();
}
unset($phpgw_info['flags']['noheader']);
unset($phpgw_info['flags']['nonavbar']);
$phpgw_info['flags']['noappfooter'] = True;
$phpgw->common->phpgw_header();
$p = CreateObject('phpgwapi.Template',$this->template_dir);
$p->set_file(Array('form'=>'delete_common.tpl','form_button'=>'form_button_script.tpl'));
$p->set_var('messages',lang('Are you sure you want to delete this Country ?')."<br>".$this->bo->locales[0]);
$var = Array(
'action_url_button' => $phpgw->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.admin')),
'action_text_button' => lang('No'),
'action_confirm_button' => '',
'action_extra_field' => ''
);
$p->set_var($var);
$p->parse('no','form_button');
$var = Array(
'action_url_button' => $phpgw->link($this->base_url,Array('menuaction'=>'calendar.boholiday.delete_locale','locale'=>$this->bo->locales[0])),
'action_text_button' => lang('Yes'),
'action_confirm_button' => '',
'action_extra_field' => ''
);
$p->set_var($var);
$p->parse('yes','form_button');
$p->pparse('out','form');
}
function delete_holiday()
{
global $phpgw, $phpgw_info;
$holiday = $this->bo->read_entry($this->bo->id);
if(!$holiday)
{
$this->edit_locale();
}
unset($phpgw_info['flags']['noheader']);
unset($phpgw_info['flags']['nonavbar']);
$phpgw_info['flags']['noappfooter'] = True;
$phpgw->common->phpgw_header();
$p = CreateObject('phpgwapi.Template',$this->template_dir);
$p->set_file(Array('form'=>'delete_common.tpl','form_button'=>'form_button_script.tpl'));
$p->set_var('messages',lang('Are you sure you want to delete this holiday ?')."<br>".$holiday['name'].' ('.$this->bo->locales[0].')');
$var = Array(
'action_url_button' => $phpgw->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.edit_locale','locale'=>$this->bo->locales[0])),
'action_text_button' => lang('No'),
'action_confirm_button' => '',
'action_extra_field' => ''
);
$p->set_var($var);
$p->parse('no','form_button');
$var = Array(
'action_url_button' => $phpgw->link($this->base_url,Array('menuaction'=>'calendar.boholiday.delete_holiday','locale'=>$this->bo->locales[0],'id'=>$this->bo->id)),
'action_text_button' => lang('Yes'),
'action_confirm_button' => '',
'action_extra_field' => ''
);
$p->set_var($var);
$p->parse('yes','form_button');
$p->pparse('out','form');
}
function submit()
{
global $phpgw, $phpgw_info;
if(!@$this->bo->locales[0])
{
$this->admin();
}
$holidays = $this->bo->get_holiday_list();
$phpgw_info['flags']['noappheader'] = True;
$phpgw_info['flags']['noappfooter'] = True;
$phpgw_info['flags']['nofooter'] = True;
$phpgw->common->phpgw_header();
echo '<body onLoad="document.submitform.submit()">'."\n";
if($this->debug)
{
echo '<form action="'.$phpgw->link($this->base_url,'menuaction=calendar.boholiday,accept_holiday').'" method="post" name="submitform">'."\n";
}
else
{
echo '<form action="http://www.phpgroupware.org/cal/accept_holiday.php" method="post" name="submitform">'."\n";
}
$c_holidays = count($holidays);
echo '<input type="hidden" name="locale" value="'.$this->bo->locales[0].'">'."\n";
for($i=0;$i<$c_holidays;$i++)
{
echo '<input type="hidden" name="name[]" value="'.$holidays[$i]['name'].'">'."\n"
. '<input type="hidden" name="day[]" value="'.$holidays[$i]['day'].'">'."\n"
. '<input type="hidden" name="month[]" value="'.$holidays[$i]['month'].'">'."\n"
. '<input type="hidden" name="occurence[]" value="'.$holidays[$i]['occurence'].'">'."\n"
. '<input type="hidden" name="dow[]" value="'.$holidays[$i]['dow'].'">'."\n"
. '<input type="hidden" name="observance[]" value="'.$holidays[$i]['observance_rule'].'">'."\n";
}
echo "</form>\n</body>\n</head>";
}
/* private functions */
function display_item(&$p,$field,$data)
{
$var = Array(
'field' => $field,
'data' => $data
);
$p->set_var($var);
$p->parse('rows','list',True);
}
}
?>

View File

@ -58,14 +58,18 @@
$str = ' <td width="2%" align="left">'.add_image_ahref($link,'year.gif',lang('This Year')).'</td>';
add_col($tpl,$str);
$link = $this->page('planner','&date='.$today);
$str = ' <td width="2%" align="left">'.add_image_ahref($link,'planner.gif',lang('Planner')).'</td>';
add_col($tpl,$str);
$link = $this->page('matrixselect');
$str = ' <td width="2%" align="left">'.add_image_ahref($link,'view.gif',lang('Daily Matrix View')).'</td>';
add_col($tpl,$str);
$remainder = 65;
$remainder = 63;
if($this->bo->check_perms(PHPGW_ACL_PRIVATE))
{
$remainder -= 30;
$remainder -= 28;
$hidden_vars = '<input type="hidden" name="from" value="'.$menuaction.'">'."\n";
if(isset($date) && $date)
{
@ -94,7 +98,7 @@
$form_options .= ' <option value=" private "'.((!isset($this->bo->filter) || !$this->bo->filter) || $this->bo->filter==' private '?' selected':'').'>'.lang('Private Only').'</option>'."\n";
$var = Array(
'form_width' => '30',
'form_width' => '28',
'form_link' => $this->page($referrer),
'form_name' => 'filter',
'title' => lang('Filter'),
@ -175,7 +179,4 @@
$button = $tpl->fp('out','form_button');
$tpl->set_var('str','<td align="right" valign="bottom">'.$button.'</td>');
$tpl->parse('header_column','head_col',True);
echo $tpl->fp('out','head');
unset($tpl);
?>

View File

@ -0,0 +1,35 @@
<!-- BEGIN year -->
{print}
<center>
<table border="0" cellspacing="3" cellpadding="4" cols=4>
<tr>
<td align="left">
{left_link}
</td>
<td align="center">
<font face="{font}" size="+1">{year_text}</font>
</td>
<td align="right">
{right_link}
</td>
</tr>
<tr valign="top">
{row}
</tr>
</table>
</center>
<p>
<p>
{printer_friendly}
<hr>
<!-- END year -->
<!-- BEGIN month -->
<td valign="top">
{mini_month}
</td>
<!-- END month -->
<!-- BEGIN month_sep -->
</tr>
<tr valign="top">
<!-- END month_sep -->

View File

@ -58,14 +58,18 @@
$str = ' <td width="2%" align="left">'.add_image_ahref($link,'year.gif',lang('This Year')).'</td>';
add_col($tpl,$str);
$link = $this->page('planner','&date='.$today);
$str = ' <td width="2%" align="left">'.add_image_ahref($link,'planner.gif',lang('Planner')).'</td>';
add_col($tpl,$str);
$link = $this->page('matrixselect');
$str = ' <td width="2%" align="left">'.add_image_ahref($link,'view.gif',lang('Daily Matrix View')).'</td>';
add_col($tpl,$str);
$remainder = 65;
$remainder = 63;
if($this->bo->check_perms(PHPGW_ACL_PRIVATE))
{
$remainder -= 30;
$remainder -= 28;
$hidden_vars = '<input type="hidden" name="from" value="'.$menuaction.'">'."\n";
if(isset($date) && $date)
{
@ -94,7 +98,7 @@
$form_options .= ' <option value=" private "'.((!isset($this->bo->filter) || !$this->bo->filter) || $this->bo->filter==' private '?' selected':'').'>'.lang('Private Only').'</option>'."\n";
$var = Array(
'form_width' => '30',
'form_width' => '28',
'form_link' => $this->page($referrer),
'form_name' => 'filter',
'title' => lang('Filter'),

View File

@ -58,14 +58,18 @@
$str = ' <td width="2%" align="left">'.add_image_ahref($link,'year.gif',lang('This Year')).'</td>';
add_col($tpl,$str);
$link = $this->page('planner','&date='.$today);
$str = ' <td width="2%" align="left">'.add_image_ahref($link,'planner.gif',lang('Planner')).'</td>';
add_col($tpl,$str);
$link = $this->page('matrixselect');
$str = ' <td width="2%" align="left">'.add_image_ahref($link,'view.gif',lang('Daily Matrix View')).'</td>';
add_col($tpl,$str);
$remainder = 65;
$remainder = 63;
if($this->bo->check_perms(PHPGW_ACL_PRIVATE))
{
$remainder -= 30;
$remainder -= 28;
$hidden_vars = '<input type="hidden" name="from" value="'.$menuaction.'">'."\n";
if(isset($date) && $date)
{
@ -94,7 +98,7 @@
$form_options .= ' <option value=" private "'.((!isset($this->bo->filter) || !$this->bo->filter) || $this->bo->filter==' private '?' selected':'').'>'.lang('Private Only').'</option>'."\n";
$var = Array(
'form_width' => '30',
'form_width' => '28',
'form_link' => $this->page($referrer),
'form_name' => 'filter',
'title' => lang('Filter'),

View File

@ -58,14 +58,18 @@
$str = ' <td width="2%" align="left">'.add_image_ahref($link,'year.gif',lang('This Year')).'</td>';
add_col($tpl,$str);
$link = $this->page('planner','&date='.$today);
$str = ' <td width="2%" align="left">'.add_image_ahref($link,'planner.gif',lang('Planner')).'</td>';
add_col($tpl,$str);
$link = $this->page('matrixselect');
$str = ' <td width="2%" align="left">'.add_image_ahref($link,'view.gif',lang('Daily Matrix View')).'</td>';
add_col($tpl,$str);
$remainder = 65;
$remainder = 63;
if($this->bo->check_perms(PHPGW_ACL_PRIVATE))
{
$remainder -= 30;
$remainder -= 28;
$hidden_vars = '<input type="hidden" name="from" value="'.$menuaction.'">'."\n";
if(isset($date) && $date)
{
@ -94,7 +98,7 @@
$form_options .= ' <option value=" private "'.((!isset($this->bo->filter) || !$this->bo->filter) || $this->bo->filter==' private '?' selected':'').'>'.lang('Private Only').'</option>'."\n";
$var = Array(
'form_width' => '30',
'form_width' => '28',
'form_link' => $this->page($referrer),
'form_name' => 'filter',
'title' => lang('Filter'),