phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc class.uitts.inc.php, 1.46, 1.47 class.ui


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] property/inc class.uitts.inc.php, 1.46, 1.47 class.uiproject.inc.php, 1.56, 1.57 class.soproject.inc.php, 1.47, 1.48 class.sorequest.inc.php, 1.22, 1.23 class.soentity.inc.php, 1.16, 1.17 class.uiwo_hour.inc.php, 1.40, 1.41 class.sowo_hour.inc.php, 1.18, 1.19 class.bowo_hour.inc.php, 1.11, 1.12
Date: Mon, 17 Nov 2003 22:49:46 +0000

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

Modified Files:
        class.uitts.inc.php class.uiproject.inc.php 
        class.soproject.inc.php class.sorequest.inc.php 
        class.soentity.inc.php class.uiwo_hour.inc.php 
        class.sowo_hour.inc.php class.bowo_hour.inc.php 
Log Message:
no message

Index: class.soproject.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soproject.inc.php,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** class.soproject.inc.php     14 Nov 2003 19:00:38 -0000      1.47
--- class.soproject.inc.php     17 Nov 2003 22:49:35 -0000      1.48
***************
*** 314,317 ****
--- 314,318 ----
                                $project['status']                              
= $this->db->f('status');
                                $project['budget']                              
= (int)$this->db->f('budget');
+                               $project['reserve']                             
= (int)$this->db->f('reserve');
                                $project['tenant_id']                   = 
$this->db->f('tenant_id');
                                $project['user_id']                             
= $this->db->f('user_id');
***************
*** 493,496 ****
--- 494,498 ----
                                $project['descr'],
                                $project['budget'],
+                               $project['reserve'],
                                $project['location_code'],
                                $address,
***************
*** 507,511 ****
  
                        $this->db->query("INSERT INTO fm_project 
(id,name,access,category,entry_date,start_date,end_date,coordinator,status,"
!                               . 
"descr,budget,location_code,address,key_deliver,key_fetch,other_branch,key_responsible,charge_tenant,user_id
 $cols) "
                                . "VALUES ($values $vals )",__LINE__,__FILE__);
  
--- 509,513 ----
  
                        $this->db->query("INSERT INTO fm_project 
(id,name,access,category,entry_date,start_date,end_date,coordinator,status,"
!                               . 
"descr,budget,reserve,location_code,address,key_deliver,key_fetch,other_branch,key_responsible,charge_tenant,user_id
 $cols) "
                                . "VALUES ($values $vals )",__LINE__,__FILE__);
  
***************
*** 533,537 ****
                                        . "VALUES ('"
                                        . $project['origin']. "','"
!                                       . $project['origin_id']. "','"
                                        . $project['project_id']. ","
                                        . time() . ")",__LINE__,__FILE__);
--- 535,539 ----
                                        . "VALUES ('"
                                        . $project['origin']. "','"
!                                       . $project['origin_id']. "',"
                                        . $project['project_id']. ","
                                        . time() . ")",__LINE__,__FILE__);
***************
*** 658,661 ****
--- 660,664 ----
                                'descr'                         => 
$project['descr'],
                                'budget'                        => 
(int)$project['budget'],
+                               'reserve'                       => 
(int)$project['reserve'],
                                'key_deliver'           => 
$project['key_deliver'],
                                'key_fetch'                     => 
$project['key_fetch'],

Index: class.uiproject.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiproject.inc.php,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** class.uiproject.inc.php     14 Nov 2003 19:00:38 -0000      1.56
--- class.uiproject.inc.php     17 Nov 2003 22:49:33 -0000      1.57
***************
*** 884,887 ****
--- 884,891 ----
                                'lang_budget_statustext'                => 
lang('Enter the budget'),
  
+                               'lang_reserve'                                  
=> lang('reserve'),
+                               'value_reserve'                                 
=> $values['reserve'],
+                               'lang_reserve_statustext'               => 
lang('Enter the reserve'),
+ 
                                'vendor_data'                                   
=> $vendor_data,
                                'location_data'                                 
=> $location_data,

Index: class.uitts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uitts.inc.php,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** class.uitts.inc.php 16 Nov 2003 13:21:52 -0000      1.46
--- class.uitts.inc.php 17 Nov 2003 22:49:30 -0000      1.47
***************
*** 168,171 ****
--- 168,183 ----
                                                                                
                                                        
'allrows'=>$this->allrows)
                                                                                
)),
+                               'sort_date'     => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'fm_tts_tickets.entry_date',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uitts.index',
+                                                                               
                                                        'cat_id'        
=>$this->cat_id,
+                                                                               
                                                        'filter'        
=>$this->filter,
+                                                                               
                                                        'district_id'   => 
$this->district_id,
+                                                                               
                                                        'query'         
=>$this->query,
+                                                                               
                                                        
'allrows'=>$this->allrows)
+                                                                               
)),
                                'lang_opened_by'                => lang('Opened 
by')
                        );

Index: class.sowo_hour.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sowo_hour.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** class.sowo_hour.inc.php     28 Oct 2003 15:14:41 -0000      1.18
--- class.sowo_hour.inc.php     17 Nov 2003 22:49:41 -0000      1.19
***************
*** 91,96 ****
                        $sql = "SELECT *  FROM fm_wo_hours WHERE 
workorder_id='$workorder_id' ";
  
- 
- 
                        $this->db->query($sql . $ordermethod,__LINE__,__FILE__);
                        $this->total_records = $this->db->num_rows();
--- 91,94 ----
***************
*** 119,126 ****
                                        );
                        }
! //_debug_array($hour_list);
                        return $hour_list;
                }
  
                function next_record($workorder_id)
                {
--- 117,238 ----
                                        );
                        }
! 
!                       for ($i=0; $i<count($hour_list); $i++)
!                       {
!                               $sql = "SELECT sum(amount) as deviation, 
count(amount) as count_deviation FROM fm_wo_h_deviation WHERE 
workorder_id=$workorder_id and hour_id=". $hour_list[$i]['hour_id'];
!                               $this->db->query($sql,__LINE__,__FILE__);
!                               $this->db->next_record();
!                               
$hour_list[$i]['deviation']=$this->db->f('deviation');
!                               
$hour_list[$i]['count_deviation']=$this->db->f('count_deviation');
!                       }
! 
                        return $hour_list;
                }
  
+ 
+               function read_deviation($data)
+               {
+                       if(is_array($data))
+                       {
+                               $workorder_id = 
(isset($data['workorder_id'])?$data['workorder_id']:0);
+                               $hour_id = 
(isset($data['hour_id'])?$data['hour_id']:0);
+                       }
+ 
+                       $ordermethod = ' order by id asc';
+ 
+                       $sql = "SELECT *  FROM fm_wo_h_deviation WHERE 
workorder_id=$workorder_id AND hour_id=$hour_id ";
+ 
+ 
+                       $this->db->query($sql . $ordermethod,__LINE__,__FILE__);
+                       $this->total_records = $this->db->num_rows();
+ 
+                       while ($this->db->next_record())
+                       {
+                               $deviation[] = array
+                               (
+                               //      'project_id'            => 
$this->db->f('project_id'),
+                                       'workorder_id'          => 
$workorder_id,
+                                       'hour_id'                       => 
$hour_id,
+                                       'id'                            => 
$this->db->f('id'),
+                                       'amount'                        => 
$this->db->f('amount'),
+                                       'descr'                         => 
stripslashes($this->db->f('descr'))
+                                       );
+                       }
+ //_debug_array($deviation);
+                       return $deviation;
+ 
+ 
+               }
+ 
+ 
+               function read_single_deviation($data)
+               {
+                       if(is_array($data))
+                       {
+                               $workorder_id = 
(isset($data['workorder_id'])?$data['workorder_id']:0);
+                               $hour_id = 
(isset($data['hour_id'])?$data['hour_id']:0);
+                               $id = (isset($data['id'])?$data['id']:0);
+                       }
+ 
+                       $sql = "SELECT *  FROM fm_wo_h_deviation WHERE 
workorder_id=$workorder_id AND hour_id=$hour_id AND id = $id";
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       $this->db->next_record();
+                       $deviation = array
+                       (
+                               //'project_id'          => 
$this->db->f('project_id'),
+                               'workorder_id'          => $workorder_id,
+                               'hour_id'                       => $hour_id,
+                               'id'                            => 
$this->db->f('id'),
+                               'amount'                        => 
$this->db->f('amount'),
+                               'descr'                         => 
stripslashes($this->db->f('descr'))
+                       );
+                       return $deviation;
+               }
+ 
+               function add_deviation($values)
+               {
+                       $sql = "SELECT max(id) as current_id FROM 
fm_wo_h_deviation WHERE  workorder_id=" . $values['workorder_id'] . " AND 
hour_id=" . $values['hour_id'];
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       $this->db->next_record();
+                       $id=$this->db->f('current_id')+1;
+ 
+                       $values['descr'] = 
$this->db->db_addslashes($values['descr']);
+ 
+                       $values_insert= array(
+                               $values['workorder_id'],
+                               $values['hour_id'],
+                               $id,
+                               $values['amount'],
+                               $values['descr'],
+                               );
+ 
+                       $values_insert  = 
$this->bocommon->validate_db_insert($values_insert);
+ 
+                       $this->db->query("INSERT INTO fm_wo_h_deviation 
(workorder_id,hour_id,id,amount,descr) VALUES 
($values_insert)",__LINE__,__FILE__);
+ 
+                       $receipt['id']= $id;
+ 
+                       $receipt['message'][] = array('msg'=> lang('deviation 
has been added'));
+                       return $receipt;
+               }
+ 
+               function edit_deviation($values)
+               {
+                       $values['descr'] = 
$this->db->db_addslashes($values['descr']);
+ 
+                       $value_set=array(
+                               'amount'                        => 
$values['amount'],
+                               'descr'                 => 
$this->db->db_addslashes($values['descr'])
+                               );
+ 
+                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
+ 
+                       $this->db->query("UPDATE fm_wo_h_deviation set 
$value_set WHERE workorder_id=" . $values['workorder_id'] . " AND hour_id=" . 
$values['hour_id'] . " AND id=" . $values['id'],__LINE__,__FILE__);
+ 
+                       $receipt['message'][] = array('msg'=> lang('deviation 
has been edited'));
+ 
+                       return $receipt;
+               }
+ 
                function next_record($workorder_id)
                {
***************
*** 535,539 ****
--- 647,654 ----
                        $old_record     = $this->db->f('record');
  
+                       $this->db->transaction_begin();
+ 
                        $this->db->query("DELETE FROM fm_wo_hours WHERE id='" . 
$hour_id . "'",__LINE__,__FILE__);
+                       $this->db->query("DELETE FROM fm_wo_h_deviation WHERE 
workorder_id=$workorder_id AND hour_id=$hour_id",__LINE__,__FILE__);
                        if($old_record)
                        {
***************
*** 543,549 ****
--- 658,673 ----
                        $this->update_calculation($workorder_id);
  
+                       $this->db->transaction_commit();
+ 
                        $receipt['message'][] = array('msg'=>lang('hour %1 has 
been deleted',$hour_id));
                        return $receipt;
  
+               }
+ 
+               function delete_deviation($workorder_id,$hour_id,$id )
+               {
+                       $this->db->query("DELETE FROM fm_wo_h_deviation WHERE 
workorder_id=$workorder_id AND hour_id=$hour_id AND id=$id",__LINE__,__FILE__);
+                       $receipt['message'][] = array('msg'=>lang('deviation %1 
has been deleted',$id));
+                       return $receipt;
                }
  

Index: class.sorequest.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sorequest.inc.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** class.sorequest.inc.php     14 Nov 2003 19:00:38 -0000      1.22
--- class.sorequest.inc.php     17 Nov 2003 22:49:36 -0000      1.23
***************
*** 545,549 ****
                                        . "VALUES ('"
                                        . $request['origin']. "','"
!                                       . $request['origin_id']. "','"
                                        . $request['request_id']. ","
                                        . time() . ")",__LINE__,__FILE__);
--- 545,549 ----
                                        . "VALUES ('"
                                        . $request['origin']. "','"
!                                       . $request['origin_id']. "',"
                                        . $request['request_id']. ","
                                        . time() . ")",__LINE__,__FILE__);

Index: class.bowo_hour.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bowo_hour.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** class.bowo_hour.inc.php     10 Oct 2003 21:57:15 -0000      1.11
--- class.bowo_hour.inc.php     17 Nov 2003 22:49:42 -0000      1.12
***************
*** 256,259 ****
--- 256,286 ----
                }
  
+               function read_deviation($data)
+               {
+                       $deviation = 
$this->so->read_deviation(array('workorder_id' => 
$data['workorder_id'],'hour_id' => $data['hour_id']));
+                       $this->total_records = $this->so->total_records;
+                       return $deviation;
+               }
+ 
+               function read_single_deviation($data)
+               {
+                       return  $this->so->read_single_deviation($data);
+               }
+ 
+               function save_deviation($values,$action='')
+               {
+                       if ($action=='edit')
+                       {
+                               if ($values['id'] != '')
+                               {
+                                       $receipt = 
$this->so->edit_deviation($values);
+                               }
+                       }
+                       else
+                       {
+                               $receipt = $this->so->add_deviation($values);
+                       }
+                       return $receipt;
+               }
  
                function add_template($values,$workorder_id)
***************
*** 262,266 ****
                }
  
- 
                function add_hour($values,$workorder_id)
                {
--- 289,292 ----
***************
*** 364,368 ****
                }
  
- 
                function save_hour($values,$workorder_id)
                {
--- 390,393 ----
***************
*** 437,440 ****
--- 462,470 ----
                {
                        return $this->so->delete($hour_id,$workorder_id);
+               }
+ 
+               function delete_deviation($workorder_id,$hour_id,$id)
+               {
+                       return 
$this->so->delete_deviation($workorder_id,$hour_id,$id);
                }
        }

Index: class.uiwo_hour.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiwo_hour.inc.php,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** class.uiwo_hour.inc.php     29 Oct 2003 17:28:42 -0000      1.40
--- class.uiwo_hour.inc.php     17 Nov 2003 22:49:39 -0000      1.41
***************
*** 28,32 ****
                        'add'                   => True,
                        'edit'                  => True,
!                       'delete'                => True
                );
  
--- 28,34 ----
                        'add'                   => True,
                        'edit'                  => True,
!                       'delete'                => True,
!                       'deviation'             => True,
!                       'edit_deviation'=> True
                );
  
***************
*** 85,88 ****
--- 87,259 ----
                }
  
+               function deviation()
+               {
+                       $workorder_id   = 
get_var('workorder_id',array('POST','GET'));
+                       $hour_id                = 
get_var('hour_id',array('POST','GET'));
+ 
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('wo_hour'));
+                       $list = 
$this->bo->read_deviation(array('workorder_id'=>$workorder_id,'hour_id'=>$hour_id));
+ 
+                       $sum_deviation = 0;
+ 
+                       if (isset($list) AND is_array($list))
+                       {
+                               foreach($list as $entry)
+                               {
+                                       $sum_deviation = $sum_deviation + 
$entry['amount'];
+ 
+                                       $content[] = array
+                                       (
+                                               'id'                            
                => $entry['id'],
+                                               'amount'                        
                => $entry['amount'],
+                                               'descr'                         
                => $entry['descr'],
+                                               'link_edit'                     
                => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiwo_hour.edit_deviation&workorder_id='
 . $workorder_id . '&hour_id=' . $hour_id . '&id=' . $entry['id']),
+                                               'lang_edit_statustext'          
=> lang('edit the deviation'),
+                                               'text_edit'                     
                => lang('edit'),
+                                               'link_delete'                   
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiwo_hour.delete&workorder_id='
 . $workorder_id . '&hour_id=' . $hour_id . '&deviation_id=' . $entry['id']),
+                                               'lang_delete_statustext'        
=> lang('delete the deviation'),
+                                               'text_delete'                   
        => lang('delete'),
+                                       );
+                               }
+                       }
+ 
+ 
+                       $table_header[] = array
+                       (
+                               'lang_ID'               => lang('ID'),
+                               'lang_amount'   => lang('amount'),
+                               'lang_descr'    => lang('Descr'),
+                               'lang_edit'             => lang('edit'),
+                               'lang_delete'   => lang('delete')
+                       );
+ 
+ 
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uiwo_hour.edit_deviation',
+                                               'workorder_id'  =>$workorder_id,
+                                               'hour_id'               
=>$hour_id
+                       );
+ 
+ 
+                       $data = array
+                       (
+                               'sum_deviation'                                 
=> $sum_deviation,
+                               'table_header_deviation'                => 
$table_header,
+                               'values_deviation'                              
=> $content,
+                               'lang_add'                                      
        => lang('add'),
+                               'lang_add_statustext'                   => 
lang('add a deviation'),
+                               'add_action'                                    
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'lang_done'                                     
        => lang('done'),
+                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiwo_hour.index&workorder_id='
 . $workorder_id)
+                       );
+ 
+                       $appname                                = 
lang('Workorder');
+                       $function_msg                   = lang('list 
deviation');
+ 
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_deviation' => $data));
+               }
+ 
+               function edit_deviation()
+               {
+                       $workorder_id   = 
get_var('workorder_id',array('POST','GET'));
+                       $hour_id                = 
get_var('hour_id',array('POST','GET'));
+                       $id                             = 
get_var('id',array('POST','GET'));
+                       $values                 = 
get_var('values',array('POST','GET'));
+ 
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('wo_hour'));
+ 
+                       if ($values['save'])
+                       {
+                               $values['workorder_id']=$workorder_id;
+                               $values['hour_id']=$hour_id;
+                               if (!$values['amount'])
+                               {
+                                       $receipt['error'][] = 
array('msg'=>lang('amount not entered!'));
+                               }
+ 
+                               if($id)
+                               {
+                                       $values['id']=$id;
+                                       $action='edit';
+                               }
+ 
+                               if (!$receipt['error'])
+                               {
+                                       $receipt = 
$this->bo->save_deviation($values,$action);
+                                       if(!$id)
+                                       {
+                                               $id=$receipt['id'];
+                                       }
+                               }
+                               else
+                               {
+                                       $receipt['error'][] = array('msg'=> 
lang('Status has NOT been saved'));
+                               }
+ 
+                       }
+ 
+                       if ($id)
+                       {
+                               $values = 
$this->bo->read_single_deviation(array('workorder_id'=>$workorder_id,'hour_id'=>$hour_id,'id'=>$id));
+                               $function_msg = lang('edit deviation');
+                               $action='edit';
+                       }
+                       else
+                       {
+                               $function_msg = lang('add deviation');
+                               $action='add';
+                       }
+ 
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uiwo_hour.edit_deviation',
+                               'entity_id'             => $this->entity_id,
+                               'cat_id'                => $this->cat_id,
+                               'id'                    => $id
+                       );
+ 
+ //                    $workorder      = 
$this->boworkorder->read_single($workorder_id);
+                       $hour = $this->bo->read_single_hour($hour_id);
+ 
+ //_debug_array($workorder);
+ //_debug_array($hour);
+ 
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+ 
+                       $data = array
+                       (
+                               'lang_workorder'                                
=> lang('Workorder ID'),
+                               'lang_hour_id'                                  
=> lang('Post'),
+                               'entity_name'                                   
=> $entity['name'],
+                               'lang_category'                                 
=> lang('category'),
+                               'category_name'                                 
=> $category['name'],
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'lang_name_standardtext'                => 
lang('Enter a name of the standard'),
+                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiwo_hour.deviation&workorder_id='
 . $workorder_id . '&hour_id=' . $hour_id),
+                               'lang_id'                                       
        => lang('deviation ID'),
+                               'lang_descr'                                    
=> lang('Descr'),
+                               'lang_save'                                     
        => lang('save'),
+                               'lang_done'                                     
        => lang('done'),
+                               'value_id'                                      
        => $id,
+                               'value_workorder_id'                    => 
$workorder_id,
+                               'value_hour_id'                                 
=> $hour_id,
+                               'value_id'                                      
        => $id,
+                               'lang_descr_standardtext'               => 
lang('Enter a description of the deviation'),
+                               'lang_done_standardtext'                => 
lang('Back to the list'),
+                               'lang_save_standardtext'                => 
lang('Save the deviation'),
+                               'lang_amount'                                   
=> lang('amount'),
+                               'value_amount'                                  
=> $values['amount'],
+                               'value_descr'                                   
=> $values['descr']
+                       );
+ 
+                       $appname                                                
= lang('entity');
+ 
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_deviation' => $data));
+               }
+ 
                function common_data($workorder_id)
                {
***************
*** 97,104 ****
  
                        $hour_list = $this->bo->read($workorder_id);
! 
                        $grouping_descr_old='';
  
!                       if (isSet($hour_list) AND is_array($hour_list))
                        {
                                foreach($hour_list as $hour)
--- 268,275 ----
  
                        $hour_list = $this->bo->read($workorder_id);
! //_debug_array($hour_list);
                        $grouping_descr_old='';
  
!                       if (isset($hour_list) AND is_array($hour_list))
                        {
                                foreach($hour_list as $hour)
***************
*** 126,129 ****
--- 297,309 ----
                                        }
  
+                                       if($hour['count_deviation'])
+                                       {
+                                               $deviation=$hour['deviation'];
+                                       }
+                                       else
+                                       {
+                                               $deviation=lang('edit');
+                                       }
+ 
                                        $content[] = array
                                        (
***************
*** 145,148 ****
--- 325,331 ----
                                                'unit'                          
                => $hour['unit'],
                                                'billperae'                     
                => $hour['billperae'],
+                                               'deviation'                     
                => $deviation,
+                                               'result'                        
                => ($hour['deviation']+$hour['cost']),
+                                               'link_deviation'                
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiwo_hour.deviation&workorder_id='
 . $workorder_id . '&hour_id=' . $hour['hour_id']),
                                                'link_edit'                     
                => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiwo_hour.edit&workorder_id='
 . $workorder_id . '&hour_id=' . $hour['hour_id']),
                                                'lang_edit_statustext'          
=> lang('edit/customise this hour'),
***************
*** 166,169 ****
--- 349,354 ----
                                'lang_quantity'         => lang('Quantity'),
                                'lang_cost'                     => lang('cost'),
+                               'lang_deviation '       => lang('deviation '),
+                               'lang_result'           => lang('result'),
                                'lang_view'                     => lang('view'),
                                'lang_edit'                     => lang('edit'),
***************
*** 200,203 ****
--- 385,391 ----
                                'lang_workorder_id'                             
=> lang('Workorder ID'),
                                'workorder_id'                                  
=> $workorder['workorder_id'],
+                               'lang_project_id'                               
=> lang('Project ID'),
+                               'link_project'                                  
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiproject.edit&id='
 . $workorder['project_id']),
+                               'project_id'                                    
=> $workorder['project_id'],
  
                                'lang_workorder_title'                  => 
lang('Workorder title'),
***************
*** 354,358 ****
                        );
  
! //_debug_array($data);
  
                        $appname                                                
= lang('Workorder');
--- 542,546 ----
                        );
  
! //_debug_array($common_data['content']);
  
                        $appname                                                
= lang('Workorder');
***************
*** 1353,1367 ****
                                
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uilocation.stop&perm=2&acl_location='
 . $this->acl2_location);
                        }
!                       $id = get_var('id',array('POST','GET'));
!                       $confirm        = get_var('confirm',array('POST'));
  
!                       $link_data = array
!                       (
!                               'menuaction' => 
$this->currentapp.'.uiwo_hour.index'
!                       );
  
                        if (get_var('confirm',array('POST')))
                        {
!                               $this->bo->delete($id);
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
                        }
--- 1541,1593 ----
                                
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uilocation.stop&perm=2&acl_location='
 . $this->acl2_location);
                        }
!                       $id                     = 
get_var('id',array('POST','GET'));
!                       $workorder_id   = 
get_var('workorder_id',array('POST','GET'));
!                       $hour_id                = 
get_var('hour_id',array('POST','GET'));
!                       $deviation_id   = 
get_var('deviation_id',array('POST','GET'));
!                       $confirm                = 
get_var('confirm',array('POST'));
  
! 
!                       if($deviation_id)
!                       {
!                               $link_data = array
!                               (
!                                       'menuaction' => 
$this->currentapp.'.uiwo_hour.deviation',
!                                       'workorder_id'=>$workorder_id,
!                                       'hour_id'=>$hour_id
!                               );
!                               $delete_link_data = array
!                               (
!                                       'menuaction' => 
$this->currentapp.'.uiwo_hour.delete',
!                                       'workorder_id'=>$workorder_id,
!                                       'hour_id'=>$hour_id,
!                                       'deviation_id'=>$deviation_id
!                               );
! 
!                               $function_msg                                   
= lang('delete deviation');
!                       }
!                       else
!                       {
!                               $link_data = array
!                               (
!                                       'menuaction' => 
$this->currentapp.'.uiwo_hour.index'
!                               );
!                               $delete_link_data = array
!                               (
!                                       'menuaction' => 
$this->currentapp.'.uiwo_hour.delete',
!                                       'id'=>$id
!                               );
!                               $function_msg                                   
= lang('delete hour');
!                       }
  
                        if (get_var('confirm',array('POST')))
                        {
!                               if($deviation_id)
!                               {
!                                       
$this->bo->delete_deviation($workorder_id,$hour_id,$deviation_id);
!                               }
!                               else
!                               {
!                                       $this->bo->delete($id);
!                               }
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
                        }
***************
*** 1372,1376 ****
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
!                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiwo_hour.delete&id='
 . $id),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                              => 
lang('yes'),
--- 1598,1602 ----
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
!                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',$delete_link_data),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                              => 
lang('yes'),
***************
*** 1381,1385 ****
  
                        $appname                                                
= lang('workorder');
-                       $function_msg                                   = 
lang('delete workorder');
  
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
--- 1607,1610 ----

Index: class.soentity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soentity.inc.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** class.soentity.inc.php      14 Nov 2003 19:00:37 -0000      1.16
--- class.soentity.inc.php      17 Nov 2003 22:49:37 -0000      1.17
***************
*** 504,509 ****
                        $this->db->transaction_begin();
  
- 
- 
                        $this->db->query("INSERT INTO $table 
(id,num,address,location_code,entry_date,user_id $cols) "
                                . "VALUES ("
--- 504,507 ----
***************
*** 596,600 ****
--- 594,601 ----
                {
                        $table='fm_entity_' . $entity_id .'_' . $cat_id;
+                       $this->db->transaction_begin();
                        $this->db->query("DELETE FROM $table WHERE 
id=$id",__LINE__,__FILE__);
+                       $this->db->query("DELETE FROM fm_entity_origin WHERE 
entity_id=$entity_id AND cat_id=$cat_id AND id=$id",__LINE__,__FILE__);
+                       $this->db->transaction_commit();
                }
        }





reply via email to

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