phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: projects/inc class.boprojects.inc.php,1.42.2.5.2


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: projects/inc class.boprojects.inc.php,1.42.2.5.2.12,1.42.2.5.2.13 class.soprojecthours.inc.php,1.8.4.2,1.8.4.3 class.soprojects.inc.php,1.34.2.6.2.10,1.34.2.6.2.11 class.uiprojects.inc.php,1.47.2.7.2.9,1.47.2.7.2.10
Date: Sat, 07 Jun 2003 19:34:05 -0400

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

Modified Files:
      Tag: Version-0_9_16-branch
        class.boprojects.inc.php class.soprojecthours.inc.php 
        class.soprojects.inc.php class.uiprojects.inc.php 
Log Message:
update

Index: class.boprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.boprojects.inc.php,v
retrieving revision 1.42.2.5.2.12
retrieving revision 1.42.2.5.2.13
diff -C2 -r1.42.2.5.2.12 -r1.42.2.5.2.13
*** class.boprojects.inc.php    7 Jun 2003 01:05:02 -0000       1.42.2.5.2.12
--- class.boprojects.inc.php    7 Jun 2003 23:34:03 -0000       1.42.2.5.2.13
***************
*** 169,172 ****
--- 169,187 ----
                }
  
+               function return_date()
+               {
+                       $date = array
+                       (
+                               'month'         => 
$GLOBALS['phpgw']->common->show_date(time(),'n'),
+                               'day'           => 
$GLOBALS['phpgw']->common->show_date(time(),'d'),
+                               'year'          => 
$GLOBALS['phpgw']->common->show_date(time(),'Y')
+                       );
+ 
+                       $date['daydate']                = 
mktime(2,0,0,$date['month'],$date['day'],$date['year']);
+                       $date['monthdate']              = 
mktime(2,0,0,$date['month']+2,0,$date['year']);
+                       $date['monthformatted'] = 
$GLOBALS['phpgw']->common->show_date($date['monthdate'],'n/Y');
+                       return $date;
+               }
+ 
                function read_abook($start, $query, $qfilter, $sort, $order)
                {
***************
*** 196,199 ****
--- 211,219 ----
                }
  
+               function list_pcosts($project_id)
+               {
+                       return $this->so->list_pcosts($project_id);
+               }
+ 
                function read_prefs()
                {
***************
*** 416,446 ****
                {
                        $pro = $this->so->read_single_project($project_id);
-                       $pro['utime'] = 
$this->sohours->get_time_used($project_id);
  
!                       $pro['phours']          = ($pro['ptime']/60);
!                       //$pro['pminutes']      = 
$pro['ptime']-(floor($pro['ptime']/60)*60);
!                       $pro['uhours']          = ($pro['utime']/60);
!                       //$pro['uminutes']      = 
$pro['utime']-(floor($pro['utime']/60)*60);
  
                        if ($pro['edate'] == 0)
                        {
!                               $pro['edate_formatted'] = '&nbsp;';
                        }
                        else
                        {
!                               $pro['edate'] = $pro['edate'] + (60*60) * 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
!                               $pro['edate_formatted'] = 
$GLOBALS['phpgw']->common->show_date($pro['edate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
                        }
  
!                       $pro['sdate'] = $pro['sdate'] + (60*60) * 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
!                       $pro['sdate_formatted'] = 
$GLOBALS['phpgw']->common->show_date($pro['sdate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
  
!                       $pro['udate'] = $pro['udate'] + (60*60) * 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
!                       $pro['udate_formatted'] = 
$GLOBALS['phpgw']->common->show_date($pro['udate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
  
!                       $pro['cdate'] = $pro['cdate'] + (60*60) * 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
!                       $pro['cdate_formatted'] = 
$GLOBALS['phpgw']->common->show_date($pro['cdate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
  
!                       return $pro;
                }
  
--- 436,482 ----
                {
                        $pro = $this->so->read_single_project($project_id);
  
!                       $project = array
!                       (
!                               'utime'                         => 
$this->sohours->get_time_used($project_id),
!                               'phours'                        => 
($pro['ptime']/60),
!                               'uhours'                        => 
($pro['utime']/60),
!                               'title'                         => 
$GLOBALS['phpgw']->strip_html($pro['title']),
!                               'number'                        => 
$GLOBALS['phpgw']->strip_html($pro['number']),
!                               'investment_nr'         => 
$GLOBALS['phpgw']->strip_html($pro['investment_nr']),
!                               'descr'                         => 
$GLOBALS['phpgw']->strip_html($pro['descr']),
!                               'budget'                        => 
$pro['budget'],
!                               'pcosts'                        => 
$pro['pcosts'],
!                               'project_id'            => $pro['project_id'],
!                               'parent'                        => 
$pro['parent'],
!                               'cat'                           => $pro['cat'],
!                               'access'                        => 
$pro['access'],
!                               'coordinator'           => $pro['coordinator'],
!                               'customer'                      => 
$pro['customer'],
!                               'status'                        => 
$pro['status'],
!                               'owner'                         => 
$pro['owner'],
!                               'processor'                     => 
$pro['processor']
!                       );
  
                        if ($pro['edate'] == 0)
                        {
!                               $project['edate_formatted'] = '&nbsp;';
                        }
                        else
                        {
!                               $project['edate'] = $pro['edate'] + (60*60) * 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
!                               $project['edate_formatted'] = 
$GLOBALS['phpgw']->common->show_date($pro['edate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
                        }
  
!                       $project['sdate'] = $pro['sdate'] + (60*60) * 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
!                       $project['sdate_formatted'] = 
$GLOBALS['phpgw']->common->show_date($pro['sdate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
  
!                       $project['udate'] = $pro['udate'] + (60*60) * 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
!                       $project['udate_formatted'] = 
$GLOBALS['phpgw']->common->show_date($pro['udate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
  
!                       $project['cdate'] = $pro['cdate'] + (60*60) * 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
!                       $project['cdate_formatted'] = 
$GLOBALS['phpgw']->common->show_date($pro['cdate'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
  
!                       return $project;
                }
  
***************
*** 692,695 ****
--- 728,734 ----
                        }
  
+                       $month = $this->return_date();
+                       $values['monthdate'] = $month['monthdate'];
+ 
                        $values['ptime'] = intval($values['ptime'])*60;
  
***************
*** 708,711 ****
--- 747,752 ----
                                $values['edate'] = 
mktime(0,0,0,$values['emonth'],$values['eday'],$values['eyear']);
                        }
+ 
+                       //_debug_array($values);
  
                        if ($values['project_id'])

Index: class.soprojecthours.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.soprojecthours.inc.php,v
retrieving revision 1.8.4.2
retrieving revision 1.8.4.3
diff -C2 -r1.8.4.2 -r1.8.4.3
*** class.soprojecthours.inc.php        2 Jun 2003 22:11:23 -0000       1.8.4.2
--- class.soprojecthours.inc.php        7 Jun 2003 23:34:03 -0000       1.8.4.3
***************
*** 45,52 ****
                        else
                        {
!                               $ordermethod = " order by start_date asc";
                        }
  
!                       $filtermethod = " project_id = '$project_id'";
  
                        if ($state != 'all')
--- 45,52 ----
                        else
                        {
!                               $ordermethod = ' order by start_date asc';
                        }
  
!                       $filtermethod = ' project_id =' . $project_id;
  
                        if ($state != 'all')
***************
*** 57,61 ****
                        if ($filter == 'yours')
                        {
!                               $filtermethod .= " AND employee='" . 
$this->account . "'";
                        }
  
--- 57,61 ----
                        if ($filter == 'yours')
                        {
!                               $filtermethod .= ' AND employee=' . 
$this->account;
                        }
  
***************
*** 71,86 ****
                        $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
  
-                       $i = 0;
                        while ($this->db->next_record())
                        {
!                               $hours[$i]['hours_id']          = 
$this->db->f('id');
!                               $hours[$i]['project_id']        = 
$this->db->f('project_id');
!                               $hours[$i]['hours_descr']       = 
$this->db->f('hours_descr');
!                               $hours[$i]['status']            = 
$this->db->f('status');
!                               $hours[$i]['sdate']                     = 
$this->db->f('start_date');
!                               $hours[$i]['edate']                     = 
$this->db->f('end_date');
!                               $hours[$i]['minutes']           = 
$this->db->f('minutes');
!                               $hours[$i]['employee']          = 
$this->db->f('employee');
!                               $i++;
                        }
                        return $hours;
--- 71,87 ----
                        $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
  
                        while ($this->db->next_record())
                        {
!                               $hours[] = array
!                               (
!                                       'hours_id'              => 
$this->db->f('id'),
!                                       'project_id'    => 
$this->db->f('project_id'),
!                                       'hours_descr'   => 
$this->db->f('hours_descr'),
!                                       'status'                => 
$this->db->f('status'),
!                                       'sdate'                 => 
$this->db->f('start_date'),
!                                       'edate'                 => 
$this->db->f('end_date'),
!                                       'minutes'               => 
$this->db->f('minutes'),
!                                       'employee'              => 
$this->db->f('employee')
!                               );
                        }
                        return $hours;
***************
*** 89,93 ****
                function read_single_hours($hours_id)
                {
!                       $this->db->query("SELECT * from phpgw_p_hours WHERE 
id='$hours_id'",__LINE__,__FILE__);
        
                        while($this->db->next_record())
--- 90,94 ----
                function read_single_hours($hours_id)
                {
!                       $this->db->query('SELECT * from phpgw_p_hours WHERE 
id=' . $hours_id,__LINE__,__FILE__);
        
                        while($this->db->next_record())
***************
*** 116,124 ****
                        $values['remark']               = 
$this->db->db_addslashes($values['remark']);
  
!                       $this->db->query("INSERT into phpgw_p_hours 
(project_id,activity_id,entry_date,start_date,end_date,hours_descr,remark,minutes,"
!                                                       . 
"status,minperae,billperae,employee,pro_parent) VALUES ('" . 
$values['project_id'] . "','" . $values['activity_id'] . "','"
!                                                       . time() . "','" . 
$values['sdate'] . "','" . $values['edate'] . "','" . $values['hours_descr'] . 
"','"
!                                                       . $values['remark'] . 
"','" . $values['ae_minutes'] . "','" . $values['status'] . "','" . 
$values['minperae']
!                                                       . "','" . 
$values['billperae'] . "','" . $values['employee'] . "','" . 
$values['pro_parent'] . "')",__LINE__,__FILE__); 
                }
  
--- 117,125 ----
                        $values['remark']               = 
$this->db->db_addslashes($values['remark']);
  
!                       $this->db->query('INSERT into phpgw_p_hours 
(project_id,activity_id,entry_date,start_date,end_date,hours_descr,remark,minutes,'
!                                                       . 
'status,minperae,billperae,employee,pro_parent) VALUES (' . 
$values['project_id'] . ',' . $values['activity_id'] . ','
!                                                       . time() . ',' . 
$values['sdate'] . ',' . $values['edate'] . ",'" . $values['hours_descr'] . 
"','"
!                                                       . $values['remark'] . 
"'," . $values['ae_minutes'] . ",'" . $values['status'] . "'," . 
$values['minperae']
!                                                       . ',' . 
$values['billperae'] . ',' . $values['employee'] . ',' . $values['pro_parent'] 
. ')',__LINE__,__FILE__); 
                }
  
***************
*** 129,147 ****
                        $values['remark']               = 
$this->db->db_addslashes($values['remark']);
  
!                       $this->db->query("UPDATE phpgw_p_hours SET 
activity_id='" . $values['activity_id'] . "',entry_date='" . time() . 
"',start_date='"
!                                                       . $values['sdate'] . 
"',end_date='" . $values['edate'] . "',hours_descr='" . $values['hours_descr'] 
. "',remark='"
!                                                       . $values['remark'] . 
"',minutes='" . $values['ae_minutes'] . "',status='" . $values['status'] . 
"',minperae='"
!                                                       . $values['minperae'] . 
"',billperae='" . $values['billperae'] . "',employee='" . $values['employee']
!                                                       . "' where id='" . 
$values['hours_id'] . "'",__LINE__,__FILE__);
                }
  
                function delete_hours($hours_id)
                {
!                       $this->db->query("Delete from phpgw_p_hours where id = 
'$hours_id'",__LINE__,__FILE__);
                }
  
                function update_hours_act($activity_id, $minperae)
                {
!                       $this->db->query("SELECT id,minperae from phpgw_p_hours 
where activity_id='" . $activity_id . "'",__LINE__,__FILE__); 
  
                        while ($this->db->next_record())
--- 130,148 ----
                        $values['remark']               = 
$this->db->db_addslashes($values['remark']);
  
!                       $this->db->query('UPDATE phpgw_p_hours SET 
activity_id=' . $values['activity_id'] . ',entry_date=' . time() . 
',start_date='
!                                                       . $values['sdate'] . 
',end_date=' . $values['edate'] . ",hours_descr='" . $values['hours_descr'] . 
"',remark='"
!                                                       . $values['remark'] . 
"',minutes=" . $values['ae_minutes'] . ",status='" . $values['status'] . 
"',minperae="
!                                                       . $values['minperae'] . 
',billperae=' . $values['billperae'] . ',employee=' . $values['employee']
!                                                       . ' where id=' . 
$values['hours_id'],__LINE__,__FILE__);
                }
  
                function delete_hours($hours_id)
                {
!                       $this->db->query('Delete from phpgw_p_hours where id=' 
. $hours_id,__LINE__,__FILE__);
                }
  
                function update_hours_act($activity_id, $minperae)
                {
!                       $this->db->query('SELECT id,minperae from phpgw_p_hours 
where activity_id=' . $activity_id,__LINE__,__FILE__); 
  
                        while ($this->db->next_record())
***************
*** 157,161 ****
                                for ($i=0;$i<=count($hours);$i++)
                                {
!                                       $this->db->query("UPDATE phpgw_p_hours 
set minperae='" . $minperae . "' WHERE id='" . $hours[$i] . 
"'",__LINE__,__FILE__);
                                }
                        }
--- 158,162 ----
                                for ($i=0;$i<=count($hours);$i++)
                                {
!                                       $this->db->query('UPDATE phpgw_p_hours 
set minperae=' . $minperae . ' WHERE id=' . $hours[$i],__LINE__,__FILE__);
                                }
                        }

Index: class.soprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.soprojects.inc.php,v
retrieving revision 1.34.2.6.2.10
retrieving revision 1.34.2.6.2.11
diff -C2 -r1.34.2.6.2.10 -r1.34.2.6.2.11
*** class.soprojects.inc.php    7 Jun 2003 00:21:39 -0000       1.34.2.6.2.10
--- class.soprojects.inc.php    7 Jun 2003 23:34:03 -0000       1.34.2.6.2.11
***************
*** 304,307 ****
--- 304,313 ----
                                        }
                                }
+ 
+                               if ($values['pcosts'] && $values['pcosts'] != 0)
+                               {
+                                       $this->db->query('INSERT into 
phpgw_p_pcosts (project_id,month,pcosts) VALUES (' . $p_id . ',' . 
$values['monthdate'] . ','
+                                                                       . 
$values['pcosts'] . ')',__LINE__,__FILE__);
+                               }
                                return $p_id;
                        }
***************
*** 347,350 ****
--- 353,373 ----
                                }
                        }
+ 
+                       $this->db->query('SELECT max(month) FROM phpgw_p_pcosts 
where project_id=' . $values['project_id'],__LINE__,__FILE__);
+                       if($this->db->next_record())
+                       {
+                               $month = $this->db->f(0);
+                       }
+ 
+                       if($values['monthdate'] > intval($month))
+                       {
+                               $this->db->query('INSERT into phpgw_p_pcosts 
(project_id,month,pcosts) VALUES (' . $values['project_id'] . ',' . 
$values['monthdate'] . ','
+                                                                       . 
$values['pcosts'] . ')',__LINE__,__FILE__);
+                       }
+                       else
+                       {
+                               $this->db->query('UPDATE phpgw_p_pcosts set 
pcosts=' . $values['pcosts'] . ' WHERE project_id=' . $values['project_id']
+                                                               . ' AND month=' 
. $values['monthdate'],__LINE__,__FILE__);
+                       }
                }
  
***************
*** 496,500 ****
                                if ($this->db->next_record())
                                {
!                                       $thing = 
$GLOBALS['phpgw']->strip_html($this->db->f('descr')) . ' [' . 
$GLOBALS['phpgw']->strip_html($this->db->f('num')) . ']';
                                }
                        }
--- 519,523 ----
                                if ($this->db->next_record())
                                {
!                                       $bla = 
$GLOBALS['phpgw']->strip_html($this->db->f('descr')) . ' [' . 
$GLOBALS['phpgw']->strip_html($this->db->f('num')) . ']';
                                }
                        }
***************
*** 504,508 ****
                                if ($this->db->next_record())
                                {
!                                       $thing = $this->db->f('coordinator');
                                }
                        }
--- 527,531 ----
                                if ($this->db->next_record())
                                {
!                                       $bla = $this->db->f('coordinator');
                                }
                        }
***************
*** 524,536 ****
                                        if ($action == 'pro')
                                        {
!                                               return 
$GLOBALS['phpgw']->strip_html($this->db->f('title')) . ' ['
                                                                . 
$GLOBALS['phpgw']->strip_html($this->db->f('num')) . ']';
                                        }
                                        else
                                        {
!                                               return 
$GLOBALS['phpgw']->strip_html($this->db->f($column));
                                        }
                                }
                        }
                }
  
--- 547,560 ----
                                        if ($action == 'pro')
                                        {
!                                               $bla = 
$GLOBALS['phpgw']->strip_html($this->db->f('title')) . ' ['
                                                                . 
$GLOBALS['phpgw']->strip_html($this->db->f('num')) . ']';
                                        }
                                        else
                                        {
!                                               $bla = 
$GLOBALS['phpgw']->strip_html($this->db->f($column));
                                        }
                                }
                        }
+                       return $bla;
                }
  
***************
*** 1015,1018 ****
--- 1039,1057 ----
                                return $this->db->f('sumvalue');
                        }
+               }
+ 
+               function list_pcosts($project_id)
+               {
+                       $this->db->query('SELECT month,pcosts from 
phpgw_p_pcosts where project_id=' . intval($project_id) . ' order by month 
DESC',__LINE__,__FILE__);
+ 
+                       while ($this->db->next_record())
+                       {
+                               $costs[] = array
+                               (
+                                       'month'         => 
$this->db->f('month'),
+                                       'pcosts'        => 
$this->db->f('pcosts')
+                               );
+                       }
+                       return $costs;
                }
  

Index: class.uiprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.uiprojects.inc.php,v
retrieving revision 1.47.2.7.2.9
retrieving revision 1.47.2.7.2.10
diff -C2 -r1.47.2.7.2.9 -r1.47.2.7.2.10
*** class.uiprojects.inc.php    7 Jun 2003 01:05:02 -0000       1.47.2.7.2.9
--- class.uiprojects.inc.php    7 Jun 2003 23:34:03 -0000       1.47.2.7.2.10
***************
*** 50,54 ****
                        'archive'                       => True,
                        'accounts_popup'        => True,
!                       'list_budget'           => True
                );
  
--- 50,55 ----
                        'archive'                       => True,
                        'accounts_popup'        => True,
!                       'list_budget'           => True,
!                       'view_pcosts'           => True
                );
  
***************
*** 134,137 ****
--- 135,139 ----
                        
$GLOBALS['phpgw']->template->set_var('lang_ptime',lang('time planned'));
                        
$GLOBALS['phpgw']->template->set_var('lang_utime',lang('time used'));
+                       
$GLOBALS['phpgw']->template->set_var('lang_month',lang('month'));
  
                        
$GLOBALS['phpgw']->template->set_var('lang_done',lang('done'));
***************
*** 591,595 ****
                        
$GLOBALS['phpgw']->template->set_var('currency',$prefs['currency']);
                        
$GLOBALS['phpgw']->template->set_var('budget',$values['budget']);
-                       
$GLOBALS['phpgw']->template->set_var('pcosts',$values['pcosts']);
  
                        
$GLOBALS['phpgw']->template->set_var('number',$values['number']);
--- 593,596 ----
***************
*** 598,601 ****
--- 599,605 ----
                        
$GLOBALS['phpgw']->template->set_var('phours',$values['phours']);
  
+                       $month = $this->bo->return_date();
+                       
$GLOBALS['phpgw']->template->set_var('month',$month['monthformatted']);
+ 
                        
$GLOBALS['phpgw']->template->set_var('status_list',$this->status_format($values['status']));
  
***************
*** 636,639 ****
--- 640,645 ----
                                                                                
                         . '" size="50" maxlength="45">');
  
+                               
$GLOBALS['phpgw']->template->set_var('pcosts','<input type="text" 
name="values[pcosts]" value="' . $values['pcosts'] . '">');
+ 
  // ------------ activites bookable ----------------------
  
***************
*** 662,665 ****
--- 668,672 ----
                                
$GLOBALS['phpgw']->template->set_var('lang_number',lang('Job ID'));
                                
$GLOBALS['phpgw']->template->set_var('investment_nr',$parent['investment_nr']);
+                               
$GLOBALS['phpgw']->template->set_var('pcosts',$parent['pcosts']);
                        }
  
***************
*** 751,754 ****
--- 758,762 ----
                                
$GLOBALS['phpgw']->template->set_var('investment_nr',$values['investment_nr']);
                                
$GLOBALS['phpgw']->template->set_var('lang_number',lang('Project ID'));
+                               
$GLOBALS['phpgw']->template->set_var('pcosts',$values['pcosts']);
                        }
                        else
***************
*** 760,764 ****
                                        
$GLOBALS['phpgw']->template->set_var('pro_parent',$GLOBALS['phpgw']->strip_html($parent['number'])
 . ' ' . $GLOBALS['phpgw']->strip_html($parent['title']));
                                        
$GLOBALS['phpgw']->template->set_var('cat',$this->cats->id2name($parent['cat']));
!                                       
$GLOBALS['phpgw']->template->set_var('investment_nr',$parent['investment_nr']);
                                }
                                
$GLOBALS['phpgw']->template->set_var('lang_number',lang('Job ID'));
--- 768,773 ----
                                        
$GLOBALS['phpgw']->template->set_var('pro_parent',$GLOBALS['phpgw']->strip_html($parent['number'])
 . ' ' . $GLOBALS['phpgw']->strip_html($parent['title']));
                                        
$GLOBALS['phpgw']->template->set_var('cat',$this->cats->id2name($parent['cat']));
!                                       
$GLOBALS['phpgw']->template->set_var('investment_nr',($parent['investment_nr']?$parent['investment_nr']:'&nbsp;'));
!                                       
$GLOBALS['phpgw']->template->set_var('pcosts',$parent['pcosts']);
                                }
                                
$GLOBALS['phpgw']->template->set_var('lang_number',lang('Job ID'));
***************
*** 767,780 ****
  
                        
$GLOBALS['phpgw']->template->set_var('number',$GLOBALS['phpgw']->strip_html($values['number']));
!                       $title = 
$GLOBALS['phpgw']->strip_html($values['title']);
!                       if (! $title) $title = '&nbsp;';
!                       $GLOBALS['phpgw']->template->set_var('title',$title);
!                       $descr = 
$GLOBALS['phpgw']->strip_html($values['descr']);
!                       if (! $descr) $descr = '&nbsp;';
!                       $GLOBALS['phpgw']->template->set_var('descr',$descr);
                        
$GLOBALS['phpgw']->template->set_var('status',lang($values['status']));
                        
$GLOBALS['phpgw']->template->set_var('budget',$values['budget']);
-                       
$GLOBALS['phpgw']->template->set_var('pcosts',$values['pcosts']);
                        
$GLOBALS['phpgw']->template->set_var('currency',$prefs['currency']);
  
                        
$GLOBALS['phpgw']->template->set_var('phours',$values['phours']);
--- 776,786 ----
  
                        
$GLOBALS['phpgw']->template->set_var('number',$GLOBALS['phpgw']->strip_html($values['number']));
!                       
$GLOBALS['phpgw']->template->set_var('title',($values['title']?$values['title']:'&nbsp;'));
!                       
$GLOBALS['phpgw']->template->set_var('descr',($values['descr']?$values['descr']:'&nbsp;'));
                        
$GLOBALS['phpgw']->template->set_var('status',lang($values['status']));
                        
$GLOBALS['phpgw']->template->set_var('budget',$values['budget']);
                        
$GLOBALS['phpgw']->template->set_var('currency',$prefs['currency']);
+                       $month = $this->bo->return_date();
+                       
$GLOBALS['phpgw']->template->set_var('month',$month['monthformatted']);
  
                        
$GLOBALS['phpgw']->template->set_var('phours',$values['phours']);
***************
*** 1767,1771 ****
  
                                $link_data['project_id'] = 
$pro[$i]['project_id'];
!                               $link_data['menuaction'] = 
'projects.uiprojects.view_project';
                                
$GLOBALS['phpgw']->template->set_var('view',$GLOBALS['phpgw']->link('/index.php',$link_data));
                                
$GLOBALS['phpgw']->template->set_var('lang_view_entry',lang('View'));
--- 1773,1777 ----
  
                                $link_data['project_id'] = 
$pro[$i]['project_id'];
!                               $link_data['menuaction'] = 
'projects.uiprojects.view_pcosts';
                                
$GLOBALS['phpgw']->template->set_var('view',$GLOBALS['phpgw']->link('/index.php',$link_data));
                                
$GLOBALS['phpgw']->template->set_var('lang_view_entry',lang('View'));
***************
*** 1786,1789 ****
--- 1792,1835 ----
  
                        $this->save_sessiondata($action);
+                       
$GLOBALS['phpgw']->template->pfp('out','projects_list_t',True);
+               }
+ 
+               function view_pcosts()
+               {
+                       $project_id = get_var('project_id',array('GET'));
+ 
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('projects') . ': ' . lang('list pcosts');
+ 
+                       $this->display_app_header();
+ 
+                       
$GLOBALS['phpgw']->template->set_file(array('projects_list_t' => 
'list_pcosts.tpl'));
+                       
$GLOBALS['phpgw']->template->set_block('projects_list_t','projects_list','list');
+                       
$GLOBALS['phpgw']->template->set_var('done_action',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_projects'));
+                       $pcosts = $this->bo->list_pcosts($project_id);
+ 
+                       for ($i=0;$i<count($pcosts);$i++)
+             {
+                               
$this->nextmatchs->template_alternate_row_color(&$GLOBALS['phpgw']->template);
+ 
+ // --------------- template declaration for list records 
-------------------------------------
+ 
+                               if ($pcosts[$i]['month'] > 0)
+                               {
+                                       $pcosts[$i]['month'] = 
$pcosts[$i]['month'] + (60*60) * 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
+                                       $pdateout = 
$GLOBALS['phpgw']->common->show_date($pcosts[$i]['month'],'n/Y');
+                               }
+                               else
+                               {
+                                       $pdateout = '&nbsp;';
+                               }
+ 
+                               $GLOBALS['phpgw']->template->set_var(array
+                               (
+                                       'month'         => $pdateout,
+                                       'pcosts'        => 
($pcosts[$i]['pcosts']?$pcosts[$i]['pcosts']:'&nbsp;')
+                               ));
+ 
+                               
$GLOBALS['phpgw']->template->parse('list','projects_list',True);
+                       }
                        
$GLOBALS['phpgw']->template->pfp('out','projects_list_t',True);
                }





reply via email to

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