fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [6464] Property: update locations at setup


From: Sigurd Nes
Subject: [Fmsystem-commits] [6464] Property: update locations at setup
Date: Sun, 10 Oct 2010 17:16:21 +0000

Revision: 6464
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6464
Author:   sigurdne
Date:     2010-10-10 17:16:20 +0000 (Sun, 10 Oct 2010)
Log Message:
-----------
Property: update locations at setup

Modified Paths:
--------------
    trunk/property/inc/class.solocation.inc.php
    trunk/property/setup/default_records.inc.php

Modified: trunk/property/inc/class.solocation.inc.php
===================================================================
--- trunk/property/inc/class.solocation.inc.php 2010-10-10 16:45:28 UTC (rev 
6463)
+++ trunk/property/inc/class.solocation.inc.php 2010-10-10 17:16:20 UTC (rev 
6464)
@@ -37,6 +37,7 @@
 
                var $bocommon;
                var $total_records;
+               protected $global_lock = false;
 
                function __construct($bocommon = '')
                {
@@ -1340,7 +1341,14 @@
 
                function update_location()
                {
-                       $this->db->transaction_begin();
+                       if ( $this->db->Transaction )
+                       {
+                               $this->global_lock = true;
+                       }
+                       else
+                       {
+                               $this->db->transaction_begin();
+                       }
 
                        $this->db->query('SELECT max(id) as levels FROM 
fm_location_type');
                        $this->db->next_record();
@@ -1428,17 +1436,19 @@
                                }
                        }
 
-                       if( $this->db->transaction_commit() )
+                       if ( !$this->global_lock )
                        {
-                               return $receipt;
+                               if( $this->db->transaction_commit() )
+                               {
+                                       return $receipt;
+                               }
+                               else
+                               {
+                                       return 
$receipt['error'][]=array('msg'=>lang('update failed'));
+                               }
                        }
-                       else
-                       {
-                               return 
$receipt['error'][]=array('msg'=>lang('update failed'));
-                       }
                }
 
-
                function read_summary($data='')
                {
                        if(is_array($data))

Modified: trunk/property/setup/default_records.inc.php
===================================================================
--- trunk/property/setup/default_records.inc.php        2010-10-10 16:45:28 UTC 
(rev 6463)
+++ trunk/property/setup/default_records.inc.php        2010-10-10 17:16:20 UTC 
(rev 6464)
@@ -705,3 +705,6 @@
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_jasper_format_type (id) 
VALUES ('XLS')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_jasper_format_type (id) 
VALUES ('XHTML')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_jasper_format_type (id) 
VALUES ('DOCX')");
+
+$solocation = createObject('property.solocation');
+$solocation->update_location();




reply via email to

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