[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 /**************************************************************************\ 3 * eGroupWare - ProjectManager - Administration * 4 * http://www.egroupware.org * 5 * Written and (c) 2005 by Ralf Becker <RalfBecker@outdoor-training.de> * 6 * -------------------------------------------- * 7 * This program is free software; you can redistribute it and/or modify it * 8 * under the terms of the GNU General Public License as published by the * 9 * Free Software Foundation; either version 2 of the License, or (at your * 10 * option) any later version. * 11 \**************************************************************************/ 12 13 /* $Id: class.admin.inc.php 19000 2005-08-17 11:06:25Z ralfbecker $ */ 14 15 include_once (EGW_INCLUDE_ROOT.'/etemplate/inc/class.uietemplate.inc.php'); 16 17 /** 18 * ProjectManager: Administration 19 * 20 * @package projectmanager 21 * @author RalfBecker-AT-outdoor-training.de 22 * @copyright (c) 2005 by RalfBecker-AT-outdoor-training.de 23 * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License 24 */ 25 class admin 26 { 27 /** 28 * @var array $public_functions Functions to call via menuaction 29 */ 30 var $public_functions = array( 31 'config' => true, 32 ); 33 var $accounting_types; 34 var $duration_units; 35 36 /** 37 * Constructor, calls the constructor of the extended class 38 */ 39 function admin() 40 { 41 if (!$GLOBALS['egw_info']['user']['apps']['admin']) 42 { 43 $GLOBALS['egw']->common->redirect_link('/index.php',array( 44 'menuaction' => 'projectmanager.uiprojectmanger.index', 45 'msg' => lang('Permission denied !!!'), 46 )); 47 } 48 $this->config =& CreateObject('phpgwapi.config','projectmanager'); 49 $this->config->read_repository(); 50 51 $this->accounting_types = array( 52 'status' => lang('No accounting, only status'), 53 'times' => lang('No accounting, only times and status'), 54 'budget' => lang('Budget (no pricelist)'), 55 'pricelist' => lang('Budget and pricelist'), 56 ); 57 $this->duration_units = array( 58 'd' => 'days', 59 'h' => 'hours', 60 ); 61 } 62 63 /** 64 * Edit the site configuration 65 * 66 * @param array $content=null 67 */ 68 function config($content=null) 69 { 70 $tpl =& new etemplate('projectmanager.config'); 71 72 if ($content['save'] || $content['apply']) 73 { 74 foreach(array('duration_units','hours_per_workday','accounting_types','allow_change_workingtimes') as $name) 75 { 76 $this->config->config_data[$name] = $content[$name]; 77 } 78 $this->config->save_repository(); 79 $msg = lang('Site configuration saved'); 80 } 81 if ($content['cancel'] || $content['save']) 82 { 83 $tpl->location(array( 84 'menuaction' => 'projectmanager.uiprojectmanager.index', 85 'msg' => $msg, 86 )); 87 } 88 $content = $this->config->config_data; 89 if (!$content['duration_units']) $content['duration_units'] = array_keys($this->duration_units); 90 if (!$content['hours_per_workday']) $content['hours_per_workday'] = 8; 91 if (!$content['accounting_types']) $content['accounting_types'] = array_keys($this->accounting_types); 92 93 $content['msg'] = $msg; 94 95 $GLOBALS['egw_info']['flags']['app_header'] = lang('projectmanager').' - '.lang('Site configuration'); 96 $tpl->exec('projectmanager.admin.config',$content,array( 97 'duration_units' => $this->duration_units, 98 'accounting_types' => $this->accounting_types, 99 'allow_change_workingtimes' => array('no','yes'), 100 )); 101 } 102 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |