<?php
	/**************************************************************************\
	* phpGroupWare - projects's Sidebox-Menu for idots-template                *
	* http://www.phpgroupware.org                                              *
	* Written by Pim Snel <pim@lingewoud.nl>                                   *
	* --------------------------------------------                             *
	*  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: hook_sidebox_menu.inc.php,v 1.1.1.1.8.2 2004/11/27 15:14:57 kazuyan Exp $ */
	{

 /*
	This hookfile is for generating an app-specific side menu used in the idots 
	template set.

	$menu_title speaks for itself
	$file is the array with link to app functions

	display_sidebox can be called as much as you like
 */

			$boprojects = CreateObject('projects.boprojects');
			$appname = 'projects';
			$menu_title = $GLOBALS['phpgw_info']['apps'][$appname]['title'] . ' '. lang('Menu');
			if ($boprojects->isprojectadmin('pad'))
			{
				$file[] = array('text'	=> 'Activities',
								'url'	=> $GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_activities&action=act'));
				$file[] = array('text'	=> 'Budget',
								'url'	=> $GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_budget&action=mains'));
			}

			$file[] = array('text'	=> 'Project',
							'url'	=> $GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_projects&action=mains'));
			$file[] = array('text'	=> 'Jobs',
							'url'	=> $GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_projects&action=subs'));
			$file[] = array('text'	=> 'Work hours',
							'url'	=> $GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojecthours.list_hours'));
			$file[] = array('text'	=> 'Statistics',
							'url'	=> $GLOBALS['phpgw']->link('/index.php','menuaction=projects.uistatistics.list_projects&action=mains'));
			$file[] = array('text'	=> 'Archive',
							'url'	=> $GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.archive&action=amains'));

			if ($boprojects->isprojectadmin('pbo'))
			{
				$file[] = array('text'	=> 'Billing',
								'url'	=> $GLOBALS['phpgw']->link('/index.php','menuaction=projects.uibilling.list_projects&action=mains'));
				$file[] = array('text'	=> 'Deliveries',
								'url'	=> $GLOBALS['phpgw']->link('/index.php','menuaction=projects.uideliveries.list_projects&action=mains'));
			}


			display_sidebox($appname,$menu_title,$file);

			if ($GLOBALS['phpgw_info']['user']['apps']['preferences'])
			{
				if ($GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] != 'ja')
					$menu_title = $GLOBALS['phpgw_info']['apps'][$appname]['title'] . ' '. lang('Preferences');
				else
					$menu_title = lang('Preferences');
				$pref_file[] = array('text'	=> 'Preferences',
								'url'	=> $GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.preferences'));
				$pref_file[] = array('text'	=> 'Grant Access',
								'url'	=> $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname));
				$pref_file[] = array('text'	=> 'Edit categories',
								'url'	=> $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=projects&cats_level=True&global_cats=True'));

				display_sidebox($appname,$menu_title,$pref_file);
			}

			if ($GLOBALS['phpgw_info']['user']['apps']['admin'])
			{
				if ($GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] != 'ja')
					$menu_title = $GLOBALS['phpgw_info']['apps'][$appname]['title'] . ' '. lang('Administration');
				else
					$menu_title = lang('Administration');

				$admin_file[] = array('text'	=> 'project administrators',
								'url'	=> $GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_admins'));
				$admin_file[] = array('text'	=> 'Global Categories',
								'url'	=> $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=' . $appname));

				display_sidebox($appname,$menu_title,$admin_file);
			}
			unset($boprojects);
	}
?>
