From b47c0977f3b562c402828ae0239e7e4549be7e59 Mon Sep 17 00:00:00 2001 From: Pim Snel Date: Wed, 15 Jun 2005 12:14:25 +0000 Subject: [PATCH] add toolbar hook for idots2 template set add notify hook for idots2 template set add menu hook for idots2 template set --- calendar/inc/class.calendarmenu.inc.php | 60 +++++++++++++++++++ calendar/inc/class.calendernotify.inc.php | 61 +++++++++++++++++++ calendar/inc/class.toolbar.inc.php | 71 +++++++++++++++++++++++ calendar/setup/setup.inc.php | 27 +++------ 4 files changed, 201 insertions(+), 18 deletions(-) create mode 100755 calendar/inc/class.calendarmenu.inc.php create mode 100755 calendar/inc/class.calendernotify.inc.php create mode 100755 calendar/inc/class.toolbar.inc.php diff --git a/calendar/inc/class.calendarmenu.inc.php b/calendar/inc/class.calendarmenu.inc.php new file mode 100755 index 0000000000..ef6a951d61 --- /dev/null +++ b/calendar/inc/class.calendarmenu.inc.php @@ -0,0 +1,60 @@ + * + * http://www.radix.net/~cknudsen * + * Modified by Mark Peters * + * -------------------------------------------- * + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + \**************************************************************************/ + + /* $Id$ */ + + class calendarmenu + { + + + function calendarmenu() + { + $menu = Array(); + $menu['File'] = Array( + 'New Entry' => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.add'), + 'Export'=>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.export'), + 'Import'=>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uiicalendar.import') + ); + + $menu['View'] = Array( + 'Today'=>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.day'), + 'This week'=>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.week'), + 'This month'=>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.month'), + 'This year'=>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.year'), + 'Group Planner'=>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.planner'), + 'Daily Matrix'=>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.matrixselect') + ); + + $menu['Preferences'] = Array( + 'Calendar preferences'=>$GLOBALS['phpgw']->link('/preferences/preferences.php','appname=calendar'), + 'Grant Access'=>$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app=calendar'), + 'Edit Categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=calendar&cats_level=True&global_cats=True') + ); + + if ($GLOBALS['phpgw_info']['user']['apps']['admin']) { + $menu['Administration'] = Array( + 'Configuration'=>$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=calendar'), + 'Custom Fields'=>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicustom_fields.index'), + 'Holiday Management'=>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uiholiday.admin'), + 'Import CSV-File' => $GLOBALS['phpgw']->link('/calendar/csv_import.php'), + 'Global Categories' =>$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=calendar') + ); + } + + + return $menu; + } + + } +?> diff --git a/calendar/inc/class.calendernotify.inc.php b/calendar/inc/class.calendernotify.inc.php new file mode 100755 index 0000000000..7f8c344a91 --- /dev/null +++ b/calendar/inc/class.calendernotify.inc.php @@ -0,0 +1,61 @@ + * + * http://www.radix.net/~cknudsen * + * File created by Edo van Bruggen * + * -------------------------------------------- * + * 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. * + \**************************************************************************/ + + + class calendernotify + { + + + function notify() + { + $db; + $table = 'phpgw_cal'; + $owner; + $this->db = $GLOBALS['phpgw']->db; + $this->owner = $GLOBALS['phpgw_info']['user']['account_id']; + $config = CreateObject('phpgwapi.config'); + $config->read_repository(); + $GLOBALS['phpgw_info']['server']['calendar'] = $config->config_data; + unset($config); + $messages = array(); + $count = 0; + $time = time(); + $date_new = time()+ 604800; + $this->db->limit_query('SELECT * FROM `'. $table .'` WHERE cal_owner =\'' + . $this->owner.'\' ',"",__LINE__,__FILE__); + + while($this->db->next_record()) + { + if($this->db->f('cal_starttime') - $time < 604800 and $this->db->f('cal_starttime') - $time > 0) + { + $count++; + } + } + if($count > 0) + { + if($count == 1) + { + return "You have ".$count." new appointment."; + } + else + { + return "You have ".$count." new appointments."; + } + + } + return False; + + } + } +?> diff --git a/calendar/inc/class.toolbar.inc.php b/calendar/inc/class.toolbar.inc.php new file mode 100755 index 0000000000..21c127f521 --- /dev/null +++ b/calendar/inc/class.toolbar.inc.php @@ -0,0 +1,71 @@ + * + * http://www.radix.net/~cknudsen * + * Modified by Mark Peters * + * -------------------------------------------- * + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + \**************************************************************************/ + + /* $Id$ */ + + class toolbar + { + + + function toolbar() + { + $toolbar = Array(); + $toolbar['viewday'] = Array( + 'title' => "Today", + 'image' => 'today.png', + 'url'=>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.day') + ); + + $toolbar['viewweek'] = Array( + 'title' => "This week", + 'image' => 'week.png', + 'url'=>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.week') + ); + + $toolbar['viewmonth'] = Array( + 'title' => "This month", + 'image' => 'month.png', + 'url'=>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.month') + ); + + $toolbar['viewyear'] = Array( + 'title' => "This year", + 'image' => 'year.png', + 'url'=>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.year') + ); + + + + + $toolbar['planner'] = Array( + 'title' => "Group Planner", + 'image' => 'planner.png', + 'url'=>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.planner') + ); + + $toolbar['view'] = 'Separator'; + + $toolbar['matrixselect'] = Array( + 'title' => "Daily Matrix", + 'image' => 'view.png', + 'url'=>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.matrixselect') + ); + + + + return $toolbar; + } + + } +?> diff --git a/calendar/setup/setup.inc.php b/calendar/setup/setup.inc.php index 1afd4f641c..81a77c804b 100755 --- a/calendar/setup/setup.inc.php +++ b/calendar/setup/setup.inc.php @@ -12,7 +12,7 @@ /* $Id$ */ $setup_info['calendar']['name'] = 'calendar'; - $setup_info['calendar']['version'] = '1.0.0.005'; + $setup_info['calendar']['version'] = '1.0.0'; $setup_info['calendar']['app_order'] = 3; $setup_info['calendar']['enable'] = 1; @@ -44,22 +44,13 @@ $setup_info['calendar']['hooks'][] = 'home_month'; $setup_info['calendar']['hooks'][] = 'home_week'; $setup_info['calendar']['hooks'][] = 'home_year'; + $setup_info['calendar']['hooks'][] = 'manual'; $setup_info['calendar']['hooks'][] = 'preferences'; $setup_info['calendar']['hooks'][] = 'settings'; - $setup_info['calendar']['hooks']['sidebox_menu'] = 'calendar.uical.sidebox_menu'; - - /* Dependencies for this app to work */ - $setup_info['calendar']['depends'][] = array( - 'appname' => 'phpgwapi', - 'versions' => Array('0.9.14','0.9.15','0.9.16','1.0.0','1.0.1') - ); - $setup_info['calendar']['depends'][] = array( - 'appname' => 'etemplate', - 'versions' => Array('1.0.0','1.0.1') - ); - - - - - - + $setup_info['calendar']['hooks'][] = 'sidebox_menu'; + + $setup_info['calendar']['hooks']['toolbar'] = 'calendar.toolbar.toolbar'; + $setup_info['calendar']['hooks']['menu'] = 'calendar.calendarmenu.calendarmenu'; + + $setup_info['calendar']['hooks']['notify'] = 'calendar.calendernotify.notify'; +