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: Mon, 13 Feb 2006 14:40:57 +0000

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

Modified files:
        inc            : class.bocommon.inc.php 
                         class.bor_agreement.inc.php 
                         class.sor_agreement.inc.php 
                         class.sos_agreement.inc.php 
                         class.uir_agreement.inc.php 
        setup          : tables_current.inc.php tables_update.inc.php 
        templates/base : r_agreement.xsl 
        templates/default: r_agreement.xsl 
Added files:
        templates/base : tenant_form.xsl tenant_view.xsl 
        templates/default: tenant_form.xsl tenant_view.xsl 

Log message:
        

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.bocommon.inc.php.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.bor_agreement.inc.php.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sor_agreement.inc.php.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sos_agreement.inc.php.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uir_agreement.inc.php.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/setup/tables_current.inc.php.diff?tr1=1.40&tr2=1.41&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/setup/tables_update.inc.php.diff?tr1=1.23&tr2=1.24&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/base/r_agreement.xsl.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/base/tenant_form.xsl?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/base/tenant_view.xsl?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/default/r_agreement.xsl.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/default/tenant_form.xsl?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/default/tenant_view.xsl?rev=1.1

Patches:
Index: property/inc/class.bocommon.inc.php
diff -u property/inc/class.bocommon.inc.php:1.22 
property/inc/class.bocommon.inc.php:1.23
--- property/inc/class.bocommon.inc.php:1.22    Tue Feb  7 19:22:01 2006
+++ property/inc/class.bocommon.inc.php Mon Feb 13 14:40:56 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.22 2006/02/07 19:22:01 
sigurdne Exp $
+       * @version $Id: class.bocommon.inc.php,v 1.23 2006/02/13 14:40:56 
sigurdne Exp $
        */
 
        /**
@@ -578,6 +578,61 @@
                }
 
 
+               function initiate_ui_tenant_lookup($data)
+               {
+                       if($data['type']=='view')
+                       {
+                               
$GLOBALS['phpgw']->xslttpl->add_file(array('tenant_view'));
+                       }
+                       else
+                       {
+                               
$GLOBALS['phpgw']->xslttpl->add_file(array('tenant_form'));
+                       }
+
+                       $tenant['value_tenant_id']                      = 
$data['tenant_id'];
+                       $tenant['value_first_name']                     = 
$data['first_name'];
+                       $tenant['value_last_name']                      = 
$data['last_name'];
+                       $tenant['tenant_link']                          = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.tenant');
+                       if($data['role']=='customer')
+                       {
+                               $tenant['lang_select_tenant_help']              
= lang('Klick this link to select customer');
+                               $tenant['lang_tenant']                          
= lang('Customer');
+
+                       }
+                       else
+                       {
+                               $tenant['lang_select_tenant_help']              
= lang('Klick this link to select tenant');
+                               $tenant['lang_tenant']                          
= lang('Tenant');
+                       }
+
+                       
+                       if($data['tenant_id'] && !$data['tenant_name'])
+                       {
+                               $tenant_object  = 
CreateObject($this->currentapp.'.soactor');
+                               $tenant_object->role = 'tenant';
+                               $tenant_data    = 
$tenant_object->read_single(array('actor_id' => $data['tenant_id']));
+                               if(is_array($tenant_data['attributes']))
+                               {
+//_debug_array($tenant_data);
+                                       foreach ($tenant_data['attributes'] as 
$entry)
+                                       {
+
+                                               if ($entry['name'] == 
'first_name')
+                                               {
+                                                       
$tenant['value_first_name']     = $entry['value'];
+                                               }
+                                               if ($entry['name'] == 
'last_name')
+                                               {
+                                                       
$tenant['value_last_name']      = $entry['value'];
+                                               }
+                                       }
+                               }
+                       }
+
+//_debug_array($tenant);
+                       return $tenant;
+               }
+
                function initiate_ui_budget_account_lookup($data)
                {
                        if($data['type']=='view')
@@ -592,7 +647,6 @@
                        $b_account['value_b_account_id']                        
= $data['b_account_id'];
                        $b_account['value_b_account_name']                      
= $data['b_account_name'];
                        $b_account['b_account_link']                            
= 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.b_account');
-                       $b_account['lang_b_account']                            
= lang('b_account');
                        $b_account['lang_select_b_account_help']        = 
lang('Klick this link to select budget account');
                        $b_account['lang_b_account']                            
= lang('Budget account');
                        if($data['b_account_id'] && !$data['b_account_name'])
Index: property/inc/class.bor_agreement.inc.php
diff -u property/inc/class.bor_agreement.inc.php:1.1 
property/inc/class.bor_agreement.inc.php:1.2
--- property/inc/class.bor_agreement.inc.php:1.1        Sun Feb 12 18:12:01 2006
+++ property/inc/class.bor_agreement.inc.php    Mon Feb 13 14:40:56 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.1 2006/02/12 18:12:01 
sigurdne Exp $
+       * @version $Id: class.bor_agreement.inc.php,v 1.2 2006/02/13 14:40:56 
sigurdne Exp $
        */
 
        /**
@@ -443,26 +443,28 @@
 
                function convert_attribute_save($values_attribute='')
                {
-
-                       for ($i=0;$i<count($values_attribute);$i++)
+                       if(is_array($values_attribute))
                        {
-                               if($values_attribute[$i]['datatype']=='CH' && 
$values_attribute[$i]['value'])
-                               {
-                                       $values_attribute[$i]['value'] = 
serialize($values_attribute[$i]['value']);
-                               }
-                               if($values_attribute[$i]['datatype']=='R' && 
$values_attribute[$i]['value'])
+                               for ($i=0;$i<count($values_attribute);$i++)
                                {
-                                       $values_attribute[$i]['value'] = 
$values_attribute[$i]['value'][0];
-                               }
+                                       
if($values_attribute[$i]['datatype']=='CH' && $values_attribute[$i]['value'])
+                                       {
+                                               $values_attribute[$i]['value'] 
= serialize($values_attribute[$i]['value']);
+                                       }
+                                       
if($values_attribute[$i]['datatype']=='R' && $values_attribute[$i]['value'])
+                                       {
+                                               $values_attribute[$i]['value'] 
= $values_attribute[$i]['value'][0];
+                                       }
 
-                               if($values_attribute[$i]['datatype']=='N' && 
$values_attribute[$i]['value'])
-                               {
-                                       $values_attribute[$i]['value'] = 
str_replace(",",".",$values_attribute[$i]['value']);
-                               }
+                                       
if($values_attribute[$i]['datatype']=='N' && $values_attribute[$i]['value'])
+                                       {
+                                               $values_attribute[$i]['value'] 
= str_replace(",",".",$values_attribute[$i]['value']);
+                                       }
 
-                               if($values_attribute[$i]['datatype']=='D' && 
$values_attribute[$i]['value'])
-                               {
-                                       $values_attribute[$i]['value'] = 
date($this->bocommon->dateformat,$this->bocommon->date_to_timestamp($values_attribute[$i]['value']));
+                                       
if($values_attribute[$i]['datatype']=='D' && $values_attribute[$i]['value'])
+                                       {
+                                               $values_attribute[$i]['value'] 
= 
date($this->bocommon->dateformat,$this->bocommon->date_to_timestamp($values_attribute[$i]['value']));
+                                       }
                                }
                        }
 
Index: property/inc/class.sor_agreement.inc.php
diff -u property/inc/class.sor_agreement.inc.php:1.1 
property/inc/class.sor_agreement.inc.php:1.2
--- property/inc/class.sor_agreement.inc.php:1.1        Sun Feb 12 18:12:02 2006
+++ property/inc/class.sor_agreement.inc.php    Mon Feb 13 14:40:56 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.1 2006/02/12 18:12:02 
sigurdne Exp $
+       * @version $Id: class.sor_agreement.inc.php,v 1.2 2006/02/13 14:40:56 
sigurdne Exp $
        */
 
        /**
@@ -50,6 +50,7 @@
 
                function select_vendor_list()
                {
+                       return ;
                        $table = 'fm_r_agreement';
                        $this->db->query("SELECT vendor_id,org_name FROM $table 
$this->join fm_vendor on fm_r_agreement.vendor_id=fm_vendor.id GROUP BY 
org_name,vendor_id ");
 
@@ -73,7 +74,7 @@
                                $sort                   = 
(isset($data['sort'])?$data['sort']:'DESC');
                                $order                  = 
(isset($data['order'])?$data['order']:'');
                                $cat_id                 = 
(isset($data['cat_id'])?$data['cat_id']:'');
-                               $vendor_id              = 
(isset($data['vendor_id'])?$data['vendor_id']:'');
+                               $customer_id            = 
(isset($data['customer_id'])?$data['customer_id']:'');
                                $allrows                = 
(isset($data['allrows'])?$data['allrows']:'');
                                $member_id              = 
(isset($data['member_id'])?$data['member_id']:0);
                                $r_agreement_id = 
(isset($data['r_agreement_id'])?$data['r_agreement_id']:'');
@@ -91,45 +92,46 @@
 
                                $paranthesis .='(';
                                $joinmethod .= " $this->join $category_table ON 
( $entity_table.category =$category_table.id))";
-                               $paranthesis .='(';
-                               $joinmethod .= " $this->join fm_vendor ON ( 
$entity_table.vendor_id =fm_vendor.id))";
 
-                               $cols = $entity_table . 
".*,$category_table.descr as category, org_name";
+                               $cols = $entity_table . 
".*,$category_table.descr as category";
+//                             $cols .= ",org_name";
+//                             $paranthesis .='(';
+//                             $joinmethod .= " $this->join fm_tenant ON ( 
$entity_table.customer_id =fm_tenant.id))";
 
-                               $cols_return[]                          = 'id';
+                               $cols_return[]                  = 'id';
                                $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 'id';
-                               $uicols['descr'][]                      = 
lang('ID');
+                               $uicols['name'][]               = 'id';
+                               $uicols['descr'][]              = lang('ID');
                                $uicols['statustext'][]         = lang('ID');
 
-                               $cols_return[]                          = 
'name';
+                               $cols_return[]                  = 'name';
                                $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 
'name';
-                               $uicols['descr'][]                      = 
lang('name');
+                               $uicols['name'][]               = 'name';
+                               $uicols['descr'][]              = lang('name');
                                $uicols['statustext'][]         = lang('name');
 
-                               $cols_return[]                          = 
'org_name';
+                               $cols_return[]                  = 
'customer_name';
                                $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 
'org_name';
-                               $uicols['descr'][]                      = 
lang('vendor');
-                               $uicols['statustext'][]         = 
lang('vendor');
+                               $uicols['name'][]               = 
'customer_name';
+                               $uicols['descr'][]              = 
lang('customer');
+                               $uicols['statustext'][]         = 
lang('customer');
 
-                               $cols_return[]                          = 
'category';
+                               $cols_return[]                  = 'category';
                                $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 
'category';
-                               $uicols['descr'][]                      = 
lang('category');
+                               $uicols['name'][]               = 'category';
+                               $uicols['descr'][]              = 
lang('category');
                                $uicols['statustext'][]         = 
lang('category');
 
-                               $cols_return[]                          = 
'start_date';
+                               $cols_return[]                  = 'start_date';
                                $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 
'start_date';
-                               $uicols['descr'][]                      = 
lang('start');
+                               $uicols['name'][]               = 'start_date';
+                               $uicols['descr'][]              = lang('start');
                                $uicols['statustext'][]         = lang('start 
date');
 
-                               $cols_return[]                          = 
'end_date';
+                               $cols_return[]                  = 'end_date';
                                $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 
'end_date';
-                               $uicols['descr'][]                      = 
lang('end');
+                               $uicols['name'][]               = 'end_date';
+                               $uicols['descr'][]              = lang('end');
                                $uicols['statustext'][]         = lang('end 
date');
 
                        }
@@ -146,64 +148,64 @@
 
                                $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_return[]                          = 
'agreement_id';
+                               $cols_return[]                  = 
'agreement_id';
                                $uicols['input_type'][]         = 'hidden';
-                               $uicols['name'][]                       = 
'agreement_id';
-                               $uicols['descr'][]                      = 
lang('agreement_id');
+                               $uicols['name'][]               = 
'agreement_id';
+                               $uicols['descr'][]              = 
lang('agreement_id');
                                $uicols['statustext'][]         = 
lang('agreement_id');
 
-                               $cols_return[]                          = 
'item_id';
+                               $cols_return[]                  = 'item_id';
                                $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 
'item_id';
-                               $uicols['descr'][]                      = 
lang('ID');
+                               $uicols['name'][]               = 'item_id';
+                               $uicols['descr'][]              = lang('ID');
                                $uicols['statustext'][]         = lang('ID');
 
-                               $cols_return[]                          = 'id';
+                               $cols_return[]                  = 'id';
                                $uicols['input_type'][]         = 'hidden';
-                               $uicols['name'][]                       = 'id';
+                               $uicols['name'][]               = 'id';
                                $uicols['descr'][]                      = False;
                                $uicols['statustext'][]         = False;
 
-                               $cols_return[]                          = 
'location_code';
+                               $cols_return[]                  = 
'location_code';
                                $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 
'location_code';
-                               $uicols['descr'][]                      = 
lang('location');
+                               $uicols['name'][]               = 
'location_code';
+                               $uicols['descr'][]              = 
lang('location');
                                $uicols['statustext'][]         = 
lang('location');
 
-                               $cols_return[]                          = 
'address';
+                               $cols_return[]                  = 'address';
                                $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 
'address';
-                               $uicols['descr'][]                      = 
lang('address');
+                               $uicols['name'][]               = 'address';
+                               $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['name'][]               = 'p_num';
+                               $uicols['descr'][]              = lang('entity 
num');
                                $uicols['statustext'][]         = lang('entity 
num');
 
-                               $cols_return[]                          = 
'cost';
+                               $cols_return[]                  = 'cost';
                                $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 
'cost';
-                               $uicols['descr'][]                      = 
lang('cost');
+                               $uicols['name'][]               = 'cost';
+                               $uicols['descr'][]              = lang('cost');
                                $uicols['statustext'][]         = lang('cost');
 
-                               $cols_return[]                          = 
'this_index';
+                               $cols_return[]                  = 'this_index';
                                $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 
'this_index';
-                               $uicols['descr'][]                      = 
lang('index');
+                               $uicols['name'][]               = 'this_index';
+                               $uicols['descr'][]              = lang('index');
                                $uicols['statustext'][]         = lang('index');
 
-                               $cols_return[]                          = 
'index_count';
+                               $cols_return[]                  = 'index_count';
                                $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 
'index_count';
-                               $uicols['descr'][]                      = 
lang('index_count');
+                               $uicols['name'][]               = 'index_count';
+                               $uicols['descr'][]              = 
lang('index_count');
                                $uicols['statustext'][]         = 
lang('index_count');
 
-                               $cols_return[]                          = 
'index_date';
+                               $cols_return[]                  = 'index_date';
                                $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 
'index_date';
-                               $uicols['descr'][]                      = 
lang('date');
+                               $uicols['name'][]               = 'index_date';
+                               $uicols['descr'][]              = lang('date');
                                $uicols['statustext'][]         = lang('date');
                        }
 
@@ -312,7 +314,7 @@
 
                        if ($vendor_id)
                        {
-                               $filtermethod .= " $where 
$entity_table.vendor_id='$vendor_id' ";
+                               $filtermethod .= " $where 
$entity_table.customer_id='$customer_id' ";
                                $where= 'AND';
                        }
 
@@ -579,7 +581,7 @@
                                        $r_agreement['start_date']              
= $this->db->f('start_date');
                                        $r_agreement['end_date']                
= $this->db->f('end_date');
                                        $r_agreement['termination_date']= 
$this->db->f('termination_date');
-                                       $r_agreement['vendor_id']               
= $this->db->f('vendor_id');
+                                       $r_agreement['customer_id']             
= $this->db->f('customer_id');
                                        $r_agreement['b_account_id']    = 
$this->db->f('account_id');
                                        $r_agreement['name']                    
= stripslashes($this->db->f('name'));
                                        $r_agreement['descr']                   
= stripslashes($this->db->f('descr'));
@@ -658,7 +660,7 @@
 
 
                        $this->db->transaction_begin();
-                       $id = $this->bocommon->increment_id('workorder');
+                       $id = $this->bocommon->next_id('fm_r_agreement');
 
                        $vals[] = $id;
                        $vals[] = $r_agreement['name'];
@@ -669,7 +671,8 @@
                        $vals[] = $r_agreement['start_date'];
                        $vals[] = $r_agreement['end_date'];
                        $vals[] = $r_agreement['termination_date'];
-                       $vals[] = $r_agreement['vendor_id'];
+                       $vals[] = $r_agreement['customer_id'];
+                       $vals[] = $r_agreement['customer_name'];
                        $vals[] = $r_agreement['b_account_id'];
                        $vals[] = $this->account;
 
@@ -697,10 +700,11 @@
                        if($cols)
                        {
                                $cols   = "," . implode(",", $cols);
-                               $vals   = 
$this->bocommon->validate_db_insert($vals);
                        }
 
-                       $this->db->query("INSERT INTO $table 
(id,name,descr,entry_date,category,member_of,start_date,end_date,termination_date,vendor_id,account_id,user_id
 $cols) "
+                       $vals   = $this->bocommon->validate_db_insert($vals);
+
+                       $this->db->query("INSERT INTO $table 
(id,name,descr,entry_date,category,member_of,start_date,end_date,termination_date,customer_id,customer_name,account_id,user_id
 $cols) "
                                . "VALUES ($vals)",__LINE__,__FILE__);
 
 //                     $this->db->query("INSERT INTO fm_orders (id,type) 
VALUES ($id,'r_agreement')");
@@ -802,7 +806,6 @@
 
                function edit($values,$values_attribute='')
                {
-//_debug_array($values);
 //_debug_array($values_attribute);
                        $table = 'fm_r_agreement';
 
@@ -831,13 +834,15 @@
 
                        $value_set['name']      = $values['name'];
                        $value_set['descr']     = $values['descr'];
+                       $value_set['customer_id']= $values['customer_id'];
+                       $value_set['customer_name']= $values['customer_name'];
                        if($value_set)
                        {
                                $value_set      = ',' . 
$this->bocommon->validate_db_update($value_set);
                        }
 
                        $this->db->query("UPDATE $table set entry_date='" . 
time() . "', category='"
-                                                       . $values['cat_id'] . 
"', member_of='" . $values['member_of'] . "', start_date=" . 
intval($values['start_date']) . ", end_date=" . intval($values['end_date']) . 
", termination_date=" . intval($values['termination_date']) . ", account_id=" . 
intval($values['b_account_id']) . "$value_set WHERE id=" . 
intval($values['r_agreement_id']));
+                                                       . $values['cat_id'] . 
"', member_of='" . $values['member_of'] . "', start_date=" . 
intval($values['start_date']) . ", end_date=" . intval($values['end_date']) . 
", termination_date=" . intval($values['termination_date']) . ", account_id=" . 
intval($values['b_account_id']) .  " $value_set WHERE id=" . 
intval($values['r_agreement_id']));
 
                        $this->db->query("UPDATE fm_r_agreement_pricing set 
index_date=" . intval($values['start_date']) . " WHERE id=1 AND agreement_id= " 
. intval($values['r_agreement_id']));
 
@@ -1238,7 +1243,8 @@
                                case 'fm_r_agreement':
                                        $fd=array(
                                                'id' => array('type' => 'int', 
'precision' => 4,'nullable' => False,'default' => '0'),
-                                               'vendor_id' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
+                                               'customer_id' => array('type' 
=> 'int', 'precision' => 4,'nullable' => True),
+                                               'customer_name' => array('type' 
=> 'varchar', 'precision' => 255,'nullable' => True),
                                                'name' => array('type' => 
'varchar', 'precision' => 100,'nullable' => False),
                                                'descr' => array('type' => 
'text','nullable' => True),
                                                'status' => array('type' => 
'varchar', 'precision' => 10,'nullable' => True),
Index: property/inc/class.sos_agreement.inc.php
diff -u property/inc/class.sos_agreement.inc.php:1.18 
property/inc/class.sos_agreement.inc.php:1.19
--- property/inc/class.sos_agreement.inc.php:1.18       Sun Feb 12 14:01:14 2006
+++ property/inc/class.sos_agreement.inc.php    Mon Feb 13 14:40:56 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.sos_agreement.inc.php,v 1.18 2006/02/12 14:01:14 
sigurdne Exp $
+       * @version $Id: class.sos_agreement.inc.php,v 1.19 2006/02/13 14:40:56 
sigurdne Exp $
        */
 
        /**
@@ -697,9 +697,10 @@
                        if($cols)
                        {
                                $cols   = "," . implode(",", $cols);
-                               $vals   = 
$this->bocommon->validate_db_insert($vals);
                        }
 
+                       $vals   = $this->bocommon->validate_db_insert($vals);
+
                        $this->db->query("INSERT INTO $table 
(id,name,descr,entry_date,category,member_of,start_date,end_date,termination_date,vendor_id,account_id,user_id
 $cols) "
                                . "VALUES ($vals)",__LINE__,__FILE__);
 
Index: property/inc/class.uir_agreement.inc.php
diff -u property/inc/class.uir_agreement.inc.php:1.1 
property/inc/class.uir_agreement.inc.php:1.2
--- property/inc/class.uir_agreement.inc.php:1.1        Sun Feb 12 18:12:02 2006
+++ property/inc/class.uir_agreement.inc.php    Mon Feb 13 14:40:56 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.1 2006/02/12 18:12:02 
sigurdne Exp $
+       * @version $Id: class.uir_agreement.inc.php,v 1.2 2006/02/13 14:40:56 
sigurdne Exp $
        */
 
        /**
@@ -48,16 +48,16 @@
                        $this->nextmatchs       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
-                       $this->bo                       = 
CreateObject($this->currentapp.'.bor_agreement',True);
+                       $this->bo               = 
CreateObject($this->currentapp.'.bor_agreement',True);
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
-                       $this->menu                     = 
CreateObject($this->currentapp.'.menu');
+                       $this->menu             = 
CreateObject($this->currentapp.'.menu');
 
                        $this->role             = $this->bo->role;
 
                        $this->cats             = 
CreateObject('phpgwapi.categories');
                        $this->cats->app_name = 'fm_vendor';
 
-                       $this->acl2                     = 
CreateObject($this->currentapp.'.acl2');
+                       $this->acl2             = 
CreateObject($this->currentapp.'.acl2');
                        $this->acl2_location= '.r_agreement';
 
                        $this->acl_read         = 
$this->acl2->check($this->acl2_location,1);
@@ -397,7 +397,7 @@
                        {
                                foreach($list as $entry)
                                {
-                                       $content[$j]['id']                      
= $entry['id'];
+                                       $content[$j]['id']              = 
$entry['id'];
                                        $content[$j]['item_id']         = 
$entry['item_id'];
                                        $content[$j]['index_count']     = 
$entry['index_count'];
                                        $content[$j]['cost']            = 
$entry['cost'];
@@ -519,8 +519,14 @@
 
                                if ($values['save'] || $values['apply']):
                                {
-                                       $values['vendor_id']            = 
get_var('vendor_id',array('POST'));
-                                       $values['vendor_name']          = 
get_var('vendor_name',array('POST'));
+                                       $values['customer_id']          = 
get_var('tenant_id',array('POST'));
+                                       $values['customer_name']        = 
get_var('last_name',array('POST'));
+                                       $first_name                     = 
get_var('first_name',array('POST'));
+                                       if($first_name)
+                                       {
+                                               $values['customer_name'] = 
$first_name . ' ' . $values['customer_name'];
+                                       }
+                                                                               
                                        $values['b_account_id']         = 
get_var('b_account_id',array('POST'));
                                        $values['b_account_name']       = 
get_var('b_account_name',array('POST'));
                                        $values['start_date']           = 
get_var('start_date',array('POST'));
@@ -693,10 +699,12 @@
                                'role'                          => $this->role
                        );
 
-
-                       
$vendor_data=$this->bocommon->initiate_ui_vendorlookup(array(
-                                               'vendor_id'             => 
$r_agreement['vendor_id'],
-                                               'vendor_name'   => 
$r_agreement['vendor_name']));
+                       
$tenant_data=$this->bocommon->initiate_ui_tenant_lookup(array(
+                                               'tenant_id'     => 
$r_agreement['customer_id'],
+                                               'last_name'     => 
$r_agreement['last_name'],
+                                               'first_name'    => 
$r_agreement['first_name'],
+                                               'role'          => 'customer')
+                                               );
 
                        
$b_account_data=$this->bocommon->initiate_ui_budget_account_lookup(array(
                                                'b_account_id'          => 
$r_agreement['b_account_id'],
@@ -852,8 +860,8 @@
                                'lang_termination_date_statustext'              
=> lang('Select the estimated termination date'),
                                'lang_termination_date'                         
        => lang('termination date'),
                                'value_termination_date'                        
        => $r_agreement['termination_date'],
-
-                               'vendor_data'                                   
=> $vendor_data,
+                               
+                               'tenant_data'                                   
=> $tenant_data,
                                'b_account_data'                                
=> $b_account_data,
                                'lang_name'                                     
        => lang('name'),
                                'lang_name_statustext'                  => 
lang('name'),
@@ -1345,6 +1353,13 @@
                                                'vendor_name'   => 
$r_agreement['vendor_name'],
                                                'type'                  => 
'view'));
 
+                       
$tenant_data=$this->bocommon->initiate_ui_tenant_lookup(array(
+                                               'tenant_id'     => 
$r_agreement['customer_id'],
+                                               'last_name'     => 
$r_agreement['last_name'],
+                                               'first_name'    => 
$r_agreement['first_name'],
+                                               'role'          => 'customer',
+                                               'type'          => 'view'));
+
                        
$b_account_data=$this->bocommon->initiate_ui_budget_account_lookup(array(
                                                'b_account_id'          => 
$r_agreement['b_account_id'],
                                                'b_account_name'        => 
$r_agreement['b_account_name'],
@@ -1433,7 +1448,7 @@
                                'lang_termination_date'                 => 
lang('termination date'),
                                'value_termination_date'                => 
$r_agreement['termination_date'],
 
-                               'vendor_data'                                   
=> $vendor_data,
+                               'tenant_data'                                   
=> $tenant_data,
                                'b_account_data'                                
=> $b_account_data,
                                'lang_name'                                     
        => lang('name'),
                                'value_name'                                    
=> $r_agreement['name'],
@@ -1717,47 +1732,45 @@
                                'value_input_text'                      => 
$values['input_text'],
                                'lang_input_name_statustext'            => 
lang('enter the input text for records'),
 
-                               'lang_id_attribtext'            => lang('Enter 
the attribute ID'),
-                               'lang_entity_statustext'        => lang('Select 
a r_agreement type'),
+                               'lang_id_attribtext'                    => 
lang('Enter the attribute ID'),
+                               'lang_entity_statustext'                => 
lang('Select a r_agreement type'),
 
                                'lang_statustext'                       => 
lang('Statustext'),
-                               'lang_statustext_attribtext'=> lang('Enter a 
statustext for the inputfield in forms'),
+                               'lang_statustext_attribtext'            => 
lang('Enter a statustext for the inputfield in forms'),
                                'value_statustext'                      => 
$values['statustext'],
 
-                               'lang_done_attribtext'          => lang('Back 
to the list'),
-                               'lang_save_attribtext'          => lang('Save 
the attribute'),
+                               'lang_done_attribtext'                  => 
lang('Back to the list'),
+                               'lang_save_attribtext'                  => 
lang('Save the attribute'),
 
                                'lang_datatype'                         => 
lang('Datatype'),
-                               'lang_datatype_statustext'      => lang('Select 
a datatype'),
+                               'lang_datatype_statustext'              => 
lang('Select a datatype'),
                                'lang_no_datatype'                      => 
lang('No datatype'),
                                'datatype_list'                         => 
$this->bocommon->select_datatype($column_type),
 
                                'lang_precision'                        => 
lang('Precision'),
-                               'lang_precision_statustext'     => lang('enter 
the record length'),
+                               'lang_precision_statustext'             => 
lang('enter the record length'),
                                'value_precision'                       => 
$column_precision,
 
                                'lang_scale'                            => 
lang('scale'),
-                               'lang_scale_statustext'         => lang('enter 
the scale if type is decimal'),
+                               'lang_scale_statustext'                 => 
lang('enter the scale if type is decimal'),
                                'value_scale'                           => 
$column_scale,
 
                                'lang_default'                          => 
lang('default'),
-                               'lang_default_statustext'       => lang('enter 
the default value'),
+                               'lang_default_statustext'               => 
lang('enter the default value'),
                                'value_default'                         => 
$column_default,
 
                                'lang_nullable'                         => 
lang('Nullable'),
-                               'lang_nullable_statustext'      => lang('Chose 
if this column is nullable'),
-                               'lang_select_nullable'          => lang('Select 
nullable'),
+                               'lang_nullable_statustext'              => 
lang('Chose if this column is nullable'),
+                               'lang_select_nullable'                  => 
lang('Select nullable'),
                                'nullable_list'                         => 
$this->bocommon->select_nullable($column_nullable),
 
                                'value_list'                            => 
$values['list'],
-                               'lang_list'                                     
=> lang('show in list'),
-                               'lang_list_statustext'          => lang('check 
to show this attribute in location list'),
+                               'lang_list'                             => 
lang('show in list'),
+                               'lang_list_statustext'                  => 
lang('check to show this attribute in location list'),
 
                                'value_search'                          => 
$values['search'],
-                               'lang_include_search'           => 
lang('Include in search'),
-                               'lang_include_search_statustext'=> lang('check 
to show this attribute in location list'),
-
-
+                               'lang_include_search'                   => 
lang('Include in search'),
+                               'lang_include_search_statustext'        => 
lang('check to show this attribute in location list'),
                        );
        //html_print_r($data);
 
Index: property/setup/tables_current.inc.php
diff -u property/setup/tables_current.inc.php:1.40 
property/setup/tables_current.inc.php:1.41
--- property/setup/tables_current.inc.php:1.40  Sun Feb  5 20:07:35 2006
+++ property/setup/tables_current.inc.php       Mon Feb 13 14:40:56 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.40 2006/02/05 20:07:35 
sigurdne Exp $
+       * @version $Id: tables_current.inc.php,v 1.41 2006/02/13 14:40:56 
sigurdne Exp $
        */
 
        $phpgw_baseline = array(
@@ -1992,5 +1992,120 @@
                        'fk' => array(),
                        'ix' => array(),
                        'uc' => array()
+               ),
+
+               'fm_r_agreement' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'int', 'precision' => 
4,'nullable' => False,'default' => '0'),
+                               'custom_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                               'customer_name' => array('type' => 'varchar', 
'precision' => 255,'nullable' => True),
+                               'name' => array('type' => 'varchar', 
'precision' => 100,'nullable' => False),
+                               'descr' => array('type' => 'text','nullable' => 
True),
+                               'status' => array('type' => 'varchar', 
'precision' => 10,'nullable' => True),
+                               'category' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                               'member_of' => array('type' => 
'text','nullable' => True),
+                               'entry_date' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                               'start_date' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                               'end_date' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                               'termination_date' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                               'user_id' => array('type' => 'int', 'precision' 
=> 4,'nullable' => True),
+                               'actual_cost' => array('type' => 'decimal', 
'precision' => 20, 'scale' => 2,'nullable' => True),
+                               'account_id' => array('type' => 'varchar', 
'precision' => 20,'nullable' => True)
+                       ),
+                       'pk' => array('id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
+
+               'fm_r_agreement_attribute' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'int', 'precision' => 
4,'nullable' => False,'default' => '0'),
+                               'attrib_detail' => array('type' => 'int', 
'precision' => 2,'nullable' => False,'default' => '0'),
+                               'list' => array('type' => 'int', 'precision' => 
2,'nullable' => True),
+                               'location_form' => array('type' => 'int', 
'precision' => 2,'nullable' => True),
+                               'lookup_form' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                               'column_name' => array('type' => 'varchar', 
'precision' => 20,'nullable' => False),
+                               'input_text' => array('type' => 'varchar', 
'precision' => 50,'nullable' => False),
+                               'statustext' => array('type' => 'varchar', 
'precision' => 100,'nullable' => False),
+                               'size' => array('type' => 'int', 'precision' => 
4,'nullable' => True),
+                               'datatype' => array('type' => 'varchar', 
'precision' => 10,'nullable' => False),
+                               'attrib_sort' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                               'precision_' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                               'scale' => array('type' => 'int', 'precision' 
=> 4,'nullable' => True),
+                               'default_value' => array('type' => 'varchar', 
'precision' => 18,'nullable' => True),
+                               'nullable' => array('type' => 'varchar', 
'precision' => 5,'nullable' => False,'default' => 'True'),
+                               'search' => array('type' => 'int', 'precision' 
=> 2,'nullable' => True)
+                       ),
+                       'pk' => array('id','attrib_detail'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
+
+               'fm_r_agreement_category' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'int', 'precision' => 
4,'nullable' => False,'default' => '0'),
+                               'descr' => array('type' => 'varchar', 
'precision' => 50,'nullable' => True)
+                       ),
+                       'pk' => array('id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
+
+               'fm_r_agreement_choice' => array(
+                       'fd' => array(
+                               'attrib_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False,'default' => '0'),
+                               'id' => array('type' => 'int', 'precision' => 
4,'nullable' => False,'default' => '0'),
+                               'value' => array('type' => 'varchar', 
'precision' => 255,'nullable' => True),
+                               'attrib_detail' => array('type' => 'int', 
'precision' => 2,'nullable' => False,'default' => '0')
+                       ),
+                       'pk' => array('attrib_id','id','attrib_detail'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
+
+               'fm_r_agreement_detail' => array(
+                       'fd' => array(
+                               'agreement_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False,'default' => '0'),
+                               'id' => array('type' => 'int', 'precision' => 
4,'nullable' => False,'default' => '0'),
+                               'location_code' => array('type' => 'varchar', 
'precision' => 30,'nullable' => True),
+                               'address' => array('type' => 'varchar', 
'precision' => 150,'nullable' => True),
+                               'p_num' => array('type' => 'varchar', 
'precision' => 15,'nullable' => True),
+                               'p_entity_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True,'default' => '0'),
+                               'p_cat_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True,'default' => '0'),
+                               'descr' => array('type' => 'text','nullable' => 
True),
+                               'unit' => array('type' => 'varchar', 
'precision' => 10,'nullable' => True),
+                               'quantity' => array('type' => 'decimal', 
'precision' => 20, 'scale' => 2,'nullable' => True),
+                               'frequency' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                               'user_id' => array('type' => 'int', 'precision' 
=> 4,'nullable' => True),
+                               '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)
+                       ),
+                       'pk' => array('agreement_id','id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
+
+               'fm_r_agreement_pricing' => array(
+                       'fd' => array(
+                               'agreement_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False,'default' => '0'),
+                               'item_id' => array('type' => 'int', 'precision' 
=> 4,'nullable' => False,'default' => '0'),
+                               'id' => array('type' => 'int', 'precision' => 
4,'nullable' => False,'default' => '0'),
+                               'current_index' => array('type' => 'int', 
'precision' => 2,'nullable' => True),
+                               'this_index' => array('type' => 'decimal', 
'precision' => 20, 'scale' => 4,'nullable' => True),
+                               'cost' => array('type' => 'decimal', 
'precision' => 20, 'scale' => 2,'nullable' => True),
+                               'index_date' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                               'user_id' => array('type' => 'int', 'precision' 
=> 4,'nullable' => True),
+                               'entry_date' => array('type' => 'int', 
'precision' => 4,'nullable' => True)
+                       ),
+                       'pk' => array('agreement_id','item_id','id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
                )
        );
Index: property/setup/tables_update.inc.php
diff -u property/setup/tables_update.inc.php:1.23 
property/setup/tables_update.inc.php:1.24
--- property/setup/tables_update.inc.php:1.23   Sun Feb 12 18:12:02 2006
+++ property/setup/tables_update.inc.php        Mon Feb 13 14:40:56 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.23 2006/02/12 18:12:02 
sigurdne Exp $
+       * @version $Id: tables_update.inc.php,v 1.24 2006/02/13 14:40:56 
sigurdne Exp $
        */
 
        /**
@@ -839,7 +839,8 @@
                        'fm_r_agreement', array(
                                'fd' => array(
                                        'id' => array('type' => 'int', 
'precision' => 4,'nullable' => False,'default' => '0'),
-                                       'vendor_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                                       'customer_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                                       'customer_name' => array('type' => 
'varchar', 'precision' => 255,'nullable' => True),
                                        'name' => array('type' => 'varchar', 
'precision' => 100,'nullable' => False),
                                        'descr' => array('type' => 
'text','nullable' => True),
                                        'status' => array('type' => 'varchar', 
'precision' => 10,'nullable' => True),
Index: property/templates/base/r_agreement.xsl
diff -u property/templates/base/r_agreement.xsl:1.1 
property/templates/base/r_agreement.xsl:1.2
--- property/templates/base/r_agreement.xsl:1.1 Sun Feb 12 18:12:02 2006
+++ property/templates/base/r_agreement.xsl     Mon Feb 13 14:40:56 2006
@@ -297,7 +297,7 @@
                                        <xsl:call-template name="cat_select"/>
                                </td>
                        </tr>
-                       <xsl:call-template name="vendor_form"/>
+                       <xsl:call-template name="tenant_form"/>
                        <xsl:call-template name="b_account_form"/>
                        <tr>
                                <td valign="top">
@@ -795,7 +795,7 @@
                                                </xsl:choose>
                                        </xsl:for-each>
                                </tr>
-                               <xsl:call-template name="vendor_view"/>
+                               <xsl:call-template name="tenant_view"/>
                                <xsl:call-template name="b_account_view"/>
                                <tr>
                                        <td valign="top">
Index: property/templates/default/r_agreement.xsl
diff -u property/templates/default/r_agreement.xsl:1.1 
property/templates/default/r_agreement.xsl:1.2
--- property/templates/default/r_agreement.xsl:1.1      Sun Feb 12 18:12:02 2006
+++ property/templates/default/r_agreement.xsl  Mon Feb 13 14:40:56 2006
@@ -297,7 +297,7 @@
                                        <xsl:call-template name="cat_select"/>
                                </td>
                        </tr>
-                       <xsl:call-template name="vendor_form"/>
+                       <xsl:call-template name="tenant_form"/>
                        <xsl:call-template name="b_account_form"/>
                        <tr>
                                <td valign="top">
@@ -795,7 +795,7 @@
                                                </xsl:choose>
                                        </xsl:for-each>
                                </tr>
-                               <xsl:call-template name="vendor_view"/>
+                               <xsl:call-template name="tenant_view"/>
                                <xsl:call-template name="b_account_view"/>
                                <tr>
                                        <td valign="top">




reply via email to

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