phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: projects/inc class.bostatistics.inc.php,1.2,1.3


From: Bettina gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: projects/inc class.bostatistics.inc.php,1.2,1.3 class.sostatistics.inc.php,1.4,1.5 class.uistatistics.inc.php,1.9,1.10
Date: Thu, 10 Jan 2002 19:40:21 -0500

Update of /cvsroot/phpgroupware/projects/inc
In directory subversions:/tmp/cvs-serv9535/inc

Modified Files:
        class.bostatistics.inc.php class.sostatistics.inc.php 
        class.uistatistics.inc.php 
Log Message:
update stats

Index: class.bostatistics.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.bostatistics.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.bostatistics.inc.php  24 Dec 2001 01:36:13 -0000      1.2
--- class.bostatistics.inc.php  11 Jan 2002 00:40:18 -0000      1.3
***************
*** 54,72 ****
                }
  
!               function get_userstat_pro($account_id, $filter)
                {
!                       $pro = $this->sostatistics->user_stat_pro($account_id, 
$filter);
                        return $pro;
                }
  
!               function get_stat_hours($type, $account_id, $project_id, 
$filter)
                {
!                       $hours = $this->sostatistics->stat_hours($type, 
$account_id, $project_id, $filter);
                        return $hours;
                }
  
!               function get_employees($project_id, $filter)
                {
!                       $employees = 
$this->sostatistics->pro_stat_employees($project_id, $filter);
                        return $employees;
                }
--- 54,72 ----
                }
  
!               function get_userstat_pro($account_id, $values)
                {
!                       $pro = $this->sostatistics->user_stat_pro($account_id, 
$values);
                        return $pro;
                }
  
!               function get_stat_hours($type, $account_id, $project_id, 
$values)
                {
!                       $hours = $this->sostatistics->stat_hours($type, 
$account_id, $project_id, $values);
                        return $hours;
                }
  
!               function get_employees($project_id, $values)
                {
!                       $employees = 
$this->sostatistics->pro_stat_employees($project_id, $values);
                        return $employees;
                }

Index: class.sostatistics.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.sostatistics.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.sostatistics.inc.php  6 Jan 2002 03:04:38 -0000       1.4
--- class.sostatistics.inc.php  11 Jan 2002 00:40:18 -0000      1.5
***************
*** 29,36 ****
                function sostatistics()
                {
!                       $this->db               = $GLOBALS['phpgw']->db;
                }
  
!               function user_stat_pro($account_id, $filter)
                {
                        if 
($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
--- 29,68 ----
                function sostatistics()
                {
!                       $this->db = $GLOBALS['phpgw']->db;
                }
  
!               function stat_filter($values)
!               {
!                       if 
(checkdate($values['smonth'],$values['sday'],$values['syear']))
!                       {
!                               $values['sdate'] = 
mktime(2,0,0,$values['smonth'],$values['sday'],$values['syear']);
!                       }
! 
!                       if 
(checkdate($values['emonth'],$values['eday'],$values['eyear']))
!                       {
!                               $values['edate'] = 
mktime(2,0,0,$values['emonth'],$values['eday'],$values['eyear']);
!                       }
! 
!                       if ($values['billed'])
!                       {
!                               $filter = " AND status='billed'";
!                       }
! 
!                       if ($values['sdate'])
!                       {
!                               $filter .= " AND start_date >='" . 
$values['sdate'] . "'";
!                       }
! 
!                       if ($values['edate'])
!                       {
!                               $filter .= " AND end_date <='" . 
$values['edate'] . "'";
!                       }
! 
!               //      _debug_array($values);
!               //      exit;
!                       return $filter;
!               }
! 
!               function user_stat_pro($account_id, $values)
                {
                        if 
($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
***************
*** 44,48 ****
  
                        $this->db->query("SELECT title,num,phpgw_p_projects.id 
as id FROM phpgw_p_projects $join phpgw_p_hours ON "
!                                                       
."phpgw_p_hours.employee='$account_id' $filter GROUP BY 
title,phpgw_p_projects.id");
  
                        while ($this->db->next_record())
--- 76,80 ----
  
                        $this->db->query("SELECT title,num,phpgw_p_projects.id 
as id FROM phpgw_p_projects $join phpgw_p_hours ON "
!                                                       . 
"phpgw_p_hours.employee='" . $account_id . "' GROUP BY 
title,phpgw_p_projects.id",__LINE__,__FILE__);
  
                        while ($this->db->next_record())
***************
*** 60,64 ****
                }
  
!               function stat_hours($type = 'account', $account_id = '', 
$project_id = '', $filter)
                {
                        switch($type)
--- 92,96 ----
                }
  
!               function stat_hours($type = 'account', $account_id = '', 
$project_id = '', $values)
                {
                        switch($type)
***************
*** 70,74 ****
  
                        $this->db->query('SELECT SUM(minutes) as min,num,descr 
FROM phpgw_p_hours,phpgw_p_activities ' . $idfilter
!                                                       . ' AND 
phpgw_p_hours.activity_id=phpgw_p_activities.id ' . $filter
                                                        . ' GROUP BY 
phpgw_p_activities.descr,phpgw_p_activities.num',__LINE__,__FILE__);
  
--- 102,106 ----
  
                        $this->db->query('SELECT SUM(minutes) as min,num,descr 
FROM phpgw_p_hours,phpgw_p_activities ' . $idfilter
!                                                       . ' AND 
phpgw_p_hours.activity_id=phpgw_p_activities.id' . $this->stat_filter($values)
                                                        . ' GROUP BY 
phpgw_p_activities.descr,phpgw_p_activities.num',__LINE__,__FILE__);
  
***************
*** 85,91 ****
                }
  
!               function pro_stat_employees($project_id, $filter)
                {
!                       $this->db->query("SELECT employee from phpgw_p_hours 
WHERE project_id='$project_id' $filter",__LINE__,__FILE__);
  
                        while ($this->db->next_record())
--- 117,125 ----
                }
  
!               function pro_stat_employees($project_id, $values)
                {
! 
!                       $this->db->query("SELECT employee from phpgw_p_hours 
WHERE project_id='" . $project_id . "'" . $this->stat_filter($values)
!                                                       . " GROUP BY 
employee",__LINE__,__FILE__);
  
                        while ($this->db->next_record())

Index: class.uistatistics.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.uistatistics.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.uistatistics.inc.php  6 Jan 2002 03:40:02 -0000       1.9
--- class.uistatistics.inc.php  11 Jan 2002 00:40:18 -0000      1.10
***************
*** 448,452 ****
                function user_stat()
                {
!                       global $submit, $billed, $account_id;
  
                        $link_data = array
--- 448,452 ----
                function user_stat()
                {
!                       global $submit, $account_id, $values;
  
                        $link_data = array
***************
*** 454,459 ****
                                'menuaction'    => 
'projects.uistatistics.user_stat',
                                'action'                => 'ustat',
!                               'account_id'    => $account_id,
!                               'billed'                => $billed
                        );
  
--- 454,458 ----
                                'menuaction'    => 
'projects.uistatistics.user_stat',
                                'action'                => 'ustat',
!                               'account_id'    => $account_id
                        );
  
***************
*** 480,545 ****
                        $this->nextmatchs->alternate_row_color(&$this->t);
  
!                       if (!$submit)
                        {
!                               $emonth = date('m',time());
!                               $eday = date('d',time());
!                               $eyear = date('Y',time());
!                               $edate = mktime(2,0,0,$emonth,$eday,$eyear);
!                       }
! 
!                       if (!$sdate)
!                       {
!                               $smonth = 0;
!                               $sday = 0;
!                               $syear = 0;
                        }
                        else
                        {
!                               $smonth = date('m',$sdate);
!                               $sday = date('d',$sdate);
!                               $syear = date('Y',$sdate);
                        }
  
!                       if (!$edate)
                        {
!                               $emonth = 0;
!                               $eday = 0;
!                               $eyear = 0;
                        }
                        else
                        {
!                               $emonth = date('m',$edate);
!                               $eday = date('d',$edate);
!                               $eyear = date('Y',$edate);
                        }
  
!                       
$this->t->set_var('start_date_select',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('syear',$syear),
!                                                                               
                                                                                
                $this->sbox->getMonthText('smonth',$smonth),
!                                                                               
                                                                                
                $this->sbox->getDays('sday',$sday)));
!                       
$this->t->set_var('end_date_select',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('eyear',$eyear),
!                                                                               
                                                                                
        $this->sbox->getMonthText('emonth',$emonth),
!                                                                               
                                                                                
        $this->sbox->getDays('eday',$eday)));
  
  // -------------- calculate statistics --------------------------
  
!                       if($billed)
!                       {
!                               $this->t->set_var('billed','checked');
!                               $filter .= " AND phpgw_p_hours.status='billed' 
";
!                       }
! 
!                       if (checkdate($smonth,$sday,$syear))
!                       {
!                               $sdate = mktime(2,0,0,$smonth,$sday,$syear);
!                               $filter .= " AND 
phpgw_p_hours.start_date>='$sdate' ";
!                       }
! 
!                       if (checkdate($emonth,$eday,$eyear))
!                       {
!                               $edate = mktime(2,0,0,$emonth,$eday,$eyear);
!                               $filter .= " AND 
phpgw_p_hours.end_date<='$edate' ";
!                       }
  
!                       $pro = 
$this->bostatistics->get_userstat_pro($account_id, $filter);
  
                        if (is_array($pro))
--- 479,521 ----
                        $this->nextmatchs->alternate_row_color(&$this->t);
  
!                       if (!$values['sdate'])
                        {
!                               $values['smonth']       = 0;
!                               $values['sday']         = 0;
!                               $values['syear']        = 0;
                        }
                        else
                        {
!                               $values['smonth']       = 
date('m',$values['sdate']);
!                               $values['sday']         = 
date('d',$values['sdate']); 
!                               $values['syear']        = 
date('Y',$values['sdate']);
                        }
  
!                       if (!$values['edate'])
                        {
!                               $values['emonth']       = 0;
!                               $values['eday']         = 0;
!                               $values['eyear']        = 0;
                        }
                        else
                        {
!                               $values['emonth']       = 
date('m',$values['edate']);
!                               $values['eday']         = 
date('d',$values['edate']); 
!                               $values['eyear']        = 
date('Y',$values['edate']);
                        }
  
!                       
$this->t->set_var('start_date_select',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('values[syear]',$values['syear']),
!                                                                               
                                                                                
                        
$this->sbox->getMonthText('values[smonth]',$values['smonth']),
!                                                                               
                                                                                
                        $this->sbox->getDays('values[sday]',$values['sday'])));
!                       
$this->t->set_var('end_date_select',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('values[eyear]',$values['eyear']),
!                                                                               
                                                                                
                        
$this->sbox->getMonthText('values[emonth]',$values['emonth']),
!                                                                               
                                                                                
                        $this->sbox->getDays('values[eday]',$values['eday'])));
  
  // -------------- calculate statistics --------------------------
  
!                       $this->t->set_var('billed','<input type="checkbox" 
name="values[billed]" value="True"'
!                                                                               
. ($values['billed'] == 'private'?' checked':'') . '>');
  
!                       $pro = 
$this->bostatistics->get_userstat_pro($account_id, $values);
  
                        if (is_array($pro))
***************
*** 551,564 ****
                                        
$this->t->set_var('e_project',$GLOBALS['phpgw']->strip_html($userpro['title']) 
. ' ['
                                                                                
        . $GLOBALS['phpgw']->strip_html($userpro['num']) . ']');
!                                       $this->t->set_var('e_activity','');
!                                       $this->t->set_var('e_hours','');
                                        $this->t->fp('stat','user_stat',True);
  
!                                       $hours = 
$this->bostatistics->get_stat_hours('both', $account_id, 
$userpro['project_id'], $filter); 
                                        for ($i=0;$i<=count($hours);$i++)
                                        {
                                                if ($hours[$i]['num'] != '')
                                                {
!                                                       
$this->t->set_var('e_project','');
                                                        
$this->t->set_var('e_activity',$GLOBALS['phpgw']->strip_html($hours[$i]['descr'])
 . ' ['
                                                                                
                        . $GLOBALS['phpgw']->strip_html($hours[$i]['num']) . 
']');
--- 527,540 ----
                                        
$this->t->set_var('e_project',$GLOBALS['phpgw']->strip_html($userpro['title']) 
. ' ['
                                                                                
        . $GLOBALS['phpgw']->strip_html($userpro['num']) . ']');
!                                       
$this->t->set_var('e_activity','&nbsp;');
!                                       $this->t->set_var('e_hours','&nbsp;');
                                        $this->t->fp('stat','user_stat',True);
  
!                                       $hours = 
$this->bostatistics->get_stat_hours('both', $account_id, 
$userpro['project_id'], $values); 
                                        for ($i=0;$i<=count($hours);$i++)
                                        {
                                                if ($hours[$i]['num'] != '')
                                                {
!                                                       
$this->t->set_var('e_project','&nbsp;');
                                                        
$this->t->set_var('e_activity',$GLOBALS['phpgw']->strip_html($hours[$i]['descr'])
 . ' ['
                                                                                
                        . $GLOBALS['phpgw']->strip_html($hours[$i]['num']) . 
']');
***************
*** 570,575 ****
                                        }
  
!                                       $this->t->set_var('e_project','');
!                                       $this->t->set_var('e_activity','');
                                        $hrs = floor($summin/60) . ':' . 
sprintf ("%02d",(int)($summin-floor($summin/60)*60)); 
                                        $this->t->set_var('e_hours',$hrs);
--- 546,551 ----
                                        }
  
!                                       $this->t->set_var('e_project','&nbsp;');
!                                       
$this->t->set_var('e_activity','&nbsp;');
                                        $hrs = floor($summin/60) . ':' . 
sprintf ("%02d",(int)($summin-floor($summin/60)*60)); 
                                        $this->t->set_var('e_hours',$hrs);
***************
*** 578,588 ****
                        }
  
!                       $allhours = 
$this->bostatistics->get_stat_hours('account', $account_id, $project_id ='', 
$filter);
  
                        $summin=0;
                        
$this->nextmatchs->template_alternate_row_color(&$this->t);
                        $this->t->set_var('e_project','<b>' . lang('Overall') . 
'</b>');
!                       $this->t->set_var('e_activity','');
!                       $this->t->set_var('e_hours','');
                        $this->t->fp('stat','user_stat',True);
  
--- 554,564 ----
                        }
  
!                       $allhours = 
$this->bostatistics->get_stat_hours('account', $account_id, $project_id ='', 
$values);
  
                        $summin=0;
                        
$this->nextmatchs->template_alternate_row_color(&$this->t);
                        $this->t->set_var('e_project','<b>' . lang('Overall') . 
'</b>');
!                       $this->t->set_var('e_activity','&nbsp;');
!                       $this->t->set_var('e_hours','&nbsp;');
                        $this->t->fp('stat','user_stat',True);
  
***************
*** 591,595 ****
                                while (list($null,$userall) = each($allhours))
                                {
!                                       $this->t->set_var('e_project','');
                                        
$this->t->set_var('e_activity',$GLOBALS['phpgw']->strip_html($userall['descr']) 
. ' ['
                                                                                
                        . $GLOBALS['phpgw']->strip_html($userall['num']) . ']');
--- 567,571 ----
                                while (list($null,$userall) = each($allhours))
                                {
!                                       $this->t->set_var('e_project','&nbsp;');
                                        
$this->t->set_var('e_activity',$GLOBALS['phpgw']->strip_html($userall['descr']) 
. ' ['
                                                                                
                        . $GLOBALS['phpgw']->strip_html($userall['num']) . ']');
***************
*** 603,611 ****
                        
$this->nextmatchs->template_alternate_row_color(&$this->t);
                        $this->t->set_var('e_project','<b>' . lang('Sum') . 
'</b>');
!                       $this->t->set_var('e_activity','');
                        $hrs = floor($summin/60) . ':' . sprintf 
("%02d",(int)($summin-floor($summin/60)*60)); 
                        $this->t->set_var('e_hours',$hrs);
                        $this->t->fp('stat','user_stat',True);
- 
                        $this->t->pfp('out','user_stat_t',True);
                }
--- 579,586 ----
                        
$this->nextmatchs->template_alternate_row_color(&$this->t);
                        $this->t->set_var('e_project','<b>' . lang('Sum') . 
'</b>');
!                       $this->t->set_var('e_activity','&nbsp;');
                        $hrs = floor($summin/60) . ':' . sprintf 
("%02d",(int)($summin-floor($summin/60)*60)); 
                        $this->t->set_var('e_hours',$hrs);
                        $this->t->fp('stat','user_stat',True);
                        $this->t->pfp('out','user_stat_t',True);
                }
***************
*** 613,617 ****
                function project_stat()
                {
!                       global $submit, $billed, $project_id, $action;
  
                        $link_data = array
--- 588,592 ----
                function project_stat()
                {
!                       global $submit, $project_id, $action, $values;
  
                        $link_data = array
***************
*** 619,624 ****
                                'menuaction'    => 
'projects.uistatistics.project_stat',
                                'action'                => $action,
!                               'project_id'    => $project_id,
!                               'billed'                => $billed
                        );
  
--- 594,598 ----
                                'menuaction'    => 
'projects.uistatistics.project_stat',
                                'action'                => $action,
!                               'project_id'    => $project_id
                        );
  
***************
*** 633,636 ****
--- 607,620 ----
                        $this->t->set_block('project_stat','stat_list','list');
  
+                       $nopref = $this->boprojects->check_prefs();
+                       if (is_array($nopref))
+                       {
+                               
$this->t->set_var('pref_message',$GLOBALS['phpgw']->common->error_list($nopref));
+                       }
+                       else
+                       {
+                               $prefs = $this->boprojects->get_prefs();
+                       }
+ 
                        $pro = 
$this->boprojects->read_single_project($project_id);
  
***************
*** 643,646 ****
--- 627,631 ----
                        $this->t->set_var('status',lang($pro['status']));
                        $this->t->set_var('budget',$pro['budget']);
+                       $this->t->set_var('currency',$prefs['currency']);
  
                        $this->t->set_var('lang_account',lang('Account'));
***************
*** 648,689 ****
                        $this->t->set_var('lang_hours',lang('Hours'));
  
!                       if (!$submit)
                        {
!                               $sdate = $pro['sdate'];
!                               $edate = $pro['edate'];
!                       }
! 
!                       if (!$sdate)
!                       {
!                               $smonth = 0;
!                               $sday = 0; 
!                               $syear = 0;
                        }
                        else
                        {
!                               $smonth = date('m',$sdate);
!                               $sday = date('d',$sdate);
!                               $syear = date('Y',$sdate);
                        }
  
!                       if (!$edate)
                        {
!                               $emonth = 0;
!                               $eday = 0;
!                               $eyear = 0;
                        }
                        else
                        {
!                               $emonth = date('m',$edate);
!                               $eday = date('d',$edate);
!                               $eyear = date('Y',$edate);
                        }
  
!                       
$this->t->set_var('start_date_select',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('syear',$syear),
!                                                                               
                                                                                
                        $this->sbox->getMonthText('smonth',$smonth),
!                                                                               
                                                                                
                        $this->sbox->getDays('sday',$sday)));
!                       
$this->t->set_var('end_date_select',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('eyear',$eyear),
!                                                                               
                                                                                
                        $this->sbox->getMonthText('emonth',$emonth),
!                                                                               
                                                                                
                        $this->sbox->getDays('eday',$eday)));
  
                        $cached_data = 
$this->boprojects->cached_accounts($pro['coordinator']);
--- 633,686 ----
                        $this->t->set_var('lang_hours',lang('Hours'));
  
!                       if (!$values['sdate'])
                        {
!                               if (! $pro['sdate'] || $pro['sdate'] == 0)
!                               {
!                                       $values['smonth']       = 0;
!                                       $values['sday']         = 0; 
!                                       $values['syear']        = 0;
!                               }
!                               else
!                               {
!                                       $values['smonth']       = 
date('m',$pro['sdate']);
!                                       $values['sday']         = 
date('d',$pro['sdate']); 
!                                       $values['syear']        = 
date('Y',$pro['sdate']);
!                               }
                        }
                        else
                        {
!                               $values['smonth']       = 
date('m',$values['sdate']);
!                               $values['sday']         = 
date('d',$values['sdate']); 
!                               $values['syear']        = 
date('Y',$values['sdate']);
                        }
  
!                       if (!$values['edate'])
                        {
!                               if (! $pro['edate'] || $pro['edate'] == 0)
!                               {
!                                       $values['emonth']       = 0;
!                                       $values['eday']         = 0; 
!                                       $values['eyear']        = 0;
!                               }
!                               else
!                               {
!                                       $values['emonth']       = 
date('m',$pro['edate']);
!                                       $values['eday']         = 
date('d',$pro['edate']); 
!                                       $values['eyear']        = 
date('Y',$pro['edate']);
!                               }
                        }
                        else
                        {
!                               $values['emonth']       = 
date('m',$values['edate']);
!                               $values['eday']         = 
date('d',$values['edate']); 
!                               $values['eyear']        = 
date('Y',$values['edate']);
                        }
  
!                       
$this->t->set_var('start_date_select',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('values[syear]',$values['syear']),
!                                                                               
                                                                                
                        
$this->sbox->getMonthText('values[smonth]',$values['smonth']),
!                                                                               
                                                                                
                        $this->sbox->getDays('values[sday]',$values['sday'])));
!                       
$this->t->set_var('end_date_select',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('values[eyear]',$values['eyear']),
!                                                                               
                                                                                
                        
$this->sbox->getMonthText('values[emonth]',$values['emonth']),
!                                                                               
                                                                                
                        $this->sbox->getDays('values[eday]',$values['eday'])));
  
                        $cached_data = 
$this->boprojects->cached_accounts($pro['coordinator']);
***************
*** 710,740 ****
                        }
  
!                       if($billed)
!                       {
!                               $this->t->set_var('billed','checked');
!                       }
! 
! // -------------------------------- calculate statistics 
-------------------------------------------                                     
                                                                                
                    
  
! //    $filter= '';
  
!                       if($billed)
!                       {
!                               $filter .= " AND phpgw_p_hours.status='billed' 
";
!                       }
! 
!                       if (checkdate($smonth,$sday,$syear))
!                       {
!                               $sdate = mktime(2,0,0,$smonth,$sday,$syear);
!                               $filter .= " AND start_date >= '$sdate' ";
!                       }
! 
!                       if (checkdate($emonth,$eday,$eyear))
!                       {
!                               $edate = mktime(2,0,0,$emonth,$eday,$eyear);
!                               $filter .= " AND end_date <= '$edate' ";
!                       }
! 
!                       $employees = 
$this->bostatistics->get_employees($project_id, $filter);
  
                        if (is_array($employees))
--- 707,716 ----
                        }
  
!                       $this->t->set_var('billed','<input type="checkbox" 
name="values[billed]" value="True"'
!                                                                               
. ($values['billed'] == 'private'?' checked':'') . '>');
  
! // -------------------------------- calculate statistics 
-----------------------------------------
  
!                       $employees = 
$this->bostatistics->get_employees($project_id, $values);
  
                        if (is_array($employees))
***************
*** 752,760 ****
                                                                                
        . 
$GLOBALS['phpgw']->strip_html($account_data[$employee['employee']]['account_lid'])
 . ']');
  
!                                       $this->t->set_var('e_activity','');
!                                       $this->t->set_var('e_hours','');
                                        $this->t->fp('list','stat_list',True);
  
!                                       $hours = 
$this->bostatistics->get_stat_hours('both', $account_id, $project_id, $filter);
  
                                        for ($i=0;$i<=count($hours);$i++)
--- 728,736 ----
                                                                                
        . 
$GLOBALS['phpgw']->strip_html($account_data[$employee['employee']]['account_lid'])
 . ']');
  
!                                       
$this->t->set_var('e_activity','&nbsp;');
!                                       $this->t->set_var('e_hours','&nbsp;');
                                        $this->t->fp('list','stat_list',True);
  
!                                       $hours = 
$this->bostatistics->get_stat_hours('both', $account_id, $project_id, $values);
  
                                        for ($i=0;$i<=count($hours);$i++)
***************
*** 762,791 ****
                                                if ($hours[$i]['num'] != '')
                                                {
!                                                       
$this->t->set_var('e_account','');
                                                        
$this->t->set_var('e_activity',$GLOBALS['phpgw']->strip_html($hours[$i]['descr'])
 . ' ['
                                                                                
                                . 
$GLOBALS['phpgw']->strip_html($hours[$i]['num']) . ']');
-                                                       $summin += 
$hours[$i]['min'];
                                                        $hrs = 
floor($hours[$i]['min']/60). ':' . sprintf 
("%02d",(int)($hours[$i]['min']-floor($hours[$i]['min']/60)*60));
                                                        
$this->t->set_var('e_hours',$hrs);
! 
                                                        
$this->t->fp('list','stat_list',True);
                                                }
                                        }
-                               }
-                               $this->t->set_var('e_account','');
-                               $this->t->set_var('e_activity','');
-                               $hrs = floor($summin/60). ':' . sprintf 
("%02d",(int)($summin-floor($summin/60)*60));
-                               $this->t->set_var('e_hours',$hrs);
  
!                               $this->t->fp('list','stat_list',True);
                        }
  
!                       $prohours = 
$this->bostatistics->get_stat_hours('project', $account_id = '', $project_id, 
$filter); 
  
                        $summin=0;
                        
$this->nextmatchs->template_alternate_row_color(&$this->t);
                        $this->t->set_var('e_account','<b>' . lang('Overall') . 
'</b>');
!                       $this->t->set_var('e_activity','');
!                       $this->t->set_var('e_hours','');
  
                        $this->t->fp('list','stat_list',True);
--- 738,766 ----
                                                if ($hours[$i]['num'] != '')
                                                {
!                                                       
$this->t->set_var('e_account','&nbsp;');
                                                        
$this->t->set_var('e_activity',$GLOBALS['phpgw']->strip_html($hours[$i]['descr'])
 . ' ['
                                                                                
                                . 
$GLOBALS['phpgw']->strip_html($hours[$i]['num']) . ']');
                                                        $hrs = 
floor($hours[$i]['min']/60). ':' . sprintf 
("%02d",(int)($hours[$i]['min']-floor($hours[$i]['min']/60)*60));
                                                        
$this->t->set_var('e_hours',$hrs);
!                                                       $summin += 
$hours[$i]['min'];
                                                        
$this->t->fp('list','stat_list',True);
                                                }
                                        }
  
!                                       $this->t->set_var('e_account','&nbsp;');
!                                       
$this->t->set_var('e_activity','&nbsp;');
!                                       $sumhours = floor($summin/60). ':' . 
sprintf ("%02d",(int)($summin-floor($summin/60)*60));
!                                       $this->t->set_var('e_hours',$sumhours); 
!                                       $this->t->fp('list','stat_list',True);
!                               }
                        }
  
!                       $prohours = 
$this->bostatistics->get_stat_hours('project', $account_id = '', $project_id, 
$values); 
  
                        $summin=0;
                        
$this->nextmatchs->template_alternate_row_color(&$this->t);
                        $this->t->set_var('e_account','<b>' . lang('Overall') . 
'</b>');
!                       $this->t->set_var('e_activity','&nbsp;');
!                       $this->t->set_var('e_hours','&nbsp;');
  
                        $this->t->fp('list','stat_list',True);
***************
*** 795,799 ****
                                while (list($null,$proall) = each($prohours))
                                {
!                                       $this->t->set_var('e_account','');
                                        
$this->t->set_var('e_activity',$GLOBALS['phpgw']->strip_html($proall['descr']) 
. ' ['
                                                                                
                . $GLOBALS['phpgw']->strip_html($proall['num']) . ']');
--- 770,774 ----
                                while (list($null,$proall) = each($prohours))
                                {
!                                       $this->t->set_var('e_account','&nbsp;');
                                        
$this->t->set_var('e_activity',$GLOBALS['phpgw']->strip_html($proall['descr']) 
. ' ['
                                                                                
                . $GLOBALS['phpgw']->strip_html($proall['num']) . ']');
***************
*** 807,811 ****
                        
$this->nextmatchs->template_alternate_row_color(&$this->t);
                        $this->t->set_var('e_account','<b>' . lang('sum') . 
'</b>');
!                       $this->t->set_var('e_activity','');
                        $hrs = floor($summin/60). ':' . sprintf 
("%02d",(int)($summin-floor($summin/60)*60));
                        $this->t->set_var('e_hours',$hrs);
--- 782,786 ----
                        
$this->nextmatchs->template_alternate_row_color(&$this->t);
                        $this->t->set_var('e_account','<b>' . lang('sum') . 
'</b>');
!                       $this->t->set_var('e_activity','&nbsp;');
                        $hrs = floor($summin/60). ':' . sprintf 
("%02d",(int)($summin-floor($summin/60)*60));
                        $this->t->set_var('e_hours',$hrs);




reply via email to

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