2000-08-18 05:24:22 +02:00
< ? php
/************************************************************************** \
* phpGroupWare - Calendar *
* http :// www . phpgroupware . org *
* Based on Webcalendar by Craig Knudsen < cknudsen @ radix . net > *
* http :// www . radix . net /~ cknudsen *
2001-01-17 13:35:43 +01:00
* Modified by Mark Peters < skeeter @ phpgroupware . org > *
2000-08-18 05:24:22 +02:00
* -------------------------------------------- *
* 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 . *
\ **************************************************************************/
2001-03-07 02:28:52 +01:00
/* $Id$ */
2000-08-18 05:24:22 +02:00
2001-04-28 23:56:24 +02:00
$phpgw_flags = array (
'currentapp' => 'calendar' ,
);
$phpgw_info [ 'flags' ] = $phpgw_flags ;
2001-02-14 03:58:46 +01:00
2001-03-07 02:28:52 +01:00
include ( '../header.inc.php' );
if ( $id < 1 )
{
echo lang ( 'Invalid entry id.' );
$phpgw -> common -> phpgw_footer ();
$phpgw -> common -> phpgw_exit ();
}
2001-03-12 04:45:30 +01:00
if ( $phpgw -> calendar -> check_perms ( PHPGW_ACL_READ ) == False )
2001-03-07 02:28:52 +01:00
{
2001-03-12 04:45:30 +01:00
echo lang ( 'You do not have permission to read this record!' );
$phpgw -> common -> phpgw_footer ();
$phpgw -> common -> phpgw_exit ();
2001-03-07 02:28:52 +01:00
}
2001-05-20 23:11:52 +02:00
$phpgw -> calendar -> open ( 'INBOX' , $owner , '' );
$event = $phpgw -> calendar -> fetch_event ( $id );
2001-03-07 02:28:52 +01:00
2001-03-12 04:45:30 +01:00
echo $phpgw -> calendar -> view_event ( $event );
2001-03-07 02:28:52 +01:00
2001-03-12 04:45:30 +01:00
$thisyear = $event -> start -> year ;
$thismonth = $event -> start -> month ;
$thisday = $event -> start -> mday ;
2001-03-07 02:28:52 +01:00
$p = CreateObject ( 'phpgwapi.Template' , $phpgw -> calendar -> template_dir );
$templates = Array (
2001-03-12 04:45:30 +01:00
'form_button' => 'form_button_script.tpl'
2001-03-07 02:28:52 +01:00
);
$p -> set_file ( $templates );
2001-03-12 04:45:30 +01:00
echo '<center>' ;
2001-03-07 02:28:52 +01:00
2001-03-13 06:03:50 +01:00
if (( $event -> owner == $owner ) && ( $phpgw -> calendar -> check_perms ( PHPGW_ACL_EDIT ) == True ))
2001-03-07 02:28:52 +01:00
{
2001-04-28 23:56:24 +02:00
$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 );
2001-03-13 06:03:50 +01:00
echo $p -> finish ( $p -> parse ( 'out' , 'form_button' ));
2001-03-07 02:28:52 +01:00
}
2001-03-12 04:45:30 +01:00
2001-03-13 06:03:50 +01:00
if (( $event -> owner == $owner ) && ( $phpgw -> calendar -> check_perms ( PHPGW_ACL_DELETE ) == True ))
2001-03-07 02:28:52 +01:00
{
2001-04-28 23:56:24 +02:00
$var = Array (
'action_url_button' => $phpgw -> link ( '/' . $phpgw_info [ 'flags' ][ 'currentapp' ] . '/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 );
2001-03-13 06:03:50 +01:00
echo $p -> finish ( $p -> parse ( 'out' , 'form_button' ));
2001-03-07 02:28:52 +01:00
}
2001-03-12 04:45:30 +01:00
echo '</center>' ;
2001-03-07 02:28:52 +01:00
$phpgw -> common -> phpgw_footer ();
2000-08-18 05:24:22 +02:00
?>