phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property inc/class.boactor.inc.php inc/class.so...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property inc/class.boactor.inc.php inc/class.so...
Date: Tue, 31 Oct 2006 19:13:11 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Changes by:     Sigurd Nes <sigurdne>   06/10/31 19:13:11

Modified files:
        inc            : class.boactor.inc.php class.soactor.inc.php 
        setup          : setup.inc.php tables_current.inc.php 
                         tables_update.inc.php 

Log message:
        enable filter on grants on tenants, owners and vendors

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.boactor.inc.php?cvsroot=phpgroupware&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.soactor.inc.php?cvsroot=phpgroupware&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/property/setup/setup.inc.php?cvsroot=phpgroupware&r1=1.52&r2=1.53
http://cvs.savannah.gnu.org/viewcvs/property/setup/tables_current.inc.php?cvsroot=phpgroupware&r1=1.70&r2=1.71
http://cvs.savannah.gnu.org/viewcvs/property/setup/tables_update.inc.php?cvsroot=phpgroupware&r1=1.59&r2=1.60

Patches:
Index: inc/class.boactor.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.boactor.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- inc/class.boactor.inc.php   31 Oct 2006 14:14:05 -0000      1.14
+++ inc/class.boactor.inc.php   31 Oct 2006 19:13:11 -0000      1.15
@@ -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.boactor.inc.php,v 1.14 2006/10/31 14:14:05 
sigurdne Exp $
+       * @version $Id: class.boactor.inc.php,v 1.15 2006/10/31 19:13:11 
sigurdne Exp $
        */
 
        /**
@@ -134,7 +134,6 @@
                        return (!!($has & $needed) == True);
                }
 
-
                function read()
                {
                        $actor = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
@@ -145,7 +144,10 @@
 
                        for ($i=0; $i<count($actor); $i++)
                        {
-                               $actor[$i]['entry_date']  = 
$GLOBALS['phpgw']->common->show_date($actor[$i]['date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+                               if(isset($actor[$i]['entry_date']) && 
$actor[$i]['entry_date'])
+                               {
+                                       $actor[$i]['entry_date']  = 
$GLOBALS['phpgw']->common->show_date($actor[$i]['entry_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+                               }
                        }
                        return $actor;
                }
@@ -263,7 +265,7 @@
 
                                $actor['attributes'][$i]['datatype_text'] = 
$this->bocommon->translate_datatype($actor['attributes'][$i]['datatype']);
                                $actor['attributes'][$i]['counter']     = $i;
-                               $actor['attributes'][$i]['type_id']     = 
$data['type_id'];
+//                             $actor['attributes'][$i]['type_id']     = 
$data['type_id'];
                        }
 
                        for ($j=0;$j<count($lookup_functions);$j++)

Index: inc/class.soactor.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.soactor.inc.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- inc/class.soactor.inc.php   31 Oct 2006 14:14:05 -0000      1.20
+++ inc/class.soactor.inc.php   31 Oct 2006 19:13:11 -0000      1.21
@@ -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.soactor.inc.php,v 1.20 2006/10/31 14:14:05 
sigurdne Exp $
+       * @version $Id: class.soactor.inc.php,v 1.21 2006/10/31 19:13:11 
sigurdne Exp $
        */
 
        /**
@@ -75,6 +75,12 @@
                                $uicols['descr'][]                      = 
lang('category');
                                $uicols['statustext'][]         = 
lang('category');
 
+                               $cols_return[]                          = 
'entry_date';
+                               $uicols['input_type'][]         = 'text';
+                               $uicols['name'][]                       = 
'entry_date';
+                               $uicols['descr'][]                      = 
lang('entry date');
+                               $uicols['statustext'][]         = lang('entry 
date');
+
 
                                $paranthesis .='(';
 
@@ -158,8 +164,15 @@
 
                        $where= 'WHERE';
 
-/*                     if ($filter=='all')
+                       $grants         = 
$GLOBALS['phpgw']->session->appsession('grants_' . $this->role 
,$this->currentapp);
+
+                       if(!$grants)
                        {
+                               $this->acl              = & 
$GLOBALS['phpgw']->acl;
+                               $this->grants   = 
$this->acl->get_grants($this->currentapp,'.' . $this->role);
+                               
$GLOBALS['phpgw']->session->appsession('grants_' . 
$this->role,$this->currentapp,$this->grants);
+                       }
+
                                if (is_array($grants))
                                {
                                        while (list($user) = each($grants))
@@ -167,18 +180,9 @@
                                                $public_user_list[] = $user;
                                        }
                                        reset($public_user_list);
-                                       $filtermethod .= " $where ( 
$entity_table.user_id IN(" . implode(',',$public_user_list) . "))";
-
-                                       $where= 'AND';
-                               }
-
-                       }
-                       else
-                       {
-                               $filtermethod = " $where 
$entity_table.user_id=$filter ";
+                               $filtermethod .= " $where ( 
$entity_table.owner_id IN(" . implode(',',$public_user_list) . "))";
                                $where= 'AND';
                        }
-*/
 
                        if ($cat_id)
                        {
@@ -260,7 +264,7 @@
                                for ($i=0;$i<$n;$i++)
                                {
                                        $actor_list[$j][$cols_return[$i]] = 
$this->db->f($cols_return[$i]);
-                                       $actor_list[$j]['grants'] = 
(int)$grants[$this->db->f('user_id')];
+                                       $actor_list[$j]['grants'] = 
(int)$grants[$this->db->f('owner_id')];
                                }
 
                                for ($i=0;$i<count($cols_return_extra);$i++)
@@ -439,6 +443,9 @@
                                $vals[] = $actor['member_of'];
                        }
 
+                       $cols[] = 'owner_id';
+                       $vals[] = $this->account;
+                       
                        if($cols)
                        {
                                $cols   = "," . implode(",", $cols);
@@ -832,6 +839,7 @@
                        $fd['id'] = array('type' => 'int','precision' => 
'4','nullable' => False);
                        $fd['entry_date'] = array('type' => 'int','precision' 
=> '4','nullable' => True);
                        $fd['category'] =array('type' => 'int','precision' => 
'4','nullable' => False);
+                       $fd['owner_id'] =array('type' => 'int','precision' => 
'4','nullable' => False);
 
                        switch($this->role)
                        {

Index: setup/setup.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/setup/setup.inc.php,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- setup/setup.inc.php 31 Oct 2006 14:14:05 -0000      1.52
+++ setup/setup.inc.php 31 Oct 2006 19:13:11 -0000      1.53
@@ -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.52 2006/10/31 14:14:05 sigurdne Exp $
+       * @version $Id: setup.inc.php,v 1.53 2006/10/31 19:13:11 sigurdne Exp $
        */
 
        $setup_info['property']['name']         = 'property';
        $setup_info['property']['title']        = 'Property';
-       $setup_info['property']['version']      = '0.9.17.531';
+       $setup_info['property']['version']      = '0.9.17.532';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']       = 1;
        $setup_info['property']['app_group']    = 'office';

Index: setup/tables_current.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/setup/tables_current.inc.php,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -b -r1.70 -r1.71
--- setup/tables_current.inc.php        31 Oct 2006 14:14:05 -0000      1.70
+++ setup/tables_current.inc.php        31 Oct 2006 19:13:11 -0000      1.71
@@ -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_current.inc.php,v 1.70 2006/10/31 14:14:05 
sigurdne Exp $
+       * @version $Id: tables_current.inc.php,v 1.71 2006/10/31 19:13:11 
sigurdne Exp $
        */
 
        $phpgw_baseline = array(
@@ -68,7 +68,8 @@
                                'phpgw_account_id' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'account_lid' => array('type' => 
'varchar','precision' => '25','nullable' => True),
                                'account_pwd' => array('type' => 
'varchar','precision' => '32','nullable' => True),
-                               'account_status' => array('type' => 
'int','precision' => '4','nullable' => True,'default' => '1')
+                               'account_status' => array('type' => 
'int','precision' => '4','nullable' => True,'default' => '1'),
+                               'owner_id' => array('type' => 'int','precision' 
=> '4','nullable' => True)
                        ),
                        'pk' => array('id'),
                        'fk' => array(),
@@ -131,7 +132,8 @@
                                'klasse' => array('type' => 
'varchar','precision' => '10','nullable' => True),
                                'member_of' => array('type' => 
'varchar','precision' => '255','nullable' => True),
                                'category' => array('type' => 'int','precision' 
=> '2','nullable' => True),
-                               'mva' => array('type' => 'int','precision' => 
'4','nullable' => True)
+                               'mva' => array('type' => 'int','precision' => 
'4','nullable' => True),
+                               'owner_id' => array('type' => 'int','precision' 
=> '4','nullable' => True)
                        ),
                        'pk' => array('id'),
                        'fk' => array(),
@@ -1455,7 +1457,8 @@
                                'category' => array('type' => 'int','precision' 
=> '4','nullable' => False),
                                'member_of' => array('type' => 
'varchar','precision' => '255','nullable' => True),
                                'remark' => array('type' => 
'varchar','precision' => '255','nullable' => True),
-                               'entry_date' => array('type' => 
'int','precision' => '4','nullable' => True)
+                               'entry_date' => array('type' => 
'int','precision' => '4','nullable' => True),
+                               'owner_id' => array('type' => 'int','precision' 
=> '4','nullable' => True) // record owner
                        ),
                        'pk' => array('id'),
                        'fk' => array(),

Index: setup/tables_update.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/setup/tables_update.inc.php,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -b -r1.59 -r1.60
--- setup/tables_update.inc.php 31 Oct 2006 14:18:36 -0000      1.59
+++ setup/tables_update.inc.php 31 Oct 2006 19:13:11 -0000      1.60
@@ -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.59 2006/10/31 14:18:36 
sigurdne Exp $
+       * @version $Id: tables_update.inc.php,v 1.60 2006/10/31 19:13:11 
sigurdne Exp $
        */
 
        /**
@@ -1622,3 +1622,21 @@
                $GLOBALS['setup_info']['property']['currentver'] = '0.9.17.531';
                return $GLOBALS['setup_info']['property']['currentver'];
        }
+
+       /**
+       * Update property version from 0.9.17.531 to 0.9.17.532
+       */
+
+       $test[] = '0.9.17.531';
+       function property_upgrade0_9_17_531()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_tenant','owner_id', array('type' 
=> 'int','precision' => '4','nullable' => True));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_owner','owner_id', array('type' 
=> 'int','precision' => '4','nullable' => True));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_vendor','owner_id', array('type' 
=> 'int','precision' => '4','nullable' => True));
+
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+               $GLOBALS['setup_info']['property']['currentver'] = '0.9.17.532';
+               return $GLOBALS['setup_info']['property']['currentver'];
+       }




reply via email to

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