diff --git a/calendar/inc/class.bopreferences.inc.php b/calendar/inc/class.bopreferences.inc.php deleted file mode 100755 index 3cec2d9c42..0000000000 --- a/calendar/inc/class.bopreferences.inc.php +++ /dev/null @@ -1,107 +0,0 @@ - * - * 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 bopreferences - { - var $public_functions = Array( - 'preferences' => True - ); - - var $prefs; - var $debug = False; - - function bopreferences() - { - $GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs'); - $this->prefs['calendar'] = $GLOBALS['phpgw_info']['user']['preferences']['calendar']; - } - - function preferences() - { - if (get_var('submit',Array('POST'))) - { - $prefs = get_var('prefs',Array('POST')); - $GLOBALS['phpgw']->preferences->read_repository(); - - $pref_list = Array( - 'weekdaystarts', - 'workdaystarts', - 'workdayends', - 'defaultcalendar', - 'defaultfilter', - 'interval', - 'planner_intervals_per_day', - 'planner_start_with_group' - ); - - for($i=0;$ipreferences->add('calendar',$pref_list[$i],$prefs[$pref_list[$i]]); - } - - $pref_list = Array( - 'send_updates', - 'send_extra' - ); - - if($prefs[$pref_list[1]] == True) - { - $GLOBALS['phpgw']->preferences->add('calendar',$pref_list[1],$prefs[$pref_list[1]]); - if($prefs[$pref_list[2]] == True) - { - $GLOBALS['phpgw']->preferences->add('calendar',$pref_list[2],$prefs[$pref_list[2]]); - } - else - { - $GLOBALS['phpgw']->preferences->delete('calendar',$pref_list[2]); - } - } - else - { - $GLOBALS['phpgw']->preferences->delete('calendar',$pref_list[1]); - $GLOBALS['phpgw']->preferences->delete('calendar',$pref_list[2]); - } - - $pref_list = Array( - 'mainscreen_showevents', - 'display_status', - 'default_private', - 'display_minicals', - 'print_black_white', - 'weekdays_only' - ); - - for($i=0;$ipreferences->add('calendar',$pref_list[$i],$prefs[$pref_list[$i]]); - } - else - { - $GLOBALS['phpgw']->preferences->delete('calendar',$pref_list[$i]); - } - } - - $GLOBALS['phpgw']->preferences->save_repository(True); - - Header('Location: '.$GLOBALS['phpgw']->link('/preferences/index.php')); - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; - } - } - } -?> diff --git a/calendar/inc/class.uipreferences.inc.php b/calendar/inc/class.uipreferences.inc.php deleted file mode 100755 index c6ee66dcbd..0000000000 --- a/calendar/inc/class.uipreferences.inc.php +++ /dev/null @@ -1,207 +0,0 @@ - * - * 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 uipreferences - { -// var $template_dir; - var $template; - - var $bo; - - var $debug = False; -// var $debug = True; - - var $theme; - - var $public_functions = array( - 'preferences' => True - ); - - function uipreferences() - { - $GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs'); - $this->template = $GLOBALS['phpgw']->template; - $this->theme = $GLOBALS['phpgw_info']['theme']; - $this->bo = CreateObject('calendar.bopreferences'); - } - - function preferences() - { - unset($GLOBALS['phpgw_info']['flags']['noheader']); - unset($GLOBALS['phpgw_info']['flags']['nonavbar']); - $GLOBALS['phpgw_info']['flags']['noappheader'] = True; - $GLOBALS['phpgw_info']['flags']['noappfooter'] = True; - $GLOBALS['phpgw']->common->phpgw_header(); - - $this->template->set_file( - Array( - 'pref' =>'pref.tpl', - 'pref_colspan' =>'pref_colspan.tpl', - 'pref_list' =>'pref_list.tpl' - ) - ); - - $var = Array( - 'title' => lang('Calendar preferences'), - 'action_url' => $GLOBALS['phpgw']->link('/index.php',Array('menuaction'=>'calendar.bopreferences.preferences')), - 'bg_color ' => $this->theme['th_bg'], - 'submit_lang' => lang('submit'), - 'text' => ' ' - ); - - $this->output_template_array('row','pref_colspan',$var); - - $this->display_item(lang('show default view on main screen'),'bo->prefs['calendar']['mainscreen_showevents']?' checked':'').'>'); - - $days = Array( - 'Monday', - 'Sunday', - 'Saturday' - ); - $str = ''; - for($i=0;$ibo->prefs['calendar']['weekdaystarts']==$days[$i]?' selected':'').'>'.lang($days[$i]).''."\n"; - } - $this->display_item(lang('weekday starts on'),''."\n"); - - $str = ''; - for ($i=0; $i<24; $i++) - { - $str .= ''."\n"; - } - $this->display_item(lang('work day starts on'),''."\n"); - - $str = ''; - for ($i=0; $i<24; $i++) - { - $str .= ''; - } - $this->display_item(lang('work day ends on'),''."\n"); - - if(strpos('.',$this->bo->prefs['calendar']['defaultcalendar'])) - { - $temp = explode('.',$this->bo->prefs['calendar']['defaultcalendar']); - $this->bo->prefs['calendar']['defaultcalendar'] = $temp[0]; - } - $selected[$this->bo->prefs['calendar']['defaultcalendar']] = ' selected'; - if (!isset($this->bo->prefs['calendar']['defaultcalendar'])) - { - $selected['month'] = ' selected'; - } - $str = ''; - $this->display_item(lang('default calendar view'),$str); - - $user = $GLOBALS['phpgw_info']['user']['account_id']; - $groups = $GLOBALS['phpgw']->accounts->membership($user); - $str = ''."\n"; - while (list($key,$group) = @each($groups)) - { - $str .= ''."\n"; - } - $this->display_item(lang('Preselected group for entering the planner'),''."\n"); - - $selected = array(); - $selected[$this->bo->prefs['calendar']['defaultfilter']] = ' selected'; - if (!isset($this->bo->prefs['calendar']['defaultfilter']) || $this->bo->prefs['calendar']['defaultfilter'] == 'private') - { - $selected['private'] = ' selected'; - } - $str = ''; - $this->display_item(lang('Default calendar filter'),$str); - - $var = Array( - 5 => '5', - 10 => '10', - 15 => '15', - 20 => '20', - 30 => '30', - 45 => '45', - 60 => '60' - ); - - $str = ''; - while(list($key,$value) = each($var)) - { - $str .= ''."\n"; - } - $this->display_item(lang('Display interval in Day View'),''."\n"); - - $var = Array( - 1 => '1', - 2 => '2', - 3 => '3', - 4 => '4', - ); - - $str = ''; - while(list($key,$value) = each($var)) - { - $str .= ''."\n"; - } - $this->display_item(lang('Number of Intervals per Day in Planner View'),''."\n"); - - $checkboxes = Array( - 'send_updates' => lang('Send/receive updates via email'), - 'send_extra' => lang('Receive extra information in event mails'), - 'weekdays_only' => lang('Display week days only in Month/Week View'), - 'display_status' => lang('Display status of events'), - 'default_private' => lang('When creating new events default set to private'), - 'display_minicals' => lang('Display mini calendars when printing'), - 'print_black_white' => lang('Print calendars in black & white') - ); - - while(list($pref_var,$desc) = each($checkboxes)) - { - $this->display_item($desc,'bo->prefs['calendar'][$pref_var]?' checked':'').'>'."\n"); - } - - $this->template->pparse('out','pref'); - } - - function output_template_array($row,$list,$var) - { - $this->template->set_var($var); - $this->template->parse($row,$list,True); - } - - function display_item($field,$data) - { - static $tr_color; - $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); - $var = Array( - 'bg_color' => $tr_color, - 'field' => $field, - 'data' => $data - ); - $this->output_template_array('row','pref_list',$var); - } - } diff --git a/calendar/inc/hook_preferences.inc.php b/calendar/inc/hook_preferences.inc.php index f84703172a..888629721a 100644 --- a/calendar/inc/hook_preferences.inc.php +++ b/calendar/inc/hook_preferences.inc.php @@ -12,16 +12,13 @@ /* $Id$ */ { // Only Modify the $file and $title variables..... + $title = $appname; $file = array( - 'Preferences' => $GLOBALS['phpgw']->link('/index.php', - Array( - 'menuaction' => 'calendar.uipreferences.preferences' - ) - ), - 'Grant Access' => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname), + 'Preferences' => $GLOBALS['phpgw']->link('/preferences/preferences.php','appname='.$appname), + 'Grant Access' => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname), 'Edit Categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app='.$appname.'&cats_level=True&global_cats=True') ); //Do not modify below this line - display_section($appname,$file); + display_section($appname,$title,$file); } ?> diff --git a/calendar/inc/hook_settings.inc.php b/calendar/inc/hook_settings.inc.php new file mode 100644 index 0000000000..8680184387 --- /dev/null +++ b/calendar/inc/hook_settings.inc.php @@ -0,0 +1,89 @@ + * + * http://www.radix.net/~cknudsen * + * Modified by Mark Peters * + * Modified by Ralf Becker * + * -------------------------------------------- * + * 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$ */ + + create_check_box('show default view on main screen','mainscreen_showevents'); + + create_select_box('weekday starts on','weekdaystarts',array( + 'Monday' => lang('Monday'), + 'Sunday' => lang('Sunday'), + 'Saturday' => lang('Saturday') + )); + + for ($i=0; $i < 24; ++$i) + { + $options[$i] = $GLOBALS['phpgw']->common->formattime($i,'00'); + } + create_select_box('work day starts on','workdaystarts',$options); + create_select_box('work day ends on','workdayends',$options); + unset($options); + + create_select_box('default calendar view','defaultcalendar',array( + 'planner_cat' => lang('Planner by category'), + 'planner_user' => lang('Planner by user'), + 'year' => lang('Yearly'), + 'month' => lang('Monthly'), + 'week' => lang('Weekly'), + 'day' => lang('Daily') + )); + $groups = $GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']); + $options = array(-1 => lang('none')); + foreach($groups as $group) + { + $options[$group['account_id']] = $GLOBALS['phpgw']->common->grab_owner_name($group['account_id']); + } + create_select_box('Preselected group for entering the planner','planner_start_with_group',$options); + unset($groups); + unset($options); + unset($group); + + create_select_box('Default calendar filter','defaultfilter',array( + 'all' => lang('all'), + 'private' => lang('private only'), +// 'public' => lang('global public only'), +// 'group' => lang('group public only'), +// 'private+public' => lang('private and global public'), +// 'private+group' => lang('private and group public'), +// 'public+group' => lang('global public and group public') + )); + + create_select_box('Display interval in Day View','interval',array( + 5 => '5', + 10 => '10', + 15 => '15', + 20 => '20', + 30 => '30', + 45 => '45', + 60 => '60' + )); + + create_select_box('Number of Intervals per Day in Planner View','planner_intervals_per_day',array( + 1 => '1', + 2 => '2', + 3 => '3', + 4 => '4', + )); + + create_check_box('Send/receive updates via email','send_updates'); + create_check_box('Receive extra information in event mails','send_extra'); + + create_check_box('Display status of events','display_status'); + + create_check_box('When creating new events default set to private','default_private'); + + create_check_box('Display mini calendars when printing','display_minicals'); + + create_check_box('Print calendars in black & white','print_black_white'); diff --git a/calendar/setup/setup.inc.php b/calendar/setup/setup.inc.php index 4ef22c6006..66d47cf795 100755 --- a/calendar/setup/setup.inc.php +++ b/calendar/setup/setup.inc.php @@ -23,12 +23,12 @@ ); $setup_info['calendar']['license'] = 'GPL'; + $setup_info['calendar']['description'] = 'Powerful calendar with meeting request system and ACL security.'; - $setup_info['calendar']['maintainer'] = array - ( - 'name' => 'Mark Peters', - 'email' => 'skeeter@phpgroupware.org' + $setup_info['calendar']['maintainer'] = array( + 'name' => 'Ralf Becker', + 'email' => 'ralfbecker@outdoor-training.de' ); $setup_info['calendar']['based_on'] = array @@ -58,7 +58,7 @@ 'home_year', 'manual', 'preferences', - 'about' + 'settings' ); /* Dependencies for this app to work */