phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] projects/inc class.boprojects.inc.php, 1.60, 1.61 cla


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] projects/inc class.boprojects.inc.php, 1.60, 1.61 class.bostatistics.inc.php, 1.5, 1.6 class.uistatistics.inc.php, 1.20, 1.21
Date: Mon, 29 Sep 2003 14:51:30 +0000

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

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

Index: class.uistatistics.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.uistatistics.inc.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** class.uistatistics.inc.php  29 Sep 2003 00:36:35 -0000      1.20
--- class.uistatistics.inc.php  29 Sep 2003 14:51:26 -0000      1.21
***************
*** 50,54 ****
                        $action = get_var('action',array('POST','GET'));
  
!                       $this->boprojects                               = 
CreateObject('projects.boprojects',True,$action);
                        $this->bostatistics                             = 
CreateObject('projects.bostatistics');
                        $this->nextmatchs                               = 
CreateObject('phpgwapi.nextmatchs');
--- 50,54 ----
                        $action = get_var('action',array('POST','GET'));
  
!                       $this->boprojects                               = 
CreateObject('projects.boprojects',True,'pstat');
                        $this->bostatistics                             = 
CreateObject('projects.bostatistics');
                        $this->nextmatchs                               = 
CreateObject('phpgwapi.nextmatchs');
***************
*** 65,68 ****
--- 65,69 ----
                        $this->sort                                             
= $this->boprojects->sort;
                        $this->cat_id                                   = 
$this->boprojects->cat_id;
+                       $this->status                                   = 
$this->boprojects->status;
                }
  
***************
*** 76,80 ****
                                'order'         => $this->order,
                                'sort'          => $this->sort,
!                               'cat_id'        => $this->cat_id
                        );
                        $this->boprojects->save_sessiondata($data, $action);
--- 77,82 ----
                                'order'         => $this->order,
                                'sort'          => $this->sort,
!                               'cat_id'        => $this->cat_id,
!                               'status'        => $this->status
                        );
                        $this->boprojects->save_sessiondata($data, $action);
***************
*** 161,164 ****
--- 163,191 ----
                }
  
+               function status_format($status = '', $showarchive = False)
+               {
+                       if (!$status)
+                       {
+                               $status = $this->status = 'active';
+                       }
+ 
+                       switch ($status)
+                       {
+                               case 'active':          $stat_sel[0]=' 
selected'; break;
+                               case 'nonactive':       $stat_sel[1]=' 
selected'; break;
+                               case 'archive':         $stat_sel[2]=' 
selected'; break;
+                       }
+ 
+                       $status_list = '<option value="active"' . $stat_sel[0] 
. '>' . lang('Active') . '</option>' . "\n"
+                                               . '<option value="nonactive"' . 
$stat_sel[1] . '>' . lang('Nonactive') . '</option>' . "\n";
+ 
+                       if ($showarchive)
+                       {
+                               $status_list .= '<option value="archive"' . 
$stat_sel[2] . '>' . lang('Archive') . '</option>' . "\n";
+                       }
+                       return $status_list;
+               }
+ 
+ 
                function list_projects()
                {
***************
*** 219,246 ****
  
                        
$GLOBALS['phpgw']->template->set_var('action_list',$action_list);
-                       
$GLOBALS['phpgw']->template->set_var('filter_action',$GLOBALS['phpgw']->link('/index.php',$link_data));
                        
$GLOBALS['phpgw']->template->set_var('filter_list',$this->nextmatchs->new_filter($this->filter));
-                       
$GLOBALS['phpgw']->template->set_var('search_action',$GLOBALS['phpgw']->link('/index.php',$link_data));
                        
$GLOBALS['phpgw']->template->set_var('search_list',$this->nextmatchs->search(array('query'
 => $this->query)));
  
! // ---------------- list header variable template-declarations 
--------------------------
! 
!                       
$GLOBALS['phpgw']->template->set_var(sort_number,$this->nextmatchs->show_sort_order($this->sort,'num',$this->order,'/index.php',lang('Project
 ID'),$link_data));
  
!                       if ($action == 'mains')
!                       {
!                               
$GLOBALS['phpgw']->template->set_var(sort_action,$this->nextmatchs->show_sort_order($this->sort,'customer',$this->order,'/index.php',lang('Customer'),$link_data));
!                               $lang_action = '<td width="5%" align="center">' 
. lang('Jobs') . '</td>' . "\n";
!                               
$GLOBALS['phpgw']->template->set_var('lang_action',$lang_action);
!                       }
!                       else
!                       {
!                               
$GLOBALS['phpgw']->template->set_var(sort_action,$this->nextmatchs->show_sort_order($this->sort,'start_date',$this->order,'/index.php',lang('Start
 date'),$link_data));
!                               
$GLOBALS['phpgw']->template->set_var('lang_action','');
!                       }
  
!                       
$GLOBALS['phpgw']->template->set_var('sort_status',$this->nextmatchs->show_sort_order($this->sort,'status',$this->order,'/index.php',lang('Status'),$link_data));
                        
$GLOBALS['phpgw']->template->set_var('sort_title',$this->nextmatchs->show_sort_order($this->sort,'title',$this->order,'/index.php',lang('Title'),$link_data));
!                       
$GLOBALS['phpgw']->template->set_var('sort_end_date',$this->nextmatchs->show_sort_order($this->sort,'end_date',$this->order,'/index.php',lang('Date
 due'),$link_data));
                        
$GLOBALS['phpgw']->template->set_var('sort_coordinator',$this->nextmatchs->show_sort_order($this->sort,'coordinator',$this->order,'/index.php',lang('Coordinator'),$link_data));
  
--- 246,262 ----
  
                        
$GLOBALS['phpgw']->template->set_var('action_list',$action_list);
                        
$GLOBALS['phpgw']->template->set_var('filter_list',$this->nextmatchs->new_filter($this->filter));
                        
$GLOBALS['phpgw']->template->set_var('search_list',$this->nextmatchs->search(array('query'
 => $this->query)));
+                       
$GLOBALS['phpgw']->template->set_var('status_list',$this->status_format($this->status));
  
!                       
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
  
! // ---------------- list header variable template-declarations 
--------------------------
  
!                       
$GLOBALS['phpgw']->template->set_var('sort_number',$this->nextmatchs->show_sort_order($this->sort,'num',$this->order,'/index.php',lang('Project
 ID'),$link_data));
!                       
$GLOBALS['phpgw']->template->set_var('sort_action',$this->nextmatchs->show_sort_order($this->sort,'customer',$this->order,'/index.php',lang('Customer'),$link_data));
                        
$GLOBALS['phpgw']->template->set_var('sort_title',$this->nextmatchs->show_sort_order($this->sort,'title',$this->order,'/index.php',lang('Title'),$link_data));
!                       
$GLOBALS['phpgw']->template->set_var('sort_sdate',$this->nextmatchs->show_sort_order($this->sort,'start_date',$this->order,'/index.php',lang('Start
 date'),$link_data));
!                       
$GLOBALS['phpgw']->template->set_var('sort_edate',$this->nextmatchs->show_sort_order($this->sort,'end_date',$this->order,'/index.php',lang('Date
 due'),$link_data));
                        
$GLOBALS['phpgw']->template->set_var('sort_coordinator',$this->nextmatchs->show_sort_order($this->sort,'coordinator',$this->order,'/index.php',lang('Coordinator'),$link_data));
  
***************
*** 250,269 ****
              {
                                
$this->nextmatchs->template_alternate_row_color(&$GLOBALS['phpgw']->template);
-                               $edate = $pro[$i]['edate'];
-                               if ($edate == 0)
-                               {
-                                       $edateout = '&nbsp;';
-                               }
-                               else
-                               {
-                                       $month  = 
$GLOBALS['phpgw']->common->show_date(time(),'n');
-                                       $day    = 
$GLOBALS['phpgw']->common->show_date(time(),'d');
-                                       $year   = 
$GLOBALS['phpgw']->common->show_date(time(),'Y');
  
!                                       $edate = $edate + (60*60) * 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
!                                       $edateout = 
$GLOBALS['phpgw']->common->show_date($edate,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
!                                       if (mktime(2,0,0,$month,$day,$year) == 
$edate) { $edateout = '<b>' . $edateout . '</b>'; }
!                                       if (mktime(2,0,0,$month,$day,$year) >= 
$edate) { $edateout = '<font color="CC0000"><b>' . $edateout . '</b></font>'; }
!                               }
  
                                if ($action == 'mains')
--- 266,272 ----
              {
                                
$this->nextmatchs->template_alternate_row_color(&$GLOBALS['phpgw']->template);
  
!                               $edateout = 
$this->boprojects->formatted_edate($pro[$i]['edate']);
!                               $sdateout = 
$this->boprojects->formatted_edate($pro[$i]['sdate'],False);
  
                                if ($action == 'mains')
***************
*** 271,278 ****
                                        $td_action = 
($pro[$i]['customerout']?$pro[$i]['customerout']:'&nbsp;');
                                }
-                               else
-                               {
-                                       $td_action = 
($pro[$i]['sdateout']?$pro[$i]['sdateout']:'&nbsp;');
-                               }
  
  // --------------- template declaration for list records 
-------------------------------------
--- 274,277 ----
***************
*** 282,288 ****
                                        'number'                => 
$pro[$i]['number'],
                                        'td_action'             => $td_action,
-                                       'status'                => 
lang($pro[$i]['status']),
                                        'title'                 => 
($pro[$i]['title']?$pro[$i]['title']:'&nbsp;'),
!                                       'end_date'              => $edateout,
                                        'coordinator'   => 
$pro[$i]['coordinatorout']
                                ));
--- 281,287 ----
                                        'number'                => 
$pro[$i]['number'],
                                        'td_action'             => $td_action,
                                        'title'                 => 
($pro[$i]['title']?$pro[$i]['title']:'&nbsp;'),
!                                       'sdate'                 => 
(isset($pro[$i]['sdate'])?$sdateout:'&nbsp;'),
!                                       'edate'                 => 
(isset($pro[$i]['edate'])?$edateout:'&nbsp;'),
                                        'coordinator'   => 
$pro[$i]['coordinatorout']
                                ));
***************
*** 312,317 ****
                        
$GLOBALS['phpgw']->template->set_var('userstats_action',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uistatistics.list_users&action=ustat'));
  
                        
$GLOBALS['phpgw']->template->pfp('out','projects_list_t',True);
-                       $this->save_sessiondata($action);
                }
  
--- 311,316 ----
                        
$GLOBALS['phpgw']->template->set_var('userstats_action',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uistatistics.list_users&action=ustat'));
  
+                       $this->save_sessiondata('pstat');
                        
$GLOBALS['phpgw']->template->pfp('out','projects_list_t',True);
                }
  
***************
*** 575,578 ****
--- 574,579 ----
                {
                        $project_id     = 
get_var('project_id',array('GET','POST'));
+                       $smonth         = get_var('smonth',array('GET','POST'));
+                       $syear          = get_var('syear',array('GET','POST'));
  
                        if (! $project_id)
***************
*** 593,597 ****
                        
$GLOBALS['phpgw']->template->set_file(array('project_stat' => 
'stats_gant.tpl'));
  
!                       $this->bostatistics->show_graph($project_id);
  
                        
$GLOBALS['phpgw']->template->set_var('pix_src',$GLOBALS['phpgw_info']['server']['webserver_url']
 . SEP . 'phpgwapi' . SEP . 'images' . SEP . 'draw_tmp.png');
--- 594,613 ----
                        
$GLOBALS['phpgw']->template->set_file(array('project_stat' => 
'stats_gant.tpl'));
  
!                       if (!$smonth)
!                       {
!                               $smonth = date('m',time());
!                       }
! 
!                       if (!$syear)
!                       {
!                               $syear = date('Y',time());
!                       }
! 
!                       
$GLOBALS['phpgw']->template->set_var('date_select',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('syear',$syear),
!                                                                               
                                                                                
                                                
$this->sbox->getMonthText('smonth',$smonth),''));
!                       
$GLOBALS['phpgw']->template->set_var('project_id',$project_id);
!                       
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
! 
!                       $this->bostatistics->show_graph(array('project_id' => 
$project_id,'syear' => $syear, 'smonth' => $smonth));
  
                        
$GLOBALS['phpgw']->template->set_var('pix_src',$GLOBALS['phpgw_info']['server']['webserver_url']
 . SEP . 'phpgwapi' . SEP . 'images' . SEP . 'draw_tmp.png');

Index: class.boprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.boprojects.inc.php,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -d -r1.60 -r1.61
*** class.boprojects.inc.php    29 Sep 2003 00:36:35 -0000      1.60
--- class.boprojects.inc.php    29 Sep 2003 14:51:24 -0000      1.61
***************
*** 125,128 ****
--- 125,129 ----
                                case 'asubs'    : $column = 'projects_asubs'; 
break;
                                case 'ustat'    : $column = 'projects_ustat'; 
break;
+                               case 'pstat'    : $column = 'projects_pstat'; 
break;
                                case 'bill'             : $column = 
'projects_bill'; break;
                                case 'del'              : $column = 
'projects_del'; break;

Index: class.bostatistics.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.bostatistics.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** class.bostatistics.inc.php  29 Sep 2003 00:36:35 -0000      1.5
--- class.bostatistics.inc.php  29 Sep 2003 14:51:26 -0000      1.6
***************
*** 29,32 ****
--- 29,33 ----
        class bostatistics
        {
+               var $debug;
                var $start;
                var $query;
***************
*** 46,49 ****
--- 47,51 ----
                function bostatistics()
                {
+                       $this->debug            = False;
                        $this->sostatistics     = 
CreateObject('projects.sostatistics');
                        $this->boprojects       = 
CreateObject('projects.boprojects');
***************
*** 74,101 ****
                }
  
!               function set_x_text()
                {
!                       $weekday = 
strftime('%w',mktime(0,0,0,date('m'),date('d'),date('Y')));
!                       $weekend = date('d') + (7-$weekday);
  
-                       $graph_edate = 
mktime(0,0,0,date('m'),$weekend,date('Y'));
-                       $graph_sdate = 
mktime(0,0,0,date('m')-1,date('d'),date('Y'));
  
                        $graph_sdateout = 
$GLOBALS['phpgw']->common->show_date($graph_sdate,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
                        $graph_edateout = 
$GLOBALS['phpgw']->common->show_date($graph_edate,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
-                       $sdiff  = $graph_edate - $graph_sdate;
-                       $mdiff  = $sdiff/60;
-                       $sdiff  = $mdiff/60;
  
!                       $diff   = $sdiff/24;
                        $this->date_diff        = $diff;
  
!                       //echo 'DIFF: ' . $tdiff;
!                       //exit;
!                       $this->graph->line_captions_x[0]['date_formatted']      
= $GLOBALS['phpgw']->common->show_date($graph_sdate,'d/m');
                        $this->graph->line_captions_x[0]['date']                
        = $graph_sdate;
-                       $this->graph->line_captions_x[0]['x']                   
        = 0;
  
!                       for ($i=1;$i<$diff;$i++)
                        {
                                $temp_date = '';
--- 76,95 ----
                }
  
!               function set_x_text($smonth,$syear)
                {
!                       $graph_sdate = mktime(0,0,0,$smonth,1,$syear);
!                       $graph_edate = 
mktime(0,0,0,$smonth,date('t',$graph_sdate),$syear);
  
  
                        $graph_sdateout = 
$GLOBALS['phpgw']->common->show_date($graph_sdate,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
                        $graph_edateout = 
$GLOBALS['phpgw']->common->show_date($graph_edate,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
  
!                       $diff                           = date('t',$smonth);
                        $this->date_diff        = $diff;
  
!                       $this->graph->line_captions_x[0]['date_formatted']      
= $GLOBALS['phpgw']->common->show_date($graph_sdate,'m/d');
                        $this->graph->line_captions_x[0]['date']                
        = $graph_sdate;
  
!                       for ($i=1;$i<($diff-1);$i++)
                        {
                                $temp_date = '';
***************
*** 104,113 ****
                                
$this->graph->line_captions_x[$i]['date_formatted']     = 
$GLOBALS['phpgw']->common->show_date($temp_date,'d');
                                $this->graph->line_captions_x[$i]['date']       
                = $temp_date;
-                               $this->graph->line_captions_x[$i]['x']          
                = $i*20;
                        }
  
!                       $this->graph->line_captions_x[$diff]['date_formatted']  
= $GLOBALS['phpgw']->common->show_date($graph_edate,'d/m');
                        $this->graph->line_captions_x[$diff]['date']            
        = $graph_edate;
-                       $this->graph->line_captions_x[$diff]['x']               
                = $diff*20;
  
                        $this->graph->title = lang('Gantt chart from %1 to %2', 
$graph_sdateout,$graph_edateout);
--- 98,105 ----
                                
$this->graph->line_captions_x[$i]['date_formatted']     = 
$GLOBALS['phpgw']->common->show_date($temp_date,'d');
                                $this->graph->line_captions_x[$i]['date']       
                = $temp_date;
                        }
  
!                       $this->graph->line_captions_x[$diff]['date_formatted']  
= $GLOBALS['phpgw']->common->show_date($graph_edate,'m/d');
                        $this->graph->line_captions_x[$diff]['date']            
        = $graph_edate;
  
                        $this->graph->title = lang('Gantt chart from %1 to %2', 
$graph_sdateout,$graph_edateout);
***************
*** 122,142 ****
                }
  
!               function show_graph($project_id)
                {
!                       $this->graph = CreateObject('phpgwapi.gdgraph');
                        $pro = $this->boprojects->list_projects(array('type' => 
'mainandsubs','main' => $project_id,'mstones_stat' => True));
  
!                       //_debug_array($pro);
  
!                       $this->graph->data = $pro;
  
!                       $this->set_x_text();
  
!                       $this->set_y_text($pro);
  
!                       $this->graph->num_lines_y = count($pro)+2;
!                       $this->graph->num_lines_x = $this->date_diff + 1;
!                       $this->graph->colors = array('red','blue');
  
                        $this->graph->render();
                }
--- 114,164 ----
                }
  
!               function show_graph($params)
                {
!                       $project_id     = $params['project_id'];
!                       $syear          = 
(isset($params['syear'])?$params['syear']:date('Y'));
!                       $smonth         = 
(isset($params['smonth'])?$params['smonth']:date('m'));
! 
!                       $this->graph = 
CreateObject('phpgwapi.gdgraph',$this->debug);
! 
!                       $this->boprojects->order = 'level';
!                       $this->boprojects->sort = 'DESC';
                        $pro = $this->boprojects->list_projects(array('type' => 
'mainandsubs','main' => $project_id,'mstones_stat' => True));
  
!                       while(is_array($pro) && list(,$p) = each($pro))
!                       {
!                               while(is_array($p['mstones']) && list(,$s) = 
each($p['mstones']))
!                               {
!                                       $spro[] = array
!                                       (
!                                               'title'                 => 
$s['title'],
!                                               'extracolor'    => 'yellow',
!                                               'sdate'                 => 
$p['sdate'],
!                                               'edate'                 => 
$s['edate'],
!                                               'pro_id'                => 
$p['project_id']
!                                       );
!                               }
  
!                               $spro[] = array
!                               (
!                                       'title'         => $p['title'],
!                                       'sdate'         => $p['sdate'],
!                                       'edate'         => 
$p['edate']?$p['edate']:mktime(0,0,0,date('m'),date('d'),date('Y')),
!                                       'color'         => $p['level'],
!                                       'pro_id'        => $p['project_id']
!                               );
!                       }
  
!                       if(is_array($spro))
!                       {
!                               $this->graph->data = $spro;
!                       }
  
!                       $this->set_x_text($smonth,$syear);
  
!                       $this->set_y_text($spro);
  
+                       $this->graph->num_lines_y = count($spro)+2;
+                       $this->graph->num_lines_x = $this->date_diff;
                        $this->graph->render();
                }





reply via email to

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