phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] projects/inc/class.uiconfig.inc.php, 1.24


From: nomail
Subject: [Phpgroupware-cvs] projects/inc/class.uiconfig.inc.php, 1.24
Date: Fri, 21 May 2004 21:17:47 -0000

Update of /projects/inc
Modified Files:
        Branch: 
          class.uiconfig.inc.php

date: 2004/04/28 13:34:47;  author: ceb;  state: Exp;  lines: +60 -17

Log Message:
update
=====================================================================
Index: projects/inc/class.uiconfig.inc.php
diff -u projects/inc/class.uiconfig.inc.php:1.23 
projects/inc/class.uiconfig.inc.php:1.24
--- projects/inc/class.uiconfig.inc.php:1.23    Mon Apr 26 16:07:13 2004
+++ projects/inc/class.uiconfig.inc.php Wed Apr 28 13:34:47 2004
@@ -7,7 +7,7 @@
        * Project Manager                                                   *
        * Written by Bettina Gille address@hidden                   *
        * -----------------------------------------------                   *
-       * Copyright 2000 - 2004 Free Software Foundation, Inc.              *
+       * Copyright 2004 Free Software Foundation, Inc.                     *
        *                                                                   *
        * This program is free software; you can redistribute it and/or     *
        * modify it under the terms of the GNU General Public License as    *
@@ -37,17 +37,18 @@
 
                var $public_functions = array
                (
-                       'edit_activity'         => True,
-                       'list_activities'       => True,
-                       'list_admins'           => True,
-                       'list_roles'            => True,
-                       'list_employees'        => True,
-                       'edit_admins'           => True,
-                       'abook'                         => True,
-                       'preferences'           => True,
-                       'delete_pa'                     => True,
-                       'list_employees'        => True,
-                       'list_events'           => True
+                       'edit_activity'                 => True,
+                       'list_activities'               => True,
+                       'list_admins'                   => True,
+                       'list_roles'                    => True,
+                       'list_employees'                => True,
+                       'edit_admins'                   => True,
+                       'abook'                                 => True,
+                       'preferences'                   => True,
+                       'delete_pa'                             => True,
+                       'list_employees'                => True,
+                       'list_events'                   => True,
+                       'edit_employee_factor'  => True
                );
 
                function uiconfig()
@@ -152,6 +153,10 @@
                        
$GLOBALS['phpgw']->template->set_var('lang_result',lang('result'));
                        
$GLOBALS['phpgw']->template->set_var('lang_test',lang('test'));
                        
$GLOBALS['phpgw']->template->set_var('lang_quality',lang('quality check'));
+
+                       
$GLOBALS['phpgw']->template->set_var('lang_period',lang('period'));
+                       
$GLOBALS['phpgw']->template->set_var('lang_sdate',lang('start date'));
+                       
$GLOBALS['phpgw']->template->set_var('lang_edate',lang('end date'));
                }
 
                function display_app_header()
@@ -227,6 +232,8 @@
                        $id                     = $_GET['id'];
                        $account_id     = $_GET['account_id'];
                        $values         = $_POST['values'];
+                       $sdate          = get_var('sdate',array('GET','POST'));
+                       $edate          = get_var('edate',array('GET','POST'));
 
                        $link_data = array
                        (
@@ -242,8 +249,16 @@
                        if ($values['save'])
                        {
                                //_debug_array($values);
-                               
$this->boconfig->save_accounting_factor($values);
-                               
$GLOBALS['phpgw']->template->set_var('message',($account_id?lang('factor has 
been updated'):lang('factor has been saved')));
+                               $error = 
$this->boconfig->check_pa_values($values,'accounting');
+                               if(is_array($error))
+                               {
+                                       
$GLOBALS['phpgw']->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
+                               }
+                               else
+                               {
+                                       
$this->boconfig->save_accounting_factor($values);
+                                       
$GLOBALS['phpgw']->template->set_var('message',lang('factor has been saved'));
+                               }
                        }
 
                        if ($_GET['delete'])
@@ -253,6 +268,8 @@
                        }
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('projects') . ': ' . lang('accounting');
+                       $jscal = CreateObject('phpgwapi.jscalendar');
+
                        $this->display_app_header();
 
                        
$GLOBALS['phpgw']->template->set_file(array('emp_list_t' => 
'list_employees.tpl'));
@@ -299,19 +316,45 @@
                                        'delete_emp'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiconfig.list_employees&id='
                                                                                
                                                        . $emps[$i]['id'] . 
'&delete=True'),
                                        'delete_img'                    => 
$GLOBALS['phpgw']->common->image('phpgwapi','delete'),
-                                       'lang_delete_factor'    => lang('delete 
factor')
+                                       'lang_delete_factor'    => lang('delete 
factor'),
+                                       'edit_emp'                              
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiconfig.edit_employee_factor&id='
+                                                                               
                                                                . 
$emps[$i]['id']),
+                                       'edit_img'                              
=> $GLOBALS['phpgw']->common->image('phpgwapi','edit'),
+                                       'lang_edit_factor'              => 
lang('edit factor')
                                ));
                                
$GLOBALS['phpgw']->template->fp('list','emp_list',True);
                        }
                        
$GLOBALS['phpgw']->template->set_var('accounting',$values['accounting']);
                        
$GLOBALS['phpgw']->template->set_var('d_accounting',$values['d_accounting']);
-                       
$GLOBALS['phpgw']->template->set_var('lang_save_factor',lang('save factor'));
+                       
$GLOBALS['phpgw']->template->set_var('lang_add_factor',lang('add factor'));
                        
$GLOBALS['phpgw']->template->set_var('emp_select',$this->employee_format($values['account_id']));
 
+                       if(is_array($sdate))
+                       {
+                               $start_array    = 
$jscal->input2date($sdate['str']);
+                               $start_val              = $start_array['raw'];
+                       }
+
+                       if(is_array($edate))
+                       {
+                               $end_array      = 
$jscal->input2date($edate['str']);
+                               $end_val        = $end_array['raw'];
+                       }
+
+                       $start  = 
$start_val?$start_val:mktime(12,0,0,date('m'),date('d'),date('Y'));
+                       $end    = 
$end_val?$end_val:mktime(12,0,0,date('m'),date('d')+30,date('Y'));
+
+                       
$GLOBALS['phpgw']->template->set_var('sdate_select',$jscal->input('sdate[str]',$start));
+                       
$GLOBALS['phpgw']->template->set_var('edate_select',$jscal->input('edate[str]',$end));
+
                        $this->save_sessiondata('accounting');
                        
$GLOBALS['phpgw']->template->pfp('out','emp_list_t',True);
                }
 
+               function edit_employee_factor()
+               {
+
+               }
 
                function delete_pa()
                {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]