phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/class.sowo_hour.php, 1.1.1.7


From: nomail
Subject: [Phpgroupware-cvs] property/class.sowo_hour.php, 1.1.1.7
Date: Sun, 9 May 2004 15:42:35 +0200

Update of /property
Modified Files:
        Branch: 
          class.sowo_hour.php

date: 2004/05/09 13:42:35;  author: sigurdne;  state: Exp;  lines: +23 -10

Log Message:
no message
=====================================================================
Index: property/class.sowo_hour.php
diff -u property/class.sowo_hour.php:1.1.1.6 
property/class.sowo_hour.php:1.1.1.7
--- property/class.sowo_hour.php:1.1.1.6        Fri Apr 30 09:52:25 2004
+++ property/class.sowo_hour.php        Sun May  9 13:42:35 2004
@@ -283,15 +283,17 @@
 
                        $GLOBALS['phpgw']->db->begintrans();
 
-                       $GLOBALS['phpgw']->db->Execute("INSERT into fm_template 
(owner,name,descr,chapter_id,entry_date) "
-                               . " values ('" .
+                       $template_id = 
$GLOBALS['phpgw']->db->genid('fm_template_id_seq');
+
+                       $GLOBALS['phpgw']->db->Execute("INSERT into fm_template 
(id,owner,name,descr,chapter_id,entry_date) "
+                               . " values ($id,'" .
                                        $this->account . "','" .
                                        $values['name'] . "','" .
                                        $values['descr'] . "','" .
                                        $workorder['chapter_id'] . "','" .
                                        time() . "')");
 
-                       $template_id = 
$this->db->get_last_insert_id('fm_template','id');
+//                     $template_id = 
$this->db->get_last_insert_id('fm_template','id');
 
                        $hour = $this->read(array('workorder_id' => 
$workorder_id));
 
@@ -340,9 +342,10 @@
 
                        $record = $this->next_record($hour[0]['workorder_id']);
 
+                       $GLOBALS['phpgw']->db->begintrans();
+
                        for ($i=0; $i<count($hour); $i++)
                        {
-
                                $values= array(
                                        $hour[$i]['activity_id'],
                                        $hour[$i]['activity_num'],
@@ -360,15 +363,19 @@
 
                                $values = 
$this->bocommon->validate_db_insert($values);
 
-                               $GLOBALS['phpgw']->db->Execute("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 ($values)");
+                               $id = 
$GLOBALS['phpgw']->db->genid('fm_wo_hours_id_seq');
+
+                               $GLOBALS['phpgw']->db->Execute("INSERT into 
fm_wo_hours 
(id,activity_id,activity_num,owner,hours_descr,unit,cost,quantity,billperae,ns3420_id,dim_d,record,entry_date,workorder_id)
 "
+                               . " values ($id,$values)");
 
                                $record++;
                        }
 
                        $receipt['message'][] = array('msg'=>lang('%1 entries 
is added!',count($hour)));
 
-                       $receipt['hour_id'] = 
$this->db->get_last_insert_id('fm_wo_hours','id');
+//                     $receipt['hour_id'] = 
$this->db->get_last_insert_id('fm_wo_hours','id');
+                       $receipt['hour_id'] = $id;
+                       $GLOBALS['phpgw']->db->committrans();
 
                        return $receipt;
 
@@ -498,13 +505,19 @@
 
                        $values = $this->bocommon->validate_db_insert($values);
 
-                       $GLOBALS['phpgw']->db->Execute("INSERT into fm_wo_hours 
(owner,hours_descr,unit,cost,quantity,billperae,ns3420_id,dim_d,"
+                       $GLOBALS['phpgw']->db->begintrans();
+                       $id = 
$GLOBALS['phpgw']->db->genid('fm_wo_hours_id_seq');
+
+                       $GLOBALS['phpgw']->db->Execute("INSERT into fm_wo_hours 
(id,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 ( $values )");
+                               . "VALUES ($id, $values )");
 
-                       $receipt['hour_id'] = 
$this->db->get_last_insert_id('fm_wo_hours','id');
+//                     $receipt['hour_id'] = 
$this->db->get_last_insert_id('fm_wo_hours','id');
+                       $receipt['hour_id'] = $id;
 
                        $receipt['message'][] = array('msg'=>lang('hour %1 is 
added!',$receipt['hour_id']));
+
+                       $GLOBALS['phpgw']->db->committrans();
 
                        return $receipt;
 




reply via email to

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