phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: property/inc class.bowo_hour.inc.php,1.2,1.3 cla


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.bowo_hour.inc.php,1.2,1.3 class.sowo_hour.inc.php,1.2,1.3 class.uiwo_hour.inc.php,1.2,1.3
Date: Wed, 26 Mar 2003 07:31:58 -0500

Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv28778/inc

Modified Files:
        class.bowo_hour.inc.php class.sowo_hour.inc.php 
        class.uiwo_hour.inc.php 
Log Message:
no message

Index: class.bowo_hour.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bowo_hour.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.bowo_hour.inc.php     24 Mar 2003 17:37:24 -0000      1.2
--- class.bowo_hour.inc.php     26 Mar 2003 12:31:56 -0000      1.3
***************
*** 263,267 ****
                {
  
! _debug_array($values);
  
  
--- 263,267 ----
                {
  
! //_debug_array($values);
  
  
***************
*** 317,323 ****
                                if ($values['hour_id'] != 0)
                                {
!                                       $receipt['hour_id'] = 
$values['hour_id'];
! 
!                                       $this->so->edit($values);
                                }
                        }
--- 317,321 ----
                                if ($values['hour_id'] != 0)
                                {
!                                       $receipt = 
$this->so->edit($values,$workorder_id);
                                }
                        }

Index: class.sowo_hour.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sowo_hour.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.sowo_hour.inc.php     24 Mar 2003 17:37:24 -0000      1.2
--- class.sowo_hour.inc.php     26 Mar 2003 12:31:56 -0000      1.3
***************
*** 45,49 ****
                function get_grouping_list($workorder_id='')
                {
!                       $this->db->query("SELECT grouping_id, grouping_descr 
FROM fm_wo_hours where workorder_id='$workorder_id' and grouping_id is not null 
group by grouping_id, grouping_descr");
  
                        $i = 0;
--- 45,49 ----
                function get_grouping_list($workorder_id='')
                {
!                       $this->db->query("SELECT grouping_id, grouping_descr 
FROM fm_wo_hours where workorder_id='$workorder_id' and grouping_id >0 group by 
grouping_id, grouping_descr");
  
                        $i = 0;
***************
*** 95,108 ****
  
  
!                       $ordermethod = ' order by grouping_id, record , h.id 
asc ';
  
! 
!                       $sql = "SELECT h.tolerance,h.quantity as 
quantity,h.activity_id as activity_id, h.activity_num as activity_num,"
!                               . " h.record as record, h.grouping_id as 
grouping_id,h.grouping_descr as grouping_descr,"
!                               . " h.id as id,h.hours_descr,a.descr as 
activity_descr,h.ns3420_id as ns3420_id,h.unit as unit,h.status,"
!                               . " h.start_date,h.end_date,h.owner, 
cost,h.remark as remark, h.building_part as building_part,h.billperae"
!                               . " FROM (fm_wo_hours AS h $this->join"
!                               . " fm_wo_activities AS a ON 
h.activity_id=a.id) $this->join"
!                               . " fm_wo_wrkorders ON h.workorder_id = 
fm_wo_wrkorders.id WHERE h.workorder_id='$workorder_id' ";
  
  
--- 95,101 ----
  
  
!                       $ordermethod = ' order by grouping_id, record , id asc 
';
  
!                       $sql = "SELECT *  FROM fm_wo_hours WHERE 
workorder_id='$workorder_id' ";
  
  
***************
*** 119,126 ****
                                        'activity_num'          => 
$this->db->f('activity_num'),
                                        'hours_descr'           => 
stripslashes($this->db->f('hours_descr')),
-                                       'activity_descr'        => 
stripslashes($this->db->f('activity_descr')),
-                                       'start_date'            => 
$this->db->f('start_date'),
-                                       'end_date'                      => 
$this->db->f('end_date'),
-                                       'status'                        => 
$this->db->f('status'),
                                        'owner'                         => 
$this->db->f('owner'),
                                        'quantity'                      => 
$this->db->f('quantity'),
--- 112,115 ----
***************
*** 144,156 ****
  
  
                function add_hour($hour)
                {
                        for ($i=0; $i<count($hour); $i++)
                        {
  
!                               $this->db->query("insert into fm_wo_hours 
(activity_id,activity_num,hours_descr,unit,cost,quantity,billperae,ns3420_id,dim_d,workorder_id)
 "
                                . " values ('" .
                                        $hour[$i]['activity_id'] . "','" .
                                        $hour[$i]['activity_num'] . "','" .
                                        $hour[$i]['hours_descr'] . "','" .
                                        $hour[$i]['unit'] . "','" .
--- 133,160 ----
  
  
+ 
+               function next_record($workorder_id)
+               {
+ 
+                       $this->db->query("SELECT  max(record) as record FROM 
fm_wo_hours where workorder_id='$workorder_id'",__LINE__,__FILE__);
+                       $this->db->next_record();
+                       $record = $this->db->f('record')+1;
+                       return $record;
+ 
+               }
+ 
                function add_hour($hour)
                {
+ 
+                       $record = $this->next_record($hour[0]['workorder_id']);
+ 
                        for ($i=0; $i<count($hour); $i++)
                        {
  
!                               $this->db->query("insert into fm_wo_hours 
(activity_id,activity_num,owner,hours_descr,unit,cost,quantity,billperae,ns3420_id,dim_d,record,entry_date,workorder_id)
 "
                                . " values ('" .
                                        $hour[$i]['activity_id'] . "','" .
                                        $hour[$i]['activity_num'] . "','" .
+                                       $this->account . "','" .
                                        $hour[$i]['hours_descr'] . "','" .
                                        $hour[$i]['unit'] . "','" .
***************
*** 160,164 ****
--- 164,172 ----
                                        $hour[$i]['ns3420_id'] . "','" .
                                        $hour[$i]['dim_d'] . "','" .
+                                       $record . "','" .
+                                       time() . "','" .
                                        $hour[$i]['workorder_id']. 
"')",__LINE__,__FILE__);
+ 
+                               $record++;
                        }
  
***************
*** 173,176 ****
--- 181,185 ----
                {
  
+                       $hour['record'] = $this->next_record($workorder_id);
  
                        $this->db->query("UPDATE fm_wo_wrkorders set
***************
*** 179,189 ****
                        if($hour['grouping_id'])
                        {
!                               $this->db->query("SELECT grouping_descr , max 
(record) as record FROM fm_wo_hours where grouping_id='" .$hour['grouping_id'] 
. "' and workorder_id= '$workorder_id'",__LINE__,__FILE__);
                                $this->db->next_record();
                                $hour['grouping_descr'] = 
$this->db->f('grouping_descr');
!                               $hour['record'] = $this->db->f('record')+1;
                        }
  
!                       if($hour['new_grouping'] && !$hour['grouping_id'])
                        {
                                $this->db->query("SELECT grouping_id FROM 
fm_wo_hours where grouping_descr ='" .$hour['new_grouping'] . "' and 
workorder_id= '$workorder_id'",__LINE__,__FILE__);
--- 188,198 ----
                        if($hour['grouping_id'])
                        {
!                               $this->db->query("SELECT grouping_descr , 
max(record) as record FROM fm_wo_hours where grouping_id='" 
.$hour['grouping_id'] . "' and workorder_id= '$workorder_id' GROUP by 
grouping_descr",__LINE__,__FILE__);
                                $this->db->next_record();
                                $hour['grouping_descr'] = 
$this->db->f('grouping_descr');
! //                            $hour['record'] = $this->db->f('record')+1;
                        }
  
!                       if($hour['new_grouping'])
                        {
                                $this->db->query("SELECT grouping_id FROM 
fm_wo_hours where grouping_descr ='" .$hour['new_grouping'] . "' and 
workorder_id= '$workorder_id'",__LINE__,__FILE__);
***************
*** 198,202 ****
                                        $this->db->next_record();
                                        $hour['grouping_id']    = 
$this->db->f('grouping_id')+1;
!                                       $hour['record'] = 1;
                                }
  
--- 207,211 ----
                                        $this->db->next_record();
                                        $hour['grouping_id']    = 
$this->db->f('grouping_id')+1;
! //                                    $hour['record'] = 1;
                                }
  
***************
*** 204,210 ****
                        }
  
!                       $this->db->query("insert into fm_wo_hours 
(hours_descr,unit,cost,quantity,billperae,ns3420_id,dim_d,"
!                               . " 
grouping_id,grouping_descr,record,building_part,tolerance,remark,workorder_id) "
                                . " values ('" .
                                        $hour['descr'] . "','" .
                                        $hour['unit'] . "','" .
--- 213,220 ----
                        }
  
!                       $this->db->query("insert into fm_wo_hours 
(owner,hours_descr,unit,cost,quantity,billperae,ns3420_id,dim_d,"
!                               . " 
grouping_id,grouping_descr,record,building_part,tolerance,remark,entry_date,workorder_id)
 "
                                . " values ('" .
+                                       $this->account . "','" .
                                        $hour['descr'] . "','" .
                                        $hour['unit'] . "','" .
***************
*** 220,223 ****
--- 230,234 ----
                                        $hour['tolerance_id'] . "','" .
                                        $hour['remark'] . "','" .
+                                       time() . "','" .
                                        $workorder_id . "')",__LINE__,__FILE__);
  
***************
*** 231,235 ****
                }
  
- 
                function read_single_hour($hour_id)
                {
--- 242,245 ----
***************
*** 247,251 ****
                                $hour['hours_descr']                    = 
$this->db->f('hours_descr');
                                $hour['remark']                                 
= $this->db->f('remark');
-                               $hour['descr']                                  
= $this->db->f('descr');
                                $hour['billperae']                              
= $this->db->f('billperae');
                                $hour['unit']                                   
= $this->db->f('unit');
--- 257,260 ----
***************
*** 258,267 ****
                        }
  
! _debug_array($hour);
                                return $hour;
                }
  
  
!               function edit($hour)
                {
  
--- 267,276 ----
                        }
  
! //_debug_array($hour);
                                return $hour;
                }
  
  
!               function edit($hour,$workorder_id)
                {
  
***************
*** 270,275 ****
  //_debug_array($hour);
  
                        $this->db->query("UPDATE fm_wo_hours set
-                               record                          ='" . 
$hour['record'] . "',
                                hours_descr                     ='" . 
$hour['descr'] . "',
                                remark                          ='" . 
$hour['remark'] . "',
--- 279,345 ----
  //_debug_array($hour);
  
+ 
+                       $this->db->query("UPDATE fm_wo_wrkorders set
+                               chapter_id      ='" . $hour['chapter_id'] . "' 
WHERE id= '$workorder_id'",__LINE__,__FILE__);
+ 
+ 
+ 
+                       $this->db->query("SELECT grouping_id, record FROM 
fm_wo_hours where id ='" .$hour['hour_id'] . "'",__LINE__,__FILE__);
+                       $this->db->next_record();
+                       $old_grouping_id        = $this->db->f('grouping_id');
+ //                    $old_record                     = 
$this->db->f('record');
+ 
+                       if ( $old_grouping_id == $hour['grouping_id'])
+                       {
+ //                            $hour['record'] = $old_record;
+                       }
+                       else
+                       {
+                               $this->db->query("SELECT grouping_descr , 
max(record) as record FROM fm_wo_hours where grouping_id='" 
.$hour['grouping_id'] . "' and workorder_id= '$workorder_id' GROUP by 
grouping_descr",__LINE__,__FILE__);
+                               $this->db->next_record();
+                               if($this->db->f('grouping_descr'))
+                               {
+                                       $hour['grouping_descr'] = 
$this->db->f('grouping_descr');
+ //                                    $hour['record'] = 
$this->db->f('record')+1;
+                               }
+                               else
+                               {
+                                       $hour['grouping_id']='';
+                                       $hour['grouping_descr']='';
+ //                                    $hour['record'] ='';
+                               }
+ 
+ /*                            if($old_record>1)
+                               {
+                                       $this->db->query("UPDATE fm_wo_hours set
+                                               record  = record - 1 where 
grouping_id='" .$hour['grouping_id'] . "' and workorder_id= '$workorder_id' and 
record > $old_record ",__LINE__,__FILE__);
+ 
+                               }
+ 
+ */
+                       }
+ 
+                       if($hour['new_grouping'])
+                       {
+                               $this->db->query("SELECT grouping_id FROM 
fm_wo_hours where grouping_descr ='" .$hour['new_grouping'] . "' and 
workorder_id= '$workorder_id'",__LINE__,__FILE__);
+                               $this->db->next_record();
+                               if ( $this->db->f('grouping_id'))
+                               {
+                                       $hour['grouping_id']    = 
$this->db->f('grouping_id');
+                               }
+                               else
+                               {
+                                       $this->db->query("SELECT 
max(grouping_id) as grouping_id FROM fm_wo_hours where workorder_id= 
'$workorder_id'",__LINE__,__FILE__);
+                                       $this->db->next_record();
+                                       $hour['grouping_id']    = 
$this->db->f('grouping_id')+1;
+ //                                    $hour['record'] = 1;
+                               }
+ 
+                               $hour['grouping_descr'] = $hour['new_grouping'];
+                       }
+ 
+ 
+ 
                        $this->db->query("UPDATE fm_wo_hours set
                                hours_descr                     ='" . 
$hour['descr'] . "',
                                remark                          ='" . 
$hour['remark'] . "',
***************
*** 279,289 ****
                                cost                            ='" . 
$hour['cost'] . "',
                                ns3420_id                       ='" . 
$hour['ns3420_id'] . "',
!                               tolerance               ='" . 
$hour['tolerance_id'] . "',
!                               building_part   ='" . $hour['building_part_id'] 
. "',
                                dim_d                           ='" . 
$hour['dim_d'] . "',
                                grouping_descr          ='" . 
$hour['grouping_descr']
                                . "' WHERE id= '" . $hour['hour_id'] 
."'",__LINE__,__FILE__);
  
  
                        $receipt['message'][] = array('msg'=>lang('hour %1 has 
been edited',$hour['hour_id']));
                        return $receipt;
--- 349,361 ----
                                cost                            ='" . 
$hour['cost'] . "',
                                ns3420_id                       ='" . 
$hour['ns3420_id'] . "',
!                               tolerance                       ='" . 
$hour['tolerance_id'] . "',
!                               building_part           ='" . 
$hour['building_part_id'] . "',
                                dim_d                           ='" . 
$hour['dim_d'] . "',
+                               grouping_id                     ='" . 
$hour['grouping_id'] . "',
                                grouping_descr          ='" . 
$hour['grouping_descr']
                                . "' WHERE id= '" . $hour['hour_id'] 
."'",__LINE__,__FILE__);
  
  
+                       $receipt['hour_id'] = $hour['hour_id'];
                        $receipt['message'][] = array('msg'=>lang('hour %1 has 
been edited',$hour['hour_id']));
                        return $receipt;

Index: class.uiwo_hour.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiwo_hour.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.uiwo_hour.inc.php     24 Mar 2003 17:37:24 -0000      1.2
--- class.uiwo_hour.inc.php     26 Mar 2003 12:31:56 -0000      1.3
***************
*** 22,31 ****
                var $public_functions = array
                (
!                       'index'         => True,
!                       'prizebook'     => True,
!                       'view'          => True,
!                       'add'           => True,
!                       'edit'          => True,
!                       'delete'        => True
                );
  
--- 22,34 ----
                var $public_functions = array
                (
!                       'index'                 => True,
!                       'pdf'                   => True,
!                       'save_template' => True,
! 
!                       'prizebook'             => True,
!                       'view'                  => True,
!                       'add'                   => True,
!                       'edit'                  => True,
!                       'delete'                => True
                );
  
***************
*** 43,47 ****
  
  
! //                    $this->boproject                        = 
CreateObject($this->currentapp.'.boproject',True);
                        $this->so                                       = 
CreateObject($this->currentapp.'.sowo_hour',True);
                        $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon',True);
--- 46,50 ----
  
  
!                       $this->pdf                                      = 
CreateObject($this->currentapp.'.pdf');
                        $this->so                                       = 
CreateObject($this->currentapp.'.sowo_hour',True);
                        $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon',True);
***************
*** 76,79 ****
--- 79,84 ----
                function common_data($workorder_id)
                {
+ 
+                       $workorder      = 
$this->boworkorder->read_single($workorder_id);
                        $hour_list = $this->bo->read($workorder_id);
  
***************
*** 84,89 ****
--- 89,105 ----
                                $sum_hour       = $sum_hour + $hour['cost'];
  
+                               if($hour['activity_num'])
+                               {
+                                       $code   = $hour['activity_num'];
+                               }
+                               else
+                               {
+                                       $code   = 
str_replace("-",$hour['tolerance'],$hour['ns3420_id']);
+                               }
+ 
                                $content[] = array
                                (
+ 
+                                       'post'                                  
        => sprintf("%02s",$workorder['chapter_id']) . '.' . 
sprintf("%02s",$hour['building_part']) . '.' . 
sprintf("%02s",$hour['grouping_id']) . '.' . sprintf("%03s",$hour['record']),
                                        'hour_id'                               
        => $hour['hour_id'],
                                        'activity_num'                          
=> $hour['activity_num'],
***************
*** 94,98 ****
                                        'grouping_descr'                        
=> $hour['grouping_descr'],
                                        'ns3420_id'                             
        => $hour['ns3420_id'],
!                                       'tolerance'                             
        => $hour['tolerance'],
                                        'remark'                                
        => $hour['remark'],
                                        'building_part'                         
=> $hour['building_part'],
--- 110,114 ----
                                        'grouping_descr'                        
=> $hour['grouping_descr'],
                                        'ns3420_id'                             
        => $hour['ns3420_id'],
!                                       'code'                                  
        => $code,
                                        'remark'                                
        => $hour['remark'],
                                        'building_part'                         
=> $hour['building_part'],
***************
*** 111,121 ****
                                );
                        }
! 
! 
!                       $workorder      = 
$this->boworkorder->read_single($workorder_id);
  
                        $table_header[] = array
                        (
!                               'lang_activity_num'             => 
lang('Acitity code'),
                                'lang_descr'    => lang('descr'),
                                'lang_unit'             => lang('Unit'),
--- 127,136 ----
                                );
                        }
! //_debug_array($content);
  
                        $table_header[] = array
                        (
!                               'lang_post'             => lang('Post'),
!                               'lang_code'             => lang('Code'),
                                'lang_descr'    => lang('descr'),
                                'lang_unit'             => lang('Unit'),
***************
*** 173,176 ****
--- 188,238 ----
                }
  
+ 
+ 
+ 
+ 
+               function save_template()
+               {
+ 
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('wo_hour',
+                                                                               
'menu',
+                                                                               
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 
'app_header'));
+ 
+                       $name = get_var('name',array('POST','GET'));
+                       $workorder_id = 
get_var('workorder_id',array('POST','GET'));
+ 
+                       $common_data=$this->common_data($workorder_id);
+ 
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uiwo_hour.index',
+                               'workorder_id'  => $workorder_id
+                       );
+ 
+                       $data = array
+                       (
+                               'appname'                                       
        => lang('Workorder'),
+                               'function_msg'                                  
=> lang('Add template'),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'add_action'                                    
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiwo_hour.save_template'),
+ 
+                               'lang_done_statustext'                  => 
lang('Back to the workorder list'),
+                               'lang_add_statustext'                   => 
lang('Adds this workorders calculation as a template for later use'),
+                               'lang_search_statustext'                => 
lang('Adds a new workorder to an existing project'),
+ 
+                               'lang_done'                                     
        => lang('Done'),
+                               'lang_add'                                      
        => lang('Add'),
+                               'lang_search'                                   
=> lang('Search'),
+ 
+                               'lang_name'                                     
=> lang('name'),
+                               'lang_name_statustext'          => lang('Enter 
the name the template'),
+ 
+                               'workorder_data'                                
=> $common_data['workorder_data']
+                       );
+ 
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add_template' => $data));
+               }
+ 
+ 
                function index()
                {
***************
*** 205,209 ****
                                'lang_add_custom'                               
        => lang('Add custom'),
                                'lang_add_custom_statustext'            => 
lang('Add single custom line'),
!                               'add_custom_action'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiwo_hour.edit&workorder_id='
 . $workorder_id)
                        );
  
--- 267,275 ----
                                'lang_add_custom'                               
        => lang('Add custom'),
                                'lang_add_custom_statustext'            => 
lang('Add single custom line'),
!                               'add_custom_action'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiwo_hour.edit&from=index&workorder_id='
 . $workorder_id),
! 
!                               'lang_save_template'                            
=> lang('Save as template'),
!                               'lang_save_template_statustext'         => 
lang('Save this workorder as a template for later use'),
!                               'save_template_action'                          
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiwo_hour.save_template&from=index&workorder_id='
 . $workorder_id)
                        );
  
***************
*** 213,216 ****
--- 279,283 ----
                                'message'                                       
        => $receipt['message'],
                                'link_delete'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiwo_hour.index&delete=true&workorder_id='
 . $workorder_id),
+                               'function'                                      
        => 'index',
                                'links'                                         
        => $links,
                                'num_records'                                   
=> count($hours_list),
***************
*** 287,298 ****
                                        'unit'                                  
=> $pricebook['unit'],
                                        'descr'                                 
=> $pricebook['descr'],
!                                       'base_descr'                    => 
$pricebook['base_descr'],
!                                       'index_count'                   => 
$pricebook['index_count'],
!                                       'link_edit'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uipricebook.edit_activity&activity_id='
 . $pricebook['activity_id']),
!                                       'link_prizing'                          
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uipricebook.prizing&activity_id='
 . $pricebook['activity_id'].'&vendor_id=' . $pricebook['vendor_id'] 
.'&cat_id=' .$this->cat_id),
!                                       'lang_edit_statustext'          => 
lang('edit the pricebook'),
!                                       'lang_prizing_statustext'       => 
lang('view or edit prizing history of this element'),
!                                       'text_edit'                             
        => lang('edit'),
!                                       'text_prizing'                          
=> lang('prizing')
                                );
  
--- 354,358 ----
                                        'unit'                                  
=> $pricebook['unit'],
                                        'descr'                                 
=> $pricebook['descr'],
!                                       'base_descr'                    => 
$pricebook['base_descr']
                                );
  
***************
*** 385,388 ****
--- 445,449 ----
                                'link_delete'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data_delete),
  
+                               'function'                                      
        => 'prizebook',
                                'links'                                         
        => $links,
                                'allrows'                                       
        => $this->bopricebook->allrows,
***************
*** 417,420 ****
--- 478,482 ----
                function edit()
                {
+                       $from                                   = 
get_var('from',array('POST','GET'));
                        $workorder_id                   = 
get_var('workorder_id',array('POST','GET'));
                        $activity_id                    = 
get_var('activity_id',array('POST','GET'));
***************
*** 425,432 ****
  
  
- 
-                       $common_data=$this->common_data($workorder_id);
- 
-                       $workorder      = $common_data['workorder'];
  //_debug_array($workorder);
  
--- 487,490 ----
***************
*** 436,439 ****
--- 494,502 ----
                        if ($values['save'])
                        {
+                               if($values['copy_hour'])
+                               {
+                                       unset($hour_id);
+                               }
+ 
                                $values['hour_id'] = $hour_id;
  
***************
*** 456,459 ****
--- 519,524 ----
                        }
  
+                       $workorder      = 
$this->boworkorder->read_single($workorder_id);
+ 
  //_debug_array($values);
  
***************
*** 468,472 ****
                                'activity_id'   => $activity_id,
                                'workorder_id'  => $workorder_id,
!                               'hour_id'               => $hour_id
                        );
  
--- 533,538 ----
                                'activity_id'   => $activity_id,
                                'workorder_id'  => $workorder_id,
!                               'hour_id'               => $hour_id,
!                               'from'                  => $from
                        );
  
***************
*** 476,480 ****
                                'function_msg'                                  
=> $function_msg,
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
!                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiwo_hour.index&workorder_id='
 . $workorder_id),
                                'lang_workorder'                                
=> lang('Workorder'),
                                'value_workorder_id'                    => 
$workorder['workorder_id'],
--- 542,546 ----
                                'function_msg'                                  
=> $function_msg,
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
!                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiwo_hour.'
 . $from . '&workorder_id=' . $workorder_id),
                                'lang_workorder'                                
=> lang('Workorder'),
                                'value_workorder_id'                    => 
$workorder['workorder_id'],
***************
*** 484,487 ****
--- 550,556 ----
                                'value_hour_id'                                 
=> $hour_id,
  
+                               'lang_copy_hour'                        => 
lang('Copy hour ?'),
+                               'lang_copy_hour_statustext'     => lang('Choose 
Copy Hour to copy this hour to a new hour'),
+ 
                                'lang_activity_num'                             
=> lang('Activity code'),
                                'value_activity_num'                    => 
$values['activity_num'],
***************
*** 792,795 ****
--- 861,885 ----
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
                }
+ 
+               function pdf()
+               {
+                       define('PHPGW_FOOTER_RAN',True);
+ 
+                       $data[0]=array('sigurd','nes','38');
+                       $cols=array('fornavn','etternavn','alder');
+ 
+ //_debug_array($data);
+                       // don't want any warnings turning up in the pdf code 
if the server is set to 'anal' mode.
+                       //error_reporting(7);
+                       error_reporting(E_ALL);
+                       set_time_limit(1800);
+                       $this->pdf->selectFont(PHPGW_APP_INC . 
'/pdf/fonts/Helvetica.afm');
+                       $this->pdf->ezText('Hello World!',50);
+                       $this->pdf->ezNewPage();
+                       $this->pdf->ezTable($data,$cols,'tittel');
+                       $this->pdf->ezStream();
+               }
+ 
+ 
        }
  ?>





reply via email to

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