phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property inc/class.bocommon.inc.php inc/class.b...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property inc/class.bocommon.inc.php inc/class.b...
Date: Tue, 14 Feb 2006 14:45:50 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Branch:         
Changes by:     Sigurd Nes <address@hidden>     06/02/14 14:45:50

Modified files:
        inc            : class.bocommon.inc.php 
                         class.bor_agreement.inc.php 
                         class.socommon.inc.php 
                         class.sor_agreement.inc.php 
                         class.uir_agreement.inc.php hook_admin.inc.php 
        setup          : tables_current.inc.php tables_update.inc.php 
        templates/base : invoice.xsl r_agreement.xsl tenant_view.xsl 
        templates/default: invoice.xsl r_agreement.xsl tenant_view.xsl 

Log message:
        

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.bocommon.inc.php.diff?tr1=1.23&tr2=1.24&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.bor_agreement.inc.php.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.socommon.inc.php.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sor_agreement.inc.php.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uir_agreement.inc.php.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/hook_admin.inc.php.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/setup/tables_current.inc.php.diff?tr1=1.42&tr2=1.43&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/setup/tables_update.inc.php.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/base/invoice.xsl.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/base/r_agreement.xsl.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/base/tenant_view.xsl.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/default/invoice.xsl.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/default/r_agreement.xsl.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/default/tenant_view.xsl.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: property/inc/class.bocommon.inc.php
diff -u property/inc/class.bocommon.inc.php:1.23 
property/inc/class.bocommon.inc.php:1.24
--- property/inc/class.bocommon.inc.php:1.23    Mon Feb 13 14:40:56 2006
+++ property/inc/class.bocommon.inc.php Tue Feb 14 14:45:49 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage core
-       * @version $Id: class.bocommon.inc.php,v 1.23 2006/02/13 14:40:56 
sigurdne Exp $
+       * @version $Id: class.bocommon.inc.php,v 1.24 2006/02/14 14:45:49 
sigurdne Exp $
        */
 
        /**
@@ -1432,7 +1432,13 @@
                }
 
                function new_db()
-               {                       return $this->socommon->new_db();
+               {
+                       return $this->socommon->new_db();
+               }
+
+               function get_max_location_level()
+               {
+                       return $this->socommon->get_max_location_level();
                }
 
        }
Index: property/inc/class.bor_agreement.inc.php
diff -u property/inc/class.bor_agreement.inc.php:1.2 
property/inc/class.bor_agreement.inc.php:1.3
--- property/inc/class.bor_agreement.inc.php:1.2        Mon Feb 13 14:40:56 2006
+++ property/inc/class.bor_agreement.inc.php    Tue Feb 14 14:45:50 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.bor_agreement.inc.php,v 1.2 2006/02/13 14:40:56 
sigurdne Exp $
+       * @version $Id: class.bor_agreement.inc.php,v 1.3 2006/02/14 14:45:50 
sigurdne Exp $
        */
 
        /**
@@ -51,16 +51,32 @@
                                $this->use_session = True;
                        }
 
-                       $start  = get_var('start',array('POST','GET'));
-                       $query  = get_var('query',array('POST','GET'));
+                       $reset_query            = 
get_var('reset_query',array('POST','GET'));
                        $sort   = get_var('sort',array('POST','GET'));
                        $order  = get_var('order',array('POST','GET'));
-                       $filter = get_var('filter',array('POST','GET'));
-                       $cat_id = get_var('cat_id',array('POST','GET'));
-                       $vendor_id      = 
get_var('vendor_id',array('POST','GET'));
                        $allrows        = 
get_var('allrows',array('POST','GET'));
                        $role   = get_var('role',array('POST','GET'));
-                       $member_id      = 
get_var('member_id',array('POST','GET'));
+
+                       if($reset_query)
+                       {
+                               $start  = '';
+                               $query  = '';
+                               $filter = '';
+                               $cat_id = '';
+                               $customer_id ='';
+                               $member_id      = '';
+                               $loc1   = '';
+                       }
+                       else
+                       {
+                               $start  = get_var('start',array('POST','GET'));
+                               $query  = get_var('query',array('POST','GET'));
+                               $filter = get_var('filter',array('POST','GET'));
+                               $cat_id = get_var('cat_id',array('POST','GET'));
+                               $customer_id    = 
get_var('tenant_id',array('POST','GET'));
+                               $member_id      = 
get_var('member_id',array('POST','GET'));
+                               $loc1   = get_var('loc1',array('POST','GET'));  
+                       }
 
 
                        $this->role     = $role;
@@ -107,9 +123,13 @@
                        {
                                $this->member_id = $member_id;
                        }
-                       if(isset($vendor_id))
+                       if(isset($customer_id))
                        {
-                               $this->vendor_id = $vendor_id;
+                               $this->customer_id = $customer_id;
+                       }
+                       if(isset($loc1))
+                       {
+                               $this->loc1 = $loc1;
                        }
                }
 
@@ -133,9 +153,10 @@
                        $this->sort             = $data['sort'];
                        $this->order    = $data['order'];
                        $this->cat_id   = $data['cat_id'];
-                       $this->vendor_id= $data['vendor_id'];
+                       $this->customer_id= $data['customer_id'];
                        $this->member_id= $data['member_id'];
                        $this->allrows  = $data['allrows'];
+                       $this->loc1     = $data['loc1'];
                }
 
                function check_perms($has, $needed)
@@ -207,7 +228,7 @@
                {
                        $r_agreement = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
                                                                                
        'filter' => $this->filter,'cat_id' => 
$this->cat_id,'allrows'=>$this->allrows,'member_id'=>$this->member_id,
-                                                                               
        'vendor_id'=>$this->vendor_id));
+                                                                               
        'customer_id'=>$this->customer_id, 'loc1' => $this->loc1));
                        $this->total_records = $this->so->total_records;
 
                        $this->uicols   = $this->so->uicols;
@@ -703,7 +724,33 @@
 //_debug_array($receipt);
                        return $receipt;
                }
+               
+               function get_rental_type_list($selected = '')
+               {
+                       $input_list[0]['id'] = 1;
+                       $input_list[0]['name'] = lang('plain');
+                       $input_list[1]['id'] = 2;
+                       $input_list[1]['name'] = lang('Floor common');
+                       $input_list[2]['id'] = 3;
+                       $input_list[2]['name'] = lang('Building common');
+                       $input_list[3]['id'] = 4;
+                       $input_list[3]['name'] = lang('Shared use');
+                       
+                       $rental_type_list= 
$this->bocommon->select_list($selected,$input_list);
+
+                       return $rental_type_list;
+               }
+
+               function get_rental_type_list2($selected = '')
+               {
+                       $rental_type = array(
+                       1 => lang('plain'),
+                       2 => lang('Floor common'),
+                       3 => lang('Building common'),
+                       4 => lang('Shared use'),
+                       );
 
-
+                       return $rental_type[$selected];
+               }
        }
 ?>
Index: property/inc/class.socommon.inc.php
diff -u property/inc/class.socommon.inc.php:1.15 
property/inc/class.socommon.inc.php:1.16
--- property/inc/class.socommon.inc.php:1.15    Sat Jan 28 12:59:32 2006
+++ property/inc/class.socommon.inc.php Tue Feb 14 14:45:50 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage core
-       * @version $Id: class.socommon.inc.php,v 1.15 2006/01/28 12:59:32 
sigurdne Exp $
+       * @version $Id: class.socommon.inc.php,v 1.16 2006/02/14 14:45:50 
sigurdne Exp $
        */
 
        /**
@@ -326,5 +326,13 @@
                        $db->Password = 
$GLOBALS['phpgw_info']['server']['db_pass'];
                        return $db;
                }
+
+               function get_max_location_level()
+               {
+                       $this->db->query("SELECT count(*) as level FROM 
fm_location_type ");
+                       $this->db->next_record();
+                       return $this->db->f('level');
+               }
+
        }
 ?>
\ No newline at end of file
Index: property/inc/class.sor_agreement.inc.php
diff -u property/inc/class.sor_agreement.inc.php:1.3 
property/inc/class.sor_agreement.inc.php:1.4
--- property/inc/class.sor_agreement.inc.php:1.3        Mon Feb 13 20:44:30 2006
+++ property/inc/class.sor_agreement.inc.php    Tue Feb 14 14:45:50 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.sor_agreement.inc.php,v 1.3 2006/02/13 20:44:30 
sigurdne Exp $
+       * @version $Id: class.sor_agreement.inc.php,v 1.4 2006/02/14 14:45:50 
sigurdne Exp $
        */
 
        /**
@@ -79,6 +79,8 @@
                                $member_id              = 
(isset($data['member_id'])?$data['member_id']:0);
                                $r_agreement_id = 
(isset($data['r_agreement_id'])?$data['r_agreement_id']:'');
                                $detail                 = 
(isset($data['detail'])?$data['detail']:'');
+                               $loc1                   = 
(isset($data['loc1'])?$data['loc1']:'');
+                               
                        }
 
                        $choice_table = 'fm_r_agreement_choice';
@@ -94,6 +96,16 @@
                                $joinmethod .= " $this->join $category_table ON 
( $entity_table.category =$category_table.id))";
 
                                $cols = $entity_table . 
".*,$category_table.descr as category";
+
+/*                             if($loc1)
+                               {
+                                       $paranthesis .='(';
+                                       $joinmethod .= " $this->join 
fm_r_agreement_detail ON ( $entity_table.id 
=fm_r_agreement_detail.agreement_id))";
+                                       
+                               
+                                       $cols .= ",location_code";
+                               }
+`*/
 //                             $cols .= ",org_name";
 //                             $paranthesis .='(';
 //                             $joinmethod .= " $this->join fm_tenant ON ( 
$entity_table.customer_id =fm_tenant.id))";
@@ -146,7 +158,7 @@
 
 
 
-                               $cols = "$entity_table.*, 
fm_r_agreement_pricing.cost,fm_r_agreement_pricing.id as 
index_count,fm_r_agreement_pricing.index_date,fm_r_agreement_pricing.item_id,fm_r_agreement_pricing.this_index";
+                               $cols = "$entity_table.*, 
fm_r_agreement_pricing.cost,fm_r_agreement_pricing.id as 
index_count,fm_r_agreement_pricing.index_date,fm_r_agreement_pricing.item_id,fm_r_agreement_pricing.this_index,
 rental_type_id";
 
                                $cols_return[]                  = 
'agreement_id';
                                $uicols['input_type'][]         = 'hidden';
@@ -178,12 +190,12 @@
                                $uicols['descr'][]              = 
lang('address');
                                $uicols['statustext'][]         = 
lang('address');
 
-                               $cols_return[]                  = 'p_num';
+/*                             $cols_return[]                  = 'p_num';
                                $uicols['input_type'][]         = 'text';
                                $uicols['name'][]               = 'p_num';
                                $uicols['descr'][]              = lang('entity 
num');
                                $uicols['statustext'][]         = lang('entity 
num');
-
+*/
                                $cols_return[]                  = 'cost';
                                $uicols['input_type'][]         = 'text';
                                $uicols['name'][]               = 'cost';
@@ -207,6 +219,12 @@
                                $uicols['name'][]               = 'index_date';
                                $uicols['descr'][]              = lang('date');
                                $uicols['statustext'][]         = lang('date');
+
+                               $cols_return[]                  = 
'rental_type_id';
+                               $uicols['input_type'][]         = 'text';
+                               $uicols['name'][]               = 
'rental_type_id';
+                               $uicols['descr'][]              = lang('rental 
type');
+                               $uicols['statustext'][]         = lang('rental 
type');
                        }
 
                        $from .= " FROM $paranthesis $entity_table ";
@@ -312,7 +330,7 @@
                                $where= 'AND';
                        }
 
-                       if ($vendor_id)
+                       if ($customer_id)
                        {
                                $filtermethod .= " $where 
$entity_table.customer_id='$customer_id' ";
                                $where= 'AND';
@@ -324,6 +342,22 @@
                                $where= 'AND';
                        }
 
+                       if ($loc1)
+                       {
+                               $this->db->query("SELECT agreement_id FROM 
fm_r_agreement_detail WHERE location_code $this->like '$loc1%' group by 
agreement_id");
+                               while ($this->db->next_record())
+                               {
+                                       $filter_id[]                    = 
$this->db->f('agreement_id');
+       
+                               }
+
+                               if(is_array($filter_id))
+                               {
+                                       $filtermethod .= " $where 
$entity_table.id in (" . implode(',', $filter_id)  .")";      
+                                       $where= 'AND';
+                               }
+                       }
+
                        if ($status)
                        {
                                $filtermethod .= " $where 
$entity_table.status='$status' ";
@@ -627,14 +661,16 @@
                                if($this->db->next_record())
                                {
                                        $item['agreement_id']           = 
(int)$this->db->f('agreement_id');
-                                       $item['id']                     = 
(int)$this->db->f('id');
-                                       $item['entry_date']             = 
$this->db->f('entry_date');
+                                       $item['id']                             
        = (int)$this->db->f('id');
+                                       $item['entry_date']                     
= $this->db->f('entry_date');
                                        $item['location_code']          = 
$this->db->f('location_code');
-                                       $item['p_num']                  = 
$this->db->f('p_num');
+                                       $item['p_num']                          
= $this->db->f('p_num');
                                        $item['p_entity_id']            = 
$this->db->f('p_entity_id');
-                                       $item['p_cat_id']               = 
$this->db->f('p_cat_id');
-                                       $item['cost']                   = 
$this->db->f('cost');
-                                       $item['tenant_id']              = 
$this->db->f('tenant_id');
+                                       $item['p_cat_id']                       
= $this->db->f('p_cat_id');
+                                       $item['cost']                           
= $this->db->f('cost');
+                                       $item['tenant_id']                      
= $this->db->f('tenant_id');
+                                       $item['rental_type_id']         = 
$this->db->f('rental_type_id');
+                                       
                                        
                                        for 
($i=0;$i<count($item['attributes']);$i++)
                                        {
@@ -727,6 +763,8 @@
                        $vals[] = $values['location_code'];
                        $cols[] = 'tenant_id';
                        $vals[] = $values['tenant_id'];
+                       $cols[] = 'rental_type_id';
+                       $vals[] = $values['rental_type_id'];
                        
 /*                     while (is_array($values['location']) && 
list($input_name,$value) = each($values['location']))
                        {
@@ -892,6 +930,8 @@
                        $value_set['cost']      = $values['cost'];
                        $value_set['address']   = $address;
                        $value_set['tenant_id'] = $values['tenant_id'];
+                       $value_set['rental_type_id']    = 
$values['rental_type_id'];
+                       
                        
                        if($value_set)
                        {
@@ -1280,7 +1320,8 @@
                                                'entry_date' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
                                                'test' => array('type' => 
'text','nullable' => True),
                                                'cost' => array('type' => 
'decimal', 'precision' => 20, 'scale' => 2,'nullable' => True),
-                                               'tenant_id' => array('type' => 
'int', 'precision' => 4,'nullable' => True)
+                                               'tenant_id' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
+                                               'rental_type_id' => 
array('type' => 'int', 'precision' => 4,'nullable' => True)
                                                );
                                        break;
                                default:
Index: property/inc/class.uir_agreement.inc.php
diff -u property/inc/class.uir_agreement.inc.php:1.3 
property/inc/class.uir_agreement.inc.php:1.4
--- property/inc/class.uir_agreement.inc.php:1.3        Mon Feb 13 20:44:30 2006
+++ property/inc/class.uir_agreement.inc.php    Tue Feb 14 14:45:50 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.uir_agreement.inc.php,v 1.3 2006/02/13 20:44:30 
sigurdne Exp $
+       * @version $Id: class.uir_agreement.inc.php,v 1.4 2006/02/14 14:45:50 
sigurdne Exp $
        */
 
        /**
@@ -55,7 +55,7 @@
                        $this->role             = $this->bo->role;
 
                        $this->cats             = 
CreateObject('phpgwapi.categories');
-                       $this->cats->app_name = 'fm_vendor';
+                       $this->cats->app_name = 'fm_tenant';
 
                        $this->acl2             = 
CreateObject($this->currentapp.'.acl2');
                        $this->acl2_location= '.r_agreement';
@@ -72,10 +72,11 @@
                        $this->order            = $this->bo->order;
                        $this->filter           = $this->bo->filter;
                        $this->cat_id           = $this->bo->cat_id;
-                       $this->vendor_id        = $this->bo->vendor_id;
+                       $this->customer_id      = $this->bo->customer_id;
                        $this->allrows          = $this->bo->allrows;
                        $this->member_id        = $this->bo->member_id;
                        $this->fakebase         = $this->bo->fakebase;
+                       $this->loc1             = $this->bo->loc1;
 
                }
 
@@ -89,9 +90,10 @@
                                'order'         => $this->order,
                                'filter'        => $this->filter,
                                'cat_id'        => $this->cat_id,
-                               'vendor_id'     => $this->vendor_id,
+                               'customer_id'   => $this->customer_id,
                                'allrows'       => $this->allrows,
-                               'member_id'     => $this->member_id
+                               'member_id'     => $this->member_id,
+                               'loc1'          => $this->loc1
                        );
                        $this->bo->save_sessiondata($data);
                }
@@ -194,9 +196,9 @@
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('r_agreement',
                                                                                
'menu',
                                                                                
'receipt',
-                                                                               
'search_field',
+                                                                               
'search_field_grouped',
                                                                                
'nextmatchs',
-                                                                               
'filter_member_of'));
+                                                                               
));
 
                        $links = $this->menu->links('r_agreement');
 
@@ -318,7 +320,9 @@
                                                'filter'                
=>$this->filter,
                                                'query'                 
=>$this->query,
                                                'role'                  => 
$this->role,
-                                               'member_id'             => 
$this->member_id
+                                               'member_id'             => 
$this->member_id,
+                                               'customer_id'   => 
$this->customer_id,
+                                               'loc1'                  => 
$this->loc1,
 
                        );
 
@@ -361,12 +365,12 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the r_agreement belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'cat_id',
-                               'cat_list'                                      
        => $this->bo->select_category_list('filter',$this->cat_id),
+                               'cat_list'                                      
        => $this->bo->select_category_list('select',$this->cat_id),
                                'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
 
-                               'lang_no_vendor'                                
=> lang('no vendor'),
-                               'lang_vendor_statustext'                => 
lang('Select the vendor the r_agreement belongs to.'),
-                               'vendor_list'                                   
=> $this->bo->select_vendor_list('filter',$this->vendor_id),
+//                             'lang_no_vendor'                                
=> lang('no vendor'),
+//                             'lang_vendor_statustext'                => 
lang('Select the vendor the r_agreement belongs to.'),
+//                             'vendor_list'                                   
=> $this->bo->select_vendor_list('filter',$this->vendor_id),
 
                                'lang_no_member'                                
=> lang('no member'),
                                'member_of_name'                                
=> 'member_id',
@@ -380,7 +384,17 @@
                                'lang_search'                                   
=> lang('search'),
                                'table_header'                                  
=> $table_header,
                                'values'                                        
        => $content,
-                               'table_add'                                     
        => $table_add
+                               'table_add'                                     
        => $table_add,
+
+                               'tenant_link'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.tenant'),
+                               'lang_select_tenant_statustext' => lang('Select 
the customer by klicking this link'),
+                               'lang_tenant'                                   
=> lang('customer'),
+                               'property_link'                                 
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.index&lookup=1&type_id=1&lookup_name=0'),
+                               'lang_select_property_statustext'=> 
lang('Select the property by klicking this link'),
+                               'lang_property_statustext'              => 
lang('Search by property'),
+                               'lang_property'                                 
=> lang('property'),
+                               'customer_id'                                   
=> $this->customer_id,
+                               'loc1'                                          
        => $this->loc1,
                        );
                        $this->save_sessiondata();
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('rental agreement') . ': ' . lang('list ' . $this->role);
@@ -405,8 +419,16 @@
                                        {
                                                
if($uicols['input_type'][$i]!='hidden')
                                                {
-                                                       
$content[$j]['row'][$i]['value']                        = 
$entry[$uicols['name'][$i]];
                                                        
$content[$j]['row'][$i]['name']                         = $uicols['name'][$i];
+
+                                                       if($uicols['name'][$i] 
== 'rental_type_id')
+                                                       {
+                                                               
$content[$j]['row'][$i]['value'] = 
$this->bo->get_rental_type_list2($entry[$uicols['name'][$i]]);
+                                                       }
+                                                       else
+                                                       {
+                                                               
$content[$j]['row'][$i]['value']                        = 
$entry[$uicols['name'][$i]];
+                                                       }
                                                }
                                        }
 
@@ -758,9 +780,23 @@
 
                        $member_of_data = 
$this->cats->formatted_xslt_list(array('selected' => $this->member_id,'globals' 
=> True,link_data => array()));
 
-                       $table_add[] = array
+                       $table_add_space[] = array
                        (
-                               'lang_add'                              => 
lang('add detail'),
+                               'lang_add'                              => 
lang('add space'),
+                               'lang_add_standardtext' => lang('add an item to 
the details'),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uir_agreement.edit_item&r_agreement_id='
 . $id)
+                       );
+
+                       $table_add_service[] = array
+                       (
+                               'lang_add'                              => 
lang('add service'),
+                               'lang_add_standardtext' => lang('add an item to 
the details'),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uir_agreement.edit_item&r_agreement_id='
 . $id)
+                       );
+
+                       $table_add_common[] = array
+                       (
+                               'lang_add'                              => 
lang('add common'),
                                'lang_add_standardtext' => lang('add an item to 
the details'),
                                'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uir_agreement.edit_item&r_agreement_id='
 . $id)
                        );
@@ -869,7 +905,9 @@
                                'lang_descr'                                    
=> lang('descr'),
                                'lang_descr_statustext'                 => 
lang('descr'),
                                'value_descr'                                   
=> $r_agreement['descr'],
-                               'table_add'                                     
        => $table_add,
+                               'table_add_space'                               
=> $table_add_space,
+                               'table_add_service'                             
=> $table_add_service,
+                               'table_add_common'                              
=> $table_add_common,
                                'values'                                        
        => $content,
                                'table_header'                                  
=> $table_header,
                                'acl_manage'                                    
=> $this->acl_manage,
@@ -880,7 +918,9 @@
                                'check_source'                                  
=> './'.$this->currentapp.'/inc/check.js',
                                'check_all_script'                              
=> $check_all_script,
                                'set_column'                                    
=> $set_column,
-
+                               'lang_space'                                    
=> lang('space'),
+                               'lang_service'                                  
=> lang('service'),
+                               'lang_common_costs'                             
=> lang('common costs'),                                
                        );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('rental agreement') . ': ' . ($id?lang('edit') . ' ' . 
lang($this->role):lang('add') . ' ' . lang($this->role));
@@ -1106,15 +1146,16 @@
 
                        $lookup_type='form';
 
+                       $max_location_level = 
$this->bocommon->get_max_location_level();
 //_debug_array($values);
                        $location_data=$bolocation->initiate_ui_location(array(
                                                'values'                => 
$values['location_data'],
-                                               'type_id'               => -1, 
// calculated from location_types
-                                               'no_link'               => 
False, // disable lookup links for location type less than type_id
+                                               'type_id'               => 
$max_location_level, // calculated from location_types
+                                               'no_link'               => 
$max_location_level+1, // disable lookup links for location type less than 
type_id
                                                'tenant'                => 
False,
                                                'lookup_type'   => $lookup_type,
-                                               'lookup_entity' => 
$this->bocommon->get_lookup_entity('r_agreement'),
-                                               'entity_data'   => $values['p']
+                                               'lookup_entity' => False, // 
$this->bocommon->get_lookup_entity('r_agreement'),
+                                               'entity_data'   => 
False,//$values['p']
                                                ));
 
                        
$tenant_data=$this->bocommon->initiate_ui_tenant_lookup(array(
@@ -1178,6 +1219,10 @@
                                'lang_delete_last_statustext'   => lang('delete 
the last index'),
                                'delete_action'                                 
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uir_agreement.edit_item&delete_last=1&r_agreement_id='
 . $r_agreement_id . '&id=' . $id),
                                'tenant_data'                                   
=> $tenant_data,
+                               'rental_type_list'                              
=> $this->bo->get_rental_type_list($values['rental_type_id']),
+                               'lang_rental_type_statustext'   => lang('Select 
rental type'),
+                               'lang_select_rental_type'               => 
lang('Select rental type'),
+                               'lang_rental_type'                              
=> lang('Rental type'),
                        );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('rental agreement') . ': ' . ($values['id']?lang('edit item') . ' ' . 
$r_agreement['name']:lang('add item') . ' ' . $r_agreement['name']);
@@ -1271,7 +1316,8 @@
                                'value_cost'                                    
=> $values['cost'],
                                'set_column'                                    
=> $set_column,
                                'tenant_data'                                   
=> $tenant_data,
-                       );
+                               'rental_type_list'                              
=> $this->bo->get_rental_type_list($values['rental_type_id']),
+                               'lang_rental_type'                              
=> lang('Rental type'),                 );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('rental agreement') . ': ' . lang('view item') . ' ' . 
$r_agreement['name'];
 
Index: property/inc/hook_admin.inc.php
diff -u property/inc/hook_admin.inc.php:1.20 
property/inc/hook_admin.inc.php:1.21
--- property/inc/hook_admin.inc.php:1.20        Sun Feb 12 18:12:02 2006
+++ property/inc/hook_admin.inc.php     Tue Feb 14 14:45:50 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: hook_admin.inc.php,v 1.20 2006/02/12 18:12:02 sigurdne 
Exp $
+       * @version $Id: hook_admin.inc.php,v 1.21 2006/02/14 14:45:50 sigurdne 
Exp $
        */
 
                {
@@ -27,6 +27,7 @@
                                'Ticket Categories'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=ticket'),
                                'Tenant Claim Categories'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=tenant_claim'),
                                'Tenant Categories'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=tenant'),
+                               'Tenant Global Categories'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=fm_tenant&global_cats=True'),
                                'Tenant Attributes'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiactor.list_attribute&role=tenant'),
                                'Tenant'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiactor.index&role=tenant'),
                                'Owner'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiactor.index&role=owner'),
Index: property/setup/tables_current.inc.php
diff -u property/setup/tables_current.inc.php:1.42 
property/setup/tables_current.inc.php:1.43
--- property/setup/tables_current.inc.php:1.42  Mon Feb 13 20:44:30 2006
+++ property/setup/tables_current.inc.php       Tue Feb 14 14:45:50 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage setup
-       * @version $Id: tables_current.inc.php,v 1.42 2006/02/13 20:44:30 
sigurdne Exp $
+       * @version $Id: tables_current.inc.php,v 1.43 2006/02/14 14:45:50 
sigurdne Exp $
        */
 
        $phpgw_baseline = array(
@@ -2085,6 +2085,7 @@
                                'test' => array('type' => 'text','nullable' => 
True),
                                'cost' => array('type' => 'decimal', 
'precision' => 20, 'scale' => 2,'nullable' => True),
                                'tenant_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                               'rental_type_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True)
                        ),
                        'pk' => array('agreement_id','id'),
                        'fk' => array(),
Index: property/setup/tables_update.inc.php
diff -u property/setup/tables_update.inc.php:1.25 
property/setup/tables_update.inc.php:1.26
--- property/setup/tables_update.inc.php:1.25   Mon Feb 13 20:44:30 2006
+++ property/setup/tables_update.inc.php        Tue Feb 14 14:45:50 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage setup
-       * @version $Id: tables_update.inc.php,v 1.25 2006/02/13 20:44:30 
sigurdne Exp $
+       * @version $Id: tables_update.inc.php,v 1.26 2006/02/14 14:45:50 
sigurdne Exp $
        */
 
        /**
@@ -783,11 +783,11 @@
                $GLOBALS['phpgw_setup']->oProc->m_aTables = $table_def;
 
                $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
-               
+
                
$GLOBALS['phpgw_setup']->oProc->RenameColumn('fm_custom','sql','sql_text');
-               
+
                $GLOBALS['setup_info']['property']['currentver'] = '0.9.17.511';
-               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();    
        
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
                return $GLOBALS['setup_info']['property']['currentver'];
        }
 
@@ -934,7 +934,8 @@
                                        'entry_date' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
                                        'test' => array('type' => 
'text','nullable' => True),
                                        'cost' => array('type' => 'decimal', 
'precision' => 20, 'scale' => 2,'nullable' => True),
-                                       'tenant_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True)
+                                       'tenant_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                                       'rental_type_id' => array('type' => 
'int', 'precision' => 4,'nullable' => True)
                                ),
                                'pk' => array('agreement_id','id'),
                                'fk' => array(),
Index: property/templates/base/invoice.xsl
diff -u property/templates/base/invoice.xsl:1.7 
property/templates/base/invoice.xsl:1.8
--- property/templates/base/invoice.xsl:1.7     Fri Feb  3 12:05:49 2006
+++ property/templates/base/invoice.xsl Tue Feb 14 14:45:50 2006
@@ -1,4 +1,4 @@
-<!-- $Id: invoice.xsl,v 1.7 2006/02/03 12:05:49 sigurdne Exp $ -->
+<!-- $Id: invoice.xsl,v 1.8 2006/02/14 14:45:50 sigurdne Exp $ -->
 
        <xsl:template name="app_data">
                <xsl:choose>
@@ -573,7 +573,7 @@
                </script>
 
                <xsl:call-template name="menu"/> 
-               <xsl:variable name="form_action"><xsl:value-of 
select="form_action"/></xsl:variable>
+               <xsl:variable name="form_action"><xsl:value-of 
select="link_url"/></xsl:variable>
                <div align="left">
                <form method="post" name="form" action="{$form_action}">
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
Index: property/templates/base/r_agreement.xsl
diff -u property/templates/base/r_agreement.xsl:1.3 
property/templates/base/r_agreement.xsl:1.4
--- property/templates/base/r_agreement.xsl:1.3 Mon Feb 13 20:44:30 2006
+++ property/templates/base/r_agreement.xsl     Tue Feb 14 14:45:50 2006
@@ -30,7 +30,22 @@
                <xsl:variable name="overlib_source"><xsl:value-of 
select="overlib_source"/></xsl:variable>
                <SCRIPT LANGUAGE="JavaScript" SRC="{$overlib_source}"></SCRIPT>
 
+               <script language="JavaScript">
+                       self.name="first_Window";
+                       function tenant_lookup()
+                       {
+                               Window1=window.open('<xsl:value-of 
select="tenant_link"/>',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");
+                       }               
+                       function property_lookup()
+                       {
+                               Window1=window.open('<xsl:value-of 
select="property_link"/>',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");
+                       }               
+               </script>
+
                <xsl:call-template name="menu"/>
+               <xsl:variable name="form_action"><xsl:value-of 
select="form_action"/></xsl:variable>
+               <form method="post" name="form" action="{$form_action}">
+
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
@@ -44,20 +59,62 @@
                        <tr>
                                <xsl:choose>
                                        <xsl:when test="member_of_list != ''">
-                                               <td align="left">
+                                       <td align="left" valign = 'top'>
                                                        <xsl:call-template 
name="filter_member_of"/>
                                                </td>
                                        </xsl:when>
                                </xsl:choose>
 
-                               <td align="left">
-                                       <xsl:call-template name="cat_filter"/>
+                               <td align="left" valign = 'top'>
+                                       <xsl:call-template name="cat_select"/>
                                </td>
-                               <td align="left">
-                                       <xsl:call-template 
name="filter_vendor"/>
+
+                               <td align="left" valign = 'top'>
+                                       <input type="text" name="tenant_id" 
value="{customer_id}" size="4"  onMouseout="window.status='';return true;">
+                                               <xsl:attribute 
name="onMouseover">
+                                                       
<xsl:text>window.status='</xsl:text>
+                                                               <xsl:value-of 
select="lang_tenant_statustext"/>
+                                                       <xsl:text>'; return 
true;</xsl:text>
+                                               </xsl:attribute>
+                                       </input>
+                                       <a href="javascript:tenant_lookup()"
+                                       
onMouseOver="overlib('{lang_select_tenant_statustext}', CAPTION, 
'{lang_tenant}')"
+                                       onMouseOut="nd()">
+                                       <xsl:value-of 
select="lang_tenant"/></a>                                        
+
+                                       <input type="hidden" 
name="first_name"></input>
+                                       <input type="hidden" 
name="last_name"></input>
                                </td>
-                               <td align="right">
-                                       <xsl:call-template name="search_field"/>
+
+                               <td align="left" valign = 'top'>
+                                       <input type="text" name="loc1" 
value="{loc1}" size="4" onMouseout="window.status='';return true;">
+                                               <xsl:attribute 
name="onMouseover">
+                                                       
<xsl:text>window.status='</xsl:text>
+                                                               <xsl:value-of 
select="lang_property_statustext"/>
+                                                       <xsl:text>'; return 
true;</xsl:text>
+                                               </xsl:attribute>
+                                       </input>
+                                       <a href="javascript:property_lookup()"
+                                       
onMouseOver="overlib('{lang_select_property_statustext}', CAPTION, 
'{lang_property}')"
+                                       onMouseOut="nd()">
+                                       <xsl:value-of 
select="lang_property"/></a>                                      
+
+                                       <input type="hidden" 
name="loc1_name"></input>
+                               </td>
+
+                               <td align="right" colspan = '3'>
+                                       <xsl:call-template 
name="search_field_grouped"/>
+                               <xsl:text> </xsl:text>
+                               </td>
+                               <td>
+                               <input type="checkbox" name="reset_query" 
value="True"  onMouseout="window.status='';return true;">
+                                       <xsl:attribute name="onMouseover">
+                                               
<xsl:text>window.status='</xsl:text>
+                                                       <xsl:value-of 
select="lang_reset_query_statustext"/>
+                                               <xsl:text>'; return 
true;</xsl:text>
+                                       </xsl:attribute>
+                               </input>
+
                                </td>
                                <td valign ="top">
                                <table>
@@ -76,11 +133,12 @@
                                </td>
                        </tr>
                        <tr>
-                               <td colspan="8" width="100%">
+                               <td colspan="10" width="100%">
                                        <xsl:call-template name="nextmatchs"/>
                                </td>
                        </tr>
                </table>
+               </form>
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:call-template name="table_header"/>
                        <xsl:call-template name="values"/>
@@ -218,6 +276,77 @@
                        </tr>
        </xsl:template>
 
+       <xsl:template match="table_add_space">
+                       <tr>
+                               <td height="50">
+                                       <xsl:variable 
name="add_action"><xsl:value-of select="add_action"/></xsl:variable>
+                                       <xsl:variable 
name="lang_add"><xsl:value-of select="lang_add"/></xsl:variable>
+                                       <form method="post" 
action="{$add_action}">
+                                               <input type="submit" name="add" 
value="{$lang_add}" onMouseout="window.status='';return true;">
+                                                       <xsl:attribute 
name="onMouseover">
+                                                               
<xsl:text>window.status='</xsl:text>
+                                                                       
<xsl:value-of select="lang_add_statustext"/>
+                                                               <xsl:text>'; 
return true;</xsl:text>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </form>
+                               </td>
+                       </tr>
+       </xsl:template>
+
+
+       <xsl:template match="table_add_space">
+                       <tr>
+                               <td height="50">
+                                       <xsl:variable 
name="add_action"><xsl:value-of select="add_action"/></xsl:variable>
+                                       <xsl:variable 
name="lang_add"><xsl:value-of select="lang_add"/></xsl:variable>
+                                       <form method="post" 
action="{$add_action}">
+                                               <input type="submit" name="add" 
value="{$lang_add}" onMouseout="window.status='';return true;">
+                                                       <xsl:attribute 
name="onMouseover">
+                                                               
<xsl:text>window.status='</xsl:text>
+                                                                       
<xsl:value-of select="lang_add_statustext"/>
+                                                               <xsl:text>'; 
return true;</xsl:text>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </form>
+                               </td>
+                       </tr>
+       </xsl:template>
+       <xsl:template match="table_add_service">
+                       <tr>
+                               <td height="50">
+                                       <xsl:variable 
name="add_action"><xsl:value-of select="add_action"/></xsl:variable>
+                                       <xsl:variable 
name="lang_add"><xsl:value-of select="lang_add"/></xsl:variable>
+                                       <form method="post" 
action="{$add_action}">
+                                               <input type="submit" name="add" 
value="{$lang_add}" onMouseout="window.status='';return true;">
+                                                       <xsl:attribute 
name="onMouseover">
+                                                               
<xsl:text>window.status='</xsl:text>
+                                                                       
<xsl:value-of select="lang_add_statustext"/>
+                                                               <xsl:text>'; 
return true;</xsl:text>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </form>
+                               </td>
+                       </tr>
+       </xsl:template>
+       <xsl:template match="table_add_common">
+                       <tr>
+                               <td height="50">
+                                       <xsl:variable 
name="add_action"><xsl:value-of select="add_action"/></xsl:variable>
+                                       <xsl:variable 
name="lang_add"><xsl:value-of select="lang_add"/></xsl:variable>
+                                       <form method="post" 
action="{$add_action}">
+                                               <input type="submit" name="add" 
value="{$lang_add}" onMouseout="window.status='';return true;">
+                                                       <xsl:attribute 
name="onMouseover">
+                                                               
<xsl:text>window.status='</xsl:text>
+                                                                       
<xsl:value-of select="lang_add_statustext"/>
+                                                               <xsl:text>'; 
return true;</xsl:text>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </form>
+                               </td>
+                       </tr>
+       </xsl:template>
+
 <!-- add / edit -->
 
        <xsl:template match="edit">
@@ -509,6 +638,15 @@
                </tr>
                </table>
 
+               <table>
+               <tr>
+                       <td class="th_text" align="left" colspan="5">
+                       <HR/>
+                       <xsl:value-of select="lang_space"/>
+                       </td>
+               </tr>
+               <tr>
+               <td>
                <xsl:choose>
                        <xsl:when test="table_update!=''">
                        <xsl:variable name="update_action"><xsl:value-of 
select="update_action"/></xsl:variable>
@@ -552,10 +690,28 @@
                <xsl:choose>
                        <xsl:when test="value_r_agreement_id!=''">
                                <table width="100%" cellpadding="2" 
cellspacing="2" align="center">
-                                       <xsl:apply-templates 
select="table_add"/>
+                                       <xsl:apply-templates 
select="table_add_space"/>
                                </table>
                        </xsl:when>
                </xsl:choose>                                           
+               </td>
+               </tr>
+               <tr>
+                       <td class="th_text" align="left" colspan="5">
+                       <HR/>
+                               <xsl:value-of select="lang_service"/>
+                       </td>
+               </tr>
+                       <xsl:apply-templates select="table_add_service"/>
+
+               <tr>
+                       <td class="th_text" align="left" colspan="5">
+                       <HR/>
+                               <xsl:value-of select="lang_common_costs"/>
+                       </td>
+                       <xsl:apply-templates select="table_add_common"/>
+               </tr>
+               </table>
                </div>
        </xsl:template>
 
@@ -613,6 +769,18 @@
                        <xsl:call-template name="tenant_form"/>
                        <tr>
                                <td valign="top">
+                                       <xsl:value-of 
select="lang_rental_type"/>
+                               </td>
+                               <td valign="top">
+                                       <xsl:variable 
name="lang_rental_type_statustext"><xsl:value-of 
select="lang_rental_type_statustext"/></xsl:variable>
+                                       <select name="values[rental_type_id]" 
class="forms" onMouseover="window.status='{$lang_rental_type_statustext}'; 
return true;" onMouseout="window.status='';return true;">
+                                               <option value=""><xsl:value-of 
select="lang_select_rental_type"/></option>
+                                               <xsl:apply-templates 
select="rental_type_list"/>
+                                       </select>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td valign="top">
                                        <xsl:value-of select="lang_cost"/>
                                </td>
                                <td>
@@ -994,6 +1162,17 @@
                        <xsl:call-template name="tenant_view"/>
                        <tr>
                                <td valign="top">
+                                       <xsl:value-of 
select="lang_rental_type"/>
+                               </td>
+                               <td>
+                                       <xsl:for-each 
select="rental_type_list[selected='selected']" >
+                                               <xsl:value-of select="name"/>
+                                               <xsl:if test="position() != 
last()">, </xsl:if>
+                                       </xsl:for-each>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td valign="top">
                                        <xsl:value-of select="lang_cost"/>
                                </td>
                                <td>
@@ -1478,3 +1657,31 @@
                        </xsl:otherwise>
                </xsl:choose>
        </xsl:template>
+
+       <xsl:template match="rental_type_list">
+       <xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
+               <xsl:choose>
+                       <xsl:when test="selected">
+                               <option value="{$id}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="name"/></option>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <option value="{$id}"><xsl:value-of 
disable-output-escaping="yes" select="name"/></option>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </xsl:template>
+
+
+       <xsl:template name="filter_member_of">
+               <xsl:variable name="select_action"><xsl:value-of 
select="select_action"/></xsl:variable>
+               <xsl:variable name="member_of_name"><xsl:value-of 
select="member_of_name"/></xsl:variable>
+               <xsl:variable name="lang_submit"><xsl:value-of 
select="lang_submit"/></xsl:variable>
+                       <select name="{$member_of_name}"  
onMouseout="window.status='';return true;">
+                               <xsl:attribute name="onMouseover">
+                                       <xsl:text>window.status='</xsl:text>
+                                               <xsl:value-of 
select="lang_cat_statustext"/>
+                                       <xsl:text>'; return true;</xsl:text>
+                               </xsl:attribute>
+                               <option value=""><xsl:value-of 
select="lang_no_member"/></option>
+                                       <xsl:apply-templates 
select="member_of_list"/>
+                       </select>
+       </xsl:template>
Index: property/templates/base/tenant_view.xsl
diff -u property/templates/base/tenant_view.xsl:1.1 
property/templates/base/tenant_view.xsl:1.2
--- property/templates/base/tenant_view.xsl:1.1 Mon Feb 13 14:40:56 2006
+++ property/templates/base/tenant_view.xsl     Tue Feb 14 14:45:50 2006
@@ -1,4 +1,4 @@
-<!-- $Id: tenant_view.xsl,v 1.1 2006/02/13 14:40:56 sigurdne Exp $ -->
+<!-- $Id: tenant_view.xsl,v 1.2 2006/02/14 14:45:50 sigurdne Exp $ -->
 
        <xsl:template name="tenant_view">
                <xsl:apply-templates select="tenant_data"/>
@@ -11,7 +11,7 @@
                                </td>
                                <td>
                                        <xsl:value-of select="value_tenant_id"/>
-                                       <xsl:text> [</xsl:text>
+                                       <xsl:text> </xsl:text>
                                        <xsl:value-of select="value_last_name"/>
                                        <xsl:text> </xsl:text>
                                        <xsl:value-of 
select="value_first_name"/>
Index: property/templates/default/invoice.xsl
diff -u property/templates/default/invoice.xsl:1.14 
property/templates/default/invoice.xsl:1.15
--- property/templates/default/invoice.xsl:1.14 Fri Feb  3 12:05:49 2006
+++ property/templates/default/invoice.xsl      Tue Feb 14 14:45:50 2006
@@ -1,4 +1,4 @@
-<!-- $Id: invoice.xsl,v 1.14 2006/02/03 12:05:49 sigurdne Exp $ -->
+<!-- $Id: invoice.xsl,v 1.15 2006/02/14 14:45:50 sigurdne Exp $ -->
 
        <xsl:template name="app_data">
                <xsl:choose>
@@ -573,7 +573,7 @@
                </script>
 
                <xsl:call-template name="menu"/> 
-               <xsl:variable name="form_action"><xsl:value-of 
select="form_action"/></xsl:variable>
+               <xsl:variable name="form_action"><xsl:value-of 
select="link_url"/></xsl:variable>
                <div align="left">
                <form method="post" name="form" action="{$form_action}">
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
Index: property/templates/default/r_agreement.xsl
diff -u property/templates/default/r_agreement.xsl:1.3 
property/templates/default/r_agreement.xsl:1.4
--- property/templates/default/r_agreement.xsl:1.3      Mon Feb 13 20:44:30 2006
+++ property/templates/default/r_agreement.xsl  Tue Feb 14 14:45:50 2006
@@ -30,7 +30,22 @@
                <xsl:variable name="overlib_source"><xsl:value-of 
select="overlib_source"/></xsl:variable>
                <SCRIPT LANGUAGE="JavaScript" SRC="{$overlib_source}"></SCRIPT>
 
+               <script language="JavaScript">
+                       self.name="first_Window";
+                       function tenant_lookup()
+                       {
+                               Window1=window.open('<xsl:value-of 
select="tenant_link"/>',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");
+                       }               
+                       function property_lookup()
+                       {
+                               Window1=window.open('<xsl:value-of 
select="property_link"/>',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");
+                       }               
+               </script>
+
                <xsl:call-template name="menu"/>
+               <xsl:variable name="form_action"><xsl:value-of 
select="form_action"/></xsl:variable>
+               <form method="post" name="form" action="{$form_action}">
+
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
@@ -44,20 +59,62 @@
                        <tr>
                                <xsl:choose>
                                        <xsl:when test="member_of_list != ''">
-                                               <td align="left">
+                                       <td align="left" valign = 'top'>
                                                        <xsl:call-template 
name="filter_member_of"/>
                                                </td>
                                        </xsl:when>
                                </xsl:choose>
 
-                               <td align="left">
-                                       <xsl:call-template name="cat_filter"/>
+                               <td align="left" valign = 'top'>
+                                       <xsl:call-template name="cat_select"/>
                                </td>
-                               <td align="left">
-                                       <xsl:call-template 
name="filter_vendor"/>
+
+                               <td align="left" valign = 'top'>
+                                       <input type="text" name="tenant_id" 
value="{customer_id}" size="4"  onMouseout="window.status='';return true;">
+                                               <xsl:attribute 
name="onMouseover">
+                                                       
<xsl:text>window.status='</xsl:text>
+                                                               <xsl:value-of 
select="lang_tenant_statustext"/>
+                                                       <xsl:text>'; return 
true;</xsl:text>
+                                               </xsl:attribute>
+                                       </input>
+                                       <a href="javascript:tenant_lookup()"
+                                       
onMouseOver="overlib('{lang_select_tenant_statustext}', CAPTION, 
'{lang_tenant}')"
+                                       onMouseOut="nd()">
+                                       <xsl:value-of 
select="lang_tenant"/></a>                                        
+
+                                       <input type="hidden" 
name="first_name"></input>
+                                       <input type="hidden" 
name="last_name"></input>
                                </td>
-                               <td align="right">
-                                       <xsl:call-template name="search_field"/>
+
+                               <td align="left" valign = 'top'>
+                                       <input type="text" name="loc1" 
value="{loc1}" size="4" onMouseout="window.status='';return true;">
+                                               <xsl:attribute 
name="onMouseover">
+                                                       
<xsl:text>window.status='</xsl:text>
+                                                               <xsl:value-of 
select="lang_property_statustext"/>
+                                                       <xsl:text>'; return 
true;</xsl:text>
+                                               </xsl:attribute>
+                                       </input>
+                                       <a href="javascript:property_lookup()"
+                                       
onMouseOver="overlib('{lang_select_property_statustext}', CAPTION, 
'{lang_property}')"
+                                       onMouseOut="nd()">
+                                       <xsl:value-of 
select="lang_property"/></a>                                      
+
+                                       <input type="hidden" 
name="loc1_name"></input>
+                               </td>
+
+                               <td align="right" colspan = '3'>
+                                       <xsl:call-template 
name="search_field_grouped"/>
+                               <xsl:text> </xsl:text>
+                               </td>
+                               <td>
+                               <input type="checkbox" name="reset_query" 
value="True"  onMouseout="window.status='';return true;">
+                                       <xsl:attribute name="onMouseover">
+                                               
<xsl:text>window.status='</xsl:text>
+                                                       <xsl:value-of 
select="lang_reset_query_statustext"/>
+                                               <xsl:text>'; return 
true;</xsl:text>
+                                       </xsl:attribute>
+                               </input>
+
                                </td>
                                <td valign ="top">
                                <table>
@@ -76,11 +133,12 @@
                                </td>
                        </tr>
                        <tr>
-                               <td colspan="8" width="100%">
+                               <td colspan="10" width="100%">
                                        <xsl:call-template name="nextmatchs"/>
                                </td>
                        </tr>
                </table>
+               </form>
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:call-template name="table_header"/>
                        <xsl:call-template name="values"/>
@@ -218,6 +276,77 @@
                        </tr>
        </xsl:template>
 
+       <xsl:template match="table_add_space">
+                       <tr>
+                               <td height="50">
+                                       <xsl:variable 
name="add_action"><xsl:value-of select="add_action"/></xsl:variable>
+                                       <xsl:variable 
name="lang_add"><xsl:value-of select="lang_add"/></xsl:variable>
+                                       <form method="post" 
action="{$add_action}">
+                                               <input type="submit" name="add" 
value="{$lang_add}" onMouseout="window.status='';return true;">
+                                                       <xsl:attribute 
name="onMouseover">
+                                                               
<xsl:text>window.status='</xsl:text>
+                                                                       
<xsl:value-of select="lang_add_statustext"/>
+                                                               <xsl:text>'; 
return true;</xsl:text>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </form>
+                               </td>
+                       </tr>
+       </xsl:template>
+
+
+       <xsl:template match="table_add_space">
+                       <tr>
+                               <td height="50">
+                                       <xsl:variable 
name="add_action"><xsl:value-of select="add_action"/></xsl:variable>
+                                       <xsl:variable 
name="lang_add"><xsl:value-of select="lang_add"/></xsl:variable>
+                                       <form method="post" 
action="{$add_action}">
+                                               <input type="submit" name="add" 
value="{$lang_add}" onMouseout="window.status='';return true;">
+                                                       <xsl:attribute 
name="onMouseover">
+                                                               
<xsl:text>window.status='</xsl:text>
+                                                                       
<xsl:value-of select="lang_add_statustext"/>
+                                                               <xsl:text>'; 
return true;</xsl:text>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </form>
+                               </td>
+                       </tr>
+       </xsl:template>
+       <xsl:template match="table_add_service">
+                       <tr>
+                               <td height="50">
+                                       <xsl:variable 
name="add_action"><xsl:value-of select="add_action"/></xsl:variable>
+                                       <xsl:variable 
name="lang_add"><xsl:value-of select="lang_add"/></xsl:variable>
+                                       <form method="post" 
action="{$add_action}">
+                                               <input type="submit" name="add" 
value="{$lang_add}" onMouseout="window.status='';return true;">
+                                                       <xsl:attribute 
name="onMouseover">
+                                                               
<xsl:text>window.status='</xsl:text>
+                                                                       
<xsl:value-of select="lang_add_statustext"/>
+                                                               <xsl:text>'; 
return true;</xsl:text>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </form>
+                               </td>
+                       </tr>
+       </xsl:template>
+       <xsl:template match="table_add_common">
+                       <tr>
+                               <td height="50">
+                                       <xsl:variable 
name="add_action"><xsl:value-of select="add_action"/></xsl:variable>
+                                       <xsl:variable 
name="lang_add"><xsl:value-of select="lang_add"/></xsl:variable>
+                                       <form method="post" 
action="{$add_action}">
+                                               <input type="submit" name="add" 
value="{$lang_add}" onMouseout="window.status='';return true;">
+                                                       <xsl:attribute 
name="onMouseover">
+                                                               
<xsl:text>window.status='</xsl:text>
+                                                                       
<xsl:value-of select="lang_add_statustext"/>
+                                                               <xsl:text>'; 
return true;</xsl:text>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </form>
+                               </td>
+                       </tr>
+       </xsl:template>
+
 <!-- add / edit -->
 
        <xsl:template match="edit">
@@ -509,6 +638,15 @@
                </tr>
                </table>
 
+               <table>
+               <tr>
+                       <td class="th_text" align="left" colspan="5">
+                       <HR/>
+                       <xsl:value-of select="lang_space"/>
+                       </td>
+               </tr>
+               <tr>
+               <td>
                <xsl:choose>
                        <xsl:when test="table_update!=''">
                        <xsl:variable name="update_action"><xsl:value-of 
select="update_action"/></xsl:variable>
@@ -552,10 +690,28 @@
                <xsl:choose>
                        <xsl:when test="value_r_agreement_id!=''">
                                <table width="100%" cellpadding="2" 
cellspacing="2" align="center">
-                                       <xsl:apply-templates 
select="table_add"/>
+                                       <xsl:apply-templates 
select="table_add_space"/>
                                </table>
                        </xsl:when>
                </xsl:choose>                                           
+               </td>
+               </tr>
+               <tr>
+                       <td class="th_text" align="left" colspan="5">
+                       <HR/>
+                               <xsl:value-of select="lang_service"/>
+                       </td>
+               </tr>
+                       <xsl:apply-templates select="table_add_service"/>
+
+               <tr>
+                       <td class="th_text" align="left" colspan="5">
+                       <HR/>
+                               <xsl:value-of select="lang_common_costs"/>
+                       </td>
+                       <xsl:apply-templates select="table_add_common"/>
+               </tr>
+               </table>
                </div>
        </xsl:template>
 
@@ -613,6 +769,18 @@
                        <xsl:call-template name="tenant_form"/>
                        <tr>
                                <td valign="top">
+                                       <xsl:value-of 
select="lang_rental_type"/>
+                               </td>
+                               <td valign="top">
+                                       <xsl:variable 
name="lang_rental_type_statustext"><xsl:value-of 
select="lang_rental_type_statustext"/></xsl:variable>
+                                       <select name="values[rental_type_id]" 
class="forms" onMouseover="window.status='{$lang_rental_type_statustext}'; 
return true;" onMouseout="window.status='';return true;">
+                                               <option value=""><xsl:value-of 
select="lang_select_rental_type"/></option>
+                                               <xsl:apply-templates 
select="rental_type_list"/>
+                                       </select>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td valign="top">
                                        <xsl:value-of select="lang_cost"/>
                                </td>
                                <td>
@@ -994,6 +1162,17 @@
                        <xsl:call-template name="tenant_view"/>
                        <tr>
                                <td valign="top">
+                                       <xsl:value-of 
select="lang_rental_type"/>
+                               </td>
+                               <td>
+                                       <xsl:for-each 
select="rental_type_list[selected='selected']" >
+                                               <xsl:value-of select="name"/>
+                                               <xsl:if test="position() != 
last()">, </xsl:if>
+                                       </xsl:for-each>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td valign="top">
                                        <xsl:value-of select="lang_cost"/>
                                </td>
                                <td>
@@ -1478,3 +1657,31 @@
                        </xsl:otherwise>
                </xsl:choose>
        </xsl:template>
+
+       <xsl:template match="rental_type_list">
+       <xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
+               <xsl:choose>
+                       <xsl:when test="selected">
+                               <option value="{$id}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="name"/></option>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <option value="{$id}"><xsl:value-of 
disable-output-escaping="yes" select="name"/></option>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </xsl:template>
+
+
+       <xsl:template name="filter_member_of">
+               <xsl:variable name="select_action"><xsl:value-of 
select="select_action"/></xsl:variable>
+               <xsl:variable name="member_of_name"><xsl:value-of 
select="member_of_name"/></xsl:variable>
+               <xsl:variable name="lang_submit"><xsl:value-of 
select="lang_submit"/></xsl:variable>
+                       <select name="{$member_of_name}"  
onMouseout="window.status='';return true;">
+                               <xsl:attribute name="onMouseover">
+                                       <xsl:text>window.status='</xsl:text>
+                                               <xsl:value-of 
select="lang_cat_statustext"/>
+                                       <xsl:text>'; return true;</xsl:text>
+                               </xsl:attribute>
+                               <option value=""><xsl:value-of 
select="lang_no_member"/></option>
+                                       <xsl:apply-templates 
select="member_of_list"/>
+                       </select>
+       </xsl:template>
Index: property/templates/default/tenant_view.xsl
diff -u property/templates/default/tenant_view.xsl:1.1 
property/templates/default/tenant_view.xsl:1.2
--- property/templates/default/tenant_view.xsl:1.1      Mon Feb 13 14:40:56 2006
+++ property/templates/default/tenant_view.xsl  Tue Feb 14 14:45:50 2006
@@ -1,4 +1,4 @@
-<!-- $Id: tenant_view.xsl,v 1.1 2006/02/13 14:40:56 sigurdne Exp $ -->
+<!-- $Id: tenant_view.xsl,v 1.2 2006/02/14 14:45:50 sigurdne Exp $ -->
 
        <xsl:template name="tenant_view">
                <xsl:apply-templates select="tenant_data"/>
@@ -11,7 +11,7 @@
                                </td>
                                <td>
                                        <xsl:value-of select="value_tenant_id"/>
-                                       <xsl:text> [</xsl:text>
+                                       <xsl:text> </xsl:text>
                                        <xsl:value-of select="value_last_name"/>
                                        <xsl:text> </xsl:text>
                                        <xsl:value-of 
select="value_first_name"/>




reply via email to

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