phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: property/inc class.acl2.inc.php, 1.14, 1.15 clas


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.acl2.inc.php, 1.14, 1.15 class.boadmin.inc.php, 1.12, 1.13 class.boadmin_location.inc.php, 1.3, 1.4 class.bocommon.inc.php, 1.66, 1.67 class.boinvoice.inc.php, 1.22, 1.23 class.soadmin.inc.php, 1.9, 1.10 class.soinvoice.inc.php, 1.32, 1.33 class.solocation.inc.php, 1.24, 1.25 class.soproject.inc.php, 1.26, 1.27 class.sotts.inc.php, 1.24, 1.25 class.soworkorder.inc.php, 1.18, 1.19 class.uiadmin.inc.php, 1.15, 1.16 class.uiinvoice.inc.php, 1.31, 1.32 class.uilocation.inc.php, 1.22, 1.23 class.uiproject.inc.php, 1.37, 1.38 class.uiwo_hour.inc.php, 1.32, 1.33 class.uiworkorder.inc.php, 1.31, 1.32
Date: Sun, 27 Jul 2003 11:53:27 -0400

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

Modified Files:
        class.acl2.inc.php class.boadmin.inc.php 
        class.boadmin_location.inc.php class.bocommon.inc.php 
        class.boinvoice.inc.php class.soadmin.inc.php 
        class.soinvoice.inc.php class.solocation.inc.php 
        class.soproject.inc.php class.sotts.inc.php 
        class.soworkorder.inc.php class.uiadmin.inc.php 
        class.uiinvoice.inc.php class.uilocation.inc.php 
        class.uiproject.inc.php class.uiwo_hour.inc.php 
        class.uiworkorder.inc.php 
Log Message:
no message

Index: class.acl2.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.acl2.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** class.acl2.inc.php  22 Jul 2003 20:01:58 -0000      1.14
--- class.acl2.inc.php  27 Jul 2003 15:53:24 -0000      1.15
***************
*** 277,281 ****
                        }
  
!                       $sql = "SELECT id FROM fm_acl_location WHERE (id like 
'%".$args['location']."%')";
                        $this->db->query($sql,__LINE__,__FILE__);
                        while($this->db->next_record())
--- 277,281 ----
                        }
  
!                       $sql = "SELECT id FROM fm_acl_location WHERE (id like 
'%".$args['location']."%') AND allow_grant=1";
                        $this->db->query($sql,__LINE__,__FILE__);
                        while($this->db->next_record())

Index: class.boadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boadmin.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.boadmin.inc.php       22 Jul 2003 20:01:59 -0000      1.12
--- class.boadmin.inc.php       27 Jul 2003 15:53:24 -0000      1.13
***************
*** 102,106 ****
  
  
!               function select_location($format='',$selected='')
                {
  
--- 102,106 ----
  
  
!               function select_location($format='',$selected='',$grant='')
                {
  
***************
*** 115,119 ****
                        }
  
!                       $locations= $this->so->select_location();
  
                        while (is_array($locations) && list(,$loc) = 
each($locations))
--- 115,119 ----
                        }
  
!                       $locations= $this->so->select_location($grant);
  
                        while (is_array($locations) && list(,$loc) = 
each($locations))

Index: class.boadmin_location.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boadmin_location.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.boadmin_location.inc.php      13 Jun 2003 11:05:29 -0000      1.3
--- class.boadmin_location.inc.php      27 Jul 2003 15:53:24 -0000      1.4
***************
*** 177,185 ****
                        $this->total_records = $this->so->total_records;
  
-                       for ($i=0; $i<count($attrib); $i++)
-                       {
-       //                      $attrib[$i]['datatype'] = 
$this->bocommon->translate_datatype_attributes($attrib[$i]['datatype']);
-                       }
- 
                        return $attrib;
                }
--- 177,180 ----

Index: class.bocommon.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bocommon.inc.php,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -r1.66 -r1.67
*** class.bocommon.inc.php      30 Jun 2003 10:49:14 -0000      1.66
--- class.bocommon.inc.php      27 Jul 2003 15:53:24 -0000      1.67
***************
*** 67,83 ****
                }
  
  
                function msgbox_data($receipt)
                {
                        $msgbox_data_error=array();
!                       while (is_array($receipt['error']) && list(,$errors) = 
each($receipt['error']))
                        {
!                               $msgbox_data_error += array($errors['msg']=> 
False);
                        }
  
                        $msgbox_data_message=array();
!                       while (is_array($receipt['message']) && 
list(,$messages) = each($receipt['message']))
                        {
!                               $msgbox_data_message += 
array($messages['msg']=> True);
                        }
  
--- 67,97 ----
                }
  
+               function check_perms($rights, $required)
+               {
+       //              return (!!($rights & $required) == True);
+                       return ($rights & $required);
+ 
+               }
+ 
  
                function msgbox_data($receipt)
                {
                        $msgbox_data_error=array();
!                       if (isSet($receipt['error']) AND 
is_array($receipt['error']))
                        {
!                               foreach($receipt['error'] as $errors)
!                               {
!                                       $msgbox_data_error += 
array($errors['msg']=> False);
!                               }
                        }
  
                        $msgbox_data_message=array();
! 
!                       if (isSet($receipt['message']) AND 
is_array($receipt['message']))
                        {
!                               foreach($receipt['message'] as $messages)
!                               {
!                                       $msgbox_data_message += 
array($messages['msg']=> True);
!                               }
                        }
  
***************
*** 134,154 ****
                        $users = $this->accounts->get_list('accounts', $start, 
$sort, $order, $query);
  
!                       while (is_array($users) && list(,$user) = each($users))
                        {
!                               $sel_user = '';
!                               if ($user['account_id']==$selected)
                                {
!                                       $sel_user = 'selected';
                                }
- 
-                               $user_list[] = array
-                               (
-                                       'user_id'       => $user['account_id'],
-                                       'name'          => 
$user['account_lastname'].', '.$user['account_firstname'],
-                                       'selected'      => $sel_user
-                               );
                        }
  
!                       for ($i=0;$i<count($user_list);$i++)
                        {
                                if ($user_list[$i]['selected'] != 'selected')
--- 148,172 ----
                        $users = $this->accounts->get_list('accounts', $start, 
$sort, $order, $query);
  
!                       if (isSet($users) AND is_array($users))
                        {
!                               foreach($users as $user)
                                {
!                                       $sel_user = '';
!                                       if ($user['account_id']==$selected)
!                                       {
!                                               $sel_user = 'selected';
!                                       }
! 
!                                       $user_list[] = array
!                                       (
!                                               'user_id'       => 
$user['account_id'],
!                                               'name'          => 
$user['account_lastname'].', '.$user['account_firstname'],
!                                               'selected'      => $sel_user
!                                       );
                                }
                        }
  
!                       $user_count= count($user_list);
!                       for ($i=0;$i<$user_count;$i++)
                        {
                                if ($user_list[$i]['selected'] != 'selected')
***************
*** 390,557 ****
                        }
  
!                       $i=0;
!                       $menu['module'][$i]['link']             = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uilocation.index&type_id=1');
!                       $menu['module'][$i]['lang']             = 
lang('Property');
!                       $menu['module'][$i]['statustext']       = 
lang('Property');
!                       $i++;
!                       $menu['module'][$i]['link']             = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiequipment.index');
!                       $menu['module'][$i]['lang']             = 
lang('Equipment');
!                       $menu['module'][$i]['statustext']       = 
lang('Equipment');
! 
!                       $i++;
!                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uitts.index');
!                       $menu['module'][$i]['lang']                     =       
lang('Helpdesk');
!                       $menu['module'][$i]['statustext']       =       
lang('Helpdesk');
!                       $i++;
!                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiproject.index');
!                       $menu['module'][$i]['lang']                     =       
lang('Project');
!                       $menu['module'][$i]['statustext']       =       
lang('Project');
!                       $i++;
!                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiinvoice.index');
!                       $menu['module'][$i]['lang']                     =       
lang('Invoice');
!                       $menu['module'][$i]['statustext']       =       
lang('Invoice');
!                       $i++;
!                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uipricebook.index');
!                       $menu['module'][$i]['lang']                     =       
lang('Pricebook');
!                       $menu['module'][$i]['statustext']       =       
lang('Pricebook');
!                       $i++;
!                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uidocument.index');
!                       $menu['module'][$i]['lang']                     =       
lang('Documentation');
!                       $menu['module'][$i]['statustext']       =       
lang('Documentation');
!                       $i++;
!                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uireport.index');
!                       $menu['module'][$i]['lang']                     =       
lang('Report');
!                       $menu['module'][$i]['statustext']       =       
lang('Report');
! 
!                       $i=0;
!                       if ($sub == equipment)
!                       {
!                               $menu['sub_menu'][$i]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiequipment.index');
!                               $menu['sub_menu'][$i]['lang']                   
=       lang('Equipment');
!                               $menu['sub_menu'][$i]['statustext']             
=       lang('Equipment');
!                               $i++;
!                               $menu['sub_menu'][$i]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uimeter.index');
!                               $menu['sub_menu'][$i]['lang']                   
=       lang('Meter');
!                               $menu['sub_menu'][$i]['statustext']             
=       lang('Meter');
! 
  
!                               if ($this->acl2->check('.equipment',16))
!                               {
!                                       $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uistandard_entity.index&type=equipment');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('Equipment type');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Equipment type');
!                               }
                        }
! 
!                       if ($sub == location)
                        {
!                               $location       = 
$this->soadmin_location->select_location_type();
!                               for ($j=0; $j<count($location); $j++)
!                               {
!                                       $i++;
!                                       $menu['sub_menu'][$i]['link'] = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uilocation.index&type_id='
 .$location[$j]['id'] );
!                                       $menu['sub_menu'][$i]['lang'] = 
$location[$j]['name'];
!                                       $menu['sub_menu'][$i]['statustext'] = 
$location[$j]['descr'];
!                               }
  
                                $i++;
!                               $menu['sub_menu'][$i]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uidrawing.index');
!                               $menu['sub_menu'][$i]['lang']                   
=       lang('Drawing');
!                               $menu['sub_menu'][$i]['statustext']             
=       lang('Drawing');
!                               $i++;
!                               $menu['sub_menu'][$i]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uigab.index');
!                               $menu['sub_menu'][$i]['lang']                   
=       lang('gabnr');
!                               $menu['sub_menu'][$i]['statustext']             
=       lang('gabnr');
!                       }
  
-                       if ($sub == invoice)
-                       {
                                $i++;
!                               $menu['sub_menu'][$i]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiinvoice.index');
!                               $menu['sub_menu'][$i]['lang']                   
=       lang('Invoice');
!                               $menu['sub_menu'][$i]['statustext']             
=       lang('Invoice');
                                $i++;
!                               $menu['sub_menu'][$i]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiinvoice.index&paid=true');
!                               $menu['sub_menu'][$i]['lang']                   
=       lang('Paid');
!                               $menu['sub_menu'][$i]['statustext']             
=       lang('Paid');
                                $i++;
!                               $menu['sub_menu'][$i]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiinvoice.consume');
!                               $menu['sub_menu'][$i]['lang']                   
=       lang('consume');
!                               $menu['sub_menu'][$i]['statustext']             
=       lang('consume');
  
!                               if ($this->acl2->check('.invoice',16))
                                {
! 
                                        $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiinvestment.index');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('Investment value');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Investment value');
                                        $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiXport.import');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('Import invoice');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Import invoice');
                                        $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiXport.export');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('Export invoice');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Export invoice');
! 
!                                       
$menu['sub_invoice_investment_value']=$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiinvestment.index');
!                                       
$menu['sublang_invoice_investment_value']=lang('Investment value');
!                                       
$menu['sub_invoice_import']=$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiXport.import');
!                                       
$menu['sublang_invoice_import']=lang('Import invoice');
!                                       
$menu['sub_invoice_export']=$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiXport.export');
!                                       
$menu['sublang_invoice_export']=lang('Export invoice');
                                }
-                       }
  
!                       if ($sub == pricebook && 
$this->acl2->check('.pricebook',16))
!                       {
!                               $i++;
!                               $menu['sub_menu'][$i]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uipricebook.index');
!                               $menu['sub_menu'][$i]['lang']                   
=       lang('Per Vendor');
!                               $menu['sub_menu'][$i]['statustext']             
=       lang('Per Vendor');
!                               $i++;
!                               $menu['sub_menu'][$i]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uipricebook.activity');
!                               $menu['sub_menu'][$i]['lang']                   
=       lang('Per Agreement');
!                               $menu['sub_menu'][$i]['statustext']             
=       lang('Per Agreement');
!                               $i++;
!                               $menu['sub_menu'][$i]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uipricebook.agreement');
!                               $menu['sub_menu'][$i]['lang']                   
=       lang('Agreement');
!                               $menu['sub_menu'][$i]['statustext']             
=       lang('Agreement');
!                       }
  
!                       if ($sub == project)
!                       {
!                               $i++;
!                               $menu['sub_menu'][$i]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiproject.index');
!                               $menu['sub_menu'][$i]['lang']                   
=       lang('Project');
!                               $menu['sub_menu'][$i]['statustext']             
=       lang('Project');
!                               $i++;
!                               $menu['sub_menu'][$i]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiworkorder.index');
!                               $menu['sub_menu'][$i]['lang']                   
=       lang('Workorder');
!                               $menu['sub_menu'][$i]['statustext']             
=       lang('Workorder');
!                               $i++;
!                               $menu['sub_menu'][$i]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uirequest.index');
!                               $menu['sub_menu'][$i]['lang']                   
=       lang('Request');
!                               $menu['sub_menu'][$i]['statustext']             
=       lang('Request');
!                               $i++;
!                               $menu['sub_menu'][$i]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uitemplate.index');
!                               $menu['sub_menu'][$i]['lang']                   
=       lang('template');
!                               $menu['sub_menu'][$i]['statustext']             
=       lang('Workorder template');
  
!                       }
  
!                       if ($sub == admin_location && 
$this->acl2->check('.location',16))
!                       {
!                               $i++;
!                               $menu['sub_menu'][$i]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiadmin_location.index');
!                               $menu['sub_menu'][$i]['lang']                   
=       lang('Location type');
!                               $menu['sub_menu'][$i]['statustext']             
=       lang('Location type');
!                               $i++;
!                               $menu['sub_menu'][$i]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiadmin_location.config');
!                               $menu['sub_menu'][$i]['lang']                   
=       lang('Config');
!                               $menu['sub_menu'][$i]['statustext']             
=       lang('Location Config');
  
                        }
  
--- 408,586 ----
                        }
  
!                       $previous_sub = 
$GLOBALS['phpgw']->session->appsession('previous_sub',$currentapp);
  
!                       if($previous_sub==$sub)
!                       {
!                               $menu = 
$GLOBALS['phpgw']->session->appsession('menu',$currentapp);
                        }
!                       else
                        {
!                               $previous_sub = 
$GLOBALS['phpgw']->session->appsession('previous_sub',$currentapp,$sub);
  
+ 
+                               $i=0;
+                               $menu['module'][$i]['link']             = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uilocation.index&type_id=1');
+                               $menu['module'][$i]['lang']             = 
lang('Property');
+                               $menu['module'][$i]['statustext']       = 
lang('Property');
                                $i++;
!                               $menu['module'][$i]['link']             = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiequipment.index');
!                               $menu['module'][$i]['lang']             = 
lang('Equipment');
!                               $menu['module'][$i]['statustext']       = 
lang('Equipment');
  
                                $i++;
!                               $menu['module'][$i]['link']                     
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uitts.index');
!                               $menu['module'][$i]['lang']                     
=       lang('Helpdesk');
!                               $menu['module'][$i]['statustext']       =       
lang('Helpdesk');
!                               $i++;
!                               $menu['module'][$i]['link']                     
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiproject.index');
!                               $menu['module'][$i]['lang']                     
=       lang('Project');
!                               $menu['module'][$i]['statustext']       =       
lang('Project');
                                $i++;
!                               $menu['module'][$i]['link']                     
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiinvoice.index');
!                               $menu['module'][$i]['lang']                     
=       lang('Invoice');
!                               $menu['module'][$i]['statustext']       =       
lang('Invoice');
                                $i++;
!                               $menu['module'][$i]['link']                     
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uipricebook.index');
!                               $menu['module'][$i]['lang']                     
=       lang('Pricebook');
!                               $menu['module'][$i]['statustext']       =       
lang('Pricebook');
!                               $i++;
!                               $menu['module'][$i]['link']                     
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uidocument.index');
!                               $menu['module'][$i]['lang']                     
=       lang('Documentation');
!                               $menu['module'][$i]['statustext']       =       
lang('Documentation');
!                               $i++;
!                               $menu['module'][$i]['link']                     
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uireport.index');
!                               $menu['module'][$i]['lang']                     
=       lang('Report');
!                               $menu['module'][$i]['statustext']       =       
lang('Report');
  
!                               $i=0;
!                               if ($sub == equipment)
                                {
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiequipment.index');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('Equipment');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Equipment');
                                        $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uimeter.index');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('Meter');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Meter');
! 
!                                       if ($this->acl2->check('.equipment',16))
!                                       {
!                                               $i++;
!                                               $menu['sub_menu'][$i]['link']   
                =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uistandard_entity.index&type=equipment');
!                                               $menu['sub_menu'][$i]['lang']   
                =       lang('Equipment type');
!                                               
$menu['sub_menu'][$i]['statustext']             =       lang('Equipment type');
!                                       }
!                               }
! 
!                               if ($sub == location)
!                               {
!                                       $location       = 
$this->soadmin_location->select_location_type();
!                                       $location_count=count($location);
!                                       for ($j=0; $j<$location_count; $j++)
!                                       {
!                                               $i++;
!                                               $menu['sub_menu'][$i]['link'] = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uilocation.index&type_id='
 .$location[$j]['id'] );
!                                               $menu['sub_menu'][$i]['lang'] = 
$location[$j]['name'];
!                                               
$menu['sub_menu'][$i]['statustext'] = $location[$j]['descr'];
!                                       }
! 
                                        $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uidrawing.index');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('Drawing');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Drawing');
                                        $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uigab.index');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('gabnr');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('gabnr');
                                }
  
!                               if ($sub == invoice)
!                               {
!                                       $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiinvoice.index');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('Invoice');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Invoice');
!                                       $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiinvoice.index&paid=true');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('Paid');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Paid');
!                                       $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiinvoice.consume');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('consume');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('consume');
! 
!                                       if ($this->acl2->check('.invoice',16))
!                                       {
!                                               $i++;
!                                               $menu['sub_menu'][$i]['link']   
                =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiinvestment.index');
!                                               $menu['sub_menu'][$i]['lang']   
                =       lang('Investment value');
!                                               
$menu['sub_menu'][$i]['statustext']             =       lang('Investment 
value');
!                                               $i++;
!                                               $menu['sub_menu'][$i]['link']   
                =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiXport.import');
!                                               $menu['sub_menu'][$i]['lang']   
                =       lang('Import invoice');
!                                               
$menu['sub_menu'][$i]['statustext']             =       lang('Import invoice');
!                                               $i++;
!                                               $menu['sub_menu'][$i]['link']   
                =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiXport.export');
!                                               $menu['sub_menu'][$i]['lang']   
                =       lang('Export invoice');
!                                               
$menu['sub_menu'][$i]['statustext']             =       lang('Export invoice');
! 
!                                               
$menu['sub_invoice_investment_value']=$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiinvestment.index');
!                                               
$menu['sublang_invoice_investment_value']=lang('Investment value');
!                                               
$menu['sub_invoice_import']=$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiXport.import');
!                                               
$menu['sublang_invoice_import']=lang('Import invoice');
!                                               
$menu['sub_invoice_export']=$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiXport.export');
!                                               
$menu['sublang_invoice_export']=lang('Export invoice');
!                                       }
!                               }
  
!                               if ($sub == pricebook && 
$this->acl2->check('.pricebook',16))
!                               {
!                                       $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uipricebook.index');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('Per Vendor');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Per Vendor');
!                                       $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uipricebook.activity');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('Per Agreement');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Per Agreement');
!                                       $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uipricebook.agreement');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('Agreement');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Agreement');
!                               }
  
!                               if ($sub == project)
!                               {
!                                       $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiproject.index');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('Project');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Project');
!                                       $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiworkorder.index');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('Workorder');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Workorder');
!                                       $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uirequest.index');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('Request');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Request');
!                                       $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uitemplate.index');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('template');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Workorder template');
!                               }
  
!                               if ($sub == admin_location && 
$this->acl2->check('.location',16))
!                               {
!                                       $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiadmin_location.index');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('Location type');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Location type');
!                                       $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiadmin_location.config');
!                                       $menu['sub_menu'][$i]['lang']           
        =       lang('Config');
!                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Location Config');
!                               }
  
+                               $menu = 
$GLOBALS['phpgw']->session->appsession('menu',$currentapp,$menu);
                        }
  
***************
*** 655,659 ****
                        }
  
!                       for ($i=0;$i<count($fm_location_cols);$i++)
                        {
                                if($fm_location_cols[$i]['list']==1)
--- 684,690 ----
                        }
  
!                       $location_cols_count    = count($fm_location_cols);
! 
!                       for ($i=0;$i<$location_cols_count;$i++)
                        {
                                if($fm_location_cols[$i]['list']==1)
***************
*** 701,705 ****
  
  
!                       for ($i=0;$i<count($config);$i++)
                        {
  
--- 732,737 ----
  
  
!                       $config_count   = count($config);
!                       for ($i=0;$i<$config_count;$i++)
                        {
  

Index: class.boinvoice.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boinvoice.inc.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** class.boinvoice.inc.php     14 Jul 2003 10:36:42 -0000      1.22
--- class.boinvoice.inc.php     27 Jul 2003 15:53:24 -0000      1.23
***************
*** 661,665 ****
                        return $dimd_list;
                }
-       //---------------------
  
                function select_tax_code_list($selected='')
--- 661,664 ----
***************
*** 693,697 ****
                }
  
! //------------------------
        }
  ?>
--- 692,706 ----
                }
  
!               function delete($params)
!               {
!                       if (is_array($params))
!                       {
!                               $this->so->delete($params[0]);
!                       }
!                       else
!                       {
!                               $this->so->delete($params);
!                       }
!               }
        }
  ?>

Index: class.soadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soadmin.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.soadmin.inc.php       22 Jul 2003 20:01:59 -0000      1.9
--- class.soadmin.inc.php       27 Jul 2003 15:53:24 -0000      1.10
***************
*** 45,52 ****
                }
  
!               function select_location()
                {
! 
!                       $this->db->query("SELECT * FROM fm_acl_location ORDER 
BY id ");
  
                                $i = 0;
--- 45,55 ----
                }
  
!               function select_location($grant='')
                {
!                       if($grant)
!                       {
!                               $filter = ' WHERE allow_grant=1';
!                       }
!                       $this->db->query("SELECT * FROM fm_acl_location $filter 
ORDER BY id ");
  
                                $i = 0;

Index: class.soinvoice.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soinvoice.inc.php,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -r1.32 -r1.33
*** class.soinvoice.inc.php     14 Jul 2003 10:36:43 -0000      1.32
--- class.soinvoice.inc.php     27 Jul 2003 15:53:24 -0000      1.33
***************
*** 783,787 ****
                {
  
!                       $sql = "SELECT * FROM fm_acl2 $this->join 
phpgw_accounts on phpgw_accounts.account_id=fm_acl2.acl_account where 
acl_location ='.invoice' ";
                        $this->db->query($sql,__LINE__,__FILE__);
                        while ($this->db->next_record())
--- 783,787 ----
                {
  
!                       $sql = "SELECT * FROM fm_acl2 $this->join 
phpgw_accounts on phpgw_accounts.account_id=fm_acl2.acl_account where 
acl_location ='.invoice' and account_type='u' ";
                        $this->db->query($sql,__LINE__,__FILE__);
                        while ($this->db->next_record())
***************
*** 814,817 ****
--- 814,822 ----
                        return $class;
                }
+               function delete($bilagsnr)
+               {
+                       $this->db->query("DELETE FROM fm_ecobilag WHERE 
bilagsnr ='" . $bilagsnr  ."'",__LINE__,__FILE__);
+               }
+ 
  
        }

Index: class.solocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.solocation.inc.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** class.solocation.inc.php    17 Jul 2003 10:46:22 -0000      1.24
--- class.solocation.inc.php    27 Jul 2003 15:53:24 -0000      1.25
***************
*** 16,21 ****
                        $this->acl2             = 
CreateObject($this->currentapp.'.acl2','##DEFAULT##','##DEFAULT##');
  
!               //      $this->grants   = 
$GLOBALS['phpgw']->acl->get_grants($this->currentapp);
!                       $this->grants   = 
$this->acl2->get_grants($this->currentapp,'.location');
                        $this->db               = $GLOBALS['phpgw']->db;
                        $this->db2              = $this->db;
--- 16,20 ----
                        $this->acl2             = 
CreateObject($this->currentapp.'.acl2','##DEFAULT##','##DEFAULT##');
  
! //                    $this->grants   = 
$this->acl2->get_grants($this->currentapp,'.location');
                        $this->db               = $GLOBALS['phpgw']->db;
                        $this->db2              = $this->db;
***************
*** 26,30 ****
                        $this->join                     = $this->socommon->join;
                        $this->left_join        = $this->socommon->left_join;
- //_debug_array($this->grants);
                }
  
--- 25,28 ----
***************
*** 135,139 ****
                        $fm_location_cols = 
$this->soadmin_location->read_attrib(array('type_id'=>$type_id,'lookup_type'=>$type_id));
  
!                       for ($i=0;$i<count($fm_location_cols);$i++)
                        {
                                if($fm_location_cols[$i]['list']==1)
--- 133,139 ----
                        $fm_location_cols = 
$this->soadmin_location->read_attrib(array('type_id'=>$type_id,'lookup_type'=>$type_id));
  
!                       $location_cols_count    = count($fm_location_cols);
! 
!                       for ($i=0;$i<$location_cols_count;$i++)
                        {
                                if($fm_location_cols[$i]['list']==1)
***************
*** 227,231 ****
                        }
  
!                       for ($i=0;$i<count($config);$i++)
                        {
                                if (($config[$i]['location_type'] <= $type_id) 
&& ($config[$i]['f_key'] ==1))
--- 227,232 ----
                        }
  
!                       $config_count   = count($config);
!                       for ($i=0;$i<$config_count;$i++)
                        {
                                if (($config[$i]['location_type'] <= $type_id) 
&& ($config[$i]['f_key'] ==1))
***************
*** 241,245 ****
                                        
if($config[$i]['column_name']=='street_id')
                                        {
!                                               $sub_query .= "or street_name 
LIKE '%$query%'";
                                                $cols.= 
',fm_streetaddress.descr as street_name';
                                                $cols_return[]                  
        = 'street_name';
--- 242,246 ----
                                        
if($config[$i]['column_name']=='street_id')
                                        {
!                                               $sub_query .= "or 
fm_streetaddress.descr LIKE '%$query%'";
                                                $cols.= 
',fm_streetaddress.descr as street_name';
                                                $cols_return[]                  
        = 'street_name';
***************
*** 332,346 ****
  
                        $j=0;
                        while ($this->db->next_record())
                        {
!                               for ($i=0;$i<count($cols_return);$i++)
                                {
!                                       $location[$j][$cols_return[$i]] = 
$this->db->f($cols_return[$i]);
                                }
                                $j++;
                        }
  
! //_debug_array($location);
!                       return $location;
                }
  
--- 333,357 ----
  
                        $j=0;
+                       $cols_return_count      = count($cols_return);
                        while ($this->db->next_record())
                        {
!                               for ($i=0;$i<$cols_return_count;$i++)
                                {
!                                       $location_list[$j][$cols_return[$i]] = 
$this->db->f($cols_return[$i]);
                                }
+ 
+                               $location_code= $this->db->f('location_code');
+                               $location = split('-',$location_code);
+                               for ($m=0;$m<count($location);$m++)
+                               {
+                                       $location_list[$j]['loc' . ($m+1)] = 
$location[$m];
+                                       
$location_list[$j]['query_location']['loc' . ($m+1)]=implode("-", 
array_slice($location, 0, ($m+1)));
+                               }
+ 
                                $j++;
                        }
  
! //_debug_array($location_list);
!                       return $location_list;
                }
  
***************
*** 368,372 ****
  //_debug_array($fm_location_cols);
  
!                       for ($i=0;$i<count($fm_location_cols);$i++)
                        {
  
--- 379,385 ----
  //_debug_array($fm_location_cols);
  
!                       $location_cols_count    = count($fm_location_cols);
! 
!                       for ($i=0;$i<$location_cols_count;$i++)
                        {
  
***************
*** 429,434 ****
                        $config = $this->soadmin_location->read_config('');
  
! //_debug_array($config);
!                       for ($i=0;$i<count($config);$i++)
                        {
                                if (($config[$i]['location_type'] <= $type_id) 
&& ($config[$i]['f_key'] ==1))
--- 442,447 ----
                        $config = $this->soadmin_location->read_config('');
  
!                       $config_count   = count($config);
!                       for ($i=0;$i<$config_count;$i++)
                        {
                                if (($config[$i]['location_type'] <= $type_id) 
&& ($config[$i]['f_key'] ==1))
***************
*** 567,577 ****
                        $cols_return    = $this->cols_return;
  
                        $this->db->next_record();
!                       for ($i=0;$i<count($cols_return);$i++)
                        {
                                $location[$cols_return[$i]] = 
$this->db->f($cols_return[$i]);
                        }
  
! //_debug_array($location);
  
                        return $location;
--- 580,592 ----
                        $cols_return    = $this->cols_return;
  
+                       $cols_return_count      = count($cols_return);
+ 
                        $this->db->next_record();
!                       for ($i=0;$i<$cols_return_count;$i++)
                        {
                                $location[$cols_return[$i]] = 
$this->db->f($cols_return[$i]);
                        }
  
! //_debug_array($cols_return);
  
                        return $location;

Index: class.soproject.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soproject.inc.php,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** class.soproject.inc.php     17 Jul 2003 10:46:22 -0000      1.26
--- class.soproject.inc.php     27 Jul 2003 15:53:24 -0000      1.27
***************
*** 16,25 ****
                        $this->db2                      = $this->db;
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
                        $this->historylog       = 
CreateObject($this->currentapp.'.historylog','project');
                        $this->historylog_r     = 
CreateObject($this->currentapp.'.historylog','request');
-                       $this->socommon         = 
CreateObject($this->currentapp.'.socommon');
  
!                       $this->join                     = $this->socommon->join;
                }
  
--- 16,25 ----
                        $this->db2                      = $this->db;
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       $this->acl2             = 
CreateObject($this->currentapp.'.acl2','##DEFAULT##','##DEFAULT##');
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
                        $this->historylog       = 
CreateObject($this->currentapp.'.historylog','project');
                        $this->historylog_r     = 
CreateObject($this->currentapp.'.historylog','request');
  
!                       $this->join                     = $this->bocommon->join;
                }
  
***************
*** 91,94 ****
--- 91,96 ----
                function read($data)
                {
+                       $this->grants           = 
$this->acl2->get_grants($this->currentapp,'.project');
+ 
                        if(is_array($data))
                        {
***************
*** 143,146 ****
--- 145,150 ----
                        $uicols['statustext'][]         = lang('Project 
coordinator');
  
+                       $cols.= ",$entity_table.user_id";
+ 
                        $sql    = 
$this->bocommon->generate_sql(array('entity_table'=>$entity_table,'cols'=>$cols,'cols_return'=>$cols_return,
                                                                                
                                        
'uicols'=>$uicols,'joinmethod'=>$joinmethod,'paranthesis'=>$paranthesis,'query'=>$query));
***************
*** 155,160 ****
--- 159,180 ----
                        }
  
+ 
                        $where= 'WHERE';
  
+                       $filtermethod = $where . ' ( fm_project.user_id=' . 
$this->account;
+                       if (is_array($this->grants))
+                       {
+                               $grants = $this->grants;
+                               while (list($user) = each($grants))
+                               {
+                                       $public_user_list[] = $user;
+                               }
+                               reset($public_user_list);
+                               $filtermethod .= " OR 
(fm_project.access='public' AND fm_project.user_id IN(" . 
implode(',',$public_user_list) . ")))";
+                       }
+ 
+                       $where= 'AND';
+ 
+ 
                        if ($cat_id > 0)
                        {
***************
*** 201,204 ****
--- 221,226 ----
                                {
                                        $project_list[$j][$cols_return[$i]] = 
$this->db->f($cols_return[$i]);
+                                       $project_list[$j]['grants'] = 
(int)$this->grants[$this->db->f('user_id')];
+ 
                                }
  
***************
*** 220,223 ****
--- 242,247 ----
                function read_single($project_id)
                {
+                       $this->grants           = 
$this->acl2->get_grants($this->currentapp,'.project');
+ 
                        $sql = "SELECT * from fm_project where 
id='$project_id'";
  
***************
*** 246,249 ****
--- 270,274 ----
                                $project['end_date']                    = 
$this->db->f('end_date');
                                $project['cat_id']                              
= $this->db->f('category');
+                               $project['grants']                              
= (int)$this->grants[$this->db->f('user_id')];
  
                                $project['power_meter'] = 
$this->get_power_meter($this->db->f('location_code'));

Index: class.sotts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sotts.inc.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** class.sotts.inc.php 9 Jul 2003 11:12:17 -0000       1.24
--- class.sotts.inc.php 27 Jul 2003 15:53:24 -0000      1.25
***************
*** 13,22 ****
                {
                        $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
!                       $this->db               = $GLOBALS['phpgw']->db;
!                       $this->db2              = $this->db;
!                       $this->mail     = 
CreateObject($this->currentapp.'.botts_mail');
!                       $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->historylog       = 
CreateObject($this->currentapp.'.historylog','tts');
                        $this->config           = 
CreateObject('phpgwapi.config');
                        $this->socommon         = 
CreateObject($this->currentapp.'.socommon');
  
--- 13,23 ----
                {
                        $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
!                       $this->db                       = $GLOBALS['phpgw']->db;
!                       $this->db2                      = $this->db;
!                       $this->mail             = 
CreateObject($this->currentapp.'.botts_mail');
!                       $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->historylog       = 
CreateObject($this->currentapp.'.historylog','tts');
                        $this->config           = 
CreateObject('phpgwapi.config');
+                       $this->acl2             = 
CreateObject($this->currentapp.'.acl2','##DEFAULT##','##DEFAULT##');
                        $this->socommon         = 
CreateObject($this->currentapp.'.socommon');
  
***************
*** 50,53 ****
--- 51,56 ----
                function read($data)
                {
+                       $this->grants           = 
$this->acl2->get_grants($this->currentapp,'.ticket');
+ 
                        if(is_array($data))
                        {
***************
*** 79,94 ****
                        $where= 'WHERE';
  
!                       if ($filter == 'all'):
                        {
!                               $where= 'WHERE';
                        }
!                       elseif ($filter == 'closed'):
                        {
!                               $filtermethod = " $where status='X'";
                                $where = 'AND';
                        }
!                       else: // open
                        {
!                               $filtermethod = " $where status='O'";
                                $where = 'AND';
                        }
--- 82,107 ----
                        $where= 'WHERE';
  
!                       $filtermethod = $where . ' ( fm_tts_tickets.user_id=' . 
$this->account;
!                       if (is_array($this->grants))
                        {
!                               $grants = $this->grants;
!                               while (list($user) = each($grants))
!                               {
!                                       $public_user_list[] = $user;
!                               }
!                               reset($public_user_list);
!                               $filtermethod .= " OR ( fm_tts_tickets.user_id 
IN(" . implode(',',$public_user_list) . ")))";
                        }
! 
!                       $where= 'AND';
! 
!                       if ($filter == 'closed'):
                        {
!                               $filtermethod .= " $where status='X'";
                                $where = 'AND';
                        }
!                       elseif($filter == ''):
                        {
!                               $filtermethod .= " $where status='O'";
                                $where = 'AND';
                        }

Index: class.soworkorder.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soworkorder.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** class.soworkorder.inc.php   17 Jul 2003 10:46:22 -0000      1.18
--- class.soworkorder.inc.php   27 Jul 2003 15:53:24 -0000      1.19
***************
*** 19,22 ****
--- 19,23 ----
                        $this->historylog       = 
CreateObject($this->currentapp.'.historylog','workorder');
                        $this->socommon         = 
CreateObject($this->currentapp.'.socommon');
+                       $this->acl2             = 
CreateObject($this->currentapp.'.acl2','##DEFAULT##','##DEFAULT##');
  
                        $this->join                     = $this->socommon->join;
***************
*** 98,101 ****
--- 99,104 ----
                function read($data)
                {
+                       $this->grants           = 
$this->acl2->get_grants($this->currentapp,'.project');
+ 
                        if(is_array($data))
                        {
***************
*** 164,167 ****
--- 167,171 ----
                        $uicols['statustext'][]         = lang('Workorder 
User');
  
+                       $cols .= ",fm_project.user_id as project_owner";
  
  
***************
*** 183,186 ****
--- 187,204 ----
                        $where= 'WHERE';
  
+                       $filtermethod = $where . ' ( fm_project.user_id=' . 
$this->account;
+                       if (is_array($this->grants))
+                       {
+                               $grants = $this->grants;
+                               while (list($user) = each($grants))
+                               {
+                                       $public_user_list[] = $user;
+                               }
+                               reset($public_user_list);
+                               $filtermethod .= " OR 
(fm_project.access='public' AND fm_project.user_id IN(" . 
implode(',',$public_user_list) . ")))";
+                       }
+ 
+                       $where= 'AND';
+ 
                        if ($cat_id > 0)
                        {
***************
*** 227,230 ****
--- 245,249 ----
                                {
                                        $workorder_list[$j][$cols_return[$i]] = 
$this->db->f($cols_return[$i]);
+                                       $workorder_list[$j]['grants'] = 
(int)$this->grants[$this->db->f('project_owner')];
                                }
  
***************
*** 245,249 ****
                function read_single($workorder_id)
                {
!                       $sql = "SELECT fm_workorder.*, fm_chapter.descr as 
chapter  from fm_workorder $this->left_join fm_chapter on "
                                . " fm_workorder.chapter_id = fm_chapter.id 
where fm_workorder.id='$workorder_id'";
  
--- 264,270 ----
                function read_single($workorder_id)
                {
!                       $this->grants           = 
$this->acl2->get_grants($this->currentapp,'.project');
! 
!                       $sql = "SELECT fm_workorder.*, fm_chapter.descr as 
chapter ,fm_project.user_id from fm_workorder $this->join fm_project on 
fm_workorder.project_id=fm_project.id  $this->left_join fm_chapter on "
                                . " fm_workorder.chapter_id = fm_chapter.id 
where fm_workorder.id='$workorder_id'";
  
***************
*** 277,280 ****
--- 298,302 ----
                                $workorder['chapter_id']                = 
$this->db->f('chapter_id');
                                $workorder['chapter']                   = 
$this->db->f('chapter');
+                               $workorder['grants']                            
= (int)$this->grants[$this->db->f('user_id')];
                        }
  

Index: class.uiadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiadmin.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** class.uiadmin.inc.php       22 Jul 2003 20:01:59 -0000      1.15
--- class.uiadmin.inc.php       27 Jul 2003 15:53:24 -0000      1.16
***************
*** 227,231 ****
                                'lang_location_statustext'              => 
lang('Select submodule'),
                                'select_name_location'                  => 
'module',
!                               'location_list'                                 
=> $this->bo->select_location('filter',$this->location)
                        );
  
--- 227,231 ----
                                'lang_location_statustext'              => 
lang('Select submodule'),
                                'select_name_location'                  => 
'module',
!                               'location_list'                                 
=> $this->bo->select_location('filter',$this->location,True)
                        );
  
***************
*** 478,482 ****
                                'lang_location_statustext'              => 
lang('Select submodule'),
                                'select_name_location'                  => 
'module',
!                               'location_list'                                 
=> $this->bo->select_location('filter',$this->location)
                        );
  
--- 478,482 ----
                                'lang_location_statustext'              => 
lang('Select submodule'),
                                'select_name_location'                  => 
'module',
!                               'location_list'                                 
=> $this->bo->select_location('filter',$this->location,False)
                        );
  

Index: class.uiinvoice.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiinvoice.inc.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** class.uiinvoice.inc.php     18 Jul 2003 09:34:54 -0000      1.31
--- class.uiinvoice.inc.php     27 Jul 2003 15:53:24 -0000      1.32
***************
*** 26,30 ****
                        'list_sub'              => True,
                        'consume'               => True,
!                       'remark'                => True
                );
  
--- 26,31 ----
                        'list_sub'              => True,
                        'consume'               => True,
!                       'remark'                => True,
!                       'delete'                => True
                );
  
***************
*** 36,41 ****
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
  
-                       $this->grants                           = 
$GLOBALS['phpgw']->acl->get_grants($this->currentapp);
-                       $this->grants[$this->account] = PHPGW_ACL_READ + 
PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
                        $this->bo                                       = 
CreateObject($this->currentapp.'.boinvoice',True);
                        $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
--- 37,40 ----
***************
*** 136,139 ****
--- 135,144 ----
                                        $content[$i]['lang_period_help']        
= lang('Klick this link to edit the period');
  
+                                       if($this->acl_delete && !$paid)
+                                       {
+                                               $content[$i]['link_delete']     
                        = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiinvoice.delete&voucher_id='
 . $extra['voucher_id']);
+                                               
$content[$i]['lang_delete_statustext']  = lang('delete the voucher');
+                                               $content[$i]['text_delete']     
                        = lang('delete');
+                                       }
  
                                        $i++;
***************
*** 189,193 ****
                                'lang_supervisor'                       => 
lang('Supervisor'),
                                'lang_budget_responsible'       => lang('Budget 
Responsible'),
!                               'lang_transfer'                         => 
lang('Transfer')
                        );
  
--- 194,199 ----
                                'lang_supervisor'                       => 
lang('Supervisor'),
                                'lang_budget_responsible'       => lang('Budget 
Responsible'),
!                               'lang_transfer'                         => 
lang('Transfer'),
!                               'lang_delete'                           => 
lang('delete')
                        );
  
***************
*** 316,319 ****
--- 322,326 ----
                                $data['table_header_list_voucher']              
= $table_header;
                                $data['values_list_voucher']                    
= $content;
+                               $data['acl_delete']                             
                = $this->acl_delete;
  
                                
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_voucher' => $data));
***************
*** 726,729 ****
--- 733,776 ----
                }
  
+               function delete()
+               {
+                       if(!$this->acl_delete)
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uilocation.stop&perm=8&acl_location='
 . $this->acl2_location);
+                       }
+ 
+                       $voucher_id = get_var('voucher_id',array('POST','GET'));
+                       $confirm        = get_var('confirm',array('POST'));
+ 
+                       $link_data = array
+                       (
+                               'menuaction' => 
$this->currentapp.'.uiinvoice.index'
+                       );
+ 
+                       if (get_var('confirm',array('POST')))
+                       {
+                               $this->bo->delete($voucher_id);
+                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
+                       }
+ 
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
+ 
+                       $data = array
+                       (
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiinvoice.delete&voucher_id='
 . $voucher_id),
+                               'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
+                               'lang_yes'                              => 
lang('yes'),
+                               'lang_yes_statustext'   => lang('Delete the 
entry'),
+                               'lang_no_statustext'    => lang('Back to the 
list'),
+                               'lang_no'                               => 
lang('no')
+                       );
+ 
+                       $appname                                                
= lang('invoice');
+                       $function_msg                                   = 
lang('delete voucher');
+ 
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
+               }
  
        }

Index: class.uilocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uilocation.inc.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** class.uilocation.inc.php    18 Jul 2003 09:34:54 -0000      1.22
--- class.uilocation.inc.php    27 Jul 2003 15:53:24 -0000      1.23
***************
*** 107,156 ****
  
                        $j=0;
!                       while (is_array($location_list) && list(,$location) = 
each($location_list))
                        {
!                               for ($i=0;$i<count($uicols['name']);$i++)
                                {
!                                       if($uicols['input_type'][$i]!='hidden')
                                        {
-                                               
$content[$j]['row'][$i]['value']                        = 
$location[$uicols['name'][$i]];
-                                               $content[$j]['row'][$i]['name'] 
                        = $uicols['name'][$i];
-                                               
$content[$j]['row'][$i]['lookup']                       = $lookup;
-                                       }
  
!                                       $content[$j]['hidden'][$i]['value']     
                = $location[$uicols['name'][$i]];
!                                       $content[$j]['hidden'][$i]['name']      
                        = $uicols['name'][$i];
  
!                               }
  
!                               if(!$lookup)
!                               {
!                                       if($this->acl_read)
!                                       {
!                                               
$content[$j]['row'][$i]['statustext']                   = lang('view the 
location');
!                                               $content[$j]['row'][$i]['text'] 
                                = lang('view');
!                                               $content[$j]['row'][$i]['link'] 
                        = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.view&location_code='
 . $location['location_code']);
!                                               $i++;
!                                       }
! 
!                                       if($this->acl_edit)
!                                       {
!                                               
$content[$j]['row'][$i]['statustext']                   = lang('edit the 
location');
!                                               $content[$j]['row'][$i]['text'] 
                                = lang('edit');
!                                               $content[$j]['row'][$i]['link'] 
                        = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.edit&location_code='
 . $location['location_code']);
!                                               $i++;
                                        }
  
!                                       if($this->acl_delete)
                                        {
!                                               
$content[$j]['row'][$i]['statustext']                   = lang('delete the 
location');
!                                               $content[$j]['row'][$i]['text'] 
                                = lang('delete');
!                                               $content[$j]['row'][$i]['link'] 
                        = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.delete&location_code='
 . $location['location_code'] . '&type_id=' . $type_id);
                                        }
                                }
-                               $j++;
                        }
  //_debug_array($content);
  
!                       for ($i=0;$i<count($uicols['descr']);$i++)
                        {
                                if($uicols['input_type'][$i]!='hidden')
--- 107,170 ----
  
                        $j=0;
!                       if (isSet($location_list) AND is_array($location_list))
                        {
!                               foreach($location_list as $location)
                                {
!                                       for 
($i=0;$i<count($uicols['name']);$i++)
                                        {
  
!                                               
if($uicols['input_type'][$i]!='hidden')
!                                               {
  
!                                                       
if($location['query_location'][$uicols['name'][$i]])
!                                                       {
!                                                               
$content[$j]['row'][$i]['statustext']                   = lang('search');
!                                                               
$content[$j]['row'][$i]['text']                                 = 
$location[$uicols['name'][$i]];
!                                                               
$content[$j]['row'][$i]['link']                         = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.index&query='
 . $location['query_location'][$uicols['name'][$i]] . '&lookup=' . $lookup . 
'&type_id=' . $type_id);
!                                                       }
!                                                       else
!                                                       {
!                                                               
$content[$j]['row'][$i]['value']                        = 
$location[$uicols['name'][$i]];
!                                                               
$content[$j]['row'][$i]['name']                         = $uicols['name'][$i];
!                                                               
$content[$j]['row'][$i]['lookup']                       = $lookup;
!                                                       }
!                                               }
  
!                                               
$content[$j]['hidden'][$i]['value']                     = 
$location[$uicols['name'][$i]];
!                                               
$content[$j]['hidden'][$i]['name']                              = 
$uicols['name'][$i];
                                        }
  
!                                       if(!$lookup)
                                        {
!                                               if($this->acl_read)
!                                               {
!                                                       
$content[$j]['row'][$i]['statustext']                   = lang('view the 
location');
!                                                       
$content[$j]['row'][$i]['text']                                 = lang('view');
!                                                       
$content[$j]['row'][$i]['link']                         = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.view&location_code='
 . $location['location_code']);
!                                                       $i++;
!                                               }
! 
!                                               if($this->acl_edit)
!                                               {
!                                                       
$content[$j]['row'][$i]['statustext']                   = lang('edit the 
location');
!                                                       
$content[$j]['row'][$i]['text']                                 = lang('edit');
!                                                       
$content[$j]['row'][$i]['link']                         = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.edit&location_code='
 . $location['location_code']);
!                                                       $i++;
!                                               }
! 
!                                               if($this->acl_delete)
!                                               {
!                                                       
$content[$j]['row'][$i]['statustext']                   = lang('delete the 
location');
!                                                       
$content[$j]['row'][$i]['text']                                 = 
lang('delete');
!                                                       
$content[$j]['row'][$i]['link']                         = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.delete&location_code='
 . $location['location_code'] . '&type_id=' . $type_id);
!                                               }
                                        }
+                                       $j++;
                                }
                        }
  //_debug_array($content);
  
!                       $uicols_count   = count($uicols['descr']);
!                       for ($i=0;$i<$uicols_count;$i++)
                        {
                                if($uicols['input_type'][$i]!='hidden')

Index: class.uiproject.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiproject.inc.php,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -r1.37 -r1.38
*** class.uiproject.inc.php     18 Jul 2003 09:34:54 -0000      1.37
--- class.uiproject.inc.php     27 Jul 2003 15:53:24 -0000      1.38
***************
*** 127,131 ****
                                if(!$lookup)
                                {
!                                       if($this->acl_read)
                                        {
                                                
$content[$j]['row'][$k]['statustext']                   = lang('view the 
project');
--- 127,131 ----
                                if(!$lookup)
                                {
!                                       if ($this->acl_read && 
$this->bocommon->check_perms($project_entry['grants'],PHPGW_ACL_READ))
                                        {
                                                
$content[$j]['row'][$k]['statustext']                   = lang('view the 
project');
***************
*** 134,139 ****
                                                $k++;
                                        }
  
!                                       if($this->acl_edit)
                                        {
                                                
$content[$j]['row'][$k]['statustext']                   = lang('edit the 
project');
--- 134,143 ----
                                                $k++;
                                        }
+                                       else
+                                       {
+                                               
$content[$j]['row'][$k++]['link']='dummy';
+                                       }
  
!                                       if ($this->acl_edit && 
$this->bocommon->check_perms($project_entry['grants'],PHPGW_ACL_EDIT))
                                        {
                                                
$content[$j]['row'][$k]['statustext']                   = lang('edit the 
project');
***************
*** 142,147 ****
                                                $k++;
                                        }
  
!                                       if($this->acl_delete)
                                        {
                                                
$content[$j]['row'][$k]['statustext']                   = lang('delete the 
project');
--- 146,155 ----
                                                $k++;
                                        }
+                                       else
+                                       {
+                                               
$content[$j]['row'][$k++]['link']='dummy';
+                                       }
  
!                                       if ($this->acl_delete && 
$this->bocommon->check_perms($project_entry['grants'],PHPGW_ACL_DELETE))
                                        {
                                                
$content[$j]['row'][$k]['statustext']                   = lang('delete the 
project');
***************
*** 150,153 ****
--- 158,165 ----
                                                $k++;
                                        }
+                                       else
+                                       {
+                                               
$content[$j]['row'][$k++]['link']='dummy';
+                                       }
                                }
  
***************
*** 492,496 ****
                        {
                                $values = $this->bo->read_single($id);
!                               $record_history = 
$this->bo->read_record_history($id);
                        }
  
--- 504,519 ----
                        {
                                $values = $this->bo->read_single($id);
!                               if 
(!$this->bocommon->check_perms($values['grants'],PHPGW_ACL_EDIT))
!                               {
!                                       
$receipt['error'][]=array('msg'=>lang('You have no edit right for this 
project'));
!                                       
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,$receipt);
! 
!                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uiproject.view&id='
 . $id);
! 
!                               }
!                               else
!                               {
!                                       $record_history = 
$this->bo->read_record_history($id);
!                               }
                        }
  
***************
*** 764,767 ****
--- 787,793 ----
                        }
  
+                       $receipt = 
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp);
+                       
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,'');
+ 
                        $id     = get_var('id',array('POST','GET'));
  
***************
*** 813,818 ****
--- 839,847 ----
                        }
  
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+ 
                        $data = array
                        (
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'lang_origin'                                   
=> lang('origin'),
                                'lang_origin_statustext'                => 
lang('Link to the origin for this project'),

Index: class.uiwo_hour.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiwo_hour.inc.php,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -r1.32 -r1.33
*** class.uiwo_hour.inc.php     18 Jul 2003 09:34:54 -0000      1.32
--- class.uiwo_hour.inc.php     27 Jul 2003 15:53:24 -0000      1.33
***************
*** 93,96 ****
--- 93,103 ----
  
                        $workorder      = 
$this->boworkorder->read_single($workorder_id);
+                       if 
(!$this->bocommon->check_perms($workorder['grants'],PHPGW_ACL_EDIT))
+                       {
+                               $receipt['error'][]=array('msg'=>lang('You have 
no edit right for this project'));
+                               
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,$receipt);
+                               
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.view&id='
 . $workorder_id);
+                       }
+ 
                        $hour_list = $this->bo->read($workorder_id);
  

Index: class.uiworkorder.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiworkorder.inc.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** class.uiworkorder.inc.php   18 Jul 2003 09:34:54 -0000      1.31
--- class.uiworkorder.inc.php   27 Jul 2003 15:53:24 -0000      1.32
***************
*** 91,160 ****
                        $workorder_list = $this->bo->read();
  
- //_debug_array($workorder_list);
- 
- 
                        $uicols = $this->bo->uicols;
- //_debug_array($uicols);
  
                        $j=0;
!                       while (is_array($workorder_list) && 
list(,$workorder_entry) = each($workorder_list))
                        {
!                               for ($k=0;$k<count($uicols['name']);$k++)
                                {
!                                       if($uicols['input_type'][$k]!='hidden')
                                        {
! 
!                                               
if($workorder_entry['query_location'][$uicols['name'][$k]])
                                                {
!                                                       
$content[$j]['row'][$k]['statustext']                   = lang('search');
!                                                       
$content[$j]['row'][$k]['text']                                 = 
$workorder_entry[$uicols['name'][$k]];
!                                                       
$content[$j]['row'][$k]['link']                         = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.index&query='
 . $workorder_entry['query_location'][$uicols['name'][$k]] . '&lookup=' . 
$lookup);
                                                }
                                                else
                                                {
!                                                       
$content[$j]['row'][$k]['value']                        = 
$workorder_entry[$uicols['name'][$k]];
!                                                       
$content[$j]['row'][$k]['name']                         = $uicols['name'][$k];
                                                }
  
!                                       }
! 
!                                       if($lookup && 
$k==(count($uicols['name'])-2))
!                                       
$content[$j]['row'][$k]['lookup_action']                        = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.edit&workorder_id='
 . $workorder_entry['workorder_id']);
! 
!                               }
! 
!                               if(!$lookup)
!                               {
!                                       if($this->acl_read)
!                                       {
!                                               
$content[$j]['row'][$k]['statustext']                   = lang('view the 
workorder');
!                                               $content[$j]['row'][$k]['text'] 
                                = lang('view');
!                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.view&id='
 . $workorder_entry['workorder_id']);
!                                               $k++;
!                                       }
! 
!                                       if($this->acl_edit)
!                                       {
!                                               
$content[$j]['row'][$k]['statustext']                   = lang('edit the 
workorder');
!                                               $content[$j]['row'][$k]['text'] 
                                = lang('edit');
!                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.edit&id='
 . $workorder_entry['workorder_id']);
!                                               $k++;
! 
!                                               
$content[$j]['row'][$k]['statustext']                   = lang('calculate the 
workorder');
!                                               $content[$j]['row'][$k]['text'] 
                                = lang('calculate');
!                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiwo_hour.index&workorder_id='
 . $workorder_entry['workorder_id']);
!                                               $k++;
!                                       }
  
!                                       if($this->acl_delete)
!                                       {
!                                               
$content[$j]['row'][$k]['statustext']                   = lang('delete the 
workorder');
!                                               $content[$j]['row'][$k]['text'] 
                                = lang('delete');
!                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.delete&id='
 . $workorder_entry['workorder_id']);
!                                               $k++;
                                        }
                                }
- 
-                               $j++;
                        }
  
--- 91,169 ----
                        $workorder_list = $this->bo->read();
  
                        $uicols = $this->bo->uicols;
  
                        $j=0;
!                       if (isSet($workorder_list) AND 
is_array($workorder_list))
                        {
!                               foreach($workorder_list as $workorder_entry)
! 
!                               //while (is_array($workorder_list) && 
list(,$workorder_entry) = each($workorder_list))
                                {
!                                       for 
($k=0;$k<count($uicols['name']);$k++)
                                        {
!                                               
if($uicols['input_type'][$k]!='hidden')
!                                               {
!                                                       
if($workorder_entry['query_location'][$uicols['name'][$k]])
!                                                       {
!                                                               
$content[$j]['row'][$k]['statustext']                   = lang('search');
!                                                               
$content[$j]['row'][$k]['text']                                 = 
$workorder_entry[$uicols['name'][$k]];
!                                                               
$content[$j]['row'][$k]['link']                         = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.index&query='
 . $workorder_entry['query_location'][$uicols['name'][$k]] . '&lookup=' . 
$lookup);
!                                                       }
!                                                       else
!                                                       {
!                                                               
$content[$j]['row'][$k]['value']                        = 
$workorder_entry[$uicols['name'][$k]];
!                                                               
$content[$j]['row'][$k]['name']                         = $uicols['name'][$k];
!                                                       }
!                                               }
!                                               if($lookup && 
$k==(count($uicols['name'])-2))
!                                               
$content[$j]['row'][$k]['lookup_action']                        = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.edit&workorder_id='
 . $workorder_entry['workorder_id']);
!                                       }
!                                       if(!$lookup)
!                                       {
!                                               if ($this->acl_read && 
$this->bocommon->check_perms($workorder_entry['grants'],PHPGW_ACL_READ))
!                                               if($this->acl_read)
                                                {
!                                                       
$content[$j]['row'][$k]['statustext']                   = lang('view the 
workorder');
!                                                       
$content[$j]['row'][$k]['text']                                 = lang('view');
!                                                       
$content[$j]['row'][$k]['link']                                 = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.view&id='
 . $workorder_entry['workorder_id']);
!                                                       $k++;
                                                }
                                                else
                                                {
!                                                       
$content[$j]['row'][$k++]['link']='dummy';
                                                }
  
!                                               if ($this->acl_edit && 
$this->bocommon->check_perms($workorder_entry['grants'],PHPGW_ACL_EDIT))
!                                               {
!                                                       
$content[$j]['row'][$k]['statustext']                   = lang('edit the 
workorder');
!                                                       
$content[$j]['row'][$k]['text']                                 = lang('edit');
!                                                       
$content[$j]['row'][$k]['link']                                 = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.edit&id='
 . $workorder_entry['workorder_id']);
!                                                       $k++;
! 
!                                                       
$content[$j]['row'][$k]['statustext']                   = lang('calculate the 
workorder');
!                                                       
$content[$j]['row'][$k]['text']                                 = 
lang('calculate');
!                                                       
$content[$j]['row'][$k]['link']                                 = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiwo_hour.index&workorder_id='
 . $workorder_entry['workorder_id']);
!                                                       $k++;
!                                               }
!                                               else
!                                               {
!                                                       
$content[$j]['row'][$k++]['link']='dummy';
!                                                       
$content[$j]['row'][$k++]['link']='dummy';
!                                               }
  
!                                               if ($this->acl_delete && 
$this->bocommon->check_perms($workorder_entry['grants'],PHPGW_ACL_DELETE))
!                                               {
!                                                       
$content[$j]['row'][$k]['statustext']                   = lang('delete the 
workorder');
!                                                       
$content[$j]['row'][$k]['text']                                 = 
lang('delete');
!                                                       
$content[$j]['row'][$k]['link']                                 = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.delete&id='
 . $workorder_entry['workorder_id']);
!                                                       $k++;
!                                               }
!                                               else
!                                               {
!                                                       
$content[$j]['row'][$k++]['link']='dummy';
!                                               }
                                        }
+                                       $j++;
                                }
                        }
  
***************
*** 443,446 ****
--- 452,462 ----
                                $project        = 
$this->boproject->read_single($values['project_id']);
  
+                               if 
(!$this->bocommon->check_perms($project['grants'],PHPGW_ACL_EDIT))
+                               {
+                                       
$receipt['error'][]=array('msg'=>lang('You have no edit right for this 
project'));
+                                       
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,$receipt);
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.view&id='
 . $id);
+                               }
+ 
                                if( $project['key_fetch'] && 
!$values['key_fetch'])
                                {
***************
*** 759,762 ****
--- 775,781 ----
                        }
  
+                       $receipt = 
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp);
+                       
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,'');
+ 
                        $id     = get_var('id',array('POST','GET'));
  
***************
*** 802,807 ****
--- 821,829 ----
                                                ));
  
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+ 
                        $data = array
                        (
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'project_link'                                  
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiproject.view'),
                                'table_header_workorder_budget' => 
$table_header_workorder_budget,





reply via email to

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