mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-27 00:09:13 +01:00
No longer needed.
This commit is contained in:
parent
8c5a988f0f
commit
bb1a0f8c8c
@ -1,36 +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$ */
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'noheader' => True,
|
||||
'nonavbar' => True
|
||||
);
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
include('../header.inc.php');
|
||||
|
||||
if($phpgw->calendar->check_perms(PHPGW_ACL_EDIT) != True)
|
||||
{
|
||||
echo '<center>You do not have permission to edit this appointment!</center>';
|
||||
$phpgw->common->footer();
|
||||
$phpgw->common->phpgw_exit();
|
||||
}
|
||||
|
||||
$phpgw->calendar->open('INBOX',$owner,'');
|
||||
|
||||
$phpgw->calendar->set_status(intval($id),$owner,intval($action));
|
||||
|
||||
Header('Location: '.$phpgw->link('/calendar/index.php','owner='.$owner));
|
||||
?>
|
@ -1,98 +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 (isset($friendly) && $friendly)
|
||||
{
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True,
|
||||
'noheader' => True,
|
||||
'nonavbar' => True,
|
||||
'noappheader' => True,
|
||||
'noappfooter' => True,
|
||||
'nofooter' => True
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True
|
||||
);
|
||||
|
||||
$friendly = 0;
|
||||
}
|
||||
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
include('../header.inc.php');
|
||||
|
||||
$view = 'day';
|
||||
|
||||
$p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar'));
|
||||
|
||||
$template = Array(
|
||||
'day_t' => 'day.tpl'
|
||||
);
|
||||
|
||||
$p->set_file($template);
|
||||
|
||||
if ($friendly == 0)
|
||||
{
|
||||
$printer = '';
|
||||
$param = 'year='.$thisyear.'&month='.$thismonth.'&day='.$thisday.'&friendly=1&filter='.$filter.'&owner='.$owner;
|
||||
$print = '<a href="'.$phpgw->link('/calendar/day.php',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>';
|
||||
$minical = $phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php');
|
||||
}
|
||||
else
|
||||
{
|
||||
$printer = '<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">';
|
||||
$print = '';
|
||||
if($phpgw_info['user']['preferences']['calendar']['display_minicals'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['display_minicals'])
|
||||
{
|
||||
$minical = $phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php');
|
||||
}
|
||||
else
|
||||
{
|
||||
$minical = '';
|
||||
}
|
||||
}
|
||||
|
||||
$now = $phpgw->calendar->datetime->makegmttime(0, 0, 0, $thismonth, $thisday, $thisyear);
|
||||
$now['raw'] += $phpgw->calendar->datetime->tz_offset;
|
||||
$m = mktime(0,0,0,$thismonth,1,$thisyear);
|
||||
|
||||
$var = Array(
|
||||
'printer_friendly' => $printer,
|
||||
'bg_text' => $phpgw_info['themem']['bg_text'],
|
||||
'daily_events' => $phpgw->calendar->print_day_at_a_glance($now),
|
||||
'small_calendar' => $minical,
|
||||
'date' => lang(date('F',$m)).' '.$thisday.', '.$thisyear,
|
||||
'username' => $phpgw->common->grab_owner_name($owner),
|
||||
'print' => $print
|
||||
);
|
||||
|
||||
$p->set_var($var);
|
||||
|
||||
$p->pparse('out','day_t');
|
||||
if(!isset($friendly) || !$friendly)
|
||||
{
|
||||
$phpgw->common->phpgw_footer();
|
||||
}
|
||||
else
|
||||
{
|
||||
$phpgw->common->phpgw_exit();
|
||||
}
|
||||
?>
|
@ -1,37 +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$ */
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'noheader' => True,
|
||||
'nonavbar' => True
|
||||
);
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
include('../header.inc.php');
|
||||
|
||||
$phpgw->calendar->open('INBOX',$owner,'');
|
||||
$event = $phpgw->calendar->fetch_event(intval($id));
|
||||
if(($id > 0) && ($event->owner == $owner) && ($phpgw->calendar->check_perms(PHPGW_ACL_DELETE) == True))
|
||||
{
|
||||
$thisyear = $event->start->year;
|
||||
$thismonth = $event->start->month;
|
||||
$thisday = $event->start->mday;
|
||||
|
||||
$phpgw->calendar->delete_event(intval($id));
|
||||
$phpgw->calendar->expunge();
|
||||
}
|
||||
|
||||
Header('Location: '.$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/index.php','year='.$thisyear.'&month='.$thismonth.'&day='.$thisday.'&owner='.$owner));
|
||||
?>
|
@ -1,70 +0,0 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare *
|
||||
* http://www.phpgroupware.org *
|
||||
* Written by Joseph Engo <jengo@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(!$id)
|
||||
{
|
||||
Header('Location: ' . $phpgw->link('/calendar/editlocale.php','locale='.$locale));
|
||||
}
|
||||
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True,
|
||||
'admin_header' => True,
|
||||
'noheader' => True,
|
||||
'nonavbar' => True,
|
||||
'noappheader' => True,
|
||||
'noappfooter' => True,
|
||||
'parent_page' => 'holiday_admin.php'
|
||||
);
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
include('../header.inc.php');
|
||||
|
||||
if(isset($yes) && $yes==True)
|
||||
{
|
||||
$phpgw->calendar->holidays->delete_holiday($id);
|
||||
Header('Location: ' . $phpgw->link('/calendar/editlocale.php','locale='.$locale));
|
||||
}
|
||||
|
||||
$phpgw->common->phpgw_header();
|
||||
echo parse_navbar();
|
||||
|
||||
$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
|
||||
$templates = Array(
|
||||
'form' => 'delete_common.tpl',
|
||||
'form_button' => 'form_button_script.tpl'
|
||||
);
|
||||
$p->set_file($templates);
|
||||
|
||||
$p->set_var('messages',lang('Are you sure you want to delete this holiday ?'));
|
||||
|
||||
$var = Array(
|
||||
'action_url_button' => $phpgw->link('/calendar/editlocale.php','locale='.$locale),
|
||||
'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('/calendar/deleteholiday.php','locale='.$locale.'&id='.$id.'&yes=true'),
|
||||
'action_text_button' => lang('Yes'),
|
||||
'action_confirm_button' => '',
|
||||
'action_extra_field' => ''
|
||||
);
|
||||
$p->set_var($var);
|
||||
$p->parse('yes','form_button');
|
||||
|
||||
$p->pparse('out','form');
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
@ -1,70 +0,0 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare *
|
||||
* http://www.phpgroupware.org *
|
||||
* Written by Joseph Engo <jengo@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(!$locale)
|
||||
{
|
||||
Header('Location: ' . $phpgw->link('/calendar/holiday_admin.php'));
|
||||
}
|
||||
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True,
|
||||
'admin_header' => True,
|
||||
'noheader' => True,
|
||||
'nonavbar' => True,
|
||||
'noappheader' => True,
|
||||
'noappfooter' => True,
|
||||
'parent_page' => 'holiday_admin.php'
|
||||
);
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
include('../header.inc.php');
|
||||
|
||||
if(isset($yes) && $yes==True)
|
||||
{
|
||||
$phpgw->calendar->holidays->delete_locale($locale);
|
||||
Header('Location: ' . $phpgw->link('/calendar/holiday_admin.php'));
|
||||
}
|
||||
|
||||
$phpgw->common->phpgw_header();
|
||||
echo parse_navbar();
|
||||
|
||||
$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
|
||||
$templates = Array(
|
||||
'form' => 'delete_common.tpl',
|
||||
'form_button' => 'form_button_script.tpl'
|
||||
);
|
||||
$p->set_file($templates);
|
||||
|
||||
$p->set_var('messages',lang('Are you sure you want to delete this ?'));
|
||||
|
||||
$var = Array(
|
||||
'action_url_button' => $phpgw->link('/calendar/holiday_admin.php'),
|
||||
'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('/calendar/deletelocale.php','locale='.$locale.'&yes=true'),
|
||||
'action_text_button' => lang('Yes'),
|
||||
'action_confirm_button' => '',
|
||||
'action_extra_field' => ''
|
||||
);
|
||||
$p->set_var($var);
|
||||
$p->parse('yes','form_button');
|
||||
|
||||
$p->pparse('out','form');
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
@ -1,408 +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$ */
|
||||
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True,
|
||||
'enable_categories_class' => True,
|
||||
'noheader' => True,
|
||||
'nonavbar' => True,
|
||||
'noappheader' => True,
|
||||
'noappfooter' => True
|
||||
);
|
||||
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
|
||||
include('../header.inc.php');
|
||||
|
||||
$sb = CreateObject('phpgwapi.sbox');
|
||||
|
||||
$cal_info = CreateObject('calendar.calendar_item');
|
||||
|
||||
function display_item(&$p,$field,$data)
|
||||
{
|
||||
$p->set_var('field',$field);
|
||||
$p->set_var('data',$data);
|
||||
$p->parse('row','list',True);
|
||||
}
|
||||
|
||||
if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12')
|
||||
{
|
||||
$hourformat = 'h';
|
||||
}
|
||||
else
|
||||
{
|
||||
$hourformat = 'H';
|
||||
}
|
||||
|
||||
if ($id > 0)
|
||||
{
|
||||
$phpgw->calendar->open('INBOX',intval($owner),'');
|
||||
$event = $phpgw->calendar->fetch_event(intval($id));
|
||||
|
||||
$can_edit = False;
|
||||
|
||||
if(($event->owner == $owner) && ($phpgw->calendar->check_perms(PHPGW_ACL_EDIT) == True))
|
||||
{
|
||||
if($event->public != True)
|
||||
{
|
||||
if($phpgw->calendar->check_perms(PHPGW_ACL_PRIVATE) == True)
|
||||
{
|
||||
$can_edit = True;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$can_edit = True;
|
||||
}
|
||||
}
|
||||
|
||||
if($can_edit == False)
|
||||
{
|
||||
header('Location: '.$phpgw->link('/calendar/view.php','id='.$id.'&owner='.$owner));
|
||||
}
|
||||
}
|
||||
elseif(isset($readsess))
|
||||
{
|
||||
$event = unserialize(str_replace('O:8:"stdClass"','O:13:"calendar_time"',serialize($phpgw->session->appsession('entry','calendar'))));
|
||||
|
||||
if($event->owner == 0)
|
||||
{
|
||||
$phpgw->calendar->add_attribute('owner',$owner);
|
||||
}
|
||||
|
||||
$can_edit = True;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($phpgw->calendar->check_perms(PHPGW_ACL_ADD) == False)
|
||||
{
|
||||
header('Location: '.$phpgw->link('/calendar/view.php','id='.$id.'&owner='.$owner));
|
||||
}
|
||||
|
||||
$phpgw->calendar->open('INBOX',intval($cal_info->owner),'');
|
||||
$phpgw->calendar->event_init();
|
||||
$phpgw->calendar->add_attribute('id',0);
|
||||
|
||||
$can_edit = True;
|
||||
|
||||
if (!isset($hour))
|
||||
{
|
||||
$thishour = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$thishour = (int)$hour;
|
||||
}
|
||||
|
||||
if (!isset($minute))
|
||||
{
|
||||
$thisminute = 00;
|
||||
}
|
||||
else
|
||||
{
|
||||
$thisminute = (int)$minute;
|
||||
}
|
||||
|
||||
$phpgw->calendar->set_start($thisyear,$thismonth,$thisday,$thishour,$thisminute,0);
|
||||
$phpgw->calendar->set_end($thisyear,$thismonth,$thisday,$thishour,$thisminute,0);
|
||||
$phpgw->calendar->set_title('');
|
||||
$phpgw->calendar->set_description('');
|
||||
$phpgw->calendar->add_attribute('priority',2);
|
||||
if($phpgw_info['user']['preferences']['calendar']['default_private'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['default_private'] == True)
|
||||
{
|
||||
$phpgw->calendar->set_class(False);
|
||||
}
|
||||
else
|
||||
{
|
||||
$phpgw->calendar->set_class(True);
|
||||
}
|
||||
|
||||
$phpgw->calendar->set_recur_none();
|
||||
$event = $phpgw->calendar->event;
|
||||
}
|
||||
|
||||
$start = mktime($event->start->hour,$event->start->min,$event->start->sec,$event->start->month,$event->start->mday,$event->start->year) - $phpgw->calendar->datetime->tz_offset;
|
||||
$end = mktime($event->end->hour,$event->end->min,$event->end->sec,$event->end->month,$event->end->mday,$event->end->year) - $phpgw->calendar->datetime->tz_offset;
|
||||
|
||||
$phpgw->common->phpgw_header();
|
||||
echo parse_navbar();
|
||||
|
||||
$p = CreateObject('phpgwapi.Template',$phpgw->calendar->template_dir);
|
||||
$templates = Array(
|
||||
'edit' => 'edit.tpl',
|
||||
'form_button' => 'form_button_script.tpl'
|
||||
);
|
||||
$p->set_file($templates);
|
||||
$p->set_block('edit','edit_entry','edit_entry');
|
||||
$p->set_block('edit','list','list');
|
||||
$p->set_block('edit','hr','hr');
|
||||
|
||||
if($id > 0)
|
||||
{
|
||||
$action = lang('Calendar - Edit');
|
||||
}
|
||||
else
|
||||
{
|
||||
$action = lang('Calendar - Add');
|
||||
}
|
||||
|
||||
if($cd)
|
||||
{
|
||||
$errormsg = $phpgw->common->check_code($cd);
|
||||
}
|
||||
else
|
||||
{
|
||||
$errormsg = '';
|
||||
}
|
||||
|
||||
$common_hidden = '<input type="hidden" name="id" value="'.$event->id.'">'."\n"
|
||||
. '<input type="hidden" name="owner" value="'.$owner.'">'."\n";
|
||||
|
||||
$vars = Array(
|
||||
'font' => $phpgw_info['theme']['font'],
|
||||
'bg_color' => $phpgw_info['theme']['bg_text'],
|
||||
'calendar_action' => $action,
|
||||
'action_url' => $phpgw->link('/calendar/edit_entry_handler.php'),
|
||||
'common_hidden' => $common_hidden,
|
||||
'errormsg' => $errormsg
|
||||
);
|
||||
|
||||
$p->set_var($vars);
|
||||
|
||||
// Brief Description
|
||||
display_item($p,lang('Title'),'<input name="title" size="25" maxlength="80" value="'.$event->title.'">');
|
||||
|
||||
// Full Description
|
||||
display_item($p,lang('Full Description'),'<textarea name="description" rows="5" cols="40" wrap="virtual" maxlength="2048">'.$event->description.'</textarea>');
|
||||
|
||||
// Display Categories
|
||||
display_item($p,lang('Category'),'<select name="category"><option value="">'.lang('Choose the category').'</option>'.$phpgw->categories->formated_list('select','all',$event->category,True).'</select>');
|
||||
|
||||
// Date
|
||||
$day_html = $sb->getDays('start[mday]',intval($phpgw->common->show_date($start,'d')));
|
||||
$month_html = $sb->getMonthText('start[month]',intval($phpgw->common->show_date($start,'n')));
|
||||
$year_html = $sb->getYears('start[year]',intval($phpgw->common->show_date($start,'Y')),intval($phpgw->common->show_date($start,'Y')));
|
||||
display_item($p,lang('Start Date'),$phpgw->common->dateformatorder($year_html,$month_html,$day_html));
|
||||
|
||||
// Time
|
||||
$amsel = ' checked'; $pmsel = '';
|
||||
if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12')
|
||||
{
|
||||
if ($event->start->hour >= 12)
|
||||
{
|
||||
$amsel = ''; $pmsel = ' checked';
|
||||
}
|
||||
}
|
||||
$str = '<input name="start[hour]" size="2" VALUE="'.$phpgw->common->show_date($start,$hourformat).'" maxlength="2">:<input name="start[min]" size="2" value="'.$phpgw->common->show_date($start,'i').'" maxlength="2">';
|
||||
if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12')
|
||||
{
|
||||
$str .= '<input type="radio" name="start[ampm]" value="am"'.$amsel.'>am';
|
||||
$str .= '<input type="radio" name="start[ampm]" value="pm"'.$pmsel.'>pm';
|
||||
}
|
||||
|
||||
display_item($p,lang('Start Time'),$str);
|
||||
|
||||
// End Date
|
||||
$day_html = $sb->getDays('end[mday]',intval($phpgw->common->show_date($end,'d')));
|
||||
$month_html = $sb->getMonthText('end[month]',intval($phpgw->common->show_date($end,'n')));
|
||||
$year_html = $sb->getYears('end[year]',intval($phpgw->common->show_date($end,'Y')),intval($phpgw->common->show_date($end,'Y')));
|
||||
display_item($p,lang('End Date'),$phpgw->common->dateformatorder($year_html,$month_html,$day_html));
|
||||
|
||||
// End Time
|
||||
$amsel = ' checked'; $pmsel = '';
|
||||
if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12')
|
||||
{
|
||||
if ($event->end->hour >= 12)
|
||||
{
|
||||
$amsel = ''; $pmsel = ' checked';
|
||||
}
|
||||
}
|
||||
|
||||
$str = '<input name="end[hour]" size="2" VALUE="'.$phpgw->common->show_date($end,$hourformat).'" maxlength="2">:<input name="end[min]" size="2" value="'.$phpgw->common->show_date($end,'i').'" maxlength="2">';
|
||||
if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12')
|
||||
{
|
||||
$str .= '<input type="radio" name="end[ampm]" value="am"'.$amsel.'>am';
|
||||
$str .= '<input type="radio" name="end[ampm]" value="pm"'.$pmsel.'>pm';
|
||||
}
|
||||
|
||||
display_item($p,lang("End Time"),$str);
|
||||
|
||||
// Priority
|
||||
display_item($p,lang('Priority'),$sb->getPriority('priority',$event->priority));
|
||||
|
||||
// Access
|
||||
$str = '<input type="checkbox" name="private" value="private"';
|
||||
if($event->public != True)
|
||||
{
|
||||
$str .= ' checked';
|
||||
}
|
||||
$str .= '>';
|
||||
display_item($p,lang('Private'),$str);
|
||||
|
||||
function build_part_list(&$users,$accounts,$owner)
|
||||
{
|
||||
global $phpgw;
|
||||
if($accounts == False)
|
||||
{
|
||||
return;
|
||||
}
|
||||
while(list($index,$id) = each($accounts))
|
||||
{
|
||||
if(intval($id) == $owner)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if(!isset($users[intval($id)]))
|
||||
{
|
||||
if($phpgw->accounts->exists(intval($id)) == True)
|
||||
{
|
||||
$users[intval($id)] = $phpgw->common->grab_owner_name(intval($id));
|
||||
}
|
||||
if($phpgw->accounts->get_type(intval($id)) == 'g')
|
||||
{
|
||||
build_part_list($users,$phpgw->acl->get_ids_for_location(intval($id),1,'phpgw_group'),$owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Participants
|
||||
$accounts = $phpgw->acl->get_ids_for_location('run',1,'calendar');
|
||||
$users = Array();
|
||||
build_part_list($users,$accounts,$owner);
|
||||
while(list($key,$status) = each($event->participants))
|
||||
{
|
||||
$parts[$key] = ' selected';
|
||||
}
|
||||
|
||||
$str = "\n".' <select name="participants[]" multiple size="5">'."\n";
|
||||
@asort($users);
|
||||
@reset($users);
|
||||
$user = Array();
|
||||
while (list($id,$name) = each($users))
|
||||
{
|
||||
if(intval($id) == intval($owner))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$str .= ' <option value="' . $id . '"'.$parts[$id].'>('.$phpgw->accounts->get_type($id).') '.$name.'</option>'."\n";
|
||||
}
|
||||
}
|
||||
$str .= ' </select>';
|
||||
display_item($p,lang('Participants'),$str);
|
||||
|
||||
// I Participate
|
||||
$str = '<input type="checkbox" name="participants[]" value="'.$owner.'"';
|
||||
if((($id > 0) && isset($event->participants[$owner])) || !isset($id))
|
||||
{
|
||||
$str .= ' checked';
|
||||
}
|
||||
$str .= '>';
|
||||
display_item($p,$phpgw->common->grab_owner_name($owner).' '.lang('Participates'),$str);
|
||||
|
||||
// Repeat Type
|
||||
$p->set_var('hr_text','<hr>');
|
||||
$p->parse('row','hr',True);
|
||||
$p->set_var('hr_text','<center><b>'.lang('Repeating Event Information').'</b></center><br>');
|
||||
$p->parse('row','hr',True);
|
||||
$str = '<select name="recur_type">';
|
||||
$rpt_type = Array(
|
||||
MCAL_RECUR_NONE,
|
||||
MCAL_RECUR_DAILY,
|
||||
MCAL_RECUR_WEEKLY,
|
||||
MCAL_RECUR_MONTHLY_WDAY,
|
||||
MCAL_RECUR_MONTHLY_MDAY,
|
||||
MCAL_RECUR_YEARLY
|
||||
);
|
||||
$rpt_type_out = Array(
|
||||
MCAL_RECUR_NONE => 'None',
|
||||
MCAL_RECUR_DAILY => 'Daily',
|
||||
MCAL_RECUR_WEEKLY => 'Weekly',
|
||||
MCAL_RECUR_MONTHLY_WDAY => 'Monthly (by day)',
|
||||
MCAL_RECUR_MONTHLY_MDAY => 'Monthly (by date)',
|
||||
MCAL_RECUR_YEARLY => 'Yearly'
|
||||
);
|
||||
for($l=0;$l<count($rpt_type);$l++)
|
||||
{
|
||||
$str .= '<option value="'.$rpt_type[$l].'"';
|
||||
if($event->recur_type == $rpt_type[$l])
|
||||
{
|
||||
$str .= ' selected';
|
||||
}
|
||||
$str .= '>'.lang($rpt_type_out[$rpt_type[$l]]).'</option>';
|
||||
}
|
||||
$str .= '</select>';
|
||||
display_item($p,lang('Repeat Type'),$str);
|
||||
|
||||
$str = '<input type="checkbox" name="rpt_use_end" value="y"';
|
||||
|
||||
if($event->recur_enddate->year != 0 && $event->recur_enddate->month != 0 && $event->recur_enddate->mday != 0)
|
||||
{
|
||||
$str .= ' checked';
|
||||
$recur_end = mktime($event->recur_enddate->hour,$event->recur_enddate->min,$event->recur_enddate->sec,$event->recur_enddate->month,$event->recur_enddate->mday,$event->recur_enddate->year) - $tz_offset;
|
||||
}
|
||||
else
|
||||
{
|
||||
$recur_end = mktime($event->start->hour,$event->start->min,$event->start->sec,$event->start->month,$event->start->mday,$event->start->year) + 86400 - $tz_offset;
|
||||
}
|
||||
|
||||
$str .= '>'.lang('Use End Date').' ';
|
||||
|
||||
$day_html = $sb->getDays('recur_enddate[mday]',intval($phpgw->common->show_date($recur_end,'d')));
|
||||
$month_html = $sb->getMonthText('recur_enddate[month]',intval($phpgw->common->show_date($recur_end,'n')));
|
||||
$year_html = $sb->getYears('recur_enddate[year]',intval($phpgw->common->show_date($recur_end,'Y')),intval($phpgw->common->show_date($recur_end,'Y')));
|
||||
$str .= $phpgw->common->dateformatorder($year_html,$month_html,$day_html);
|
||||
|
||||
display_item($p,lang('Repeat End Date'),$str);
|
||||
|
||||
$str = '<input type="checkbox" name="cal[rpt_sun]" value="'.MCAL_M_SUNDAY.'"'.(($event->recur_data & MCAL_M_SUNDAY) ?' checked':'').'> '.lang('Sunday').' ';
|
||||
$str .= '<input type="checkbox" name="cal[rpt_mon]" value="'.MCAL_M_MONDAY.'"'.(($event->recur_data & MCAL_M_MONDAY) ?' checked':'').'> '.lang('Monday').' ';
|
||||
$str .= '<input type="checkbox" name="cal[rpt_tue]" value="'.MCAL_M_TUESDAY.'"'.(($event->recur_data & MCAL_M_TUESDAY) ?' checked':'').'> '.lang('Tuesday').' ';
|
||||
$str .= '<input type="checkbox" name="cal[rpt_wed]" value="'.MCAL_M_WEDNESDAY.'"'.(($event->recur_data & MCAL_M_WEDNESDAY) ?' checked':'').'> '.lang('Wednesday').' <br>';
|
||||
$str .= '<input type="checkbox" name="cal[rpt_thu]" value="'.MCAL_M_THURSDAY.'"'.(($event->recur_data & MCAL_M_THURSDAY) ?' checked':'').'> '.lang('Thursday').' ';
|
||||
$str .= '<input type="checkbox" name="cal[rpt_fri]" value="'.MCAL_M_FRIDAY.'"'.(($event->recur_data & MCAL_M_FRIDAY) ?' checked':'').'> '.lang('Friday').' ';
|
||||
$str .= '<input type="checkbox" name="cal[rpt_sat]" value="'.MCAL_M_SATURDAY.'"'.(($event->recur_data & MCAL_M_SATURDAY) ?' checked':'').'> '.lang('Saturday').' ';
|
||||
|
||||
display_item($p,lang('Repeat Day').'<br>'.lang('(for weekly)'),$str);
|
||||
|
||||
display_item($p,lang('Frequency'),'<input name="recur_interval" size="4" maxlength="4" value="'.$event->recur_interval.'">');
|
||||
|
||||
$p->set_var('submit_button',lang('Submit'));
|
||||
|
||||
if ($id > 0)
|
||||
{
|
||||
$action_url_button = $phpgw->link('/calendar/delete.php','id='.$id);
|
||||
$action_text_button = lang('Delete');
|
||||
$action_confirm_button = "onClick=\"return confirm('".lang("Are you sure\\nyou want to \\ndelete this entry?\\n\\nThis will delete\\nthis entry for all users.")."')\"";
|
||||
$var = Array(
|
||||
'action_url_button' => $action_url_button,
|
||||
'action_text_button' => $action_text_button,
|
||||
'action_confirm_button' => $action_confirm_button,
|
||||
'action_extra_field' => ''
|
||||
);
|
||||
$p->set_var($var);
|
||||
$p->parse('delete_button','form_button');
|
||||
}
|
||||
else
|
||||
{
|
||||
$p->set_var('delete_button','');
|
||||
}
|
||||
$p->pparse('out','edit_entry');
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
@ -1,296 +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$ */
|
||||
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'noheader' => True,
|
||||
'nonavbar' => True,
|
||||
'enable_nextmatchs_class' => True,
|
||||
'enable_categories_class' => True,
|
||||
'noappheader' => True,
|
||||
'noappfooter' => True
|
||||
);
|
||||
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
include('../header.inc.php');
|
||||
|
||||
$event = CreateObject('calendar.calendar_item');
|
||||
|
||||
function validate($event)
|
||||
{
|
||||
global $phpgw;
|
||||
|
||||
$error = 0;
|
||||
// do a little form verifying
|
||||
if ($event->title == '')
|
||||
{
|
||||
$error = 40;
|
||||
}
|
||||
elseif (($phpgw->calendar->datetime->time_valid($event->start->hour,$event->start->min,0) == False) || ($phpgw->calendar->datetime->time_valid($event->end->hour,$event->end->min,0) == False))
|
||||
{
|
||||
$error = 41;
|
||||
}
|
||||
elseif (($phpgw->calendar->datetime->date_valid($event->start->year,$event->start->month,$event->start->mday) == False) || ($phpgw->calendar->datetime->date_valid($event->end->year,$event->end->month,$event->end->mday) == False) || ($phpgw->calendar->datetime->date_compare($event->start->year,$event->start->month,$event->start->mday,$event->end->year,$event->end->month,$event->end->mday) == 1))
|
||||
{
|
||||
$error = 42;
|
||||
}
|
||||
elseif ($phpgw->calendar->datetime->date_compare($event->start->year,$event->start->month,$event->start->mday,$event->end->year,$event->end->month,$event->end->mday) == 0)
|
||||
{
|
||||
if ($phpgw->calendar->datetime->time_compare($event->start->hour,$event->start->min,0,$event->end->hour,$event->end->min,0) == 1)
|
||||
{
|
||||
$error = 42;
|
||||
}
|
||||
}
|
||||
|
||||
return $error;
|
||||
}
|
||||
|
||||
if(!isset($readsess))
|
||||
{
|
||||
if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12')
|
||||
{
|
||||
if ($start[ampm] == 'pm')
|
||||
{
|
||||
if ($start[hour] <> 12)
|
||||
{
|
||||
$start[hour] += 12;
|
||||
}
|
||||
}
|
||||
elseif ($start[ampm] == 'am')
|
||||
{
|
||||
if ($start[hour] == 12)
|
||||
{
|
||||
$start[hour] -= 12;
|
||||
}
|
||||
}
|
||||
|
||||
if($start[hour] > 24)
|
||||
{
|
||||
$start[hour] -= 12;
|
||||
}
|
||||
|
||||
if ($end[ampm] == 'pm')
|
||||
{
|
||||
if ($end[hour] <> 12)
|
||||
{
|
||||
$end[hour] += 12;
|
||||
}
|
||||
}
|
||||
elseif ($end[ampm] == 'am')
|
||||
{
|
||||
if ($end[hour] == 12)
|
||||
{
|
||||
$end[hour] -= 12;
|
||||
}
|
||||
}
|
||||
|
||||
if($end[hour] > 24)
|
||||
{
|
||||
$end[hour] -= 12;
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($private))
|
||||
{
|
||||
$private = 'public';
|
||||
}
|
||||
|
||||
$is_public = ($private == 'public'?1:0);
|
||||
$phpgw->calendar->open('INBOX',intval($owner),'');
|
||||
$phpgw->calendar->event_init();
|
||||
$phpgw->calendar->set_category($category);
|
||||
$phpgw->calendar->set_title($title);
|
||||
$phpgw->calendar->set_description($description);
|
||||
$phpgw->calendar->set_start($start[year],$start[month],$start[mday],$start[hour],$start[min],0);
|
||||
$phpgw->calendar->set_end($end[year],$end[month],$end[mday],$end[hour],$end[min],0);
|
||||
$phpgw->calendar->set_class($is_public);
|
||||
|
||||
if($id != 0)
|
||||
{
|
||||
$phpgw->calendar->add_attribute('id',$id);
|
||||
}
|
||||
|
||||
if($rpt_use_end != 'y')
|
||||
{
|
||||
$recur_enddate[year] = 0;
|
||||
$recur_enddate[month] = 0;
|
||||
$recur_enddate[mday] = 0;
|
||||
}
|
||||
|
||||
$recur_data = $cal[rpt_sun] + $cal[rpt_mon] + $cal[rpt_tue] + $cal[rpt_wed] + $cal[rpt_thu] + $cal[rpt_fri] + $cal[rpt_sat];
|
||||
|
||||
switch($recur_type)
|
||||
{
|
||||
case MCAL_RECUR_NONE:
|
||||
$phpgw->calendar->set_recur_none();
|
||||
break;
|
||||
case MCAL_RECUR_DAILY:
|
||||
$phpgw->calendar->set_recur_daily($recur_enddate[year],$recur_enddate[month],$recur_enddate[mday],$recur_interval);
|
||||
break;
|
||||
case MCAL_RECUR_WEEKLY:
|
||||
$phpgw->calendar->set_recur_weekly($recur_enddate[year],$recur_enddate[month],$recur_enddate[mday],$recur_interval,$recur_data);
|
||||
break;
|
||||
case MCAL_RECUR_MONTHLY_MDAY:
|
||||
$phpgw->calendar->set_recur_monthly_mday($recur_enddate[year],$recur_enddate[month],$recur_enddate[mday],$recur_interval);
|
||||
break;
|
||||
case MCAL_RECUR_MONTHLY_WDAY:
|
||||
$phpgw->calendar->set_recur_monthly_wday($recur_enddate[year],$recur_enddate[month],$recur_enddate[mday],$recur_interval);
|
||||
break;
|
||||
case MCAL_RECUR_YEARLY:
|
||||
$phpgw->calendar->set_recur_yearly($recur_enddate[year],$recur_enddate[month],$recur_enddate[mday],$recur_interval);
|
||||
break;
|
||||
}
|
||||
|
||||
$parts = $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')
|
||||
{
|
||||
$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))
|
||||
{
|
||||
$phpgw->calendar->add_attribute('participants['.$key.']','U');
|
||||
}
|
||||
|
||||
reset($participants);
|
||||
if(!@$phpgw->calendar->event->participants[$owner])
|
||||
{
|
||||
$phpgw->calendar->add_attribute('owner',min($part));
|
||||
}
|
||||
|
||||
$phpgw->calendar->add_attribute('priority',$priority);
|
||||
$event = $phpgw->calendar->event;
|
||||
|
||||
$phpgw->session->appsession('entry','calendar',$event);
|
||||
|
||||
$datetime_check = validate($event);
|
||||
|
||||
if($datetime_check)
|
||||
{
|
||||
Header('Location: '.$phpgw->link('/calendar/edit_entry.php','readsess='.$event->id.'&cd='.$datetime_check));
|
||||
}
|
||||
|
||||
$start = mktime($event->start->hour,$event->start->min,$event->start->sec,$event->start->month,$event->start->mday,$event->start->year) - $phpgw->calendar->datetime->tz_offset;
|
||||
$end = mktime($event->end->hour,$event->end->min,$event->end->sec,$event->end->month,$event->end->mday,$event->end->year) - $phpgw->calendar->datetime->tz_offset;
|
||||
|
||||
$overlapping_events = $phpgw->calendar->overlap($start,$end,$event->participants,$event->owner,$event->id);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$phpgw->calendar->open('INBOX',intval($owner),'');
|
||||
$phpgw->calendar->event_init();
|
||||
$event = unserialize(str_replace('O:8:"stdClass"','O:13:"calendar_time"',serialize($phpgw->session->appsession('entry','calendar'))));
|
||||
$phpgw->calendar->event = $event;
|
||||
$datetime_check = validate($event);
|
||||
if($datetime_check)
|
||||
{
|
||||
Header('Location: '.$phpgw->link('/calendar/edit_entry.php','readsess='.$event->id.'&cd='.$datetime_check));
|
||||
}
|
||||
}
|
||||
|
||||
if(count($overlapping_events) > 0 && $overlapping_events != False)
|
||||
{
|
||||
$phpgw->common->phpgw_header();
|
||||
echo parse_navbar();
|
||||
|
||||
$p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar'));
|
||||
$templates = Array(
|
||||
'overlap' => 'overlap.tpl',
|
||||
'form_button' => 'form_button_script.tpl'
|
||||
);
|
||||
$p->set_file($templates);
|
||||
|
||||
$p->set_var('color',$phpgw_info['theme']['bg_text']);
|
||||
$p->set_var('overlap_title',lang('Scheduling Conflict'));
|
||||
|
||||
$phpgw->calendar->open('INBOX',intval($owner),'');
|
||||
$overlap = '';
|
||||
for($i=0;$i<count($overlapping_events);$i++)
|
||||
{
|
||||
$over = $phpgw->calendar->fetch_event($overlapping_events[$i]);
|
||||
$overlap .= '<li>'.$phpgw->calendar->link_to_entry($over,$event->start->month,$event->start->mday,$event->start->year);
|
||||
}
|
||||
if(strlen($overlap) > 0)
|
||||
{
|
||||
$var = Array(
|
||||
'overlap_text' => lang('Your suggested time of <B> x - x </B> conflicts with the following existing calendar entries:',$phpgw->common->show_date($start),$phpgw->common->show_date($end)),
|
||||
'overlap_list' => $overlap
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$var = Array(
|
||||
'overlap_text' => '',
|
||||
'overlap_list' => ''
|
||||
);
|
||||
}
|
||||
|
||||
$p->set_var($var);
|
||||
|
||||
$phpgw->calendar->event = $event;
|
||||
|
||||
$var = Array(
|
||||
'action_url_button' => $phpgw->link('/calendar/edit_entry_handler.php','readsess='.$event->id.'&year='.$event->start->year.'&month='.$event->start->month.'&day='.$event->start->mday),
|
||||
'action_text_button' => lang('Ignore Conflict'),
|
||||
'action_confirm_button' => '',
|
||||
'action_extra_field' => ''
|
||||
);
|
||||
$p->set_var($var);
|
||||
|
||||
$p->parse('resubmit_button','form_button');
|
||||
|
||||
$var = Array(
|
||||
'action_url_button' => $phpgw->link('/calendar/edit_entry.php','readsess='.$event->id.'&year='.$event->start->year.'&month='.$event->start->month.'&day='.$event->start->mday),
|
||||
'action_text_button' => lang('Re-Edit Event'),
|
||||
'action_confirm_button' => '',
|
||||
'action_extra_field' => ''
|
||||
);
|
||||
$p->set_var($var);
|
||||
|
||||
$p->parse('reedit_button','form_button');
|
||||
|
||||
$p->pparse('out','overlap');
|
||||
$phpgw_info['flags']['nofooter'] = False;
|
||||
$phpgw->common->phpgw_footer();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$phpgw->calendar->store_event();
|
||||
Header('Location: '.$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/index.php','year='.$event->start->year.'&month='.$event->start->month.'&day='.$event->start->mday.'&cd=14&owner='.$owner));
|
||||
}
|
||||
?>
|
@ -1,45 +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$ */
|
||||
$phpgw_info['flags']['currentapp'] = 'calendar';
|
||||
include('../header.inc.php');
|
||||
|
||||
$phpgw->calendar->open('INBOX',$owner,'');
|
||||
$event = $phpgw->calendar->fetch_event($id);
|
||||
|
||||
reset($event->participants);
|
||||
|
||||
if(!$event->participants[$owner])
|
||||
{
|
||||
echo '<center>The user '.$phpgw->common->grab_owner_name($owner).' is not participating in this event!</center>';
|
||||
$phpgw->common->footer();
|
||||
$phpgw->common->phpgw_exit();
|
||||
}
|
||||
|
||||
if($phpgw->calendar->check_perms(PHPGW_ACL_EDIT) == False)
|
||||
{
|
||||
echo '<center>You do not have permission to edit this appointment!</center>';
|
||||
$phpgw->common->footer();
|
||||
$phpgw->common->phpgw_exit();
|
||||
}
|
||||
|
||||
$freetime = $phpgw->calendar->datetime->localdates(mktime(0,0,0,$event->start->month,$event->start->mday,$event->start->year) - $phpgw->calendar->datetime->tz_offset);
|
||||
echo $phpgw->calendar->timematrix($freetime,$phpgw->calendar->splittime('000000',False),0,$event->participants);
|
||||
|
||||
echo $phpgw->calendar->view_event($event);
|
||||
|
||||
echo $phpgw->calendar->get_response();
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
@ -1,219 +0,0 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Admin *
|
||||
* http://www.phpgroupware.org *
|
||||
* Written by Bettina Gille [ceb@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$ */
|
||||
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True,
|
||||
'admin_header' => True,
|
||||
'noheader' => True,
|
||||
'nonavbar' => True,
|
||||
'noappheader' => True,
|
||||
'noappfooter' => True,
|
||||
'parent_page' => '/calendar/editlocale.php'
|
||||
);
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
include('../header.inc.php');
|
||||
|
||||
function display_item(&$p,$field,$data)
|
||||
{
|
||||
$p->set_var('field',$field);
|
||||
$p->set_var('data',$data);
|
||||
$p->parse('rows','list',True);
|
||||
}
|
||||
|
||||
if(isset($submit) && $submit)
|
||||
{
|
||||
if(empty($holiday['mday']))
|
||||
{
|
||||
$holiday['mday'] = 0;
|
||||
}
|
||||
if(!isset($locale) || $locale=='')
|
||||
{
|
||||
$locale = $holiday['locale'];
|
||||
}
|
||||
elseif(!isset($holiday['locale']) || $holiday['locale']=='')
|
||||
{
|
||||
$holiday['locale'] = $locale;
|
||||
}
|
||||
if(!isset($holiday['hol_id']))
|
||||
{
|
||||
$holiday['hol_id'] = $id;
|
||||
}
|
||||
|
||||
// Still need to put some validation in here.....
|
||||
|
||||
$ok = True;
|
||||
if(isset($ok) && $ok)
|
||||
{
|
||||
$phpgw->calendar->holidays->save_holiday($holiday);
|
||||
Header('Location: ' . $phpgw->link('/calendar/editlocale.php','locale='.$locale));
|
||||
}
|
||||
}
|
||||
if($id != 0)
|
||||
{
|
||||
$phpgw->calendar->holidays->users['admin'] = $locale;
|
||||
$phpgw->calendar->holidays->read_holiday();
|
||||
if(!isset($phpgw->calendar->holidays->index[$id]))
|
||||
{
|
||||
Header('Location: ' . $phpgw->link('/calendar/editlocale.php','locale='.$locale));
|
||||
}
|
||||
else
|
||||
{
|
||||
$index = $phpgw->calendar->holidays->index[$id];
|
||||
$holiday = $phpgw->calendar->holidays->get_holiday($index);
|
||||
}
|
||||
$title_descriptor = 'Edit';
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isset($locale) && $locale)
|
||||
{
|
||||
$holiday['locale'] = $locale;
|
||||
}
|
||||
$holiday['name'] = '';
|
||||
$holiday['day'] = 0;
|
||||
$holiday['month'] = 0;
|
||||
$holiday['occurence'] = 0;
|
||||
$holiday['dow'] = 0;
|
||||
$holiday['observance_rule'] = 0;
|
||||
$title_descriptor = 'Add';
|
||||
}
|
||||
|
||||
$phpgw->common->phpgw_header();
|
||||
echo parse_navbar();
|
||||
|
||||
$sb = CreateObject('phpgwapi.sbox');
|
||||
|
||||
$t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
|
||||
$templates = Array(
|
||||
'holiday' => 'holiday.tpl',
|
||||
'form_button' => 'form_button_script.tpl'
|
||||
);
|
||||
$t->set_file($templates);
|
||||
$t->set_block('holiday','form','form');
|
||||
$t->set_block('holiday','list','list');
|
||||
|
||||
$title_holiday = lang($title_descriptor).' '.lang('Holiday');
|
||||
|
||||
if ($errorcount)
|
||||
{
|
||||
$message = $phpgw->common->error_list($error);
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = '';
|
||||
}
|
||||
|
||||
$actionurl = $phpgw->link('/calendar/editholiday.php');
|
||||
$hidden_vars = '<input type="hidden" name="locale" value="'.$locale.'">'."\n"
|
||||
. '<input type="hidden" name="id" value="'.$id.'">'."\n";
|
||||
|
||||
$var = Array(
|
||||
'title_holiday' => $title_holiday,
|
||||
'message' => $message,
|
||||
'actionurl' => $actionurl,
|
||||
'hidden_vars' => $hidden_vars
|
||||
);
|
||||
|
||||
$t->set_var($var);
|
||||
|
||||
// Locale
|
||||
if(!isset($locale))
|
||||
{
|
||||
display_item($t,lang('Country'),'<input name="holiday[locale]" size="2" maxlength="2" value="">');
|
||||
}
|
||||
|
||||
// Title/Name
|
||||
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 = '';
|
||||
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 = '<select name="holiday[occurence]">'."\n";
|
||||
while(list($key,$value) = each($occur))
|
||||
{
|
||||
$out .= '<option value="'.$key.'"';
|
||||
if($holiday['occurence']==$key) $out .= ' selected';
|
||||
$out .= '>'.$value.'</option>'."\n";
|
||||
}
|
||||
$out .= '</select>'."\n";
|
||||
|
||||
$occurence_html = $out;
|
||||
|
||||
$dow = Array(
|
||||
0 => lang('Sun'),
|
||||
1 => lang('Mon'),
|
||||
2 => lang('Tue'),
|
||||
3 => lang('Wed'),
|
||||
4 => lang('Thu'),
|
||||
5 => lang('Fri'),
|
||||
6 => lang('Sat')
|
||||
);
|
||||
$out = '<select name="holiday[dow]">'."\n";
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
$out .= '<option value="'.$i.'"';
|
||||
if($holiday['dow']==$i) $out .= ' selected';
|
||||
$out .= '>'.$dow[$i].'</option>'."\n";
|
||||
}
|
||||
$out .= '</select>'."\n";
|
||||
|
||||
$dow_html = $out;
|
||||
|
||||
display_item($t,lang('Occurence'),$occurence_html.' '.$dow_html);
|
||||
|
||||
$str = '<input type="checkbox" name="holiday[observance_rule]" value="True"';
|
||||
if($holiday['observance_rule'])
|
||||
{
|
||||
$str .= ' checked';
|
||||
}
|
||||
$str .= '>';
|
||||
display_item($t,lang('Observance Rule'),$str);
|
||||
|
||||
$t->set_var('lang_add',lang('Save'));
|
||||
$t->set_var('lang_reset',lang('Reset'));
|
||||
|
||||
|
||||
if(isset($locale) && $locale)
|
||||
{
|
||||
$action_url_button = $phpgw->link('/calendar/editlocale.php','locale='.$locale);
|
||||
}
|
||||
else
|
||||
{
|
||||
$action_url_button = $phpgw->link('/calendar/holiday_admin.php');
|
||||
}
|
||||
|
||||
$var = Array(
|
||||
'action_url_button' => $action_url_button,
|
||||
'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');
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
@ -1,141 +0,0 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare *
|
||||
* http://www.phpgroupware.org *
|
||||
* Written by Joseph Engo <jengo@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$ */
|
||||
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True,
|
||||
'admin_header' => True,
|
||||
'noheader' => True,
|
||||
'nonavbar' => True,
|
||||
'noappheader' => True,
|
||||
'noappfooter' => True,
|
||||
'parent_page' => 'holiday_admin.php'
|
||||
);
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
include('../header.inc.php');
|
||||
|
||||
if(!isset($start))
|
||||
{
|
||||
$start = 0;
|
||||
}
|
||||
|
||||
function country_total($locale,$query)
|
||||
{
|
||||
global $phpgw;
|
||||
|
||||
$querymethod='';
|
||||
if($query)
|
||||
{
|
||||
$querymethod = " AND name like '%".$query."%'";
|
||||
}
|
||||
$phpgw->db->query("SELECT count(*) FROM phpgw_cal_holidays WHERE locale='".$locale."'".$querymethod,__LINE__,__FILE__);
|
||||
$phpgw->db->next_record();
|
||||
return intval($phpgw->db->f(0));
|
||||
}
|
||||
|
||||
function get_holiday_list($locale, $sort, $order, $query, $total)
|
||||
{
|
||||
global $phpgw;
|
||||
|
||||
$querymethod = '';
|
||||
|
||||
if($query)
|
||||
{
|
||||
$querymethod = " AND name like '%".$query."%'";
|
||||
}
|
||||
|
||||
if($order)
|
||||
{
|
||||
$querymethod .= ' ORDER BY '.$order;
|
||||
}
|
||||
$phpgw->db->query("SELECT hol_id,name FROM phpgw_cal_holidays WHERE locale='".$locale."'".$querymethod,__LINE__,__FILE__);
|
||||
while($phpgw->db->next_record())
|
||||
{
|
||||
$holiday[$phpgw->db->f('hol_id')] = $phpgw->strip_html($phpgw->db->f('name'));
|
||||
}
|
||||
return $holiday;
|
||||
}
|
||||
|
||||
$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
|
||||
$templates = Array(
|
||||
'locale' => 'locales.tpl'
|
||||
);
|
||||
$p->set_file($templates);
|
||||
$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');
|
||||
|
||||
$total = country_total($locale,$query);
|
||||
if(!$total && !isset($query))
|
||||
{
|
||||
Header('Location: ' . $phpgw->link('/calendar/holiday_admin.php'));
|
||||
}
|
||||
|
||||
$var = Array(
|
||||
'th_bg' => $phpgw_info['theme']['th_bg'],
|
||||
'left_next_matchs' => $phpgw->nextmatchs->left('/calendar/'.basename($SCRIPT_FILENAME),$start,$total,'&locale='.$locale),
|
||||
'right_next_matchs' => $phpgw->nextmatchs->right('/calendar/'.basename($SCRIPT_FILENAME),$start,$total,'&locale='.$locale),
|
||||
'lang_groups' => lang('Holidays').' ('.$locale.')',
|
||||
'sort_name' => $phpgw->nextmatchs->show_sort_order($sort,'name',$order,'/calendar/'.basename($SCRIPT_FILENAME),lang('Holiday'),'&locale='.$locale),
|
||||
'header_edit' => lang('Edit'),
|
||||
'header_delete' => lang('Delete'),
|
||||
'header_submit' => '',
|
||||
'submit_link_column' => ''
|
||||
);
|
||||
|
||||
$p->set_var($var);
|
||||
|
||||
$holidays = get_holiday_list($locale, $sort, $order, $query, $total);
|
||||
|
||||
if (!count($holidays))
|
||||
{
|
||||
$p->set_var('message',lang('No matchs found'));
|
||||
$p->parse('rows','row_empty',True);
|
||||
}
|
||||
else
|
||||
{
|
||||
while (list($index,$name) = each($holidays))
|
||||
{
|
||||
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
||||
if (! $name) $name = ' ';
|
||||
|
||||
$var = Array(
|
||||
'tr_color' => $tr_color,
|
||||
'header_delete' => lang('Delete'),
|
||||
'group_name' => $name,
|
||||
'edit_link' => '<a href="' . $phpgw->link('/calendar/editholiday.php','locale='.$locale.'&id='.$index) . '"> ' . lang('Edit') . ' </a>',
|
||||
'delete_link' => '<a href="' . $phpgw->link('/calendar/deleteholiday.php','locale='.$locale.'&id='.$index) . '"> ' . lang('Delete') . ' </a>'
|
||||
);
|
||||
|
||||
$p->set_var($var);
|
||||
$p->parse('rows','row',True);
|
||||
}
|
||||
}
|
||||
|
||||
$var = Array(
|
||||
'new_action' => $phpgw->link('/calendar/editholiday.php','locale='.$locale.'&id=0'),
|
||||
'lang_add' => lang('add'),
|
||||
'back_action' => $phpgw->link('/calendar/holiday_admin.php'),
|
||||
'lang_back' => lang('Back'),
|
||||
'search_action' => $phpgw->link('/calendar/editlocale.php','locale='.$locale),
|
||||
'lang_search' => lang('search')
|
||||
);
|
||||
$p->set_var($var);
|
||||
$p->parse('back_button','back_button_form',False);
|
||||
|
||||
$phpgw->common->phpgw_header();
|
||||
echo parse_navbar();
|
||||
$p->pparse('out','list');
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
@ -1,142 +0,0 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare *
|
||||
* http://www.phpgroupware.org *
|
||||
* Written by Joseph Engo <jengo@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$ */
|
||||
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True,
|
||||
'admin_header' => True,
|
||||
'noappheader' => True,
|
||||
'noappfooter' => True,
|
||||
'parent_page' => '../admin/index.php'
|
||||
);
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
include('../header.inc.php');
|
||||
|
||||
if(!isset($start))
|
||||
{
|
||||
$start = 0;
|
||||
}
|
||||
|
||||
function country_total($query)
|
||||
{
|
||||
global $phpgw;
|
||||
|
||||
$querymethod='';
|
||||
if($query)
|
||||
{
|
||||
$querymethod = " WHERE locale like '%".$query."%'";
|
||||
}
|
||||
$phpgw->db->query("SELECT DISTINCT locale FROM phpgw_cal_holidays".$querymethod,__LINE__,__FILE__);
|
||||
$count = 0;
|
||||
while($phpgw->db->next_record())
|
||||
{
|
||||
$count++;
|
||||
}
|
||||
return $count;
|
||||
}
|
||||
|
||||
function get_locale_list($sort, $order, $query, $total)
|
||||
{
|
||||
global $phpgw;
|
||||
|
||||
$querymethod = '';
|
||||
|
||||
if($query)
|
||||
{
|
||||
$querymethod .= " WHERE locale like '%".$query."%'";
|
||||
}
|
||||
|
||||
if($order)
|
||||
{
|
||||
$querymethod .= ' ORDER BY '.$order;
|
||||
}
|
||||
$phpgw->db->query("SELECT DISTINCT locale FROM phpgw_cal_holidays".$querymethod,__LINE__,__FILE__);
|
||||
while($phpgw->db->next_record())
|
||||
{
|
||||
$locale[] = $phpgw->db->f('locale');
|
||||
}
|
||||
return $locale;
|
||||
}
|
||||
|
||||
$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
|
||||
$templates = Array(
|
||||
'locales' => 'locales.tpl'
|
||||
);
|
||||
$p->set_file($templates);
|
||||
$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');
|
||||
|
||||
$total = country_total($query);
|
||||
|
||||
$var = Array(
|
||||
'th_bg' => $phpgw_info['theme']['th_bg'],
|
||||
'left_next_matchs' => $phpgw->nextmatchs->left('/calendar/'.basename($SCRIPT_FILENAME),$start,$total),
|
||||
'right_next_matchs' => $phpgw->nextmatchs->right('/calendar/'.basename($SCRIPT_FILENAME),$start,$total),
|
||||
'lang_groups' => lang('Countries'),
|
||||
'sort_name' => $phpgw->nextmatchs->show_sort_order($sort,'locale',$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 = get_locale_list($sort, $order, $query, $total);
|
||||
|
||||
if (! count($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);
|
||||
$p->set_var('tr_color',$tr_color);
|
||||
|
||||
if (! $value) $value = ' ';
|
||||
|
||||
$var = Array(
|
||||
'tr_color' => $tr_color,
|
||||
'group_name' => $value,
|
||||
'edit_link' => '<a href="' . $phpgw->link('/calendar/editlocale.php','locale='.$value) . '"> ' . lang('Edit') . ' </a>',
|
||||
'delete_link' => '<a href="' . $phpgw->link('/calendar/deletelocale.php','locale='.$value) . '"> ' . lang('Delete') . ' </a>',
|
||||
'submit_link' => '<a href="' . $phpgw->link('/calendar/submitlocale.php','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('/calendar/editholiday.php','id=0'),
|
||||
'lang_add' => lang('add'),
|
||||
'search_action' => $phpgw->link('/calendar/holiday_admin.php'),
|
||||
'lang_search' => lang('search')
|
||||
);
|
||||
|
||||
$p->set_var($var);
|
||||
$p->pparse('out','list');
|
||||
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
||||
|
@ -1,146 +0,0 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Calendar *
|
||||
* http://www.phpgroupware.org *
|
||||
* Based on Webcalendar by Craig Knudsen <cknudsen@radix.net> *
|
||||
* http://www.radix.net/~cknudsen *
|
||||
* Written 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$ */
|
||||
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True,
|
||||
);
|
||||
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
|
||||
include('../header.inc.php');
|
||||
|
||||
$datetime = mktime(0,0,0,$thismonth,$thisday,$thisyear) - $phpgw->calendar->datetime->tz_offset;
|
||||
|
||||
$sb = CreateObject('phpgwapi.sbox');
|
||||
|
||||
$p = CreateObject('phpgwapi.Template',$phpgw->calendar->template_dir);
|
||||
|
||||
$templates = Array(
|
||||
'mq' => 'matrix_query.tpl',
|
||||
'form_button' => 'form_button_script.tpl'
|
||||
);
|
||||
$p->set_file($templates);
|
||||
$p->set_block('mq','matrix_query','matrix_query');
|
||||
$p->set_block('mq','list','list');
|
||||
|
||||
$var = Array(
|
||||
'matrix_action' => lang('Daily Matrix View'),
|
||||
'action_url' => $phpgw->link('/calendar/viewmatrix.php')
|
||||
);
|
||||
|
||||
$p->set_var($var);
|
||||
|
||||
// Date
|
||||
$day_html = $sb->getDays('day',intval($phpgw->common->show_date($datetime,'d')));
|
||||
$month_html = $sb->getMonthText('month',intval($phpgw->common->show_date($datetime,'n')));
|
||||
$year_html = $sb->getYears('year',intval($phpgw->common->show_date($datetime,'Y')),intval($phpgw->common->show_date($datetime,'Y')));
|
||||
|
||||
$var = Array(
|
||||
'field' => lang('Date'),
|
||||
'data' => $phpgw->common->dateformatorder($year_html,$month_html,$day_html)
|
||||
);
|
||||
|
||||
$p->set_var($var);
|
||||
$p->parse('rows','list',True);
|
||||
|
||||
// View type
|
||||
$str = '<select name="matrixtype">';
|
||||
$str .= '<option value="free/busy" selected>'.lang('free/busy').'</option>'."\n";
|
||||
$str .= '<option value="weekly">'.lang('Weekly').'</option>'."\n";
|
||||
$str .= '</select>'."\n";
|
||||
|
||||
$var = Array(
|
||||
'field' => lang('View'),
|
||||
'data' => $str
|
||||
);
|
||||
|
||||
$p->set_var($var);
|
||||
$p->parse('rows','list',True);
|
||||
|
||||
// Participants
|
||||
$accounts = $phpgw->acl->get_ids_for_location('run',1,'calendar');
|
||||
$users = Array();
|
||||
for($i=0;$i<count($accounts);$i++)
|
||||
{
|
||||
$user = $accounts[$i];
|
||||
if(!isset($users[$user]))
|
||||
{
|
||||
$users[$user] = $phpgw->common->grab_owner_name($user);
|
||||
if($phpgw->accounts->get_type($user) == 'g')
|
||||
{
|
||||
$group_members = $phpgw->acl->get_ids_for_location($user,1,'phpgw_group');
|
||||
if($group_members != False)
|
||||
{
|
||||
for($j=0;$j<count($group_members);$j++)
|
||||
{
|
||||
if(!isset($users[$group_members[$j]]))
|
||||
{
|
||||
$users[$group_members[$j]] = $phpgw->common->grab_owner_name($group_members[$j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($num_users > 50)
|
||||
{
|
||||
$size = 15;
|
||||
}
|
||||
elseif ($num_users > 5)
|
||||
{
|
||||
$size = 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
$size = $num_users;
|
||||
}
|
||||
$str = "\n".' <select name="participants[]" multiple size="'.$size.'">'."\n";
|
||||
@asort($users);
|
||||
@reset($users);
|
||||
while ($user = each($users))
|
||||
{
|
||||
if((($phpgw->accounts->exists($user[0]) == True) && ($grants[$user[0]] && PHPGW_ACL_READ)) || ($user[0] == $owner) || $phpgw->accounts->get_type($user[0]) == 'g')
|
||||
{
|
||||
$str .= ' <option value="' . $user[0] . '">('.$phpgw->accounts->get_type($user[0]).') '.$user[1].'</option>'."\n";
|
||||
}
|
||||
}
|
||||
$str .= ' </select>';
|
||||
|
||||
$var = Array(
|
||||
'field' => lang('Participants'),
|
||||
'data' => $str
|
||||
);
|
||||
|
||||
$p->set_var($var);
|
||||
$p->parse('rows','list',True);
|
||||
|
||||
$var = Array(
|
||||
'submit_button' => lang('Submit'),
|
||||
'action_url_button' => '',
|
||||
'action_text_button' => lang('Cancel'),
|
||||
'action_confirm_button' => 'onClick="history.back(-1)"',
|
||||
'action_extra_field' => ''
|
||||
);
|
||||
|
||||
$p->set_var($var);
|
||||
$p->parse('cancel_button','form_button');
|
||||
|
||||
$p->pparse('out','matrix_query');
|
||||
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
@ -1,100 +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 (isset($friendly) && $friendly)
|
||||
{
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True,
|
||||
'noheader' => True,
|
||||
'nonavbar' => True,
|
||||
'noappheader' => True,
|
||||
'noappfooter' => True,
|
||||
'nofooter' => True
|
||||
);
|
||||
$friendly = intval($friendly);
|
||||
}
|
||||
else
|
||||
{
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True
|
||||
);
|
||||
|
||||
$friendly = 0;
|
||||
}
|
||||
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
include('../header.inc.php');
|
||||
|
||||
$view = 'month';
|
||||
|
||||
$p = CreateObject('phpgwapi.Template',$phpgw->calendar->template_dir);
|
||||
|
||||
$templates = Array(
|
||||
'index_t' => 'index.tpl'
|
||||
);
|
||||
|
||||
$p->set_file($templates);
|
||||
|
||||
$m = mktime(0,0,0,$thismonth,1,$thisyear);
|
||||
|
||||
if (intval($friendly) == 0)
|
||||
{
|
||||
$printer = '';
|
||||
$param = 'year='.$thisyear.'&month='.$thismonth.'&friendly=1&filter='.$filter.'&owner='.$owner;
|
||||
$print = '<a href="'.$phpgw->link('/calendar/month.php',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>';
|
||||
$minical_prev = $phpgw->calendar->mini_calendar(1,$thismonth - 1,$thisyear,'day.php');
|
||||
$minical_next = $phpgw->calendar->mini_calendar(1,$thismonth + 1,$thisyear,'day.php');
|
||||
}
|
||||
else
|
||||
{
|
||||
$printer = '<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">';
|
||||
$print = '';
|
||||
if($phpgw_info['user']['preferences']['calendar']['display_minicals'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['display_minicals'])
|
||||
{
|
||||
$minical_prev = $phpgw->calendar->mini_calendar(1,$thismonth - 1,$thisyear,'day.php');
|
||||
$minical_next = $phpgw->calendar->mini_calendar(1,$thismonth + 1,$thisyear,'day.php');
|
||||
}
|
||||
else
|
||||
{
|
||||
$minical_prev = '';
|
||||
$minical_next = '';
|
||||
}
|
||||
}
|
||||
|
||||
$var = Array(
|
||||
'printer_friendly' => $printer,
|
||||
'bg_text' => $phpgw_info['themem']['bg_text'],
|
||||
'small_calendar_prev' => $minical_prev,
|
||||
'month_identifier' => lang(strftime("%B",$m)) . ' ' . $thisyear,
|
||||
'username' => $phpgw->common->grab_owner_name($owner),
|
||||
'small_calendar_next' => $minical_next,
|
||||
'large_month' => $phpgw->calendar->display_large_month($thismonth,$thisyear,True,$owner),
|
||||
'print' => $print
|
||||
);
|
||||
|
||||
$p->set_var($var);
|
||||
$p->pparse('out','index_t');
|
||||
if(!isset($friendly) || $friendly == False)
|
||||
{
|
||||
$phpgw->common->phpgw_footer();
|
||||
}
|
||||
else
|
||||
{
|
||||
$phpgw->common->phpgw_exit();
|
||||
}
|
||||
?>
|
@ -1,151 +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$ */
|
||||
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True,
|
||||
'noheader' => True,
|
||||
'nonavbar' => True
|
||||
);
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
include('../header.inc.php');
|
||||
if (! $keywords)
|
||||
{
|
||||
// If we reach this, it is because they didn't search for anything,
|
||||
// attempt to send them back to where they where.
|
||||
Header('Location: ' . $phpgw->link($from,'owner='.$owner.'&month='.$month.'&day='.$day.'&year='.$year));
|
||||
}
|
||||
else
|
||||
{
|
||||
$phpgw->common->phpgw_header();
|
||||
echo parse_navbar();
|
||||
}
|
||||
|
||||
$error = '';
|
||||
|
||||
if (strlen($keywords) == 0)
|
||||
{
|
||||
echo '<b>'.lang('Error').':</b>';
|
||||
echo lang('You must enter one or more search keywords.');
|
||||
$phpgw->common->phpgw_footer();
|
||||
$phpgw->common->phpgw_exit();
|
||||
}
|
||||
|
||||
$matches = 0;
|
||||
|
||||
$phpgw->calendar->set_filter();
|
||||
|
||||
// There is currently a problem searching in with repeated events.
|
||||
// It spits back out the date it was entered. I would like to to say that
|
||||
// it is a repeated event.
|
||||
$ids = array();
|
||||
$words = split(' ',$keywords);
|
||||
for ($i=0;$i<count($words);$i++)
|
||||
{
|
||||
$sql = "AND (UPPER(phpgw_cal.title) LIKE UPPER('%".$words[$i]."%') OR "
|
||||
. " UPPER(phpgw_cal.description) LIKE UPPER('%".$words[$i]."%')) ";
|
||||
|
||||
// Private
|
||||
if(strpos($phpgw->calendar->filter,'private'))
|
||||
{
|
||||
$sql .= "AND phpgw_cal.is_public=0 ";
|
||||
}
|
||||
|
||||
$sql .= 'ORDER BY phpgw_cal.datetime ASC, phpgw_cal.edatetime ASC, phpgw_cal.priority ASC';
|
||||
|
||||
$events = $phpgw->calendar->get_event_ids(False,$sql);
|
||||
|
||||
if($events == False)
|
||||
{
|
||||
$matches = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$phpgw->calendar->open('INBOX',intval($owner),'');
|
||||
for($i=0;$i<count($events);$i++)
|
||||
{
|
||||
$event = $phpgw->calendar->fetch_event($events[$i]);
|
||||
|
||||
$datetime = mktime($event->start->hour,$event->start->min,$event->start->sec,$event->start->month,$event->start->mday,$event->start->year) - $phpgw->calendar->datetime->tz_offset;
|
||||
|
||||
$ids[strval($event->id)]++;
|
||||
$info[strval($event->id)] = $phpgw->common->show_date($datetime).$phpgw->calendar->link_to_entry($event,$event->start->month,$event->start->mday,$event->start->year);
|
||||
|
||||
}
|
||||
$matches = count($events);
|
||||
}
|
||||
}
|
||||
|
||||
if ($matches > 0)
|
||||
{
|
||||
$matches = count($ids);
|
||||
}
|
||||
|
||||
if ($matches == 1)
|
||||
{
|
||||
$quantity = lang('1 match found').'.';
|
||||
}
|
||||
elseif ($matches > 0)
|
||||
{
|
||||
$quantity = lang('x matches found',$matches).'.';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<b>'.lang('Error').':</b>';
|
||||
echo lang('no matches found.');
|
||||
$phpgw->common->phpgw_footer();
|
||||
$phpgw->common->phpgw_exit();
|
||||
}
|
||||
|
||||
$p = CreateObject('phpgwapi.Template',$phpgw->calendar->template_dir);
|
||||
$templates = Array(
|
||||
'search_form' => 'search.tpl'
|
||||
);
|
||||
$p->set_file($templates);
|
||||
$p->set_block('search_form','search','search');
|
||||
$p->set_block('search_form','search_list_header','search_list_header');
|
||||
$p->set_block('search_form','search_list','search_list');
|
||||
$p->set_block('search_form','search_list_footer','search_list_footer');
|
||||
|
||||
$var = Array(
|
||||
'color' => $phpgw_info['theme']['bg_text'],
|
||||
'search_text' => lang('Search Results'),
|
||||
'quantity' => $quantity
|
||||
);
|
||||
|
||||
$p->set_var($var);
|
||||
|
||||
if($matches > 0)
|
||||
{
|
||||
$p->parse('rows','search_list_header',True);
|
||||
}
|
||||
// now sort by number of hits
|
||||
arsort($ids);
|
||||
for(reset($ids);$key=key($ids);next($ids))
|
||||
{
|
||||
$p->set_var('result_desc',$info[$key]);
|
||||
$p->parse('rows','search_list',True);
|
||||
}
|
||||
|
||||
if($matches > 0)
|
||||
{
|
||||
$p->parse('rows','search_list_footer',True);
|
||||
}
|
||||
|
||||
$p->pparse('out','search');
|
||||
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
@ -1,89 +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$ */
|
||||
|
||||
$phpgw_flags = array(
|
||||
'currentapp' => 'calendar'
|
||||
);
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
|
||||
include('../header.inc.php');
|
||||
|
||||
if ($id < 1)
|
||||
{
|
||||
echo lang('Invalid entry id.');
|
||||
$phpgw->common->phpgw_footer();
|
||||
$phpgw->common->phpgw_exit();
|
||||
}
|
||||
|
||||
if($phpgw->calendar->check_perms(PHPGW_ACL_READ) == False)
|
||||
{
|
||||
echo lang('You do not have permission to read this record!');
|
||||
$phpgw->common->phpgw_footer();
|
||||
$phpgw->common->phpgw_exit();
|
||||
}
|
||||
|
||||
$phpgw->calendar->open('INBOX',$owner,'');
|
||||
$event = $phpgw->calendar->fetch_event(intval($id));
|
||||
|
||||
echo '<center>';
|
||||
|
||||
if(isset($event->id))
|
||||
{
|
||||
echo $phpgw->calendar->view_event($event);
|
||||
|
||||
$thisyear = $event->start->year;
|
||||
$thismonth = $event->start->month;
|
||||
$thisday = $event->start->mday;
|
||||
|
||||
$p = CreateObject('phpgwapi.Template',$phpgw->calendar->template_dir);
|
||||
|
||||
$templates = Array(
|
||||
'form_button' => 'form_button_script.tpl'
|
||||
);
|
||||
$p->set_file($templates);
|
||||
|
||||
if (($event->owner == $phpgw->calendar->owner) && ($phpgw->calendar->check_perms(PHPGW_ACL_EDIT) == True))
|
||||
{
|
||||
$var = Array(
|
||||
'action_url_button' => $phpgw->link('/calendar/edit_entry.php','id='.$id.'&owner='.$owner),
|
||||
'action_text_button' => lang('Edit'),
|
||||
'action_confirm_button' => '',
|
||||
'action_extra_field' => ''
|
||||
);
|
||||
$p->set_var($var);
|
||||
echo $p->fp('out','form_button');
|
||||
}
|
||||
|
||||
if (($event->owner == $owner) && ($phpgw->calendar->check_perms(PHPGW_ACL_DELETE) == True))
|
||||
{
|
||||
$var = Array(
|
||||
'action_url_button' => $phpgw->link('/calendar/delete.php','id='.$id.'&owner='.$owner),
|
||||
'action_text_button' => lang('Delete'),
|
||||
'action_confirm_button' => "onClick=\"return confirm('".lang("Are you sure\\nyou want to\\ndelete this entry ?\\n\\nThis will delete\\nthis entry for all users.")."')\"",
|
||||
'action_extra_field' => ''
|
||||
);
|
||||
$p->set_var($var);
|
||||
echo $p->fp('out','form_button');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo lang("Sorry, the owner has just deleted this event").'.';
|
||||
}
|
||||
echo '</center>';
|
||||
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
@ -1,94 +0,0 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Calendar *
|
||||
* http://www.phpgroupware.org *
|
||||
* Based on Webcalendar by Craig Knudsen <cknudsen@radix.net> *
|
||||
* http://www.radix.net/~cknudsen *
|
||||
* Written 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$ */
|
||||
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True,
|
||||
);
|
||||
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
|
||||
include('../header.inc.php');
|
||||
|
||||
// $date = $thisyear;
|
||||
// $date .= ($thismonth<=9?"0":"").$thismonth;
|
||||
// $date .= ($thisday<=9?"0":"").$thisday;
|
||||
|
||||
$parts = Array();
|
||||
$acct = CreateObject('phpgwapi.accounts');
|
||||
for($i=0;$i<count($participants);$i++)
|
||||
{
|
||||
switch ($phpgw->accounts->get_type($participants[$i]))
|
||||
{
|
||||
case 'g':
|
||||
$members = $acct->members(intval($participants[$i]));
|
||||
while($members != False && $member = each($members))
|
||||
{
|
||||
if(!!($grants[$member[1]['account_id']] & PHPGW_ACL_READ == True) && !isset($parts[$member[1]['account_id']]))
|
||||
{
|
||||
$parts[$member[1]['account_id']] = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'u':
|
||||
if(!!($grants[$participants[$i]] & PHPGW_ACL_READ == True) && !isset($parts[$participants[$i]]))
|
||||
{
|
||||
$parts[$participants[$i]] = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
unset($acct);
|
||||
|
||||
$participants = Array();
|
||||
reset($parts);
|
||||
while($part = each($parts))
|
||||
{
|
||||
$participants[] = $part[0];
|
||||
}
|
||||
|
||||
reset($participants);
|
||||
|
||||
switch($matrixtype)
|
||||
{
|
||||
case 'free/busy':
|
||||
$freetime = $phpgw->calendar->datetime->makegmttime(0,0,0,$thismonth,$thisday,$thisyear);
|
||||
echo $phpgw->calendar->timematrix($freetime,$phpgw->calendar->splittime('000000',False),0,$participants);
|
||||
break;
|
||||
case 'weekly':
|
||||
echo $phpgw->calendar->display_large_week($thisday,$thismonth,$thisyear,true,$participants);
|
||||
break;
|
||||
}
|
||||
echo "\n".'<center>'."\n";
|
||||
echo ' <form action="'.$phpgw->link('/calendar/viewmatrix.php').'" method="post" name="matrixform" target="viewmatrix">'."\n";
|
||||
echo ' <input type="hidden" name="year" value="'.$thisyear.'">'."\n";
|
||||
echo ' <input type="hidden" name="month" value="'.$thismonth.'">'."\n";
|
||||
echo ' <input type="hidden" name="day" value="'.$thisday.'">'."\n";
|
||||
echo ' <input type="hidden" name="matrixtype" value="'.$matrixtype.'">'."\n";
|
||||
for ($i=0;$i<count($participants);$i++)
|
||||
{
|
||||
echo ' <input type="hidden" name="participants[]" value="'.$participants[$i].'">'."\n";
|
||||
}
|
||||
if(isset($filter) && $filter)
|
||||
{
|
||||
echo ' <input type="hidden" name="filter" value="'.$filter.'">'."\n";
|
||||
}
|
||||
echo ' <input type="submit" value="'.lang('refresh').'">'."\n";
|
||||
echo ' </form>'."\n";
|
||||
echo '</center>'."\n";
|
||||
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
@ -1,126 +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 (isset($friendly) && $friendly == True)
|
||||
{
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True,
|
||||
'noheader' => True,
|
||||
'nonavbar' => True,
|
||||
'noappheader' => True,
|
||||
'noappfooter' => True,
|
||||
'nofooter' => True
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True
|
||||
);
|
||||
|
||||
$friendly = 0;
|
||||
}
|
||||
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
include('../header.inc.php');
|
||||
|
||||
$next = $phpgw->calendar->datetime->makegmttime(0,0,0,$thismonth,$thisday + 7,$thisyear);
|
||||
$prev = $phpgw->calendar->datetime->makegmttime(0,0,0,$thismonth,$thisday - 7,$thisyear);
|
||||
|
||||
$nextmonth = $phpgw->calendar->datetime->makegmttime(0,0,0,$thismonth + 1,1,$thisyear);
|
||||
$prevmonth = $phpgw->calendar->datetime->makegmttime(0,0,0,$thismonth - 1,1,$thisyear);
|
||||
|
||||
$first = $phpgw->calendar->datetime->gmtdate($phpgw->calendar->datetime->get_weekday_start($thisyear, $thismonth, $thisday));
|
||||
$last = $phpgw->calendar->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'];
|
||||
|
||||
$p = CreateObject('phpgwapi.Template',$phpgw->calendar->template_dir);
|
||||
$templates = Array(
|
||||
'week_t' => 'week.tpl'
|
||||
);
|
||||
|
||||
$p->set_file($templates);
|
||||
|
||||
if ($friendly == 0)
|
||||
{
|
||||
$printer = '';
|
||||
$prev_week_link = '<a href="'.$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/week.php','year='.$prev['year'].'&month='.$prev['month'].'&day='.$prev['day']).'"><<</a>';
|
||||
$next_week_link = '<a href="'.$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/week.php','year='.$next['year'].'&month='.$next['month'].'&day='.$next['day']).'">>></a>';
|
||||
$param = 'year='.$thisyear.'&month='.$thismonth.'&day='.$thisday.'&friendly=1&filter='.$filter.'&owner='.$owner;
|
||||
$print = '<a href="'.$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/week.php',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>';
|
||||
$minical_this = $phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php');
|
||||
$minical_prev = $phpgw->calendar->mini_calendar(1,$thismonth - 1,$thisyear,'day.php');
|
||||
$minical_next = $phpgw->calendar->mini_calendar(1,$thismonth + 1,$thisyear,'day.php');
|
||||
}
|
||||
else
|
||||
{
|
||||
$printer = '<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">';
|
||||
$prev_week_link = '<<';
|
||||
$next_week_link = '>>';
|
||||
$print = '';
|
||||
if($phpgw_info['user']['preferences']['calendar']['display_minicals'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['display_minicals'])
|
||||
{
|
||||
$minical_this = $phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php');
|
||||
$minical_prev = $phpgw->calendar->mini_calendar(1,$thismonth - 1,$thisyear,'day.php');
|
||||
$minical_next = $phpgw->calendar->mini_calendar(1,$thismonth + 1,$thisyear,'day.php');
|
||||
}
|
||||
else
|
||||
{
|
||||
$minical_this = '';
|
||||
$minical_prev = '';
|
||||
$minical_next = '';
|
||||
}
|
||||
}
|
||||
|
||||
$var = Array(
|
||||
'printer_friendly' => $printer,
|
||||
'bg_text' => $phpgw_info['themem']['bg_text'],
|
||||
'small_calendar_prev' => $minical_prev,
|
||||
'prev_week_link' => $prev_week_link,
|
||||
'small_calendar_this' => $minical_this,
|
||||
'week_identifier' => $week_id,
|
||||
'next_week_link' => $next_week_link,
|
||||
'username' => $phpgw->common->grab_owner_name($owner),
|
||||
'small_calendar_next' => $minical_next,
|
||||
'week_display' => $phpgw->calendar->display_large_week($thisday,$thismonth,$thisyear,true,$owner),
|
||||
'print' => $print
|
||||
);
|
||||
|
||||
$p->set_var($var);
|
||||
$p->pparse('out','week_t');
|
||||
if(!isset($friendly) || $friendly == False)
|
||||
{
|
||||
$phpgw->common->phpgw_footer();
|
||||
}
|
||||
else
|
||||
{
|
||||
$phpgw->common->phpgw_exit();
|
||||
}
|
||||
?>
|
@ -1,97 +0,0 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Calendar *
|
||||
* http://www.phpgroupware.org *
|
||||
* This file written by Joseph Engo <jengo@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 (isset($friendly) && $friendly)
|
||||
{
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True,
|
||||
'noheader' => True,
|
||||
'nonavbar' => True,
|
||||
'noappheader' => True,
|
||||
'noappfooter' => True,
|
||||
'nofooter' => True
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$friendly = 0;
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True
|
||||
);
|
||||
}
|
||||
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
include('../header.inc.php');
|
||||
|
||||
$view = 'year';
|
||||
|
||||
if ($friendly)
|
||||
{
|
||||
echo '<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">';
|
||||
}
|
||||
?>
|
||||
|
||||
<center>
|
||||
<table border="0" cellspacing="3" cellpadding="4" cols=4>
|
||||
<tr>
|
||||
<?php
|
||||
if (!$friendly)
|
||||
echo '<td align="left"><a href="'.$phpgw->link('/calendar/year.php','year='.($year-1)).'"><<</a>';
|
||||
?>
|
||||
</td>
|
||||
</td>
|
||||
<td align="center">
|
||||
<font face=\"".$phpgw_info["theme"][font]."\" size="+1"><?php echo $year; ?></font>
|
||||
</td>
|
||||
<?php
|
||||
if (! $friendly)
|
||||
echo '<td align="right"><a href="'.$phpgw->link('/calendar/year.php','year='.($year+1)).'">>></a>';
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<?php
|
||||
if(!$friendly) $link = 'day.php'; else $link = '';
|
||||
for($i=1;$i<13;$i++) {
|
||||
echo '<td valign="top">';
|
||||
if(!$friendly)
|
||||
echo $phpgw->calendar->mini_calendar($i,$i,$year,'day.php','none',False);
|
||||
else
|
||||
echo $phpgw->calendar->mini_calendar($i,$i,$year,'','none',False);
|
||||
echo '</td>';
|
||||
if($i % 3 == 0) echo '</tr><tr valign="top">';
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
|
||||
<?php
|
||||
if (! $friendly)
|
||||
{
|
||||
echo ' <a href="'.$phpgw->link('/calendar/year.php','friendly=1&year='.$year)
|
||||
.'" target="cal_printer_friendly" onMouseOver="window.status = '."'"
|
||||
.lang('Generate printer-friendly version')."'".'">['.lang('Printer Friendly').']</a>';
|
||||
}
|
||||
if(!isset($friendly) || $friendly == False)
|
||||
{
|
||||
$phpgw->common->phpgw_footer();
|
||||
}
|
||||
else
|
||||
{
|
||||
$phpgw->common->phpgw_exit();
|
||||
}
|
||||
?>
|
Loading…
Reference in New Issue
Block a user