forked from extern/egroupware
No longer needed.
This commit is contained in:
parent
bb1a0f8c8c
commit
950e46b5f8
@ -1,200 +0,0 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Calendar *
|
||||
* http://www.phpgroupware.org *
|
||||
* Based on Webcalendar by Craig Knudsen <cknudsen@radix.net> *
|
||||
* http://www.radix.net/~cknudsen *
|
||||
* -------------------------------------------- *
|
||||
* 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$ */
|
||||
|
||||
if (isset($friendly) && $friendly)
|
||||
{
|
||||
$phpgw->common->phpgw_footer();
|
||||
$phpgw->common->phpgw_exit();
|
||||
}
|
||||
|
||||
if(floor(phpversion()) == 4)
|
||||
{
|
||||
global $phpgw_info, $thisday, $thismonth, $thisyear;
|
||||
}
|
||||
|
||||
$p = CreateObject('phpgwapi.Template',$phpgw->calendar->template_dir);
|
||||
|
||||
$templates = Array(
|
||||
'footer' => 'footer.tpl'
|
||||
);
|
||||
|
||||
$p->set_file($templates);
|
||||
$p->set_block('footer','footer_table','footer_table');
|
||||
$p->set_block('footer','footer_row','footer_row');
|
||||
|
||||
if ($phpgw->calendar->tempyear && $phpgw->calendar->tempmonth)
|
||||
{
|
||||
$m = $phpgw->calendar->tempmonth;
|
||||
$y = $phpgw->calendar->tempyear;
|
||||
}
|
||||
else
|
||||
{
|
||||
$m = date('m');
|
||||
$y = date('Y');
|
||||
}
|
||||
|
||||
$d_time = mktime(0,0,0,$m,1,$y);
|
||||
$thisdate = date('Ymd', $d_time);
|
||||
$y--;
|
||||
|
||||
$str = '';
|
||||
|
||||
for ($i = 0; $i < 25; $i++)
|
||||
{
|
||||
$m++;
|
||||
if ($m > 12)
|
||||
{
|
||||
$m = 1;
|
||||
$y++;
|
||||
}
|
||||
$d = mktime(0,0,0,$m,1,$y);
|
||||
$str .= '<option value="' . date('Ymd', $d) . '"';
|
||||
if (date('Ymd', $d) == $thisdate)
|
||||
{
|
||||
$str .= ' selected';
|
||||
}
|
||||
$str .= '>'.lang(date('F', $d)).strftime(' %Y', $d).'</option>'."\n";
|
||||
}
|
||||
|
||||
$var = Array(
|
||||
'action_url' => $phpgw->link('/calendar/month.php','owner='.$owner),
|
||||
'form_name' => 'SelectMonth',
|
||||
'label' => lang('Month'),
|
||||
'form_label' => 'date',
|
||||
'form_onchange' => 'document.SelectMonth.submit()',
|
||||
'row' => $str,
|
||||
'go' => lang('Go!')
|
||||
);
|
||||
|
||||
$p->set_var($var);
|
||||
|
||||
$p->parse('table_row','footer_row',True);
|
||||
|
||||
$str = '';
|
||||
|
||||
if ($phpgw->calendar->tempyear)
|
||||
{
|
||||
$y = $phpgw->calendar->tempyear;
|
||||
}
|
||||
else
|
||||
{
|
||||
$y = date('Y');
|
||||
}
|
||||
if ($phpgw->calendar->tempmonth)
|
||||
{
|
||||
$m = $phpgw->calendar->tempmonth;
|
||||
}
|
||||
else
|
||||
{
|
||||
$m = date('m');
|
||||
}
|
||||
if ($phpgw->calendar->tempday)
|
||||
{
|
||||
$d = $phpgw->calendar->tempday;
|
||||
}
|
||||
else
|
||||
{
|
||||
$d = date('d');
|
||||
}
|
||||
|
||||
// if ($phpgw->calendar->tempyear && $phpgw->calendar->tempmonth)
|
||||
// {
|
||||
// $m = $phpgw->calendar->tempmonth;
|
||||
// $y = $phpgw->calendar->tempyear;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $m = date('m');
|
||||
// $y = date('Y');
|
||||
// }
|
||||
//
|
||||
// if ($thisday)
|
||||
// {
|
||||
// $d = $thisday;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $d = date ('d');
|
||||
// }
|
||||
unset($thisdate);
|
||||
|
||||
$thisdate = $phpgw->calendar->datetime->makegmttime(0,0,0,$m,$d,$y);
|
||||
$sun = $phpgw->calendar->datetime->get_weekday_start($y,$m,$d) - $phpgw->calendar->datetime->tz_offset - 7200;
|
||||
|
||||
$str = '';
|
||||
|
||||
for ($i = -7; $i <= 7; $i++)
|
||||
{
|
||||
$begin = $sun + (3600 * 24 * 7 * $i);
|
||||
$end = $begin + (3600 * 24 * 6);
|
||||
$str .= '<option value="' . $phpgw->common->show_date($begin,'Ymd') . '"';
|
||||
if ($begin <= $thisdate['raw'] && $end >= $thisdate['raw'])
|
||||
{
|
||||
$str .= ' selected';
|
||||
}
|
||||
$str .= '>' . lang($phpgw->common->show_date($begin,'F')) . ' ' . $phpgw->common->show_date($begin,'d') . '-'
|
||||
. lang($phpgw->common->show_date($end,'F')) . ' ' . $phpgw->common->show_date($end,'d') . '</option>'."\n";
|
||||
}
|
||||
|
||||
$var = Array(
|
||||
'action_url' => $phpgw->link('/calendar/week.php','owner='.$owner),
|
||||
'form_name' => 'SelectWeek',
|
||||
'label' => lang('Week'),
|
||||
'form_label' => 'date',
|
||||
'form_onchange' => 'document.SelectWeek.submit()',
|
||||
'row' => $str,
|
||||
'go' => lang('Go!')
|
||||
);
|
||||
|
||||
$p->set_var($var);
|
||||
|
||||
$p->parse('table_row','footer_row',True);
|
||||
|
||||
if ($phpgw->calendar->tempyear)
|
||||
{
|
||||
$y = $phpgw->calendar->tempyear;
|
||||
}
|
||||
else
|
||||
{
|
||||
$y = date('Y');
|
||||
}
|
||||
$str = '';
|
||||
for ($i = ($y - 3); $i < ($y + 3); $i++)
|
||||
{
|
||||
$str .= '<option value="'.$i.'"';
|
||||
if ($i == $y)
|
||||
{
|
||||
$str .= ' selected';
|
||||
}
|
||||
$str .= '>'.$i.'</option>'."\n";
|
||||
}
|
||||
|
||||
$var = Array(
|
||||
'action_url' => $phpgw->link('/calendar/year.php','owner='.$owner),
|
||||
'form_name' => 'SelectYear',
|
||||
'label' => lang('Year'),
|
||||
'form_label' => 'year',
|
||||
'form_onchange' => 'document.SelectYear.submit()',
|
||||
'row' => $str,
|
||||
'go' => lang('Go!')
|
||||
);
|
||||
|
||||
$p->set_var($var);
|
||||
|
||||
$p->parse('table_row','footer_row',True);
|
||||
|
||||
$p->pparse('out','footer_table');
|
||||
?>
|
||||
|
@ -1,117 +0,0 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare *
|
||||
* http://www.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$ */
|
||||
|
||||
if (floor(phpversion()) == 4)
|
||||
{
|
||||
global $phpgw_info, $phpgw, $grants, $owner, $rights, $filter;
|
||||
global $date, $year, $month, $day, $thisyear, $thismonth, $thisday;
|
||||
}
|
||||
|
||||
if(!isset($filter) || !$filter)
|
||||
{
|
||||
$filter = $phpgw_info['user']['preferences']['calendar']['defaultfilter'];
|
||||
}
|
||||
|
||||
// This is the initialization of the ACL usage
|
||||
|
||||
// $grants = Array();
|
||||
$grants = $phpgw->acl->get_grants('calendar');
|
||||
|
||||
if(!isset($owner))
|
||||
{
|
||||
$owner = 0;
|
||||
}
|
||||
|
||||
settype($owner,'integer');
|
||||
|
||||
if(!isset($owner) || !$owner || ($owner == $phpgw_info['user']['account_id']))
|
||||
{
|
||||
$owner = $phpgw_info['user']['account_id'];
|
||||
$rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + PHPGW_ACL_PRIVATE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($grants[$owner])
|
||||
{
|
||||
$rights = $grants[$owner];
|
||||
if ($rights == 0)
|
||||
{
|
||||
$owner = $phpgw_info['user']['account_id'];
|
||||
$rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + PHPGW_ACL_PRIVATE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$owner = $phpgw_info['user']['account_id'];
|
||||
$rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + PHPGW_ACL_PRIVATE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Load calendar class */
|
||||
$parameters = Array(
|
||||
'printer_friendly'=> ((isset($friendly) && ($friendly==1))?True:False),
|
||||
'owner' => intval($owner),
|
||||
'rights' => intval($rights)
|
||||
);
|
||||
|
||||
if(!isset($phpgw_info['user']['preferences']['calendar']['weekdaystarts']))
|
||||
{
|
||||
$phpgw->preferences->add('calendar','weekdaystarts','Sunday');
|
||||
$phpgw->preferences->save_repository();
|
||||
}
|
||||
|
||||
$phpgw->calendar = CreateObject('calendar.calendar',$parameters);
|
||||
|
||||
if (isset($date) && strlen($date) > 0)
|
||||
{
|
||||
$thisyear = intval(substr($date, 0, 4));
|
||||
$thismonth = intval(substr($date, 4, 2));
|
||||
$thisday = intval(substr($date, 6, 2));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isset($day) || !$day)
|
||||
{
|
||||
$thisday = $phpgw->calendar->today['day'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$thisday = $day;
|
||||
}
|
||||
|
||||
if (!isset($month) || !$month)
|
||||
{
|
||||
$thismonth = $phpgw->calendar->today['month'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$thismonth = $month;
|
||||
}
|
||||
|
||||
if (!isset($year) || !$year)
|
||||
{
|
||||
$thisyear = $phpgw->calendar->today['year'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$thisyear = $year;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$phpgw->calendar->tempyear = $thisyear;
|
||||
$phpgw->calendar->tempmonth = $thismonth;
|
||||
$phpgw->calendar->tempday = $thisday;
|
||||
|
||||
$phpgw->calendar->holidays->read_holiday();
|
||||
?>
|
@ -1,34 +0,0 @@
|
||||
<?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$ */
|
||||
|
||||
if (floor(phpversion()) == 4)
|
||||
{
|
||||
global $date, $year, $month, $day, $thisyear, $thismonth, $thisday, $filter, $keywords;
|
||||
global $matrixtype, $participants, $owner, $phpgw, $grants, $rights, $SCRIPT_FILENAME, $remainder, $tpl;
|
||||
}
|
||||
|
||||
$cols = 8;
|
||||
if($phpgw->calendar->check_perms(PHPGW_ACL_PRIVATE) == True)
|
||||
{
|
||||
$cols++;
|
||||
}
|
||||
|
||||
$tpl = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar'));
|
||||
$tpl->set_unknowns('remove');
|
||||
|
||||
include($phpgw->common->get_tpl_dir('calendar').'/header.inc.php');
|
||||
flush();
|
||||
?>
|
Loading…
Reference in New Issue
Block a user