phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property inc/class.bolocation.inc.php inc/class...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property inc/class.bolocation.inc.php inc/class...
Date: Fri, 24 Nov 2006 14:37:05 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Changes by:     Sigurd Nes <sigurdne>   06/11/24 14:37:05

Modified files:
        inc            : class.bolocation.inc.php 
                         class.soadmin_location.inc.php 
                         class.uilocation.inc.php 
        setup          : default_records.inc.php setup.inc.php 
                         tables_update.inc.php 

Log message:
        acl-locations

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.bolocation.inc.php?cvsroot=phpgroupware&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.soadmin_location.inc.php?cvsroot=phpgroupware&r1=1.34&r2=1.35
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uilocation.inc.php?cvsroot=phpgroupware&r1=1.42&r2=1.43
http://cvs.savannah.gnu.org/viewcvs/property/setup/default_records.inc.php?cvsroot=phpgroupware&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/property/setup/setup.inc.php?cvsroot=phpgroupware&r1=1.55&r2=1.56
http://cvs.savannah.gnu.org/viewcvs/property/setup/tables_update.inc.php?cvsroot=phpgroupware&r1=1.63&r2=1.64

Patches:
Index: inc/class.bolocation.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.bolocation.inc.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- inc/class.bolocation.inc.php        24 Nov 2006 12:33:34 -0000      1.24
+++ inc/class.bolocation.inc.php        24 Nov 2006 14:37:04 -0000      1.25
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage location
-       * @version $Id: class.bolocation.inc.php,v 1.24 2006/11/24 12:33:34 
sigurdne Exp $
+       * @version $Id: class.bolocation.inc.php,v 1.25 2006/11/24 14:37:04 
sigurdne Exp $
        */
 
        /**
@@ -129,6 +129,7 @@
                                $this->allrows = $allrows;
                        }
 
+                       $this->acl_location                     = '.location.' 
. $this->type_id;
                }
 
                function read_sessiondata()

Index: inc/class.soadmin_location.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.soadmin_location.inc.php,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- inc/class.soadmin_location.inc.php  24 Nov 2006 10:11:49 -0000      1.34
+++ inc/class.soadmin_location.inc.php  24 Nov 2006 14:37:04 -0000      1.35
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.soadmin_location.inc.php,v 1.34 2006/11/24 
10:11:49 sigurdne Exp $
+       * @version $Id: class.soadmin_location.inc.php,v 1.35 2006/11/24 
14:37:04 sigurdne Exp $
        */
 
        /**
@@ -214,8 +214,8 @@
                        $default_attrib['nullable'][] ='False';
                        $default_attrib['input_text'][] ='dummy';
                        $default_attrib['statustext'][] ='dummy';
-                       $default_attrib['attrib_sort'][] ='NULL';
-                       $default_attrib['custom'][] ='NULL';
+                       $default_attrib['attrib_sort'][] ='';
+                       $default_attrib['custom'][] ='';
 
                        $j++;
                        $default_attrib['id'][]= $j;
@@ -225,8 +225,8 @@
                        $default_attrib['nullable'][] ='True';
                        $default_attrib['input_text'][] ='dummy';
                        $default_attrib['statustext'][] ='dummy';
-                       $default_attrib['attrib_sort'][] ='NULL';
-                       $default_attrib['custom'][] ='NULL';
+                       $default_attrib['attrib_sort'][] ='';
+                       $default_attrib['custom'][] ='';
 
                        $j++;
                        $default_attrib['id'][]= $j;
@@ -236,8 +236,8 @@
                        $default_attrib['nullable'][] ='True';
                        $default_attrib['input_text'][] ='dummy';
                        $default_attrib['statustext'][] ='dummy';
-                       $default_attrib['attrib_sort'][] ='NULL';
-                       $default_attrib['custom'][] ='NULL';
+                       $default_attrib['attrib_sort'][] ='';
+                       $default_attrib['custom'][] ='';
 
                        $j++;
                        $default_attrib['id'][]= $j;
@@ -247,8 +247,8 @@
                        $default_attrib['nullable'][] ='False';
                        $default_attrib['input_text'][] ='dummy';
                        $default_attrib['statustext'][] ='dummy';
-                       $default_attrib['attrib_sort'][] ='NULL';
-                       $default_attrib['custom'][] ='NULL';
+                       $default_attrib['attrib_sort'][] ='';
+                       $default_attrib['custom'][] ='';
 
                        $j++;
                        $default_attrib['id'][]= $j;
@@ -258,8 +258,8 @@
                        $default_attrib['nullable'][] ='False';
                        $default_attrib['input_text'][] ='dummy';
                        $default_attrib['statustext'][] ='dummy';
-                       $default_attrib['attrib_sort'][] ='NULL';
-                       $default_attrib['custom'][] ='NULL';
+                       $default_attrib['attrib_sort'][] ='';
+                       $default_attrib['custom'][] ='';
 
                        $j++;
                        $status_id = $j;
@@ -292,8 +292,8 @@
                        $default_attrib['nullable'][] ='True';
                        $default_attrib['input_text'][] ='dummy';
                        $default_attrib['statustext'][] ='dummy';
-                       $default_attrib['attrib_sort'][] ='NULL';
-                       $default_attrib['custom'][] ='NULL';
+                       $default_attrib['attrib_sort'][] ='';
+                       $default_attrib['custom'][] ='';
 
                        $fd=array();
                        $fd['location_code'] = array('type' => 'varchar', 
'precision' => 25, 'nullable' => False);
@@ -318,8 +318,8 @@
                                $default_attrib['nullable'][] ='False';
                                $default_attrib['input_text'][] ='dummy';
                                $default_attrib['statustext'][] ='dummy';
-                               $default_attrib['attrib_sort'][] ='NULL';
-                               $default_attrib['custom'][] ='NULL';
+                               $default_attrib['attrib_sort'][] ='';
+                               $default_attrib['custom'][] ='';
                        }
 
                        $fk_table='fm_location'. ($standard['id']-1);
@@ -417,6 +417,11 @@
                                $this->db->query("INSERT INTO 
fm_location{$type_id}_category (id,descr) "
                                        . "VALUES (99,'Not 
active')",__LINE__,__FILE__);
 
+                               $this->db->query("INSERT INTO 
phpgw_acl_location (appname, id, descr)"
+                                       . " VALUES ('" . $this->currentapp 
."','" . '.location.' . $standard['id'] ."', '" . $standard['name'] . "')");
+                                       
+       //                      
$GLOBALS['phpgw']->acl->add_location('.location.' . $standard['id'], 
$standard['name'], $this->currentapp, $allow_grant = false, $custom_tbl = '');
+
                                $receipt['message'][] = array('msg' => 
lang('table %1 has been saved','fm_location'. $receipt['id']));
                                $this->db->transaction_commit();
                                $this->oProc->m_odb->transaction_commit();

Index: inc/class.uilocation.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uilocation.inc.php,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- inc/class.uilocation.inc.php        24 Nov 2006 12:33:34 -0000      1.42
+++ inc/class.uilocation.inc.php        24 Nov 2006 14:37:05 -0000      1.43
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage location
-       * @version $Id: class.uilocation.inc.php,v 1.42 2006/11/24 12:33:34 
sigurdne Exp $
+       * @version $Id: class.uilocation.inc.php,v 1.43 2006/11/24 14:37:05 
sigurdne Exp $
        */
 
        /**
@@ -26,6 +26,7 @@
                var $order;
                var $filter;
                var $currentapp;
+               var $type_id;
 
                var $public_functions = array
                (
@@ -50,12 +51,16 @@
                        $this->menu                             = 
CreateObject($this->currentapp.'.menu');
                        $this->soadmin_location                 = 
CreateObject($this->currentapp.'.soadmin_location');
 
-                       $this->acl                              = 
CreateObject('phpgwapi.acl');
-                       $this->acl_location                     = '.location';
-                       $this->acl_read                         = 
$this->acl->check('.location',1);
-                       $this->acl_add                          = 
$this->acl->check('.location',2);
-                       $this->acl_edit                         = 
$this->acl->check('.location',4);
-                       $this->acl_delete                       = 
$this->acl->check('.location',8);
+                       $this->acl                                      = & 
$GLOBALS['phpgw']->acl;
+               //      $this->acl                                      = 
CreateObject('phpgwapi.acl');
+
+                       $this->type_id                          = 
$this->bo->type_id;
+
+                       $this->acl_location                     = 
$this->bo->acl_location;
+                       $this->acl_read                         = 
$this->acl->check($this->acl_location,1);
+                       $this->acl_add                          = 
$this->acl->check($this->acl_location,2);
+                       $this->acl_edit                         = 
$this->acl->check($this->acl_location,4);
+                       $this->acl_delete                       = 
$this->acl->check($this->acl_location,8);
 
                        $this->start                            = 
$this->bo->start;
                        $this->query                            = 
$this->bo->query;
@@ -130,7 +135,7 @@
                                                                                
'nextmatchs',
                                                                                
'search_field'));
 
-                       $type_id        = get_var('type_id',array('GET'));
+                       $type_id        = $this->type_id;
                        $lookup         = get_var('lookup',array('POST','GET'));
                        $lookup_name    = 
get_var('lookup_name',array('POST','GET'));
                        $lookup_tenant  = 
get_var('lookup_tenant',array('POST','GET'));
@@ -548,7 +553,7 @@
                                }
                        }
 
-                       $type_id                = 
get_var('type_id',array('GET'));
+                       $type_id                = $this->type_id;
 
                        if($location_code)
                        {
@@ -1093,7 +1098,7 @@
                        }
 
                        $location_code          = 
get_var('location_code',array('GET'));
-                       $type_id                = 
get_var('type_id',array('GET','POST'));
+                       $type_id                = $this->type_id;
 
 
                        $confirm        = get_var('confirm',array('POST'));
@@ -1148,7 +1153,7 @@
                        $location_code          = 
get_var('location_code',array('POST','GET'));
                        $location               = split('-',$location_code);
 
-                       $type_id                = 
get_var('type_id',array('GET'));
+                       $type_id                = $this->type_id;
 
                        if($location_code)
                        {

Index: setup/default_records.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/setup/default_records.inc.php,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- setup/default_records.inc.php       24 Nov 2006 10:11:49 -0000      1.37
+++ setup/default_records.inc.php       24 Nov 2006 14:37:05 -0000      1.38
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage setup
-       * @version $Id: default_records.inc.php,v 1.37 2006/11/24 10:11:49 
sigurdne Exp $
+       * @version $Id: default_records.inc.php,v 1.38 2006/11/24 14:37:05 
sigurdne Exp $
        */
 
 
@@ -194,6 +194,10 @@
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.admin.entity', 'Admin entity')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.admin.location', 'Admin location')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.location', 'Location')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.location.1', 'Property')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.location.2', 'Building')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.location.3', 'Entrance')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.location.4', 'Apartment')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.tenant', 'Tenant')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.owner', 'Owner')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.vendor', 'Vendor')");

Index: setup/setup.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/setup/setup.inc.php,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- setup/setup.inc.php 24 Nov 2006 10:11:49 -0000      1.55
+++ setup/setup.inc.php 24 Nov 2006 14:37:05 -0000      1.56
@@ -8,12 +8,12 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage setup
-       * @version $Id: setup.inc.php,v 1.55 2006/11/24 10:11:49 sigurdne Exp $
+       * @version $Id: setup.inc.php,v 1.56 2006/11/24 14:37:05 sigurdne Exp $
        */
 
        $setup_info['property']['name']         = 'property';
        $setup_info['property']['title']        = 'Property';
-       $setup_info['property']['version']      = '0.9.17.534';
+       $setup_info['property']['version']      = '0.9.17.535';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']       = 1;
        $setup_info['property']['app_group']    = 'office';

Index: setup/tables_update.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/setup/tables_update.inc.php,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -b -r1.63 -r1.64
--- setup/tables_update.inc.php 24 Nov 2006 10:11:50 -0000      1.63
+++ setup/tables_update.inc.php 24 Nov 2006 14:37:05 -0000      1.64
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage setup
-       * @version $Id: tables_update.inc.php,v 1.63 2006/11/24 10:11:50 
sigurdne Exp $
+       * @version $Id: tables_update.inc.php,v 1.64 2006/11/24 14:37:05 
sigurdne Exp $
        */
 
        /**
@@ -1686,3 +1686,23 @@
                $GLOBALS['setup_info']['property']['currentver'] = '0.9.17.534';
                return $GLOBALS['setup_info']['property']['currentver'];
        }
+
+       /**
+       * Update property version from 0.9.17.534 to 0.9.17.535
+       */
+
+       $test[] = '0.9.17.534';
+       function property_upgrade0_9_17_534()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_acl_location (appname, id, descr) VALUES ('property', '.location.1', 
'Property')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_acl_location (appname, id, descr) VALUES ('property', '.location.2', 
'Building')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_acl_location (appname, id, descr) VALUES ('property', '.location.3', 
'Entrance')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_acl_location (appname, id, descr) VALUES ('property', '.location.4', 
'Apartment')");
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+               $GLOBALS['setup_info']['property']['currentver'] = '0.9.17.535';
+               return $GLOBALS['setup_info']['property']['currentver'];
+       }
+
+
+




reply via email to

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