phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc class.uientity.inc.php, 1.7 class.uiinve


From: ceb
Subject: [Phpgroupware-cvs] property/inc class.uientity.inc.php, 1.7 class.uiinvestment.inc.php, 1.5 class.uigab.inc.php, 1.7 class.uidrawing.inc.php, 1.5 class.uicategory.inc.php, 1.5 class.uicustom.inc.php, 1.5 class.uidocument.inc.php, 1.5 class.uiinvoice.inc.php, 1.13 class.uipricebook.inc.php, 1.7 class.uiproject.inc.php, 1.11 class.uirequest.inc.php, 1.6 class.uis_agreement.inc.php, 1.14 class.uib_account.inc.php, 1.6 class.uip_of_town.inc.php, 1.5 class.uilookup.inc.php, 1.8 class.uimeter.inc.php, 1.5 class.uilocation.inc.php, 1.7 class.uiadmin_entity.inc.php, 1.5 class.sotemplate.inc.php, 1.3 class.sotts.inc.php, 1.3 class.sotts2.inc.php, 1.4 class.sostandard_entity.inc.php, 1.3 class.sostandard_3.inc.php, 1.5 class.sorequest.inc.php, 1.3 class.sos_agreement.inc.php, 1.11 class.sostandard_2.inc.php, 1.3 class.sowo_hour.inc.php, 1.3 class.soworkorder.inc.php, 1.4 class.uiadmin_location.inc.php, 1.5 class.uiagreement.inc.php, 1.6 class.uialarm.inc.php, 1.6 class.uistandard_2.inc.php, 1.5 class.uiadmin.inc.php, 1.6 class. uiXport.inc.php, 1.8 class.uiactor.inc.php, 1.7 class.uiasync.inc.php, 1.6 class.uitts.inc.php, 1.6 class.uiworkorder.inc.php, 1.5 hook_admin.inc.php, 1.10 hook_help.inc.php, 1.3 class.uiwo_hour.inc.php, 1.6 class.soproject.inc.php, 1.8 class.uistandard_entity.inc.php, 1.5 class.uitemplate.inc.php, 1.5 hook_home.inc.php, 1.3 hook_manual.inc.php, 1.4 hook_preferences.inc.php, 1.3 hook_settings.inc.php, 1.4 class.uistandard_3.inc.php, 1.5 class.bometer.inc.php, 1.3 class.bocommon.inc.php, 1.8 class.bocustom.inc.php, 1.3 class.bodocument.inc.php, 1.3 class.bocategory.inc.php, 1.3 class.bob_account.inc.php, 1.3 class.boalarm.inc.php, 1.8 class.boasync.inc.php, 1.2 class.bodrawing.inc.php, 1.3 class.boentity.inc.php, 1.4 class.sopricebook.inc.php, 1.8 class.bop_of_town.inc.php, 1.3 class.bopricebook.inc.php, 1.4 class.bolocation.inc.php, 1.4 class.boinvoice.inc.php, 1.12 class.bogab.inc.php, 1.3 class.boinvestment.inc.php, 1.3 class.boagreement.inc.php, 1.3 class.boadmin_location.inc.php, 1.3 class.boactor.inc.php ,1.4 class.boadmin.inc.php,1.3 class.boadmin_entity.inc.php,! 1.4 clas
Date: Thu, 24 Feb 2005 14:27:41 -0000

Update of property/inc

Modified Files:
     Branch: MAIN
            class.uientity.inc.php lines: +58 -34
            class.uiinvestment.inc.php lines: +29 -19
            class.uigab.inc.php lines: +30 -20
            class.uidrawing.inc.php lines: +40 -31
            class.uicategory.inc.php lines: +28 -18
            class.uicustom.inc.php lines: +31 -20
            class.uidocument.inc.php lines: +97 -67
            class.uiinvoice.inc.php lines: +34 -24
            class.uipricebook.inc.php lines: +33 -23
            class.uiproject.inc.php lines: +97 -52
            class.uirequest.inc.php lines: +32 -22
            class.uis_agreement.inc.php lines: +52 -44
            class.uib_account.inc.php lines: +71 -22
            class.uip_of_town.inc.php lines: +29 -20
            class.uilookup.inc.php lines: +32 -22
            class.uimeter.inc.php lines: +29 -19
            class.uilocation.inc.php lines: +94 -30
            class.uiadmin_entity.inc.php lines: +38 -25
            class.sotemplate.inc.php lines: +28 -17
            class.sotts.inc.php lines: +27 -16
            class.sotts2.inc.php lines: +26 -15
            class.sostandard_entity.inc.php lines: +28 -19
            class.sostandard_3.inc.php lines: +27 -17
            class.sorequest.inc.php lines: +27 -16
            class.sos_agreement.inc.php lines: +94 -41
            class.sostandard_2.inc.php lines: +27 -17
            class.sowo_hour.inc.php lines: +26 -15
            class.soworkorder.inc.php lines: +28 -17
            class.uiadmin_location.inc.php lines: +32 -22
            class.uiagreement.inc.php lines: +50 -44
            class.uialarm.inc.php lines: +103 -79
            class.uistandard_2.inc.php lines: +28 -18
            class.uiadmin.inc.php lines: +54 -29
            class.uiXport.inc.php lines: +31 -21
            class.uiactor.inc.php lines: +50 -26
            class.uiasync.inc.php lines: +41 -19
            class.uitts.inc.php lines: +31 -21
            class.uiworkorder.inc.php lines: +67 -24
            hook_admin.inc.php lines: +21 -17
            hook_help.inc.php lines: +25 -16
            class.uiwo_hour.inc.php lines: +49 -27
            class.soproject.inc.php lines: +32 -19
            class.uistandard_entity.inc.php lines: +30 -20
            class.uitemplate.inc.php lines: +31 -21
            hook_home.inc.php lines: +20 -16
            hook_manual.inc.php lines: +20 -16
            hook_preferences.inc.php lines: +20 -19
            hook_settings.inc.php lines: +21 -16
            class.uistandard_3.inc.php lines: +28 -18
            class.bometer.inc.php lines: +25 -15
            class.bocommon.inc.php lines: +44 -24
            class.bocustom.inc.php lines: +25 -16
            class.bodocument.inc.php lines: +33 -16
            class.bocategory.inc.php lines: +25 -15
            class.bob_account.inc.php lines: +25 -15
            class.boalarm.inc.php lines: +61 -39
            class.boasync.inc.php lines: +25 -15
            class.bodrawing.inc.php lines: +25 -15
            class.boentity.inc.php lines: +54 -18
            class.sopricebook.inc.php lines: +93 -62
            class.bop_of_town.inc.php lines: +25 -16
            class.bopricebook.inc.php lines: +25 -15
            class.bolocation.inc.php lines: +43 -18
            class.boinvoice.inc.php lines: +27 -212
            class.bogab.inc.php lines: +25 -15
            class.boinvestment.inc.php lines: +25 -15
            class.boagreement.inc.php lines: +68 -31
            class.boadmin_location.inc.php lines: +25 -15
            class.boactor.inc.php lines: +52 -16
            class.boadmin.inc.php lines: +33 -17
            class.boadmin_entity.inc.php lines: +25 -15
            class.boXport.inc.php lines: +25 -17
            class.acl2.inc.php lines: +40 -19
            class.boproject.inc.php lines: +25 -15
            class.bolookup.inc.php lines: +25 -15
            class.socommon.inc.php lines: +28 -17
            class.socustom.inc.php lines: +27 -17
            class.sodocument.inc.php lines: +36 -18
            class.socategory.inc.php lines: +27 -16
            class.borequest.inc.php lines: +25 -15
            class.soalarm.inc.php lines: +42 -33
            class.soasync.inc.php lines: +29 -16
            class.sodrawing.inc.php lines: +27 -16
            class.soentity.inc.php lines: +37 -20
            class.solookup.inc.php lines: +34 -24
            class.someter.inc.php lines: +27 -16
            class.sop_of_town.inc.php lines: +27 -17
            class.solocation.inc.php lines: +33 -23
            class.soinvoice.inc.php lines: +251 -20
            class.sogab.inc.php lines: +30 -20
            class.soinvestment.inc.php lines: +34 -23
            class.soagreement.inc.php lines: +85 -41
            class.sob_account.inc.php lines: +28 -16
            class.soadmin_location.inc.php lines: +39 -29
            class.botts.inc.php lines: +25 -15
            class.bowo_hour.inc.php lines: +25 -15
            class.bostandard_entity.inc.php lines: +25 -15
            class.bostandard_3.inc.php lines: +25 -15
            class.bos_agreement.inc.php lines: +56 -20
            class.bostandard_2.inc.php lines: +25 -15
            class.boworkorder.inc.php lines: +25 -15
            class.botemplate.inc.php lines: +25 -15
            class.soactor.inc.php lines: +62 -21
            class.soadmin.inc.php lines: +26 -15
            class.excel.inc.php lines: +21 -17
            class.soXport.inc.php lines: +26 -15
            class.soadmin_entity.inc.php lines: +39 -25
            class.historylog.inc.php lines: +26 -23
            class.menu.inc.php lines: +43 -16
            class.pdf.inc.php lines: +19 -0

Log Message:
committed prop-18-branch version to head

====================================================
Index: property/inc/class.uientity.inc.php
diff -u property/inc/class.uientity.inc.php:1.6 
property/inc/class.uientity.inc.php:1.7
--- property/inc/class.uientity.inc.php:1.6     Sat Oct 30 16:13:57 2004
+++ property/inc/class.uientity.inc.php Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage entity
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uientity
        {
@@ -102,7 +112,9 @@

                function excel()
                {
-                       $GLOBALS['phpgw_info']['flags']['noframework'] = True;
+                       $GLOBALS['phpgw_info']['flags'][noheader] = True;
+                       $GLOBALS['phpgw_info']['flags'][nofooter] = True;
+
                        require('PEAR.php');
                        $xls            = 
CreateObject($this->currentapp.'.excel');

@@ -200,17 +212,19 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
$function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('columns' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function view_file()
                {
+                       $GLOBALS['phpgw_info']['flags'][noheader] = True;
+                       $GLOBALS['phpgw_info']['flags'][nofooter] = True;
+
                        if(!$this->acl_read)
                        {
                                
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uilocation.stop&perm=1&acl_location='
 . $this->acl2_location);
                        }

-                       $GLOBALS['phpgw_info']['flags']['noframework'] = True;
                        $file_name      = 
urldecode(get_var('file_name',array('POST','GET')));
                        $loc1           = get_var('loc1',array('POST','GET'));
                        $id             = get_var('id',array('POST','GET'));
@@ -223,27 +237,22 @@
                                'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
-                               $filename       = current(explode('.', 
basename($file_name)));
-
-                               $filetype       = 
$this->bo->vfs->file_type(array(
-                                                       'string' => $file,
-                                                       'relatives' => 
Array(RELATIVE_NONE)));
-
                                $size           = 
$this->bo->vfs->get_size(array(
                                                        'string' => $file,
                                                        'relatives' => 
Array(RELATIVE_NONE),
                                                        'checksubdirs' => 
True));

-                               $browser = CreateObject('phpgwapi.browser');
-                               
$browser->content_header($filename,$filetype,$size);
-
                                $document= $this->bo->vfs->read(array(
                                        'string' => $file,
                                        'relatives' => Array(RELATIVE_NONE)));

+                               $filename       = 
basename($values['document_name']);
+                               $filetype = array_pop(explode('.', 
basename($file)));
+                               $browser = CreateObject('phpgwapi.browser');
+                               
$browser->content_header($filename,$filetype,$size);
+
                                echo $document;

-//                             flush();
                        }
                }

@@ -495,12 +504,12 @@

                                $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname;
                                
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('empty' => $data));
-                       //      $GLOBALS['phpgw']->xslttpl->pp();
+                               $GLOBALS['phpgw']->xslttpl->pp();
                        }
                        else
                        {
                                
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-                       //      $GLOBALS['phpgw']->xslttpl->pp();
+                               $GLOBALS['phpgw']->xslttpl->pp();
                                $this->save_sessiondata();
                        }
                }
@@ -603,7 +612,6 @@
                                $lookup_tenant=True;
                        }

-//_debug_array($values);
                        if ($values['save'])
                        {
                                if(!$values['location'])
@@ -838,8 +846,24 @@
                                
$values['files'][$i]['file_name']=urlencode($values['files'][$i]['name']);
                        }

+                       $project_link_data = array
+                       (
+                               'menuaction'            => 
$this->currentapp.'.uiproject.edit',
+                               'bypass'                        => true,
+                               'location_code'         => 
$values['location_code'],
+                               'p_num'                         => 
$values['p_num'],
+                               'p_entity_id'           => 
$values['p_entity_id'],
+                               'p_cat_id'                      => 
$values['p_cat_id'],
+                               'tenant_id'                     => 
$values['tenant_id'],
+                               'origin'                        => 'entity_' . 
$this->entity_id . '_' . $this->cat_id,
+                               'origin_id'                     => $id
+                       );
+
                        $data = array
                        (
+                               'start_project'                                 
=> $category['start_project'],
+                               'lang_start_project'                    => 
lang('start project'),
+                               'project_link'                                  
=> $GLOBALS['phpgw']->link('/index.php',$project_link_data),
                                'fileupload'                                    
=> $category['fileupload'],
                                'link_view_file'                                
=> $GLOBALS['phpgw']->link('/index.php',$link_file_data),
                                'link_to_files'                                 
=> $link_to_files,
@@ -898,7 +922,7 @@
 //_debug_array($attributes_values);
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -942,7 +966,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function view()
@@ -1104,7 +1128,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }
        }
 ?>

====================================================
Index: property/inc/class.uiinvestment.inc.php
diff -u property/inc/class.uiinvestment.inc.php:1.4 
property/inc/class.uiinvestment.inc.php:1.5
--- property/inc/class.uiinvestment.inc.php:1.4 Sat Oct 30 16:13:57 2004
+++ property/inc/class.uiinvestment.inc.php     Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage eco
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uiinvestment
        {
@@ -280,7 +290,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -465,7 +475,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('history' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
 //                     $this->save_sessiondata();
                }

@@ -636,7 +646,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add' 
=> $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -682,7 +692,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

        }

====================================================
Index: property/inc/class.uigab.inc.php
diff -u property/inc/class.uigab.inc.php:1.6 
property/inc/class.uigab.inc.php:1.7
--- property/inc/class.uigab.inc.php:1.6        Sat Oct 30 16:13:57 2004
+++ property/inc/class.uigab.inc.php    Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage location
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uigab
        {
@@ -293,7 +303,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_gab' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -520,7 +530,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_gab_detail' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -697,7 +707,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -741,7 +751,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function view()
@@ -813,7 +823,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }
        }
 ?>

====================================================
Index: property/inc/class.uidrawing.inc.php
diff -u property/inc/class.uidrawing.inc.php:1.4 
property/inc/class.uidrawing.inc.php:1.5
--- property/inc/class.uidrawing.inc.php:1.4    Sat Oct 30 16:13:57 2004
+++ property/inc/class.uidrawing.inc.php        Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage document
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uidrawing
        {
@@ -341,7 +351,7 @@
                                'lang_user_statustext'                  => 
lang('Select the user the drawing belongs to. To do not use a category select 
NO USER'),
                                'select_user_name'                              
=> 'filter',
                                'lang_no_user'                                  
=> lang('No user'),
-                               'user_list'                                     
        => $this->bocommon->get_user_list('filter',$this->filter),
+                               'user_list'                                     
        => 
$this->bocommon->get_user_list('filter',$this->filter,$extra=False,$default=False,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1),

                                'lang_searchfield_statustext'   => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
                                'lang_searchbutton_statustext'  => lang('Submit 
the search string'),
@@ -357,19 +367,21 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_drawing' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }


                function view_file($file_array='')
                {
+                       $GLOBALS['phpgw_info']['flags'][noheader] = True;
+                       $GLOBALS['phpgw_info']['flags'][nofooter] = True;
+
                        if(!$this->acl_read)
                        {
                                
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uilocation.stop&perm=1&acl_location='
 . $this->acl2_location);
                        }

-                       $GLOBALS['phpgw_info']['flags']['noframework'] = True;
                        $drawing_id             = 
get_var('drawing_id',array('POST','GET'));
                        $values = $this->bo->read_single($drawing_id);

@@ -380,27 +392,24 @@
                                'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
-                               $filename       = current(explode('.', 
basename($values['drawing_name'])));

-                               $filetype       = 
$this->bo->vfs->file_type(array(
-                                                       'string' => $file,
-                                                       'relatives' => 
Array(RELATIVE_NONE)));

                                $size           = 
$this->bo->vfs->get_size(array(
                                                        'string' => $file,
                                                        'relatives' => 
Array(RELATIVE_NONE),
                                                        'checksubdirs' => 
True));

-                               $browser = CreateObject('phpgwapi.browser');
-                               
$browser->content_header($filename,$filetype,$size);
-
                                $document= $this->bo->vfs->read(array(
                                        'string' => $file,
                                        'relatives' => Array(RELATIVE_NONE)));

+                               $filename       = 
basename($values['document_name']);
+                               $filetype = array_pop(explode('.', 
basename($file)));
+                               $browser = CreateObject('phpgwapi.browser');
+                               
$browser->content_header($filename,$filetype,$size);
+
                                echo $document;

-                               flush();
                        }
                }

@@ -645,7 +654,7 @@
                                'lang_user_statustext'                  => 
lang('Select the coordinator the drawing belongs to. To do not use a category 
select NO USER'),
                                'select_user_name'                              
=> 'values[coordinator]',
                                'lang_no_user'                                  
=> lang('Select coordinator'),
-                               'user_list'                                     
        => $this->bocommon->get_user_list('select',$values['coordinator']),
+                               'user_list'                                     
        => 
$this->bocommon->get_user_list('select',$values['coordinator'],$extra=False,$default=False,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1),

                                'status_list'                                   
=> $this->bo->select_status_list('select',$values['status']),
                                'select_status_name'                    => 
'values[status]',
@@ -664,7 +673,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -706,7 +715,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function view()
@@ -844,7 +853,7 @@
                                'lang_user_statustext'                  => 
lang('Select the coordinator the drawing belongs to. To do not use a category 
select NO USER'),
                                'select_user_name'                              
=> 'values[coordinator]',
                                'lang_no_user'                                  
=> lang('Select coordinator'),
-                               'user_list'                                     
        => $this->bocommon->get_user_list('select',$values['coordinator']),
+                               'user_list'                                     
        => 
$this->bocommon->get_user_list('select',$values['coordinator'],$extra=False,$default=False,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1),

                                'status_list'                                   
=> $this->bo->select_status_list('select',$values['status']),
                                'select_status_name'                    => 
'values[status]',
@@ -867,7 +876,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }



====================================================
Index: property/inc/class.uicategory.inc.php
diff -u property/inc/class.uicategory.inc.php:1.4 
property/inc/class.uicategory.inc.php:1.5
--- property/inc/class.uicategory.inc.php:1.4   Sat Oct 30 16:13:57 2004
+++ property/inc/class.uicategory.inc.php       Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uicategory
        {
@@ -157,7 +167,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -241,7 +251,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -282,7 +292,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

        }

====================================================
Index: property/inc/class.uicustom.inc.php
diff -u property/inc/class.uicustom.inc.php:1.4 
property/inc/class.uicustom.inc.php:1.5
--- property/inc/class.uicustom.inc.php:1.4     Sat Oct 30 16:13:57 2004
+++ property/inc/class.uicustom.inc.php Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage custom
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uicustom
        {
@@ -283,7 +293,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('custom') . ': ' . lang('list custom');

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function edit()
@@ -405,7 +415,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('custom') . ': ' . ($custom_id?lang('edit custom'):lang('add custom'));

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -444,7 +454,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -547,12 +557,13 @@
                        );

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function excel()
                {
-                       $GLOBALS['phpgw_info']['flags']['noframework'] = True;
+                       $GLOBALS['phpgw_info']['flags'][noheader] = True;
+                       $GLOBALS['phpgw_info']['flags'][nofooter] = True;
                        require('PEAR.php');
                        $xls            = 
CreateObject($this->currentapp.'.excel');


====================================================
Index: property/inc/class.uidocument.inc.php
diff -u property/inc/class.uidocument.inc.php:1.4 
property/inc/class.uidocument.inc.php:1.5
--- property/inc/class.uidocument.inc.php:1.4   Sat Oct 30 16:13:57 2004
+++ property/inc/class.uidocument.inc.php       Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage document
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uidocument
        {
@@ -69,6 +79,7 @@
                        $this->status_id                        = 
$this->bo->status_id;
                        $this->entity_id                        = 
$this->bo->entity_id;
                        $this->doc_type                         = 
$this->bo->doc_type;
+                       $this->query_location           = 
$this->bo->query_location;

                        $this->menu->sub                        ='document';
                }
@@ -85,7 +96,8 @@
                                'cat_id'        => $this->cat_id,
                                'status_id'     => $this->status_id,
                                'entity_id'     => $this->entity_id,
-                               'doc_type'      => $this->doc_type
+                               'doc_type'      => $this->doc_type,
+                               'query_location'        => $this->query_location
                        );
                        $this->bo->save_sessiondata($data);
                }
@@ -138,29 +150,31 @@

                                                
if($document_entry['query_location'][$uicols['name'][$k]])
                                                {
-                                                       
$content[$j]['row'][$k]['statustext']           = lang('search');
-                                                       
$content[$j]['row'][$k]['text']                         = 
$document_entry[$uicols['name'][$k]];
-                                                       
$content[$j]['row'][$k]['link']                         = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidocument.index&query='
 . $document_entry['query_location'][$uicols['name'][$k]] . '&lookup=' . 
$lookup . '&entity_id=' . $document_entry['p_entity_id'] . '&cat_id=' . 
$document_entry['p_cat_id']);
+
+                                                       $content[$j]['row'][]= 
array(
+                                                               'statustext'    
=> lang('search'),
+                                                               'text'          
        => $document_entry[$uicols['name'][$k]],
+                                                               'link'          
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidocument.index&query='
 . $document_entry['query_location'][$uicols['name'][$k]] . '&entity_id=' . 
$document_entry['p_entity_id'] . '&cat_id=' . $document_entry['p_cat_id'])
+                                                               );
                                                }
                                                else
                                                {
-                                                       
$content[$j]['row'][$k]['value']                        = 
$document_entry[$uicols['name'][$k]];
-                                                       
$content[$j]['row'][$k]['name']                         = $uicols['name'][$k];
+                                                       $content[$j]['row'][]= 
array(
+                                                               'value'         
                => $document_entry[$uicols['name'][$k]],
+                                                               'name'          
        => $uicols['name'][$k],
+                                                               );
                                                }

                                        }
                                }

-                               if(!$lookup)
+                               if($this->acl_read)
                                {
-                                       if($this->acl_read)
-                                       {
-                                               
$content[$j]['row'][$k]['statustext']                   = lang('view documents 
for this location/entity');
-                                               $content[$j]['row'][$k]['text'] 
                                = lang('documents');
-                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidocument.list_doc&location_code='
 . $document_entry['location_code'] . '&p_num=' . $document_entry['p_num'] . 
'&entity_id=' . $document_entry['p_entity_id'] . '&cat_id=' . 
$document_entry['p_cat_id']);
-                                               $k++;
-
-                                       }
+                                       $content[$j]['row'][]= array(
+                                               'statustext'                    
=> lang('view documents for this location/entity'),
+                                               'text'                          
        => lang('documents'),
+                                               'link'                          
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidocument.list_doc&location_code='
 . $document_entry['location_code'] . '&p_num=' . $document_entry['p_num'] . 
'&entity_id=' . $document_entry['p_entity_id'] . '&cat_id=' . 
$document_entry['p_cat_id'] . '&doc_type=' . $this->doc_type)
+                                               );
                                }

                                $j++;
@@ -184,9 +198,9 @@
                                                                                
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uidocument.index',
                                                                                
                                                        'type_id'       
=>$type_id,
                                                                                
                                                        'query'         
=>$this->query,
-                                                                               
                                                        'lookup'        
=>$lookup,
                                                                                
                                                        'district_id'   => 
$this->district_id,
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
+                                                                               
                                                        'doc_type'              
=>$this->doc_type,
                                                                                
                                                        'entity_id'             
=>$this->entity_id)
                                                                                
));
                                        }
@@ -201,9 +215,9 @@
                                                                                
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uidocument.index',
                                                                                
                                                        'type_id'       
=>$type_id,
                                                                                
                                                        'query'         
=>$this->query,
-                                                                               
                                                        'lookup'        
=>$lookup,
                                                                                
                                                        'district_id'   => 
$this->district_id,
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
+                                                                               
                                                        'doc_type'              
=>$this->doc_type,
                                                                                
                                                        'entity_id'             
=>$this->entity_id)
                                                                                
));
                                        }
@@ -218,9 +232,9 @@
                                                                                
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uidocument.index',
                                                                                
                                                        'type_id'       
=>$type_id,
                                                                                
                                                        'query'         
=>$this->query,
-                                                                               
                                                        'lookup'        
=>$lookup,
                                                                                
                                                        'district_id'   => 
$this->district_id,
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
+                                                                               
                                                        'doc_type'              
=>$this->doc_type,
                                                                                
                                                        'entity_id'             
=>$this->entity_id)
                                                                                
));
                                        }
@@ -256,6 +270,7 @@
                                                'filter'                
=>$this->filter,
                                                'status_id'             
=>$this->status_id,
                                                'query'                 
=>$this->query,
+                                               'doc_type'              
=>$this->doc_type,
                                                'entity_id'             
=>$this->entity_id
                        );

@@ -277,8 +292,6 @@
                                'link_history'                                  
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidocument.index&cat_id='
 . $this->cat_id),
                                'lang_history_statustext'               => 
lang('search for history at this location'),
                                'lang_select'                                   
=> lang('select'),
-                               'lookup_action'                                 
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.edit'),
-                               'lookup'                                        
        => $lookup,
                                'links'                                         
        => $links,
                                'allow_allrows'                                 
=> false,
                                'start_record'                                  
=> $this->start,
@@ -299,6 +312,11 @@
                                'select_name'                                   
=> 'cat_id',
                                'cat_list'                                      
        => $cat_list,

+                               'lang_no_doc_type'                              
=> lang('no document type'),
+                               'lang_doc_type_statustext'              => 
lang('Select the document type the document belongs to.'),
+                               'doc_type'                                      
        => $this->bo->select_doc_type_list('filter',$this->doc_type),
+
+
                                'lang_status_statustext'                => 
lang('Select the status the document belongs to. To do not use a category 
select NO STATUS'),
                                'status_name'                                   
=> 'status_id',
                                'lang_no_status'                                
=> lang('No status'),
@@ -323,7 +341,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg . ' - ' . 
$appname_sub;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -362,6 +380,11 @@
                        
$GLOBALS['phpgw']->session->appsession('session_data','document_receipt','');

                        $location_code = 
get_var('location_code',array('POST','GET'));
+                       if($this->query_location)
+                       {
+                               $location_code = $this->query_location;
+                       }
+
                        $p_num = get_var('p_num',array('POST','GET'));

                        $location=$this->bo->read_location_data($location_code);
@@ -381,17 +404,10 @@
                                $appname_sub    = lang('location');
                        }

-                       
$entity_data[$this->entity_id]['p_cat_name']=$category['name'];
-
-                       
$location_data=$this->bolocation->initiate_ui_location(array(
-                                               'values'                => 
$location,
-                                               'type_id'               => 
count(explode('-',$location_code)),
-                                               'no_link'               => 
False, // disable lookup links for location type less than type_id
-                                               'tenant'                => 
False,
-                                               'lookup_type'   => 'view',
-                                               'lookup_entity' => 
$lookup_entity,
-                                               'entity_data'   => $entity_data
-                                               ));
+                       if($category['name'])
+                       {
+                               
$entity_data[$this->entity_id]['p_cat_name']=$category['name'];
+                       }

                        $this->config->read_repository();
                        $files_url = $this->config->config_data['files_url'];
@@ -466,7 +482,9 @@
                                                                                
                                                        'p_num'                 
=>$p_num,
                                                                                
                                                        'location_code' 
=>$location_code,
                                                                                
                                                        'filter'                
=>$this->filter,
-                                                                               
                                                        'query'                 
=>$this->query)
+                                                                               
                                                        'query'                 
=>$this->query,
+                                                                               
                                                        'query_location' 
=>$this->query_location
+                                                                               
                                                        )
                                                                                
)),
                                'lang_document_name'    => lang('Document 
name'),
                                'lang_doc_type'                 => lang('Doc 
type'),
@@ -509,9 +527,26 @@
                                                'doc_type'              
=>$this->doc_type,
                                                'location_code' 
=>$location_code,
                                                'filter'                
=>$this->filter,
-                                               'query'                 
=>$this->query
+                                               'query'                 
=>$this->query,
+                                               'query_location' 
=>$this->query_location
                        );

+
+                       
$location_data=$this->bolocation->initiate_ui_location(array(
+                                               'values'                => 
$location,
+                                               'type_id'               => 
count(explode('-',$location_code)),
+                                               'no_link'               => 
False, // disable lookup links for location type less than type_id
+                                               'tenant'                => 
False,
+                                               'lookup_type'   => 'view',
+                                               'lookup_entity' => 
$lookup_entity,
+                                               'entity_data'   => $entity_data,
+                                               'link_data'             => 
$link_data,
+                                               'query_link'    => True
+                                               ));
+
+//_debug_array($location_data);
+
+
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);

                        $data = array
@@ -571,18 +606,20 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg . ' - ' . 
$appname_sub;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_document' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

                function view_file()
                {
+                       $GLOBALS['phpgw_info']['flags'][noheader] = True;
+                       $GLOBALS['phpgw_info']['flags'][nofooter] = True;
+
                        if(!$this->acl_read)
                        {
                                
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uilocation.stop&perm=1&acl_location='
 . $this->acl2_location);
                        }

-                       $GLOBALS['phpgw_info']['flags']['noframework'] = True;
                        $document_id            = 
get_var('document_id',array('POST','GET'));
                        $p_num = get_var('p_num',array('POST','GET'));

@@ -600,34 +637,27 @@
                                $file   = $this->fakebase. SEP . 'document' . 
SEP .$values['location_data']['loc1'] . SEP . $values['document_name'];
                        }

-
-//echo 'file: ' . $file . '<br>';
                        if($this->bo->vfs->file_exists(array(
                                'string' => $file,
                                'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
-                               $filename       = current(explode('.', 
basename($values['document_name'])));
-
-                               $filetype       = 
$this->bo->vfs->file_type(array(
-                                                       'string' => $file,
-                                                       'relatives' => 
Array(RELATIVE_NONE)));

                                $size           = 
$this->bo->vfs->get_size(array(
                                                        'string' => $file,
                                                        'relatives' => 
Array(RELATIVE_NONE),
                                                        'checksubdirs' => 
True));

-                               $browser = CreateObject('phpgwapi.browser');
-                               
$browser->content_header($filename,$filetype,$size);
-
                                $document= $this->bo->vfs->read(array(
                                        'string' => $file,
                                        'relatives' => Array(RELATIVE_NONE)));

-                               echo $document;
+                               $filename       = 
basename($values['document_name']);
+                               $filetype = array_pop(explode('.', 
basename($file)));
+                               $browser = CreateObject('phpgwapi.browser');
+                               
$browser->content_header($filename,$filetype,$size);

-//                             flush();
+                               echo $document;
                        }
                }

@@ -977,7 +1007,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -1023,7 +1053,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function view()
@@ -1141,7 +1171,7 @@
                                'lang_user_statustext'                  => 
lang('Select the coordinator the document belongs to. To do not use a category 
select NO USER'),
                                'select_user_name'                              
=> 'values[coordinator]',
                                'lang_no_user'                                  
=> lang('Select coordinator'),
-                               'user_list'                                     
        => $this->bocommon->get_user_list('select',$values['coordinator']),
+                               'user_list'                                     
        => 
$this->bocommon->get_user_list('select',$values['coordinator'],$extra=False,$default=False,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1),

                                'status_list'                                   
=> $this->bo->select_status_list('select',$values['status']),
                                'select_status_name'                    => 
'values[status]',
@@ -1164,7 +1194,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }



====================================================
Index: property/inc/class.uiinvoice.inc.php
diff -u property/inc/class.uiinvoice.inc.php:1.12 
property/inc/class.uiinvoice.inc.php:1.13
--- property/inc/class.uiinvoice.inc.php:1.12   Sat Oct 30 16:13:57 2004
+++ property/inc/class.uiinvoice.inc.php        Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage eco
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uiinvoice
        {
@@ -330,7 +340,7 @@
                                $data['table_header_list_voucher_paid'] = 
$table_header;
                                $data['values_list_voucher_paid']               
= $content;
                                
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_voucher_paid' => 
$data));
-                       //      $GLOBALS['phpgw']->xslttpl->pp();
+                               $GLOBALS['phpgw']->xslttpl->pp();
                        }
                        else
                        {
@@ -352,7 +362,7 @@
                                $data['table_add_invoice']                      
        = $table_add;

                                
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_voucher' => $data));
-                       //      $GLOBALS['phpgw']->xslttpl->pp();
+                               $GLOBALS['phpgw']->xslttpl->pp();
                        }
                        $this->save_sessiondata();

@@ -548,7 +558,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_invoice_sub' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -592,7 +602,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
$function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_period' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function remark()
@@ -615,7 +625,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('remark' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function consume()
@@ -781,7 +791,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('consume' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();

                        $this->save_sessiondata();
                }
@@ -825,7 +835,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function add()
@@ -1143,7 +1153,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add' 
=> $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function debug($values)
@@ -1280,7 +1290,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('debug' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function view_order()

====================================================
Index: property/inc/class.uipricebook.inc.php
diff -u property/inc/class.uipricebook.inc.php:1.6 
property/inc/class.uipricebook.inc.php:1.7
--- property/inc/class.uipricebook.inc.php:1.6  Sat Oct 30 16:13:57 2004
+++ property/inc/class.uipricebook.inc.php      Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage agreement
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uipricebook
        {
@@ -310,7 +320,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -429,7 +439,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('agreement_group' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -559,7 +569,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_agreement_group' => 
$data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -781,7 +791,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('prizing' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -955,7 +965,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_activities' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -1093,7 +1103,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_activity_vendor' => 
$data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -1255,7 +1265,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_activity' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -1358,7 +1368,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

        }

====================================================
Index: property/inc/class.uiproject.inc.php
diff -u property/inc/class.uiproject.inc.php:1.10 
property/inc/class.uiproject.inc.php:1.11
--- property/inc/class.uiproject.inc.php:1.10   Sat Oct 30 16:13:57 2004
+++ property/inc/class.uiproject.inc.php        Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage project
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uiproject
        {
@@ -84,7 +94,8 @@

                function excel()
                {
-                       $GLOBALS['phpgw_info']['flags']['noframework'] = True;
+                       $GLOBALS['phpgw_info']['flags'][noheader] = True;
+                       $GLOBALS['phpgw_info']['flags'][nofooter] = True;
                        require('PEAR.php');
                        $xls            = 
CreateObject($this->currentapp.'.excel');

@@ -171,26 +182,34 @@

                                                        
if($project_entry['query_location'][$uicols['name'][$k]])
                                                        {
-                                                               
$content[$j]['row'][$k]['statustext']                   = lang('search');
-                                                               
$content[$j]['row'][$k]['text']                                 = 
$project_entry[$uicols['name'][$k]];
-                                                               
$content[$j]['row'][$k]['link']                         = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiproject.index&query='
 . $project_entry['query_location'][$uicols['name'][$k]] . '&lookup=' . $lookup 
. '&filter=' . $this->filter);
+                                                               
$content[$j]['row'][]= array(
+                                                                       
'statustext' => lang('search'),
+                                                                       'text'  
        => $project_entry[$uicols['name'][$k]],
+                                                                       'link'  
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiproject.index&query='
 . $project_entry['query_location'][$uicols['name'][$k]] . '&lookup=' . $lookup 
. '&filter=' . $this->filter)
+                                                               );
                                                        }
                                                        else
                                                        {
-                                                               
$content[$j]['row'][$k]['value']                        = 
$project_entry[$uicols['name'][$k]];
-                                                               
$content[$j]['row'][$k]['name']                         = $uicols['name'][$k];
+                                                               
$content[$j]['row'][]= array(
+                                                               'value'         
        => $project_entry[$uicols['name'][$k]],
+                                                               'name'          
        => $uicols['name'][$k]
+                                                               );
                                                        }
                                                }
                                                
elseif($uicols['input_type'][$k]=='link')
                                                {
-                                                       
$content[$j]['row'][$k]['statustext']                   = lang('search');
-                                                       
$content[$j]['row'][$k]['text']                                 = 
$project_entry[$uicols['name'][$k]];
-                                                       
$content[$j]['row'][$k]['link']                         = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uitts.view&id='
 . $project_entry[$uicols['name'][$k]]);
+                                                               
$content[$j]['row'][]= array(
+                                                               'statustext'    
=> lang('search'),
+                                                               'text'          
        => $project_entry[$uicols['name'][$k]],
+                                                               'link'          
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uitts.view&id='
 . $project_entry[$uicols['name'][$k]])
+                                                               );
                                                }

-                                               if($lookup && 
$k==($count_uicols_name-2))
+                                               if($lookup && 
$k==($count_uicols_name-1))
                                                {
-                                                       
$content[$j]['row'][$k]['lookup_action']                        = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.edit&project_id='
 . $project_entry['project_id']);
+                                                       $content[$j]['row'][]= 
array(
+                                                       'lookup_action' => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.edit&project_id='
 . $project_entry['project_id'])
+                                                       );
                                                }
                                        }

@@ -198,38 +217,41 @@
                                        {
                                                if ($this->acl_read && 
$this->bocommon->check_perms($project_entry['grants'],PHPGW_ACL_READ))
                                                {
-                                                       
$content[$j]['row'][$k]['statustext']                   = lang('view the 
project');
-                                                       
$content[$j]['row'][$k]['text']                                 = lang('view');
-                                                       
$content[$j]['row'][$k]['link']                                 = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiproject.view&id='
 . $project_entry['project_id']);
-                                                       $k++;
+                                                       $content[$j]['row'][]= 
array(
+                                                       'statustext'            
=> lang('view the project'),
+                                                       'text'                  
        => lang('view'),
+                                                       'link'                  
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiproject.view&id='
 . $project_entry['project_id'])
+                                                       );
                                                }
                                                else
                                                {
-                                                       
$content[$j]['row'][$k++]['link']='dummy';
+                                                       $content[$j]['row'][]= 
array('link'=>'dummy');
                                                }

                                                if ($this->acl_edit && 
$this->bocommon->check_perms($project_entry['grants'],PHPGW_ACL_EDIT))
                                                {
-                                                       
$content[$j]['row'][$k]['statustext']                   = lang('edit the 
project');
-                                                       
$content[$j]['row'][$k]['text']                                 = lang('edit');
-                                                       
$content[$j]['row'][$k]['link']                                 = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiproject.edit&id='
 . $project_entry['project_id']);
-                                                       $k++;
+                                                       $content[$j]['row'][]= 
array(
+                                                       'statustext'    => 
lang('edit the project'),
+                                                       'text'                  
=> lang('edit'),
+                                                       'link'                  
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiproject.edit&id='
 . $project_entry['project_id'])
+                                                       );
                                                }
                                                else
                                                {
-                                                       
$content[$j]['row'][$k++]['link']='dummy';
+                                                       $content[$j]['row'][]= 
array('link'=>'dummy');
                                                }

                                                if ($this->acl_delete && 
$this->bocommon->check_perms($project_entry['grants'],PHPGW_ACL_DELETE))
                                                {
-                                                       
$content[$j]['row'][$k]['statustext']                   = lang('delete the 
project');
-                                                       
$content[$j]['row'][$k]['text']                                 = 
lang('delete');
-                                                       
$content[$j]['row'][$k]['link']                                 = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiproject.delete&project_id='
 . $project_entry['project_id']);
-                                                       $k++;
+                                                       $content[$j]['row'][]= 
array(
+                                                       'statustext'    => 
lang('delete the project'),
+                                                       'text'                  
=> lang('delete'),
+                                                       'link'                  
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiproject.delete&project_id='
 . $project_entry['project_id'])
+                                                       );
                                                }
                                                else
                                                {
-                                                       
$content[$j]['row'][$k++]['link']='dummy';
+                                                       $content[$j]['row'][]= 
array('link'=>'dummy');
                                                }
                                        }

@@ -437,7 +459,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_project' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -493,7 +515,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('date_search' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function edit()
@@ -827,6 +849,16 @@
                                                'entity_data'   => $values['p']
                                                ));

+                       if($values['contact_phone'])
+                       {
+                               for 
($i=0;$i<count($location_data['location']);$i++)
+                               {
+                                       
if($location_data['location'][$i]['input_name'] == 'contact_phone')
+                                       {
+                                               
$location_data['location'][$i]['value'] = $values['contact_phone'];
+                                       }
+                               }
+                       }

                        $link_data = array
                        (
@@ -1039,7 +1071,7 @@
                        $appname                = lang('project');
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -1082,7 +1114,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function view()
@@ -1137,6 +1169,16 @@
                                                'entity_data'   => $values['p']
                                                ));

+                       if($values['contact_phone'])
+                       {
+                               for 
($i=0;$i<count($location_data['location']);$i++)
+                               {
+                                       
if($location_data['location'][$i]['input_name'] == 'contact_phone')
+                                       {
+                                               
unset($location_data['location'][$i]['value']);
+                                       }
+                               }
+                       }

                        if($values['reserve'])
                        {
@@ -1206,8 +1248,8 @@
                                'value_project_id'                              
=> $values['project_id'],
                                'value_name'                                    
=> $values['name'],

-                               'lang_other_branch'                             
        => lang('Other branch'),
-                               'value_other_branch'                            
=> $values['other_branch'],
+                               'lang_other_branch'                             
=> lang('Other branch'),
+                               'value_other_branch'                    => 
$values['other_branch'],

                                'lang_descr'                                    
=> lang('Description'),
                                'value_descr'                                   
=> $values['descr'],
@@ -1225,7 +1267,7 @@
                                'lang_sum'                                      
        => lang('Sum'),
                                'select_user_name'                              
=> 'values[coordinator]',
                                'lang_no_user'                                  
=> lang('Select coordinator'),
-                               'user_list'                                     
        => $this->bocommon->get_user_list('select',$values['coordinator']),
+                               'user_list'                                     
        => 
$this->bocommon->get_user_list('select',$values['coordinator'],$extra=False,$default=False,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1),

                                'status_list'                                   
=> $this->bo->select_status_list('select',$values['status']),
                                'lang_no_status'                                
=> lang('Select status'),
@@ -1234,8 +1276,8 @@
                                'branch_list'                                   
=> $this->bo->select_branch_p_list($values['project_id']),
                                'lang_branch'                                   
=> lang('branch'),

-                               'key_responsible_list'                          
        => $this->bo->select_branch_list($values['key_responsible']),
-                               'lang_key_responsible'                          
        => lang('key responsible'),
+                               'key_responsible_list'                  => 
$this->bo->select_branch_list($values['key_responsible']),
+                               'lang_key_responsible'                  => 
lang('key responsible'),

                                'key_fetch_list'                                
        => $this->bo->select_key_location_list($values['key_fetch']),
                                'lang_key_fetch'                                
        => lang('key fetch location'),
@@ -1246,13 +1288,16 @@
                                'edit_action'                                   
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiproject.edit&id='
 . $id),
                                'lang_edit_statustext'                          
=> lang('Edit this entry project'),
                                'lang_edit'                                     
                => lang('Edit'),
-                               'currency'                                      
                => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency']
+                               'currency'                                      
                => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'],
+
+                               'lang_contact_phone'                    => 
lang('Contact phone'),
+                               'contact_phone'                                 
=> $values['contact_phone'],
                        );

                        $appname                = lang('project');
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }
        }
 ?>

====================================================
Index: property/inc/class.uirequest.inc.php
diff -u property/inc/class.uirequest.inc.php:1.5 
property/inc/class.uirequest.inc.php:1.6
--- property/inc/class.uirequest.inc.php:1.5    Sat Oct 30 16:13:57 2004
+++ property/inc/class.uirequest.inc.php        Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage project
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uirequest
        {
@@ -355,7 +365,7 @@
                                'lang_user_statustext'                  => 
lang('Select the user the request belongs to. To do not use a category select 
NO USER'),
                                'select_user_name'                              
=> 'filter',
                                'lang_no_user'                                  
=> lang('No user'),
-                               'user_list'                                     
        => $this->bocommon->get_user_list('filter',$this->filter),
+                               'user_list'                                     
        => 
$this->bocommon->get_user_list('filter',$this->filter,$extra=False,$default=False,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1),

                                'lang_searchfield_statustext'   => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
                                'lang_searchbutton_statustext'  => lang('Submit 
the search string'),
@@ -371,7 +381,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -424,7 +434,7 @@
                        );

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('priority_key' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -863,7 +873,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -905,7 +915,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function view()
@@ -1083,7 +1093,7 @@

                                'lang_coordinator'                              
=> lang('Coordinator'),
                                'lang_no_user'                                  
=> lang('Select coordinator'),
-                               'user_list'                                     
        => $this->bocommon->get_user_list('select',$values['coordinator']),
+                               'user_list'                                     
        => 
$this->bocommon->get_user_list('select',$values['coordinator'],$extra=False,$default=False,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1),

                                'status_list'                                   
=> $this->boproject->select_status_list('select',$values['status']),
                                'lang_status'                                   
=> lang('Status'),
@@ -1101,7 +1111,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }
        }
 ?>

====================================================
Index: property/inc/class.uis_agreement.inc.php
diff -u property/inc/class.uis_agreement.inc.php:1.13 
property/inc/class.uis_agreement.inc.php:1.14
--- property/inc/class.uis_agreement.inc.php:1.13       Sat Oct 30 16:13:57 2004
+++ property/inc/class.uis_agreement.inc.php    Thu Jan 13 16:52:48 2005
@@ -1,20 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage agreement
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uis_agreement
        {
@@ -140,7 +149,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
$function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('columns' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function view_file()
@@ -150,39 +159,34 @@
                                
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uilocation.stop&perm=1&acl_location='
 . $this->acl2_location);
                        }

-                       $GLOBALS['phpgw_info']['flags']['noframework'] = True;
+                       $GLOBALS['phpgw_info']['flags'][noheader] = True;
+                       $GLOBALS['phpgw_info']['flags'][nofooter] = True;
+
                        $file_name      = 
urldecode(get_var('file_name',array('POST','GET')));
                        $id             = get_var('id',array('POST','GET'));

                        $file = $this->fakebase. SEP . 'service_agreement' . 
SEP . $id . SEP . $file_name;

-//echo 'file: ' . $file . '<br>';
                        if($this->bo->vfs->file_exists(array(
                                'string' => $file,
                                'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
-                               $filename       = current(explode('.', 
basename($file_name)));
-
-                               $filetype       = 
$this->bo->vfs->file_type(array(
-                                                       'string' => $file,
-                                                       'relatives' => 
Array(RELATIVE_NONE)));
-
                                $size           = 
$this->bo->vfs->get_size(array(
                                                        'string' => $file,
                                                        'relatives' => 
Array(RELATIVE_NONE),
                                                        'checksubdirs' => 
True));

-                               $browser = CreateObject('phpgwapi.browser');
-                               
$browser->content_header($filename,$filetype,$size);
-
                                $document= $this->bo->vfs->read(array(
                                        'string' => $file,
                                        'relatives' => Array(RELATIVE_NONE)));

-                               echo $document;
+                               $filename       = 
basename($values['document_name']);
+                               $filetype = array_pop(explode('.', 
basename($file)));
+                               $browser = CreateObject('phpgwapi.browser');
+                               
$browser->content_header($filename,$filetype,$size);

-//                             flush();
+                               echo $document;
                        }
                }

@@ -272,7 +276,9 @@
                                                                                
                        'start_date'    => $start_date,
                                                                                
                        'role'                  => $this->role,
                                                                                
                        'member_id'             => $this->member_id,
-                                                                               
                        'end_date'=>$end_date)
+                                                                               
                        'allrows'               => $this->allrows,
+                                                                               
                        'end_date'              => $end_date
+                                                                               
                        )
                                                        ));
                                        }
                                }
@@ -320,7 +326,9 @@
                                                'filter'                
=>$this->filter,
                                                'query'                 
=>$this->query,
                                                'role'                  => 
$this->role,
-                                               'member_id'             => 
$this->member_id
+                                               'member_id'             => 
$this->member_id,
+                                               'allrows'               => 
$this->allrows
+
                        );

                        if(!$this->allrows)
@@ -351,7 +359,7 @@
                                'lang_columns_help'                             
=> lang('Choose columns'),
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'links'                                         
        => $links,
-                               'allow_allrows'                                 
=> false,
+                               'allow_allrows'                                 
=> True,
                                'allrows'                                       
        => $this->allrows,
                                'start_record'                                  
=> $this->start,
                                'record_limit'                                  
=> $record_limit,
@@ -387,7 +395,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('service agreement') . ': ' . lang('list ' . $this->role);

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function list_content($list,$uicols,$edit_item='',$view_only='')
@@ -879,7 +887,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('service agreement') . ': ' . ($id?lang('edit') . ' ' . 
lang($this->role):lang('add') . ' ' . lang($this->role));

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function excel()
@@ -909,9 +917,9 @@
                        $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
                        $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity',$this->currentapp);

-                       $insert_record_s_agreement = 
$GLOBALS['phpgw']->session->appsession('insert_record_s_agreement',$this->currentapp);
+                       $insert_record_s_agreement1 = 
$GLOBALS['phpgw']->session->appsession('insert_record_s_agreement1',$this->currentapp);

-//_debug_array($insert_record_s_agreement);
+//_debug_array($insert_record_s_agreement1);

                        for ($j=0;$j<count($insert_record_entity);$j++)
                        {
@@ -920,7 +928,7 @@

                        for ($j=0;$j<count($insert_record_s_agreement1);$j++)
                        {
-                               
$insert_record['extra'][$insert_record_s_agreement[$j]] = 
$insert_record_s_agreement[$j];
+                               
$insert_record['extra'][$insert_record_s_agreement1[$j]]        = 
$insert_record_s_agreement1[$j];
                        }


@@ -1170,7 +1178,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('service agreement') . ': ' . ($values['id']?lang('edit item') . ' ' . 
$s_agreement['name']:lang('add item') . ' ' . $s_agreement['name']);

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_item' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function view_item()
@@ -1254,7 +1262,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('service agreement') . ': ' . lang('view item') . ' ' . 
$s_agreement['name'];

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view_item' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -1306,7 +1314,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -1445,7 +1453,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('service agreement') . ': ' . lang('view');

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -1578,7 +1586,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        //$this->save_sessiondata();
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_attribute' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function edit_attrib()
@@ -1754,7 +1762,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_attrib' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }
        }
 ?>
\ No newline at end of file

====================================================
Index: property/inc/class.uib_account.inc.php
diff -u property/inc/class.uib_account.inc.php:1.5 
property/inc/class.uib_account.inc.php:1.6
--- property/inc/class.uib_account.inc.php:1.5  Sat Oct 30 16:13:57 2004
+++ property/inc/class.uib_account.inc.php      Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uib_account
        {
@@ -42,6 +52,16 @@
                        $this->bo                                       = 
CreateObject($this->currentapp.'.bob_account',true);
                        $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');

+                       $this->menu                                     = 
CreateObject($this->currentapp.'.menu');
+                       $this->menu->sub                        ='invoice';
+
+                       $this->acl2                             = 
CreateObject($this->currentapp.'.acl2');
+                       $this->acl2_location            = '.b_account';
+                       $this->acl_read                         = 
$this->acl2->check('.b_account',1);
+                       $this->acl_add                          = 
$this->acl2->check('.b_account',2);
+                       $this->acl_edit                         = 
$this->acl2->check('.b_account',4);
+                       $this->acl_delete                       = 
$this->acl2->check('.b_account',8);
+
                        $this->start                            = 
$this->bo->start;
                        $this->query                            = 
$this->bo->query;
                        $this->sort                                     = 
$this->bo->sort;
@@ -64,9 +84,16 @@

                function index()
                {
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('b_account','nextmatchs',
+                       if(!$this->acl_read)
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uilocation.stop&perm=1&acl_location='
 . $this->acl2_location);
+                       }
+
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('b_account','nextmatchs','menu',
                                                                                
'search_field'));

+                       $links = $this->menu->links('b_account');
+
                        $b_account_list = $this->bo->read($type);

                        while (is_array($b_account_list) && list(,$b_account) = 
each($b_account_list))
@@ -74,12 +101,22 @@
                                $words = split(' ',$b_account['descr']);
                                $first = "$words[0] $words[1] $words[2] 
$words[3]";

+                               if($this->acl_edit)
+                               {
+                                       $link_edit                              
= 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uib_account.edit&id='
 . $b_account['id']);
+                               }
+
+                               if($this->acl_delete)
+                               {
+                                       $link_delete                            
= 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uib_account.delete&id='
 . $b_account['id']);
+                               }
+
                                $content[] = array
                                (
                                        'id'                                    
=> $b_account['id'],
                                        'first'                                 
        => $first,
-                                       'link_edit'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uib_account.edit&id='
 . $b_account['id']),
-                                       'link_delete'                           
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uib_account.delete&id='
 . $b_account['id']),
+                                       'link_edit'                             
        => $link_edit,
+                                       'link_delete'                           
=> $link_delete,
                                        'lang_view_b_accounttext'       => 
lang('view the budget account'),
                                        'lang_edit_b_accounttext'       => 
lang('edit the budget account'),
                                        'lang_delete_b_accounttext'     => 
lang('delete the budget account'),
@@ -87,7 +124,8 @@
                                        'text_edit'                             
        => lang('edit'),
                                        'text_delete'                           
=> lang('delete')
                                );
-                       }
+
+               }

 //_debug_array($content);

@@ -129,6 +167,7 @@

                        $data = array
                        (
+                               'links'                                         
        => $links,
                                'allow_allrows'                                 
=> True,
                                'allrows'                                       
        => $this->allrows,
                                'start_record'                                  
=> $this->start,
@@ -151,12 +190,17 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

                function edit()
                {
+                       if(!$this->acl_add && !$this->acl_edit)
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uilocation.stop&perm=2&acl_location='
 . $this->acl2_location);
+                       }
+
                        $id     = get_var('id',array('POST','GET'));
                        $values                 = 
get_var('values',array('POST'));

@@ -237,11 +281,16 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
                {
+                       if(!$this->acl_delete)
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uilocation.stop&perm=8&acl_location='
 . $this->acl2_location);
+                       }
+
                        $id             = get_var('id',array('POST','GET'));
                        $confirm                = 
get_var('confirm',array('POST'));

@@ -274,7 +323,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

        }

====================================================
Index: property/inc/class.uip_of_town.inc.php
diff -u property/inc/class.uip_of_town.inc.php:1.4 
property/inc/class.uip_of_town.inc.php:1.5
--- property/inc/class.uip_of_town.inc.php:1.4  Sat Oct 30 16:13:57 2004
+++ property/inc/class.uip_of_town.inc.php      Thu Jan 13 16:52:48 2005
@@ -1,20 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uip_of_town
        {
@@ -206,7 +215,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('part of town') . ': ' . lang('list part of town');

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -294,7 +303,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('part of town') . ': ' . ($part_of_town_id?lang('edit part og 
town'):lang('add part of town'));

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -333,7 +342,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function view()
@@ -360,7 +369,7 @@
                        );

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }
        }
 ?>

====================================================
Index: property/inc/class.uilookup.inc.php
diff -u property/inc/class.uilookup.inc.php:1.7 
property/inc/class.uilookup.inc.php:1.8
--- property/inc/class.uilookup.inc.php:1.7     Sat Oct 30 16:13:57 2004
+++ property/inc/class.uilookup.inc.php Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage core
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uilookup
        {
@@ -199,7 +209,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_contact' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -326,7 +336,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_vendor' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -417,7 +427,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_b_account' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -512,7 +522,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_street' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -614,7 +624,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_tenant' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -703,7 +713,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_ns3420' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -892,7 +902,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_entity' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }


====================================================
Index: property/inc/class.uimeter.inc.php
diff -u property/inc/class.uimeter.inc.php:1.4 
property/inc/class.uimeter.inc.php:1.5
--- property/inc/class.uimeter.inc.php:1.4      Sat Oct 30 16:13:57 2004
+++ property/inc/class.uimeter.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage entity
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uimeter
        {
@@ -297,7 +307,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -469,7 +479,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -511,7 +521,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function view()
@@ -575,7 +585,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

        }

====================================================
Index: property/inc/class.uilocation.inc.php
diff -u property/inc/class.uilocation.inc.php:1.6 
property/inc/class.uilocation.inc.php:1.7
--- property/inc/class.uilocation.inc.php:1.6   Sat Oct 30 16:13:57 2004
+++ property/inc/class.uilocation.inc.php       Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage location
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uilocation
        {
@@ -90,8 +100,11 @@

                function excel()
                {
+                       $GLOBALS['phpgw_info']['flags'][noheader] = True;
+                       $GLOBALS['phpgw_info']['flags'][nofooter] = True;
+
                        $summary                = 
get_var('summary',array('GET'));
-                       $GLOBALS['phpgw_info']['flags']['noframework'] = True;
+
                        require('PEAR.php');
                        $xls            = 
CreateObject($this->currentapp.'.excel');

@@ -463,7 +476,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();

                }
@@ -654,7 +667,8 @@
                                'LB' => 'listbox'
                        );

-//     _debug_array($values);
+                       $vendor = CreateObject($this->currentapp.'.soactor');
+                       $vendor->role = 'vendor';

                        $r=0;
                        $m=0;
@@ -680,8 +694,8 @@
                                {
                                        if($attributes_values[$r]['value'])
                                        {
-                                               $contact_data   = 
$contacts->read_single_entry($attributes_values[$r]['value'],array('org_name'=>'org_name','email'=>'email'));
-                                               
$attributes_values[$r]['org_name']      = $contact_data[0]['org_name'];
+                                               $contact_data   = 
$contacts->read_single_entry($attributes_values[$r]['value'],array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
+                                               
$attributes_values[$r]['contact_name']  = $contact_data[0]['n_family'] . ', ' . 
$contact_data[0]['n_given'];
                                        }

                                        $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.addressbook&column='
 . $attributes_values[$r]['name']);
@@ -690,6 +704,31 @@
                                        $functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
                                        $m++;
                                }
+
+                               if($attributes_values[$r]['datatype']=='VENDOR')
+                               {
+                                       if($attributes_values[$r]['value'])
+                                       {
+                                               $vendor_data    = 
$vendor->read_single(array('actor_id'=>$attributes_values[$r]['value']));
+
+                                               for 
($n=0;$n<count($vendor_data['attributes']);$n++)
+                                               {
+                                                       
if($vendor_data['attributes'][$n]['name'] == 'org_name')
+                                                       {
+                                                               
$attributes_values[$r]['vendor_name']= $vendor_data['attributes'][$n]['value'];
+                                                               $n 
=count($vendor_data['attributes']);
+                                                       }
+                                               }
+                                       }
+
+                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.vendor&column='
 . $attributes_values[$r]['name']);
+
+                                       $lookup_functions[$m]['name'] = 
'lookup_'. $attributes_values[$r]['name'] .'()';
+                                       $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
+                                       $m++;
+                               }
+
+
                                if($attributes_values[$r]['datatype']=='R' || 
$attributes_values[$r]['datatype']=='CH' || 
$attributes_values[$r]['datatype']=='LB')
                                {
                                        $attributes_values[$r]['choice']        
= 
$this->soadmin_location->read_attrib_choice($type_id,$attributes_values[$r]['id']);
@@ -887,7 +926,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -911,7 +950,7 @@

                        if (get_var('confirm',array('POST')))
                        {
-                               $this->bo->delete($location_code,$type_id);
+                               $this->bo->delete($location_code);
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
                        }

@@ -933,7 +972,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function view()
@@ -1008,7 +1047,8 @@
                                'LB' => 'listbox'
                        );

-//     _debug_array($values);
+                       $vendor = CreateObject($this->currentapp.'.soactor');
+                       $vendor->role = 'vendor';

                        $r=0;
                        $m=0;
@@ -1035,8 +1075,8 @@
                                {
                                        if($attributes_values[$r]['value'])
                                        {
-                                               $contact_data   = 
$contacts->read_single_entry($attributes_values[$r]['value'],array('org_name'=>'org_name','email'=>'email'));
-                                               
$attributes_values[$r]['org_name']      = $contact_data[0]['org_name'];
+                                               $contact_data   = 
$contacts->read_single_entry($attributes_values[$r]['value'],array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
+                                               
$attributes_values[$r]['contact_name']  = $contact_data[0]['n_family'] . ', ' . 
$contact_data[0]['n_given'];
                                        }

                                        $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.addressbook&column='
 . $attributes_values[$r]['name']);
@@ -1045,6 +1085,30 @@
                                        $functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
                                        $m++;
                                }
+
+                               if($attributes_values[$r]['datatype']=='VENDOR')
+                               {
+                                       if($attributes_values[$r]['value'])
+                                       {
+                                               $vendor_data    = 
$vendor->read_single(array('actor_id'=>$attributes_values[$r]['value']));
+
+                                               for 
($n=0;$n<count($vendor_data['attributes']);$n++)
+                                               {
+                                                       
if($vendor_data['attributes'][$n]['name'] == 'org_name')
+                                                       {
+                                                               
$attributes_values[$r]['vendor_name']= $vendor_data['attributes'][$n]['value'];
+                                                               $n 
=count($vendor_data['attributes']);
+                                                       }
+                                               }
+                                       }
+
+                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.vendor&column='
 . $attributes_values[$r]['name']);
+
+                                       $lookup_functions[$m]['name'] = 
'lookup_'. $attributes_values[$r]['name'] .'()';
+                                       $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
+                                       $m++;
+                               }
+
                                if($attributes_values[$r]['datatype']=='R' || 
$attributes_values[$r]['datatype']=='CH' || 
$attributes_values[$r]['datatype']=='LB')
                                {
                                        $attributes_values[$r]['choice']        
= 
$this->soadmin_location->read_attrib_choice($type_id,$attributes_values[$r]['id']);
@@ -1197,7 +1261,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function update_cat()
@@ -1242,7 +1306,7 @@
                        $function_msg   = lang('Update the not active category 
for locations');
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('update_cat' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function stop()
@@ -1269,7 +1333,7 @@
                        $appname                = lang('Access error');
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' : ' . $appname;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('stop' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function summary()
@@ -1361,7 +1425,7 @@
                        $appname                = lang('Summary');
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' : ' . $appname;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('summary' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }
        }
 ?>

====================================================
Index: property/inc/class.uiadmin_entity.inc.php
diff -u property/inc/class.uiadmin_entity.inc.php:1.4 
property/inc/class.uiadmin_entity.inc.php:1.5
--- property/inc/class.uiadmin_entity.inc.php:1.4       Sat Oct 30 16:13:57 2004
+++ property/inc/class.uiadmin_entity.inc.php   Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uiadmin_entity
        {
@@ -191,7 +201,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -309,7 +319,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_status' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -444,7 +454,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_category' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -571,7 +581,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function edit_status()
@@ -662,7 +672,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_status' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function edit_category()
@@ -772,14 +782,17 @@
                                'lang_fileupload_statustext'    => lang('If 
files can be uploaded for this category'),
                                'lang_loc_link'                                 
=> lang('Link from location'),
                                'value_loc_link'                                
=> $values['loc_link'],
-                               'lang_loc_link_statustext'              => 
lang('Enable link from location detail')
+                               'lang_loc_link_statustext'              => 
lang('Enable link from location detail'),
+                               'lang_start_project'                    => 
lang('Start project'),
+                               'value_start_project'                   => 
$values['start_project'],
+                               'lang_start_project_statustext' => lang('Enable 
start project from this category')
                        );

                        $appname                                                
= lang('entity');

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -856,7 +869,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -1000,7 +1013,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_attribute' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -1194,7 +1207,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_attrib' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

        }

====================================================
Index: property/inc/class.sotemplate.inc.php
diff -u property/inc/class.sotemplate.inc.php:1.2 
property/inc/class.sotemplate.inc.php:1.3
--- property/inc/class.sotemplate.inc.php:1.2   Wed Jun  2 18:54:28 2004
+++ property/inc/class.sotemplate.inc.php       Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage project
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class sotemplate
        {
@@ -28,6 +38,7 @@

                        $this->join                     = $this->socommon->join;
                        $this->left_join        = $this->socommon->left_join;
+                       $this->like                     = $this->socommon->like;
                }

                function read($data)
@@ -81,7 +92,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " $where (fm_template.descr LIKE 
'%$query%')";
+                               $querymethod = " $where (fm_template.descr 
$this->like '%$query%')";
                        }

                        $sql = "SELECT 
fm_template.id,fm_template.descr,fm_template.name,fm_template.owner,fm_template.entry_date,"
@@ -153,7 +164,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " AND (hours_descr LIKE 
'%$query%' or fm_template_hours.remark LIKE '%$query%' or ns3420_id LIKE 
'%$query%')";
+                               $querymethod = " AND (hours_descr $this->like 
'%$query%' or fm_template_hours.remark $this->like '%$query%' or ns3420_id 
$this->like '%$query%')";
                        }

                        $sql = "SELECT fm_template_hours.*, chapter_id from 
fm_template_hours  $this->join fm_template on 
fm_template.id=fm_template_hours.template_id $filtermethod $querymethod";

====================================================
Index: property/inc/class.sotts.inc.php
diff -u property/inc/class.sotts.inc.php:1.2 
property/inc/class.sotts.inc.php:1.3
--- property/inc/class.sotts.inc.php:1.2        Wed Jun  2 18:54:28 2004
+++ property/inc/class.sotts.inc.php    Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage helpdesk
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class sotts
        {
@@ -28,6 +38,7 @@
                        $this->config           = 
CreateObject('phpgwapi.config');
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
                        $this->join                     = $this->bocommon->join;
+                       $this->like                     = $this->bocommon->like;
                        $this->soadmin_entity   = 
CreateObject($this->currentapp.'.soadmin_entity');
                        $this->dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];

@@ -158,7 +169,7 @@
                                {
                                        $query = ereg_replace("'",'',$query);
                                        $query = ereg_replace('"','',$query);
-                                       $querymethod = " $where (subject LIKE 
'%$query%' or address LIKE '%$query%' or fm_tts_tickets.location_code LIKE 
'%$query%')";
+                                       $querymethod = " $where (subject 
$this->like '%$query%' or address $this->like '%$query%' or 
fm_tts_tickets.location_code $this->like '%$query%')";
                                }
                        }


====================================================
Index: property/inc/class.sotts2.inc.php
diff -u property/inc/class.sotts2.inc.php:1.3 
property/inc/class.sotts2.inc.php:1.4
--- property/inc/class.sotts2.inc.php:1.3       Wed Jun 30 19:01:39 2004
+++ property/inc/class.sotts2.inc.php   Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage helpdesk
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class sotts2
        {
@@ -28,6 +38,7 @@
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');

                        $this->join                     = $this->bocommon->join;
+                       $this->like                     = $this->bocommon->like;
                }

                function update_ticket($ticket,$id='')

====================================================
Index: property/inc/class.sostandard_entity.inc.php
diff -u property/inc/class.sostandard_entity.inc.php:1.2 
property/inc/class.sostandard_entity.inc.php:1.3
--- property/inc/class.sostandard_entity.inc.php:1.2    Wed Jun  2 18:54:28 2004
+++ property/inc/class.sostandard_entity.inc.php        Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class sostandard_entity
        {
@@ -27,8 +37,7 @@
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');

                        $this->join                     = $this->bocommon->join;
-
-
+                       $this->like                     = $this->bocommon->like;
                }

                function read($data)
@@ -66,7 +75,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " where name LIKE '%$query%' or 
descr LIKE '%$query%'";
+                               $querymethod = " where name $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }

                        $sql = "SELECT * FROM $table $querymethod";
@@ -281,7 +290,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " and ($table.name LIKE 
'%$query%' or $table.descr LIKE '%$query%')";
+                               $querymethod = " and ($table.name $this->like 
'%$query%' or $table.descr $this->like '%$query%')";
                        }

                        $sql = "SELECT $table.id ,$table.name ,$table.descr, 
$table.datatype ,$type_table.name as type FROM $type_table $this->join $table 
on $table.type_id = $type_table.id where $table.type_id= '$type_id' 
$querymethod";

====================================================
Index: property/inc/class.sostandard_3.inc.php
diff -u property/inc/class.sostandard_3.inc.php:1.4 
property/inc/class.sostandard_3.inc.php:1.5
--- property/inc/class.sostandard_3.inc.php:1.4 Fri Jul 16 07:53:23 2004
+++ property/inc/class.sostandard_3.inc.php     Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class sostandard_3
        {
@@ -27,7 +37,7 @@
                        $this->socommon         = 
CreateObject($this->currentapp.'.socommon');

                        $this->join                     = $this->socommon->join;
-
+                       $this->like                     = $this->socommon->like;
                }

                function read($data)
@@ -65,7 +75,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " where id LIKE '%$query%' or 
descr LIKE '%$query%'";
+                               $querymethod = " where id $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }

                        $sql = "SELECT * FROM $table $querymethod";

====================================================
Index: property/inc/class.sorequest.inc.php
diff -u property/inc/class.sorequest.inc.php:1.2 
property/inc/class.sorequest.inc.php:1.3
--- property/inc/class.sorequest.inc.php:1.2    Wed Jun  2 18:54:28 2004
+++ property/inc/class.sorequest.inc.php        Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage project
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class sorequest
        {
@@ -29,6 +39,7 @@
                        $this->socommon         = 
CreateObject($this->currentapp.'.socommon');

                        $this->join                     = $this->socommon->join;
+                       $this->like                     = $this->socommon->like;
                }

                function select_category_workorder_list()
@@ -276,7 +287,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " $where (fm_request.title LIKE 
'%$query%' or fm_request.address LIKE '%$query%' or fm_request.location_code 
LIKE '%$query%')";
+                               $querymethod = " $where (fm_request.title 
$this->like '%$query%' or fm_request.address $this->like '%$query%' or 
fm_request.location_code $this->like '%$query%')";
                        }

                        $sql .= " $filtermethod $querymethod";

====================================================
Index: property/inc/class.sos_agreement.inc.php
diff -u property/inc/class.sos_agreement.inc.php:1.10 
property/inc/class.sos_agreement.inc.php:1.11
--- property/inc/class.sos_agreement.inc.php:1.10       Fri Aug 20 15:15:21 2004
+++ property/inc/class.sos_agreement.inc.php    Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage agreement
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class sos_agreement
        {
@@ -29,7 +39,7 @@

                        $this->join                     = $this->bocommon->join;
                        $this->left_join        = $this->bocommon->left_join;
-//                     $this->role             = 's_agreement';
+                       $this->like                     = $this->bocommon->like;
                }

                function select_category_list()
@@ -90,7 +100,10 @@

                                $paranthesis .='(';
                                $joinmethod .= " $this->join $category_table ON 
( $entity_table.category =$category_table.id))";
-                               $cols = $entity_table . 
".*,$category_table.descr as category";
+                               $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_return[]                          = 'id';
                                $uicols['input_type'][]         = 'text';
@@ -104,6 +117,12 @@
                                $uicols['descr'][]                      = 
lang('name');
                                $uicols['statustext'][]         = lang('name');

+                               $cols_return[]                          = 
'org_name';
+                               $uicols['input_type'][]         = 'text';
+                               $uicols['name'][]                       = 
'org_name';
+                               $uicols['descr'][]                      = 
lang('vendor');
+                               $uicols['statustext'][]         = 
lang('vendor');
+
                                $cols_return[]                          = 
'category';
                                $uicols['input_type'][]         = 'text';
                                $uicols['name'][]                       = 
'category';
@@ -134,7 +153,7 @@



-                               $cols = "$entity_table.*, 
fm_s_agreement_pricing.cost,fm_s_agreement_pricing.id as 
index_count,fm_s_agreement_pricing.date,fm_s_agreement_pricing.item_id,fm_s_agreement_pricing.this_index";
+                               $cols = "$entity_table.*, 
fm_s_agreement_pricing.cost,fm_s_agreement_pricing.id as 
index_count,fm_s_agreement_pricing.index_date,fm_s_agreement_pricing.item_id,fm_s_agreement_pricing.this_index";

                                $cols_return[]                          = 
'agreement_id';
                                $uicols['input_type'][]         = 'hidden';
@@ -190,9 +209,9 @@
                                $uicols['descr'][]                      = 
lang('index_count');
                                $uicols['statustext'][]         = 
lang('index_count');

-                               $cols_return[]                          = 
'date';
+                               $cols_return[]                          = 
'index_date';
                                $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 
'date';
+                               $uicols['name'][]                       = 
'index_date';
                                $uicols['descr'][]                      = 
lang('date');
                                $uicols['statustext'][]         = lang('date');
                        }
@@ -250,7 +269,14 @@
 //_debug_array($cols_return_extra);
                        if ($order)
                        {
-                               $ordermethod = " order by $entity_table.$order 
$sort";
+                               if ($order=='id')
+                               {
+                                       $ordermethod = " order by 
$entity_table.$order $sort";
+                               }
+                               else
+                               {
+                                       $ordermethod = " order by $order $sort";
+                               }
                        }
                        else
                        {
@@ -301,7 +327,7 @@

                        if ($member_id>0)
                        {
-                               $filtermethod .= " $where 
$entity_table.member_of LIKE '%,$member_id,%' ";
+                               $filtermethod .= " $where 
$entity_table.member_of $this->like '%,$member_id,%' ";
                                $where= 'AND';
                        }

@@ -321,7 +347,14 @@

                                while ($this->db->next_record())
                                {
-                                       $querymethod[]= "$entity_table." . 
$this->db->f('column_name') . " LIKE '%$query%'";
+                                       if($this->db->f('datatype')=='V' || 
$this->db->f('datatype')=='email' || $this->db->f('datatype')=='CH')
+                                       {
+                                               $querymethod[]= 
"$entity_table." . $this->db->f('column_name') . " $this->like '%$query%'";
+                                       }
+                                       else
+                                       {
+                                               $querymethod[]= 
"$entity_table." . $this->db->f('column_name') . " = '$query'";
+                                       }
                                }

                                if (isset($querymethod) AND 
is_array($querymethod))
@@ -348,6 +381,9 @@
                        $j=0;
                        $n=count($cols_return);
 //_debug_array($cols_return);
+
+                       $contacts                       = 
CreateObject('phpgwapi.contacts');
+
                        while ($this->db->next_record())
                        {
                                for ($i=0;$i<$n;$i++)
@@ -370,7 +406,13 @@
                                        }
                                        
elseif($cols_return_extra[$i]['datatype']=='AB' && $value):
                                        {
-                                               $sql="SELECT org_name FROM 
phpgw_addressbook where id=$value";
+                                               $contact_data   = 
$contacts->read_single_entry($value,array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
+                                               
$s_agreement_list[$j][$cols_return_extra[$i]['name']]   = 
$contact_data[0]['n_family'] . ', ' . $contact_data[0]['n_given'];
+
+                                       }
+                                       
elseif($cols_return_extra[$i]['datatype']=='VENDOR' && $value):
+                                       {
+                                               $sql="SELECT org_name FROM 
fm_vendor where id=$value";
                                                $this->db2->query($sql);
                                                $this->db2->next_record();
                                                
$s_agreement_list[$j][$cols_return_extra[$i]['name']] = 
$this->db2->f('org_name');
@@ -423,7 +465,7 @@

                        $entity_table = 'fm_s_agreement_pricing';

-                       $cols = 
"fm_s_agreement_pricing.cost,fm_s_agreement_pricing.id as 
index_count,fm_s_agreement_pricing.date,fm_s_agreement_pricing.item_id,fm_s_agreement_pricing.this_index";
+                       $cols = 
"fm_s_agreement_pricing.cost,fm_s_agreement_pricing.id as 
index_count,fm_s_agreement_pricing.index_date,fm_s_agreement_pricing.item_id,fm_s_agreement_pricing.this_index";

                        $cols_return[]                  = 'item_id';
                        $uicols['input_type'][]         = 'text';
@@ -455,9 +497,9 @@
                        $uicols['descr'][]                      = 
lang('index_count');
                        $uicols['statustext'][]         = lang('index_count');

-                       $cols_return[]                  = 'date';
+                       $cols_return[]                  = 'index_date';
                        $uicols['input_type'][]         = 'text';
-                       $uicols['name'][]                       = 'date';
+                       $uicols['name'][]                       = 'index_date';
                        $uicols['descr'][]                      = lang('date');
                        $uicols['statustext'][]         = lang('date');

@@ -623,6 +665,23 @@
                                $s_agreement['member_of']=',' . 
implode(',',$s_agreement['member_of']) . ',';
                        }

+
+                       $this->db->transaction_begin();
+                       $id = $this->bocommon->increment_id('workorder');
+
+                       $vals[] = $id;
+                       $vals[] = $s_agreement['name'];
+                       $vals[] = $s_agreement['descr'];
+                       $vals[] = time();
+                       $vals[] = $s_agreement['cat_id'];
+                       $vals[] = $s_agreement['member_of'];
+                       $vals[] = $s_agreement['start_date'];
+                       $vals[] = $s_agreement['end_date'];
+                       $vals[] = $s_agreement['termination_date'];
+                       $vals[] = $s_agreement['vendor_id'];
+                       $vals[] = $s_agreement['b_account_id'];
+                       $vals[] = $this->account;
+
                        while (is_array($s_agreement['extra']) && 
list($input_name,$value) = each($s_agreement['extra']))
                        {
                                if($value)
@@ -647,17 +706,11 @@
                        if($cols)
                        {
                                $cols   = "," . implode(",", $cols);
-                               $vals   = "," . 
$this->bocommon->validate_db_insert($vals);
+                               $vals   = 
$this->bocommon->validate_db_insert($vals);
                        }

-                       $this->db->transaction_begin();
-               //      $id = $this->bocommon->next_id($table);
-                       $id = $this->bocommon->increment_id('workorder');
                        $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 ($id,'" . $s_agreement['name'] ."','" 
. $s_agreement['descr'] ."','" . time() . "','" . $s_agreement['cat_id'] . 
"','" . $s_agreement['member_of']
-                               . "','" . $s_agreement['start_date'] . "','" . 
$s_agreement['end_date'] . "','" . $s_agreement['termination_date']
-                               . "','" . $s_agreement['vendor_id'] . "','" . 
$s_agreement['b_account_id']
-                               . "','" . $this->account . "' $vals)");
+                               . "VALUES ($vals)",__LINE__,__FILE__);

                        $this->db->query("INSERT INTO fm_orders (id,type) 
VALUES ($id,'s_agreement')");

@@ -743,7 +796,7 @@
                        $start_date     = $this->db->f('start_date');


-                       $this->db->query("INSERT INTO fm_s_agreement_pricing 
(agreement_id,item_id,id,current_index,this_index,cost,date,entry_date,user_id) 
"
+                       $this->db->query("INSERT INTO fm_s_agreement_pricing 
(agreement_id,item_id,id,current_index,this_index,cost,index_date,entry_date,user_id)
 "
                                . "VALUES (" . $values['s_agreement_id'] . "," 
. $id .",1,1,1," . $this->floatval($values['cost']) . "," . (int)$start_date . 
"," . time()
                                . "," . $this->account . ")");

@@ -778,7 +831,7 @@
                        {
                                foreach($values_attribute as $entry)
                                {
-                                       if($entry['datatype']!='AB')
+                                       if($entry['datatype']!='AB' && 
$entry['datatype']!='VENDOR')
                                        {
                                                $value_set[$entry['name']]      
= $entry['value'];
                                        }
@@ -795,7 +848,7 @@
                        $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['s_agreement_id']));

-                       $this->db->query("UPDATE fm_s_agreement_pricing set 
date=" . intval($values['start_date']) . " WHERE id=1 AND agreement_id= " . 
intval($values['s_agreement_id']));
+                       $this->db->query("UPDATE fm_s_agreement_pricing set 
index_date=" . intval($values['start_date']) . " WHERE id=1 AND agreement_id= " 
. intval($values['s_agreement_id']));

                        $receipt['s_agreement_id']= $values['s_agreement_id'];
                        $receipt['message'][] = array('msg'=>lang('s_agreement 
%1 has been edited',$values['s_agreement_id']));
@@ -817,7 +870,7 @@
                        {
                                foreach($values_attribute as $entry)
                                {
-                                       if($entry['datatype']!='AB')
+                                       if($entry['datatype']!='AB' && 
$entry['datatype']!='VENDOR')
                                        {
                                                $value_set[$entry['name']]      
= $entry['value'];
                                        }
@@ -866,7 +919,7 @@

                                $this->db->query("UPDATE fm_s_agreement_pricing 
set current_index = NULL WHERE agreement_id=" . intval($values['agreement_id']) 
. ' AND item_id=' . intval($item_id));

-                               $this->db->query("INSERT INTO 
fm_s_agreement_pricing 
(agreement_id,item_id,id,current_index,this_index,cost,date,entry_date,user_id)"
+                               $this->db->query("INSERT INTO 
fm_s_agreement_pricing 
(agreement_id,item_id,id,current_index,this_index,cost,index_date,entry_date,user_id)"
                                        . "VALUES (" . $values['agreement_id'] 
. "," . $item_id ."," . ($values['id'][$item_id]+1) .",1,'" . 
$values['new_index'] . "','" . ($value * $values['new_index'])  . "'," . 
(int)$values['date'] . "," . time()
                                        . "," . $this->account . ")");

@@ -980,7 +1033,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " $where 
($attribute_table.input_text LIKE '%$query%' or $attribute_table.column_name 
LIKE '%$query%')";
+                               $querymethod = " $where 
($attribute_table.input_text $this->like '%$query%' or 
$attribute_table.column_name $this->like '%$query%')";
                        }

                        $sql = "SELECT * FROM $attribute_table $filtermethod 
$querymethod";

====================================================
Index: property/inc/class.sostandard_2.inc.php
diff -u property/inc/class.sostandard_2.inc.php:1.2 
property/inc/class.sostandard_2.inc.php:1.3
--- property/inc/class.sostandard_2.inc.php:1.2 Wed Jun  2 18:54:28 2004
+++ property/inc/class.sostandard_2.inc.php     Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class sostandard_2
        {
@@ -27,7 +37,7 @@
                        $this->socommon         = 
CreateObject($this->currentapp.'.socommon');

                        $this->join                     = $this->socommon->join;
-
+                       $this->like                     = $this->socommon->like;
                }

                function read($data)
@@ -66,7 +76,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " where id LIKE '%$query%' or 
descr LIKE '%$query%'";
+                               $querymethod = " where id $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }

                        $sql = "SELECT * FROM $table $querymethod";

====================================================
Index: property/inc/class.sowo_hour.inc.php
diff -u property/inc/class.sowo_hour.inc.php:1.2 
property/inc/class.sowo_hour.inc.php:1.3
--- property/inc/class.sowo_hour.inc.php:1.2    Wed Jun  2 18:54:28 2004
+++ property/inc/class.sowo_hour.inc.php        Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage project
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class sowo_hour
        {
@@ -27,6 +37,7 @@
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');

                        $this->join                     = $this->bocommon->join;
+                       $this->like                     = $this->bocommon->like;
                }

                function get_chapter_list()

====================================================
Index: property/inc/class.soworkorder.inc.php
diff -u property/inc/class.soworkorder.inc.php:1.3 
property/inc/class.soworkorder.inc.php:1.4
--- property/inc/class.soworkorder.inc.php:1.3  Fri Jun 11 18:45:50 2004
+++ property/inc/class.soworkorder.inc.php      Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage project
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class soworkorder
        {
@@ -28,6 +38,7 @@

                        $this->join                     = $this->bocommon->join;
                        $this->left_join        = $this->bocommon->left_join;
+                       $this->like                     = $this->bocommon->like;
                        $this->grants           = 
$GLOBALS['phpgw']->session->appsession('grants_project',$this->currentapp);

                        if(!$this->grants)
@@ -303,7 +314,7 @@
                                        $query = ereg_replace("'",'',$query);
                                        $query = ereg_replace('"','',$query);

-                                       $querymethod = " $where 
(fm_workorder.title LIKE '%$query%' or fm_workorder.descr LIKE '%$query%' or 
fm_project.address LIKE '%$query%' or fm_project.location_code LIKE '%$query%' 
or fm_workorder.id LIKE '%$query%')";
+                                       $querymethod = " $where 
(fm_workorder.title $this->like '%$query%' or fm_workorder.descr $this->like 
'%$query%' or fm_project.address $this->like '%$query%' or 
fm_project.location_code $this->like '%$query%' or fm_workorder.id $this->like 
'%$query%')";
                                }
                                $where= 'AND';

@@ -317,7 +328,7 @@
                                }
                                else
                                {
-                                       $querymethod_vendor = " $where  
fm_vendor.org_name LIKE '%$search_vendor%'";
+                                       $querymethod_vendor = " $where  
fm_vendor.org_name $this->like '%$search_vendor%'";
                                }
                        }


====================================================
Index: property/inc/class.uiadmin_location.inc.php
diff -u property/inc/class.uiadmin_location.inc.php:1.4 
property/inc/class.uiadmin_location.inc.php:1.5
--- property/inc/class.uiadmin_location.inc.php:1.4     Sat Oct 30 16:13:57 2004
+++ property/inc/class.uiadmin_location.inc.php Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uiadmin_location
        {
@@ -172,7 +182,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -263,7 +273,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -311,7 +321,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -443,7 +453,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_attribute' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -628,7 +638,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_attrib' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function config()
@@ -717,7 +727,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_config' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -778,7 +788,7 @@
 //_debug_array($data);
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_config' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }



====================================================
Index: property/inc/class.uiagreement.inc.php
diff -u property/inc/class.uiagreement.inc.php:1.5 
property/inc/class.uiagreement.inc.php:1.6
--- property/inc/class.uiagreement.inc.php:1.5  Sat Oct 30 16:13:57 2004
+++ property/inc/class.uiagreement.inc.php      Thu Jan 13 16:52:48 2005
@@ -1,20 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage agreement
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uiagreement
        {
@@ -77,7 +86,6 @@
                        $this->allrows          = $this->bo->allrows;
                        $this->member_id        = $this->bo->member_id;
                        $this->fakebase         = $this->bo->fakebase;
-
                }

                function save_sessiondata()
@@ -141,49 +149,46 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
$function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('columns' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function view_file()
                {
+                       $GLOBALS['phpgw_info']['flags'][noheader] = True;
+                       $GLOBALS['phpgw_info']['flags'][nofooter] = True;
+
                        if(!$this->acl_read)
                        {
                                
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uilocation.stop&perm=1&acl_location='
 . $this->acl2_location);
                        }

-                       $GLOBALS['phpgw_info']['flags']['noframework'] = True;
                        $file_name      = 
urldecode(get_var('file_name',array('POST','GET')));
                        $id             = get_var('id',array('POST','GET'));

                        $file = $this->fakebase. SEP . 'agreement' . SEP . $id 
. SEP . $file_name;

-//echo 'file: ' . $file . '<br>';
                        if($this->bo->vfs->file_exists(array(
                                'string' => $file,
                                'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
-                               $filename       = current(explode('.', 
basename($file_name)));
-
-                               $filetype       = 
$this->bo->vfs->file_type(array(
-                                                       'string' => $file,
-                                                       'relatives' => 
Array(RELATIVE_NONE)));

                                $size           = 
$this->bo->vfs->get_size(array(
                                                        'string' => $file,
                                                        'relatives' => 
Array(RELATIVE_NONE),
                                                        'checksubdirs' => 
True));

-                               $browser = CreateObject('phpgwapi.browser');
-                               
$browser->content_header($filename,$filetype,$size);
-
                                $document= $this->bo->vfs->read(array(
                                        'string' => $file,
                                        'relatives' => Array(RELATIVE_NONE)));

+                               $filename       = 
basename($values['document_name']);
+                               $filetype = array_pop(explode('.', 
basename($file)));
+                               $browser = CreateObject('phpgwapi.browser');
+                               
$browser->content_header($filename,$filetype,$size);
+
                                echo $document;

-//                             flush();
                        }
                }

@@ -273,7 +278,9 @@
                                                                                
                        'start_date'    => $start_date,
                                                                                
                        'role'                  => $this->role,
                                                                                
                        'member_id'             => $this->member_id,
-                                                                               
                        'end_date'=>$end_date)
+                                                                               
                        'allrows'               => $this->allrows,
+                                                                               
                        'end_date'              => $end_date
+                                                                               
                        )
                                                        ));
                                        }
                                }
@@ -321,7 +328,8 @@
                                                'filter'                
=>$this->filter,
                                                'query'                 
=>$this->query,
                                                'role'                  => 
$this->role,
-                                               'member_id'             => 
$this->member_id
+                                               'member_id'             => 
$this->member_id,
+                                               'allrows'               => 
$this->allrows
                        );

                        if(!$this->allrows)
@@ -343,7 +351,6 @@

                        $member_of_data = 
$this->cats->formatted_xslt_list(array('selected' => $this->member_id,'globals' 
=> True,link_data =>$link_data));

-//_debug_array($member_of_data);
                        $data = array
                        (
                                'overlib_source'                                
=> './'.$this->currentapp.'/inc/overlib.js',
@@ -352,7 +359,7 @@
                                'lang_columns_help'                             
=> lang('Choose columns'),
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'links'                                         
        => $links,
-                               'allow_allrows'                                 
=> false,
+                               'allow_allrows'                                 
=> True,
                                'allrows'                                       
        => $this->allrows,
                                'start_record'                                  
=> $this->start,
                                'record_limit'                                  
=> $record_limit,
@@ -388,7 +395,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('agreement') . ': ' . lang('list ' . $this->role);

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function list_content($list,$uicols,$edit_item='',$view_only='')
@@ -554,7 +561,7 @@
 //_debug_array($data);

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add_activity' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function edit()
@@ -1057,7 +1064,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('agreement') . ': ' . ($id?lang('edit') . ' ' . 
lang($this->role):lang('add') . ' ' . lang($this->role));

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function excel()
@@ -1257,14 +1264,13 @@
                                'lang_update_statustext'        => lang('update 
selected investments')
                        );

-
-
                        $data = array
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'edit_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'lang_id'                                       
        => lang('ID'),
                                'value_id'                                      
        => $values['id'],
+                               'value_num'                                     
        => $values['num'],
                                'value_agreement_id'                    => 
$agreement_id,
                                'lang_category'                                 
=> lang('category'),
                                'lang_save'                                     
        => lang('save'),
@@ -1326,7 +1332,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('agreement') . ': ' . ($values['id']?lang('edit item') . ' ' . 
$agreement['name']:lang('add item') . ' ' . $agreement['name']);

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_item' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function view_item()
@@ -1400,7 +1406,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('agreement') . ': ' . lang('view item') . ' ' . $agreement['name'];

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view_item' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -1452,7 +1458,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -1613,7 +1619,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('agreement') . ': ' . lang('view');

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -1746,7 +1752,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        //$this->save_sessiondata();
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_attribute' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function edit_attrib()
@@ -1921,7 +1927,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_attrib' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }
        }
 ?>
\ No newline at end of file

====================================================
Index: property/inc/class.uialarm.inc.php
diff -u property/inc/class.uialarm.inc.php:1.5 
property/inc/class.uialarm.inc.php:1.6
--- property/inc/class.uialarm.inc.php:1.5      Sat Oct 30 16:13:57 2004
+++ property/inc/class.uialarm.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uialarm
        {
@@ -90,6 +100,10 @@
                        {
                                $receipt = 
$this->bo->enable_alarm('fm_async',$values['alarm'],$values['enable_alarm']);
                        }
+                       elseif($values['test_cron']):
+                       {
+                                       $this->bo->test_cron();
+                       }
                        endif;

                        $list = $this->bo->read();
@@ -118,6 +132,13 @@

                                }

+                               if (substr($alarm['id'],0,8)=='fm_async')
+                               {
+                                       $link_edit                              
        = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uialarm.edit&async_id='
 . urlencode($alarm['id']));
+                                       $lang_edit_statustext           = 
lang('edit the alarm');
+                                       $text_edit                              
        = lang('edit');
+                               }
+
                                $content[] = array
                                (
                                        'id'                                    
        => $alarm['id'],
@@ -126,18 +147,17 @@
                                        'times'                                 
        => $times,
                                        'data'                                  
        => $data,
                                        'enabled'                               
        => $alarm['enabled'],
-                                       'user'                                  
        => $GLOBALS['phpgw']->accounts->id2name($alarm[account_id]),
-                                       'link_edit'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uialarm.edit&async_id='
 . urlencode($alarm['id'])),
-                                       'lang_view_statustext'          => 
lang('view the alarm'),
-                                       'lang_edit_statustext'          => 
lang('edit the alarm'),
-                                       'lang_delete_statustext'        => 
lang('delete the alarm'),
-                                       'text_view'                             
        => lang('view'),
-                                       'text_edit'                             
        => lang('edit'),
-                                       'text_delete'                           
=> lang('delete')
+                                       'user'                                  
        => $alarm['user'],
+                                       'link_edit'                             
        => $link_edit,
+                                       'lang_edit_statustext'          => 
$lang_edit_statustext,
+                                       'text_edit'                             
        => $text_edit
                                );
                                unset($alarm);
                                unset($data);
                                unset($times);
+                               unset($link_edit);
+                               unset($lang_edit_statustext);
+                               unset($text_edit);
                        }

                        $table_header = array
@@ -151,6 +171,26 @@
                                'lang_edit'                     => lang('edit'),
                                'lang_alarm_id'         => lang('alarm id'),
                                'lang_enabled'          => lang('enabled'),
+                               'sort_user'             => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   => 'account_lid',
+                                                                               
        'order' => $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uialarm.index',
+                                                                               
                                                        'cat_id'        => 
$this->cat_id,
+                                                                               
                                                        'query'         
=>$this->query,
+                                                                               
                                                        'allrows'       
=>$this->allrows)
+                                                                               
)),
+                               'sort_method'           => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   => 'method',
+                                                                               
        'order' => $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uialarm.index',
+                                                                               
                                                        'cat_id'        => 
$this->cat_id,
+                                                                               
                                                        'query'         
=>$this->query,
+                                                                               
                                                        'allrows'       
=>$this->allrows)
+                                                                               
)),
                                'sort_next_run'         => 
$this->nextmatchs->show_sort_order(array
                                                                                
(
                                                                                
        'sort'  => $this->sort,
@@ -164,7 +204,7 @@
                                'sort_alarm_id'         => 
$this->nextmatchs->show_sort_order(array
                                                                                
(
                                                                                
        'sort'  => $this->sort,
-                                                                               
        'var'   => 'alarm_id',
+                                                                               
        'var'   => 'id',
                                                                                
        'order' => $this->order,
                                                                                
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uialarm.index',
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
@@ -177,7 +217,8 @@
                        (
                                'lang_enable'           => lang('Enable'),
                                'lang_disable'          => lang('Disable'),
-                               'lang_delete'           => lang('Delete')
+                               'lang_delete'           => lang('Delete'),
+                               'lang_test_cron'        => lang('test cron')
                                );

                        $table_add = array
@@ -241,45 +282,22 @@
 //_debug_array($data);

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

-               function initiate_ui_addr_lookup($data)
+               function edit()
                {
-//_debug_array($data);
-
-                       if($data['type']=='view')
-                       {
-                               
$GLOBALS['phpgw']->xslttpl->add_file(array('abook_view'));
-                       }
-                       else
-                       {
-                               
$GLOBALS['phpgw']->xslttpl->add_file(array('abook_form'));
-                       }
-
-                       $owner['value_abid']                            = 
$data['abid'];
-                       $owner['value_org_name']                        = 
$data['org_name'];
+                       $method_id = get_var('method_id',array('POST'));
+                       $async_id       = 
urldecode(get_var('async_id',array('POST','GET')));
+                       $values         = get_var('values',array('POST'));

-                       if($data['abid'] && !$data['org_name'])
+                       if($async_id)
                        {
-                               $abook_data                                     
        = 
$this->contacts->read_single_entry($data['abid'],array('org_name'=>'org_name','email'=>'email'));
-                               $owner['value_org_name']                = 
$abook_data[0]['org_name'];
+                               $async_id_elements = explode(':',$async_id);
+                               $method_id = $async_id_elements[1];
                        }

-                       $owner['abook_link']                                    
= 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.addressbook');
-                       $owner['lang_contact']                                  
= lang('contact');
-                       $owner['lang_select_contact_help']              = 
lang('Klick this link to select owner from the addressbook');
-                       $owner['lang_org_name']                         = 
lang('Name');
-
-//_debug_array($owner);
-                       return $owner;
-               }
-
-
-               function edit()
-               {
-                       $async_id       = 
urldecode(get_var('async_id',array('POST','GET')));
-                       $values         = get_var('values',array('POST'));
+                       $this->method_id = 
($method_id?$method_id:$this->method_id);

                        $GLOBALS['phpgw']->xslttpl->add_file(array('alarm'));

@@ -311,15 +329,15 @@
                                        $values['alarm_id']     = $alarm_id;

                                        
$async=$this->boasync->read_single($this->method_id);
+//_debug_array($async);
                                        $data_set = unserialize($async['data']);
                                        $data_set['enabled']    = True;
-                                       $data_set['time']               = 
$times;
+                                       $data_set['times']              = 
$times;
                                        $data_set['owner']              = 
$this->account;
-                                       $data_set['event_id']           = 
$this->method_id;
-
+                                       $data_set['event_id']   = 
$this->method_id;
+                                       $data_set['id']                 = 
$async_id;

-//     _debug_array($async);
-                                       $receipt = 
$this->bo->save_alarm($alarm_type='fm_async',$entity_id=$this->method_id,$alarm=$data_set,$async['name']);
+                                       $async_id = 
$this->bo->save_alarm($alarm_type='fm_async',$entity_id=$this->method_id,$alarm=$data_set,$async['name']);

                                        if ($values['save'])
                                        {
@@ -334,34 +352,32 @@
                                
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uialarm.index');
                        }

-                       if ($alarm_id)
+                       if ($async_id)
                        {
-                               $alarm = $this->bo->read_single($alarm_id);
-                               $this->cat_id = 
($alarm['cat_id']?$alarm['cat_id']:$this->cat_id);
+                               $alarm = 
$this->bo->read_alarm($alarm_type='fm_async',$async_id);
+                               $this->method_id = 
($alarm['event_id']?$alarm['event_id']:$this->method_id);
                        }

                        $link_data = array
                        (
                                'menuaction'    => 
$this->currentapp.'.uialarm.edit',
-                               'alarm_id'              => $alarm_id
+                               'async_id'              => $async_id
                        );

                        $msgbox_data = $this->bocommon->msgbox_data($receipt);

+//_debug_array($alarm);
                        $data = array
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'abook_data'                                    
=> $abook_data,
                                'edit_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'lang_alarm_id'                                 
=> lang('ID'),
-                               'value_alarm_id'                                
=> $alarm_id,
-                               'lang_remark'                                   
=> lang('remark'),
+                               'lang_async_id'                                 
=> lang('ID'),
+                               'value_async_id'                                
=> $async_id,
                                'lang_method'                                   
=> lang('method'),
                                'lang_save'                                     
        => lang('save'),
                                'lang_cancel'                                   
=> lang('cancel'),
                                'lang_apply'                                    
=> lang('apply'),
-                               'value_remark'                                  
=> $alarm['remark'],
-                               'value_cat'                                     
        => $alarm['cat'],
                                'lang_apply_statustext'                 => 
lang('Apply the values'),
                                'lang_cancel_statustext'                => 
lang('Leave the owner untouched and return back to the list'),
                                'lang_save_statustext'                  => 
lang('Save the owner and return back to the list'),
@@ -370,24 +386,32 @@
                                'method_list'                                   
=> $this->bo->select_method_list($this->method_id),
                                'lang_timing'                                   
=> lang('timing'),
                                'lang_year'                                     
        => lang('year'),
+                               'value_year'                                    
=> $alarm['times']['year'],
                                'lang_month'                                    
=> lang('month'),
+                               'value_month'                                   
=> $alarm['times']['month'],
                                'lang_day'                                      
        => lang('day'),
+                               'value_day'                                     
        => $alarm['times']['day'],
                                'lang_dow'                                      
        => lang('Day of week (0-6, 0=Sun)'),
+                               'value_dow'                                     
        => $alarm['times']['dow'],
                                'lang_hour'                                     
        => lang('hour'),
+                               'value_hour'                                    
=> $alarm['times']['hour'],
                                'lang_minute'                                   
=> lang('minute'),
+                               'value_minute'                                  
=> $alarm['times']['min'],
                                'lang_data'                                     
        => lang('data'),
-                               'lang_data_statustext'                  => 
lang('inputdata for the method'),
-
-
-
+                               'lang_data_statustext'                  => 
lang('inputdata for the method')
                        );
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('async') . ': ' . ($owner_id?lang('edit timer'):lang('add timer'));
+//_debug_array($data);
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('async') . ': ' . ($async_id?lang('edit timer'):lang('add timer'));

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


+               /**
+               * @todo remove or alter this function
+               */
+
                function delete()
                {
                        $owner_id       = 
get_var('owner_id',array('POST','GET'));
@@ -424,7 +448,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -453,7 +477,7 @@
                        );

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }
        }
 ?>

====================================================
Index: property/inc/class.uistandard_2.inc.php
diff -u property/inc/class.uistandard_2.inc.php:1.4 
property/inc/class.uistandard_2.inc.php:1.5
--- property/inc/class.uistandard_2.inc.php:1.4 Sat Oct 30 16:13:57 2004
+++ property/inc/class.uistandard_2.inc.php     Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uistandard_2
        {
@@ -154,7 +164,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -230,7 +240,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -269,7 +279,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

        }

====================================================
Index: property/inc/class.uiadmin.inc.php
diff -u property/inc/class.uiadmin.inc.php:1.5 
property/inc/class.uiadmin.inc.php:1.6
--- property/inc/class.uiadmin.inc.php:1.5      Sat Oct 30 16:13:57 2004
+++ property/inc/class.uiadmin.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uiadmin
        {
@@ -55,6 +65,7 @@
                        $this->cat_id                           = 
$this->bo->cat_id;
                        $this->location                         = 
$this->bo->location;
                        $this->granting_group           = 
$this->bo->granting_group;
+                       $this->allrows                          = 
$this->bo->allrows;
                }

                function save_sessiondata()
@@ -68,7 +79,8 @@
                                'filter'                => $this->filter,
                                'cat_id'                => $this->cat_id,
                                'location'              => $this->location,
-                               'granting_group'                => 
$this->granting_group
+                               'granting_group'                => 
$this->granting_group,
+                               'allrows'       => $this->allrows
                        );

                        $this->bo->save_sessiondata($data);
@@ -245,7 +257,7 @@
                                'lang_group_statustext'                 => 
lang('Select the granting group. To do not use a granting group select NO 
GRANTING GROUP'),
                                'select_group_name'                             
=> 'granting_group',
                                'lang_no_group'                                 
=> lang('No granting group'),
-                               'group_list'                                    
        => $this->bocommon->get_group_list('filter',$this->granting_group),
+                               'group_list'                                    
=> 
$this->bocommon->get_group_list('filter',$this->granting_group,$start=-1,$sort='ASC',$order='account_firstname',$query='',$offset=-1),
                        );

                        $appname                                                
= lang('preferences');
@@ -254,7 +266,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg . ': ' . 
$owner_name;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_permission' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();

                }
@@ -278,7 +290,7 @@

                        if ($this->location)
                        {
-                               if(!$this->cat_id || $this->cat_id=='accounts')
+                               if($this->cat_id=='accounts')
                                {
                                        $user_list = 
$this->bo->get_user_list2('accounts',$app_id);
                                }
@@ -335,7 +347,7 @@
                                        }
                                }

-                               if(!$this->cat_id || $this->cat_id=='groups')
+                               if($this->cat_id=='groups')
                                {
                                        $group_list = 
$this->bo->get_user_list2('groups',$app_id);
                                }
@@ -454,10 +466,24 @@
                                $receipt['error'][] = array('msg' => 
lang('select a location!'));
                        }

+                       if(!$this->allrows)
+                       {
+                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                       }
+                       else
+                       {
+                               $record_limit   = $this->bo->total_records;
+                       }
+
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);

                        $data = array
                        (
+                               'allrows'                                       
        => $this->allrows,
+                               'allow_allrows'                                 
=> true,
+                               'start_record'                                  
=> $this->start,
+                               'record_limit'                                  
=> $record_limit,
+
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'done_action'                                   
=> $GLOBALS['phpgw']->link('/admin/index.php'),
@@ -466,12 +492,10 @@
                                'processed'                                     
        => $processed,
                                'location'                                      
        => $this->location,
                                'links'                                         
        => $links,
-                               'allow_allrows'                                 
=> false,
-                               'start_record'                                  
=> $this->start,
-                               'record_limit'                                  
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
+
                                'num_records'                                   
=> count($user_list),
                                'all_records'                                   
=> $this->bo->total_records,
-                               'link_url'                                      
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiadmin.list_acl2'),
+                               'link_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),

                                'lang_no_cat'                                   
=> lang('no category'),
@@ -505,7 +529,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_permission' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -568,7 +592,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_id' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -642,7 +666,8 @@

                                'lang_approval_from'                    => 
lang('Approval from'),
                                'value_old_approval_from'               => 
$prefs['approval_from'],
-                               'approval_from'                                 
=> $this->bocommon->get_user_list('select',$prefs['approval_from']),
+                               'approval_from'                                 
=> 
$this->bocommon->get_user_list('select',$prefs['approval_from'],$extra=False,$default=False,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1),
+
                                'select_user_name'                              
=> 'approval_from',
                                'lang_approval_from_statustext' => lang('Select 
the users supervisor'),

@@ -658,7 +683,7 @@
                                'select_user_name'                              
=> 'filter',
                                'lang_no_user'                                  
=> lang('No user'),
                                'value_user_id'                                 
=> $this->filter,
-                               'user_list'                                     
        => $this->bocommon->get_user_list('filter',$this->filter)
+                               'user_list'                                     
        => 
$this->bocommon->get_user_list('filter',$this->filter,$extra=False,$default=False,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1),
                        );

                        $appname                                                
        = lang('User contact info');
@@ -666,7 +691,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('contact_info' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }


====================================================
Index: property/inc/class.uiXport.inc.php
diff -u property/inc/class.uiXport.inc.php:1.7 
property/inc/class.uiXport.inc.php:1.8
--- property/inc/class.uiXport.inc.php:1.7      Sat Oct 30 16:13:57 2004
+++ property/inc/class.uiXport.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,20 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-  /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uiXport
        {
@@ -385,7 +394,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('import' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function debug_import($buffer='',$invoice_common='')
@@ -497,7 +506,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('debug' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function export()
@@ -527,7 +536,8 @@
                                        $receipt = 
$this->bo->export(array('conv_type'=>$values['conv_type'],'download'=>$values['download']));
                                        if(!$values['download'])
                                        {
-
+                                               
$GLOBALS['phpgw_info']['flags'][noheader] = True;
+                                               
$GLOBALS['phpgw_info']['flags'][nofooter] = True;
                                                
$GLOBALS['phpgw_info']['flags']['noframework'] = True;
                                                echo '<pre>' . 
$receipt['message'][0]['msg'] . '</pre>';
                                                echo '&nbsp<a 
href="'.$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiXport.export')
 . '">' . lang('Back') . '</a>';
@@ -580,7 +590,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('export' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function rollback()
@@ -681,7 +691,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('rollback' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }
        }
 ?>

====================================================
Index: property/inc/class.uiactor.inc.php
diff -u property/inc/class.uiactor.inc.php:1.6 
property/inc/class.uiactor.inc.php:1.7
--- property/inc/class.uiactor.inc.php:1.6      Sat Oct 30 16:13:57 2004
+++ property/inc/class.uiactor.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,20 +1,35 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+
+       /**
+        * uiactor class
+        *
+        * uiactor is the ui-class for three set of actors, separarated by 
their roles:
+        * - Tenant
+        * - Vendor
+        * - Owner
+        * @package property
+        */

        class uiactor
        {
@@ -142,14 +157,20 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
$function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('columns' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }



                function index()
                {
-                       $this->menu->sub        = $this->role;
+                       $menu_sub = array(
+                               'tenant'=>'admin',
+                               'owner' =>'admin',
+                               'vendor'=>'invoice'
+                               );
+
+                       $this->menu->sub        = $menu_sub[$this->role];

                        if(!$this->acl_read)
                        {
@@ -163,7 +184,7 @@
                                                                                
'nextmatchs',
                                                                                
'filter_member_of'));

-                       $links = $this->menu->links();
+                       $links = $this->menu->links($this->role);

                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data',$this->role . '_receipt');
                        
$GLOBALS['phpgw']->session->appsession('session_data',$this->role . 
'_receipt','');
@@ -342,7 +363,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('actor') . ': ' . lang('list ' . $this->role);

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function edit()
@@ -460,13 +481,14 @@
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'edit_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'lang_actor_id'                                 
=> lang('actor ID'),
+                               'lang_actor_id'                                 
=> lang($this->role) . ' ID',
                                'value_actor_id'                                
=> $actor_id,
                                'lang_category'                                 
=> lang('category'),
                                'lang_save'                                     
        => lang('save'),
                                'lang_cancel'                                   
=> lang('cancel'),
                                'lang_apply'                                    
=> lang('apply'),
                                'value_cat'                                     
        => $actor['cat'],
+                               'lang_id_statustext'                    => 
lang('Choose an ID'),
                                'lang_apply_statustext'                 => 
lang('Apply the values'),
                                'lang_cancel_statustext'                => 
lang('Leave the actor untouched and return back to the list'),
                                'lang_save_statustext'                  => 
lang('Save the actor and return back to the list'),
@@ -493,7 +515,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('actor') . ': ' . ($actor_id?lang('edit') . ' ' . 
lang($this->role):lang('add') . ' ' . lang($this->role));

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -545,7 +567,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -576,6 +598,8 @@

                        $data = array
                        (
+                               'lang_actor_id'                         => 
lang($this->role) . ' ID',
+                               'value_actor_id'                        => 
$actor_id,
                                'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiactor.index&role='
 . $this->role),
                                'lang_category'                         => 
lang('category'),
                                'lang_time_created'                     => 
lang('time created'),
@@ -592,7 +616,7 @@
                        );

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function list_attribute()
@@ -724,7 +748,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        //$this->save_sessiondata();
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_attribute' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function edit_attrib()
@@ -900,7 +924,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_attrib' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }
        }
 ?>
\ No newline at end of file

====================================================
Index: property/inc/class.uiasync.inc.php
diff -u property/inc/class.uiasync.inc.php:1.5 
property/inc/class.uiasync.inc.php:1.6
--- property/inc/class.uiasync.inc.php:1.5      Sat Oct 30 16:13:57 2004
+++ property/inc/class.uiasync.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uiasync
        {
@@ -87,11 +97,17 @@
                                        'name'                                  
        => $method['name'],
                                        'first'                                 
        => $method['descr'],
                                        'data'                                  
        => @implode (',',$method_data),
+                                       'link_run'                              
        => $GLOBALS['phpgw']->link('/index.php','menuaction='.$method['name'] . 
'&' . @implode ('&',$method_data)),
+                                       'link_schedule'                         
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uialarm.edit&method_id='
 . $method['id']),
                                        'link_edit'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiasync.edit&id='
 . $method['id']),
                                        'link_delete'                           
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiasync.delete&id='
 . $method['id']),
+                                       'lang_schedule_statustext'=> 
lang('schedule the method'),
+                                       'lang_run_statustext'   => lang('Run 
the method now'),
                                        'lang_view_statustext'  => lang('view 
the method'),
                                        'lang_edit_statustext'  => lang('edit 
the method'),
                                        'lang_delete_statustext'        => 
lang('delete the method'),
+                                       'text_schedule'                         
=> lang('Schedule'),
+                                       'text_run'                              
        => lang('Run Now'),
                                        'text_view'                             
        => lang('view'),
                                        'text_edit'                             
        => lang('edit'),
                                        'text_delete'                           
=> lang('delete')
@@ -105,6 +121,8 @@

                                'lang_descr'            => lang('Descr'),
                                'lang_data'                     => lang('Data'),
+                               'lang_schedule'         => lang('Schedule'),
+                               'lang_run'                      => lang('Run 
Now'),
                                'lang_edit'                     => lang('edit'),
                                'lang_delete'           => lang('delete'),
                                'sort_id'       => 
$this->nextmatchs->show_sort_order(array
@@ -159,7 +177,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -196,9 +214,13 @@
                                        }
                                }

-                               $values['data']=serialize($data_set);
+                               if($values['data'])
+                               {
+                                       $values['data']=serialize($data_set);
+                               }

                                $receipt = $this->bo->save($values,$action);
+                               $id = $receipt['id'];
                        }

                        if ($id)
@@ -257,7 +279,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -294,7 +316,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

        }

====================================================
Index: property/inc/class.uitts.inc.php
diff -u property/inc/class.uitts.inc.php:1.5 
property/inc/class.uitts.inc.php:1.6
--- property/inc/class.uitts.inc.php:1.5        Sat Oct 30 16:13:57 2004
+++ property/inc/class.uitts.inc.php    Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage helpdesk
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uitts
        {
@@ -281,7 +291,7 @@
                                'sort_opened_by'        => 
$this->nextmatchs->show_sort_order(array
                                                                                
(
                                                                                
        'sort'  => $this->sort,
-                                                                               
        'var'   =>      'user',
+                                                                               
        'var'   =>      'user_lid',
                                                                                
        'order' =>      $this->order,
                                                                                
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uitts.index',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
@@ -441,7 +451,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -614,7 +624,7 @@

                                'lang_group'                                    
=> lang('Group'),
                                'lang_no_group'                                 
=> lang('No group'),
-                               'group_list'                                    
=> $this->bocommon->get_group_list('select',$values['group_id']),
+                               'group_list'                                    
=> 
$this->bocommon->get_group_list('select',$values['group_id'],$start=-1,$sort='ASC',$order='account_firstname',$query='',$offset=-1),
                                'select_group_name'                             
=> 'values[group_id]',

                                'lang_priority'                                 
=> lang('Priority'),
@@ -655,7 +665,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add' 
=> $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -867,7 +877,7 @@

                                'lang_group'                                    
=> lang('Group'),
                                'lang_no_group'                                 
=> lang('No group'),
-                               'group_list'                                    
=> $this->bocommon->get_group_list('select',$ticket['group_id']),
+                               'group_list'                                    
=> 
$this->bocommon->get_group_list('select',$ticket['group_id'],$start=-1,$sort='ASC',$order='account_firstname',$query='',$offset=-1),
                                'select_group_name'                             
=> 'values[group_id]',

                                'lang_priority'                                 
=> lang('Priority'),
@@ -927,7 +937,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }
        }
 ?>

====================================================
Index: property/inc/class.uiworkorder.inc.php
diff -u property/inc/class.uiworkorder.inc.php:1.4 
property/inc/class.uiworkorder.inc.php:1.5
--- property/inc/class.uiworkorder.inc.php:1.4  Sat Oct 30 16:13:57 2004
+++ property/inc/class.uiworkorder.inc.php      Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage project
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uiworkorder
        {
@@ -83,7 +93,9 @@

                function excel()
                {
-                       $GLOBALS['phpgw_info']['flags']['noframework'] = True;
+                       $GLOBALS['phpgw_info']['flags'][noheader] = True;
+                       $GLOBALS['phpgw_info']['flags'][nofooter] = True;
+
                        require('PEAR.php');
                        $xls            = 
CreateObject($this->currentapp.'.excel');

@@ -458,7 +470,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_workorder' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -667,6 +679,19 @@
                                                'lookup_type'   => 'view'
                                                ));

+
+                       if($project['contact_phone'])
+                       {
+                               for 
($i=0;$i<count($location_data['location']);$i++)
+                               {
+                                       
if($location_data['location'][$i]['input_name'] == 'contact_phone')
+                                       {
+                                               
unset($location_data['location'][$i]['value']);
+                                       }
+                               }
+                       }
+
+
                        
$vendor_data=$this->bocommon->initiate_ui_vendorlookup(array(
                                                'vendor_id'             => 
$values['vendor_id'],
                                                'vendor_name'   => 
$values['vendor_name']));
@@ -751,6 +776,9 @@
                                'lang_copy_workorder'                   => 
lang('Copy workorder ?'),
                                'lang_copy_workorder_statustext'        => 
lang('Choose Copy Workorder to copy this workorder to a new workorder'),

+                               'lang_contact_phone'                    => 
lang('Contact phone'),
+                               'contact_phone'                                 
=> $project['contact_phone'],
+
                                'lang_charge_tenant'                    => 
lang('Charge tenant'),
                                'lang_charge_tenant_statustext' => lang('Choose 
charge tenant if the tenant i to pay for this project'),
                                'charge_tenant'                                 
=> $values['charge_tenant'],
@@ -818,7 +846,7 @@
                                'lang_coordinator'                              
=> lang('Coordinator'),
                                'lang_sum'                                      
        => lang('Sum'),
                                'select_user_name'                              
=> 'values[coordinator]',
-                               'user_list'                                     
        => $this->bocommon->get_user_list('select',$project['coordinator']),
+                               'user_list'                                     
        => 
$this->bocommon->get_user_list('select',$project['coordinator'],$extra=False,$default=False,$start=-1,$sort=False,$order=False,$query='',$offset=-1),

                                'status_list'                                   
=> $this->bo->select_status_list('select',$values['status']),
                                'select_status_name'                    => 
'values[status]',
@@ -855,7 +883,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function add()
@@ -894,7 +922,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add' 
=> $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -935,7 +963,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function view()
@@ -985,6 +1013,19 @@
                                                'lookup_type'   => 'view'
                                                ));

+
+                       if($project['contact_phone'])
+                       {
+                               for 
($i=0;$i<count($location_data['location']);$i++)
+                               {
+                                       
if($location_data['location'][$i]['input_name'] == 'contact_phone')
+                                       {
+                                               
unset($location_data['location'][$i]['value']);
+                                       }
+                               }
+                       }
+
+
                        $data = array
                        (
                                'project_link'                                  
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiproject.view'),
@@ -1059,7 +1100,7 @@

                                'lang_coordinator'                              
=> lang('Coordinator'),
                                'lang_sum'                                      
        => lang('Sum'),
-                               'user_list'                                     
        => $this->bocommon->get_user_list('select',$project['coordinator']),
+                               'user_list'                                     
        => 
$this->bocommon->get_user_list('select',$project['coordinator'],$extra=False,$default=False,$start=-1,$sort=False,$order=False,$query='',$offset=-1),

                                'status_list'                                   
=> $this->bo->select_status_list('select',$values['status']),
                                'lang_no_status'                                
=> lang('Select status'),
@@ -1085,14 +1126,16 @@
                                'total_hours_records'                   => 
$hour_data['total_hours_records'],
                                'table_header_hour'                             
=> $hour_data['table_header'],
                                'values_hour'                                   
=> $hour_data['content'],
-                               'table_sum'                                     
        => $hour_data['table_sum']
+                               'table_sum'                                     
        => $hour_data['table_sum'],
+                               'lang_contact_phone'                    => 
lang('Contact phone'),
+                               'contact_phone'                                 
=> $project['contact_phone']
                        );

                        $appname                                                
= lang('Workorder');

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }
        }
 ?>

====================================================
Index: property/inc/hook_admin.inc.php
diff -u property/inc/hook_admin.inc.php:1.9 property/inc/hook_admin.inc.php:1.10
--- property/inc/hook_admin.inc.php:1.9 Fri Oct 22 13:59:42 2004
+++ property/inc/hook_admin.inc.php     Thu Jan 13 16:52:48 2005
@@ -1,21 +1,25 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       // $Id$
-       // $Source$
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
                {
                        $file = array
                        (

====================================================
Index: property/inc/hook_help.inc.php
diff -u property/inc/hook_help.inc.php:1.2 property/inc/hook_help.inc.php:1.3
--- property/inc/hook_help.inc.php:1.2  Wed Jun  2 18:54:28 2004
+++ property/inc/hook_help.inc.php      Thu Jan 13 16:52:48 2005
@@ -1,20 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage manual
+       * @version $Id$
+       */
+
+
+       /**
+        * Description
+        */

        include(PHPGW_SERVER_ROOT.'/'.'property'.'/setup/setup.inc.php');


====================================================
Index: property/inc/class.uiwo_hour.inc.php
diff -u property/inc/class.uiwo_hour.inc.php:1.5 
property/inc/class.uiwo_hour.inc.php:1.6
--- property/inc/class.uiwo_hour.inc.php:1.5    Sat Oct 30 16:13:57 2004
+++ property/inc/class.uiwo_hour.inc.php        Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage project
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uiwo_hour
        {
@@ -167,7 +177,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_deviation' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function edit_deviation()
@@ -268,7 +278,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_deviation' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function common_data($workorder_id,$view='')
@@ -366,7 +376,7 @@
                                'lang_billperae'        => lang('Bill per 
unit'),
                                'lang_quantity'         => lang('Quantity'),
                                'lang_cost'                     => lang('cost'),
-                               'lang_deviation '       => lang('deviation '),
+                               'lang_deviation '       => lang('deviation'),
                                'lang_result'           => lang('result'),
                                'lang_view'                     => lang('view'),
                                'lang_edit'                     => lang('edit'),
@@ -487,7 +497,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add_template' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function index()
@@ -574,7 +584,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_hour' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -628,6 +638,16 @@
                                                'lookup_type'   => 'view'
                                                ));

+                       if($project['contact_phone'])
+                       {
+                               for 
($i=0;$i<count($location_data['location']);$i++)
+                               {
+                                       
if($location_data['location'][$i]['input_name'] == 'contact_phone')
+                                       {
+                                               
unset($location_data['location'][$i]['value']);
+                                       }
+                               }
+                       }

                        if(!$show_cost)
                        {
@@ -699,7 +719,6 @@
                                'lang_title'                                    
=>      lang('Title'),
                                'title'                                         
        =>      $workorder['title'],

-
                                'lang_descr'                                    
=>      lang('Description'),
                                'descr'                                         
        =>      $workorder['descr'],

@@ -709,6 +728,8 @@
                                'lang_sum_calculation'                  =>      
lang('Sum of calculation'),
                                'sum_calculation'                               
=>      $common_data['table_sum'][0]['value_total_sum'],

+                               'lang_contact_phone'                    => 
lang('Contact phone'),
+                               'contact_phone'                                 
=> $project['contact_phone'],

 //                             'lang_vendor'                                   
=>      lang('vendor'),

@@ -832,7 +853,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();

                        $this->save_sessiondata();
                }
@@ -840,7 +861,8 @@

                function tender()
                {
-                       $GLOBALS['phpgw_info']['flags']['noframework'] = True;
+                       $GLOBALS['phpgw_info']['flags'][noheader] = True;
+                       $GLOBALS['phpgw_info']['flags'][nofooter] = True;

                        $pdf                                    = 
CreateObject($this->currentapp.'.pdf');
                        if(!$this->acl_read)
@@ -1164,7 +1186,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('prizebook' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -1395,7 +1417,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_template_hour' => 
$data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -1569,7 +1591,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_hour' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -1647,7 +1669,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

        }

====================================================
Index: property/inc/class.soproject.inc.php
diff -u property/inc/class.soproject.inc.php:1.7 
property/inc/class.soproject.inc.php:1.8
--- property/inc/class.soproject.inc.php:1.7    Tue Sep 14 20:24:14 2004
+++ property/inc/class.soproject.inc.php        Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage project
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class soproject
        {
@@ -27,6 +37,7 @@
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');

                        $this->join                     = $this->bocommon->join;
+                       $this->like                     = $this->bocommon->like;

                        $this->grants   = 
$GLOBALS['phpgw']->session->appsession('grants_project',$this->currentapp);

@@ -255,7 +266,7 @@
                                {
                                        $query = ereg_replace("'",'',$query);
                                        $query = ereg_replace('"','',$query);
-                                       $querymethod = " $where 
(fm_project.name LIKE '%$query%' or fm_project.address LIKE '%$query%' or 
fm_project.location_code LIKE '%$query%' or fm_project.id LIKE '%$query%')";
+                                       $querymethod = " $where 
(fm_project.name $this->like '%$query%' or fm_project.address $this->like 
'%$query%' or fm_project.location_code $this->like '%$query%' or fm_project.id 
$this->like '%$query%')";
                                }
                        }

@@ -333,6 +344,8 @@
                                $project['p_num']                               
= $this->db->f('p_num');
                                $project['p_entity_id']                 = 
$this->db->f('p_entity_id');
                                $project['p_cat_id']                    = 
$this->db->f('p_cat_id');
+                               $project['contact_phone']               = 
$this->db->f('contact_phone');
+

                                $project['power_meter'] = 
$this->get_power_meter($this->db->f('location_code'));
                        }
@@ -498,7 +511,7 @@
                                . 
"descr,budget,reserve,location_code,address,key_deliver,key_fetch,other_branch,key_responsible,charge_tenant,user_id
 $cols) "
                                . "VALUES ($values $vals )",__LINE__,__FILE__);

-                       if($project['extra']['contact_phone'])
+                       if($project['extra']['contact_phone'] && 
$project['extra']['tenant_id'])
                        {
                                $this->db->query("update fm_tenant set 
contact_phone='". $project['extra']['contact_phone']. "' where id='". 
$project['extra']['tenant_id']. "'",__LINE__,__FILE__);
                        }
@@ -594,7 +607,7 @@
                {
                        $prefix = 'meter';
                        $pos    = strlen($prefix);
-                       $this->db->query("select max(num) from fm_meter where 
num like ('$prefix%')");
+                       $this->db->query("select max(num) from fm_meter where 
num $this->like ('$prefix%')");
                        $this->db->next_record();

                        $max = 
$this->bocommon->add_leading_zero(substr($this->db->f(0),$pos));
@@ -668,7 +681,7 @@

                        $this->db->query("UPDATE fm_project set $value_set 
$vals WHERE id= '" . $project['project_id'] ."'",__LINE__,__FILE__);

-                       if($project['extra']['contact_phone'])
+                       if($project['extra']['contact_phone'] && 
$project['extra']['tenant_id'])
                        {
                                $this->db->query("update fm_tenant set 
contact_phone='". $project['extra']['contact_phone']. "' where id='". 
$project['extra']['tenant_id']. "'",__LINE__,__FILE__);
                        }

====================================================
Index: property/inc/class.uistandard_entity.inc.php
diff -u property/inc/class.uistandard_entity.inc.php:1.4 
property/inc/class.uistandard_entity.inc.php:1.5
--- property/inc/class.uistandard_entity.inc.php:1.4    Sat Oct 30 16:13:57 2004
+++ property/inc/class.uistandard_entity.inc.php        Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uistandard_entity
        {
@@ -166,7 +176,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -256,7 +266,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -306,7 +316,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }


@@ -401,7 +411,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_attribute' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -511,7 +521,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_attrib' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

        }

====================================================
Index: property/inc/class.uitemplate.inc.php
diff -u property/inc/class.uitemplate.inc.php:1.4 
property/inc/class.uitemplate.inc.php:1.5
--- property/inc/class.uitemplate.inc.php:1.4   Sat Oct 30 16:13:57 2004
+++ property/inc/class.uitemplate.inc.php       Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage project
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uitemplate
        {
@@ -215,7 +225,7 @@
                                'lang_user_statustext'                  => 
lang('Select the user the template belongs to. To do not use a category select 
NO USER'),
                                'select_user_name'                              
=> 'filter',
                                'lang_no_user'                                  
=> lang('No user'),
-                               'user_list'                                     
        => $this->bocommon->get_user_list('filter',$this->filter),
+                               'user_list'                                     
        => 
$this->bocommon->get_user_list('filter',$this->filter,$extra=False,$default=False,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1),

                                'lang_searchfield_statustext'   => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
                                'lang_searchbutton_statustext'  => lang('Submit 
the search string'),
@@ -232,7 +242,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -448,7 +458,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;

                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_template_hour' => 
$data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -534,7 +544,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_template' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function edit_hour()
@@ -689,7 +699,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_hour' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -726,7 +736,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

        }

====================================================
Index: property/inc/hook_home.inc.php
diff -u property/inc/hook_home.inc.php:1.2 property/inc/hook_home.inc.php:1.3
--- property/inc/hook_home.inc.php:1.2  Wed Jun  2 18:54:28 2004
+++ property/inc/hook_home.inc.php      Thu Jan 13 16:52:48 2005
@@ -1,20 +1,24 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage core
+       * @version $Id$
+       */

        if 
($GLOBALS['phpgw_info']['user']['preferences']['property']['mainscreen_show_new_updated'])
        {

====================================================
Index: property/inc/hook_manual.inc.php
diff -u property/inc/hook_manual.inc.php:1.3 
property/inc/hook_manual.inc.php:1.4
--- property/inc/hook_manual.inc.php:1.3        Sat Oct 23 18:33:14 2004
+++ property/inc/hook_manual.inc.php    Thu Jan 13 16:52:48 2005
@@ -1,20 +1,24 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage core
+       * @version $Id$
+       */

        // Only Modify the $file variable.....
        $file = Array(

====================================================
Index: property/inc/hook_preferences.inc.php
diff -u property/inc/hook_preferences.inc.php:1.2 
property/inc/hook_preferences.inc.php:1.3
--- property/inc/hook_preferences.inc.php:1.2   Wed Jun  2 18:54:28 2004
+++ property/inc/hook_preferences.inc.php       Thu Jan 13 16:52:48 2005
@@ -1,27 +1,28 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-  /* $Id$ */
-
-
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage core
+       * @version $Id$
+       */

        $title = $appname;
        $file = Array(
                'Preferences'           => 
$GLOBALS['phpgw']->link('/preferences/preferences.php','appname='.$appname . 
'&type=user'),
-//             'Grant Access'  => 
$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname)
                'Grant Access'  => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiadmin.aclprefs&acl_app='.$appname)
        );
        display_section($appname,$file);

====================================================
Index: property/inc/hook_settings.inc.php
diff -u property/inc/hook_settings.inc.php:1.3 
property/inc/hook_settings.inc.php:1.4
--- property/inc/hook_settings.inc.php:1.3      Fri Oct 22 17:50:18 2004
+++ property/inc/hook_settings.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,20 +1,25 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage core
+       * @version $Id$
+       */
+
        $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];

        $yes_and_no = array(

====================================================
Index: property/inc/class.uistandard_3.inc.php
diff -u property/inc/class.uistandard_3.inc.php:1.4 
property/inc/class.uistandard_3.inc.php:1.5
--- property/inc/class.uistandard_3.inc.php:1.4 Sat Oct 30 16:13:57 2004
+++ property/inc/class.uistandard_3.inc.php     Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class uistandard_3
        {
@@ -154,7 +164,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }

@@ -229,7 +239,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

                function delete()
@@ -268,7 +278,7 @@

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $GLOBALS['phpgw']->xslttpl->pp();
                }

        }

====================================================
Index: property/inc/class.bometer.inc.php
diff -u property/inc/class.bometer.inc.php:1.2 
property/inc/class.bometer.inc.php:1.3
--- property/inc/class.bometer.inc.php:1.2      Wed Jun  2 18:54:27 2004
+++ property/inc/class.bometer.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage entity
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class bometer
        {

====================================================
Index: property/inc/class.bocommon.inc.php
diff -u property/inc/class.bocommon.inc.php:1.7 
property/inc/class.bocommon.inc.php:1.8
--- property/inc/class.bocommon.inc.php:1.7     Tue Sep 14 09:18:20 2004
+++ property/inc/class.bocommon.inc.php Thu Jan 13 16:52:48 2005
@@ -1,20 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage core
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class bocommon
        {
@@ -68,6 +77,7 @@

                        $this->join                     = $this->socommon->join;
                        $this->left_join        = $this->socommon->left_join;
+                       $this->like                     = $this->socommon->like;

                        switch($GLOBALS['phpgw_info']['server']['db_type'])
                        {
@@ -104,7 +114,9 @@
                function jscalendar()
                {
                        $phpgw_js_url = 
$GLOBALS['phpgw_info']['server']['webserver_url'].'/phpgwapi/js';
-                       $img = 
$GLOBALS['phpgw']->common->get_image_path('phpgwapi','default').'/cal.png';
+//                     $img = 
$GLOBALS['phpgw']->common->get_image_path('phpgwapi','default').'/cal.png';
+                       $img    = 
$GLOBALS['phpgw_info']['server']['webserver_url'] . 
'/phpgwapi/templates/default/images/cal.png';
+
 //                     $img = $phpgw_js_url.'/jscalendar/img.gif';
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
                        $jsDateFormat = str_replace(array('d', 'm', 'M', 'Y'), 
array('%d', '%m', '%b', '%Y'), $dateformat);
@@ -303,7 +315,7 @@
                }


-               function 
get_user_list($format='',$selected='',$extra='',$default='')
+               function 
get_user_list($format='',$selected='',$extra='',$default='',$start='', 
$sort='', $order='', $query='',$offset='')
                {
                        switch($format)
                        {
@@ -333,7 +345,7 @@
                        }

                        $accounts       = CreateObject('phpgwapi.accounts');
-                       $users = $accounts->get_list('accounts', $start, $sort, 
$order, $query);
+                       $users = $accounts->get_list('accounts', $start, $sort, 
$order, $query,$offset);
                        unset($accounts);
                        if (is_array($users_extra) && is_array($users))
                        {
@@ -372,7 +384,7 @@
                        return $user_list;
                }

-               function get_group_list($format='',$selected='')
+               function get_group_list($format='',$selected='',$start='', 
$sort='', $order='', $query='',$offset='')
                {
                        switch($format)
                        {
@@ -385,7 +397,7 @@
                        }

                        $accounts       = CreateObject('phpgwapi.accounts');
-                       $users = $accounts->get_list('groups', $start, $sort, 
$order, $query);
+                       $users = $accounts->get_list('groups', $start, $sort, 
$order, $query,$offset);
                        unset($accounts);
                        if (isSet($users) AND is_array($users))
                        {
@@ -480,7 +492,9 @@
                                }
                        }

+
                        
$users=$this->socommon->get_user_list_right($right,$acl_location);
+//_debug_array($users);

                        if (is_array($users_extra) && is_array($users))
                        {
@@ -714,6 +728,7 @@
                                'CH' => 'Muliple checkbox',
                                'LB' => 'Listbox',
                                'AB' => 'Contact',
+                               'VENDOR' => 'Vendor',
                                'email' => 'Email'
                        );

@@ -735,6 +750,7 @@
                                'CH' => 'text',
                                'LB' => 'int',
                                'AB' => 'int',
+                               'VENDOR' => 'int',
                                'email' => 'varchar'
                        );

@@ -1239,8 +1255,10 @@
                        $datatypes[8]['name']= lang('ListBox');
                        $datatypes[9]['id']= 'AB';
                        $datatypes[9]['name']= lang('Contact');
-                       $datatypes[10]['id']= 'email';
-                       $datatypes[10]['name']= lang('Email');
+                       $datatypes[10]['id']= 'VENDOR';
+                       $datatypes[10]['name']= lang('Vendor');
+                       $datatypes[11]['id']= 'email';
+                       $datatypes[11]['name']= lang('Email');

                        return $this->select_list($selected,$datatypes);

@@ -1259,7 +1277,9 @@

                function excel($list,$name,$descr)
                {
-                       $GLOBALS['phpgw_info']['flags']['noframework'] = True;
+                       $GLOBALS['phpgw_info']['flags'][noheader] = True;
+                       $GLOBALS['phpgw_info']['flags'][nofooter] = True;
+
                        require('PEAR.php');
                        $xls            = 
CreateObject($this->currentapp.'.excel');


====================================================
Index: property/inc/class.bocustom.inc.php
diff -u property/inc/class.bocustom.inc.php:1.2 
property/inc/class.bocustom.inc.php:1.3
--- property/inc/class.bocustom.inc.php:1.2     Wed Jun  2 18:54:27 2004
+++ property/inc/class.bocustom.inc.php Thu Jan 13 16:52:48 2005
@@ -1,20 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage custom
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class bocustom
        {

====================================================
Index: property/inc/class.bodocument.inc.php
diff -u property/inc/class.bodocument.inc.php:1.2 
property/inc/class.bodocument.inc.php:1.3
--- property/inc/class.bodocument.inc.php:1.2   Wed Jun  2 18:54:27 2004
+++ property/inc/class.bodocument.inc.php       Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage document
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class bodocument
        {
@@ -62,6 +72,8 @@
                        $status_id      = 
get_var('status_id',array('POST','GET'));
                        $entity_id      = 
get_var('entity_id',array('POST','GET'));
                        $doc_type       = 
get_var('doc_type',array('POST','GET'));
+                       $query_location = 
get_var('query_location',array('POST','GET'));
+

                        if ($start)
                        {
@@ -104,6 +116,10 @@
                        {
                                $this->doc_type = $doc_type;
                        }
+                       if(isset($query_location))
+                       {
+                               $this->query_location = $query_location;
+                       }

                }

@@ -129,6 +145,7 @@
                        $this->cat_id   = $data['cat_id'];
                        $this->entity_id        = $data['entity_id'];
                        $this->doc_type = $data['doc_type'];
+                       $this->query_location   = $data['query_location'];
                }

                function select_status_list($format='',$selected='')
@@ -250,7 +267,7 @@
                function read()
                {
                        $document = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-                                                                               
        'filter' => $this->filter,'cat_id' => $this->cat_id,'entity_id' => 
$this->entity_id));
+                                                                               
        'filter' => $this->filter,'cat_id' => $this->cat_id,'entity_id' => 
$this->entity_id,'doc_type'=>$this->doc_type));
                        $this->total_records = $this->so->total_records;

                        $this->uicols   = $this->so->uicols;

====================================================
Index: property/inc/class.bocategory.inc.php
diff -u property/inc/class.bocategory.inc.php:1.2 
property/inc/class.bocategory.inc.php:1.3
--- property/inc/class.bocategory.inc.php:1.2   Wed Jun  2 18:54:27 2004
+++ property/inc/class.bocategory.inc.php       Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class bocategory
        {

====================================================
Index: property/inc/class.bob_account.inc.php
diff -u property/inc/class.bob_account.inc.php:1.2 
property/inc/class.bob_account.inc.php:1.3
--- property/inc/class.bob_account.inc.php:1.2  Wed Jun  2 18:54:27 2004
+++ property/inc/class.bob_account.inc.php      Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class bob_account
        {

====================================================
Index: property/inc/class.boalarm.inc.php
diff -u property/inc/class.boalarm.inc.php:1.7 
property/inc/class.boalarm.inc.php:1.8
--- property/inc/class.boalarm.inc.php:1.7      Wed Jul 21 18:57:53 2004
+++ property/inc/class.boalarm.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,20 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class boalarm
        {
@@ -134,7 +143,8 @@

                function read()
                {
-                       $jobs = $this->so->read(array(id=>'%'));
+                       $jobs = $this->so->read(array(id=>'%','start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
+                                                                               
        'filter' => $this->filter,'allrows'=>$this->allrows));
                        $this->total_records    = $this->so->total_records;
                        return $jobs;
                }
@@ -177,12 +187,13 @@
                        {
                                return False;
                        }
-                       list($id,$job) = each($jobs);
-                       $alarm         = $job['data'];  // text, enabled
+
+                       $alarm         = $jobs[$id]['data'];    // text, enabled
                        $alarm['id']   = $id;
-                       $alarm['time'] = $job['next'];
+                       $alarm['time'] = $jobs[$id]['next'];
+                       $alarm['times'] = $jobs[$id]['times'];

-                       //echo "<p>read_alarm('$id')="; print_r($alarm); echo 
"</p>\n";
+//                     echo "<p>read_alarm('$id')="; print_r($alarm); echo 
"</p>\n";
                        return $alarm;
                }

@@ -198,7 +209,6 @@
                */
                function enable_alarm($alarm_type,$alarms,$enable=True)
                {
-//_debug_array($alarms);
                        $enabled = 0;
                        foreach ($alarms as $id => $field)
                        {
@@ -220,8 +230,8 @@
                                }
 */
                                $alarm['enabled'] = intval(!$alarm['enabled']);
-//_debug_array($alarm['entity_id']);
-                               if 
($this->save_alarm($alarm_type,$alarm['entity_id'],$alarm))
+
+                               if 
($this->save_alarm($alarm_type,$alarm['event_id'],$alarm))
                                {
                                        ++$enabled;
                                }
@@ -237,36 +247,41 @@
                @param $cal_id Id of the calendar-entry
                @param $alarm array with fields: text, owner, enabled, ..
                */
-               function save_alarm($alarm_type,$entity_id,$alarm,$method='')
+               function save_alarm($alarm_type,$event_id,$alarm,$method='')
                {
                        if(!$method)
                        {
                                $method = $this->currentapp 
.'.boalarm.send_alarm';
                        }
-//                     echo "<p>save_alarm(entity_id=$entity_id, alarm="; 
print_r($alarm); echo ")</p>\n";
-                       if (!($id = $alarm['id']))
+//                     echo "<p>save_alarm(event_id=$event_id, alarm="; 
print_r($alarm); echo ")</p>\n";
+
+                       if (!$alarm['id'])
                        {
-                               $alarms = 
$this->read_alarms($alarm_type,$entity_id);   // find a free alarm#
+                               $alarms = 
$this->read_alarms($alarm_type,$event_id);    // find a free alarm#
                                $n = count($alarms);
                                do
                                {
-                                       $id = $alarm_type 
.':'.intval($entity_id).':'.$n;
+                                       $id = $alarm_type 
.':'.intval($event_id).':'.$n;
                                        ++$n;
                                }
                                while (@isset($alarms[$id]));
+
+                               $alarm[$alarm_type.'_id'] = $event_id;          
// we need the back-reference
+
+                               $alarm['id'] = $id;
+
+                               if 
(!$this->async->set_timer($alarm['times'],$id,$method,$alarm))
+                               {
+                                       return False;
+                               }
+                               return $id;
                        }
                        else
                        {
-                               $this->async->cancel_timer($id);
+                               $this->async->cancel_timer($alarm['id']);
+                               
$this->async->set_timer($alarm['times'],$alarm['id'],$method,$alarm);
+                               return $alarm['id'];
                        }
-                       $alarm[$alarm_type.'_id'] = $entity_id;         // we 
need the back-reference
-                       $alarm['id'] = $id;
-
-                       if 
(!$this->async->set_timer($alarm['time'],$id,$method,$alarm))
-                       {
-                               return False;
-                       }
-                       return $id;
                }

                /*!
@@ -299,8 +314,9 @@
                                'event_id' => $event['id'],
                                'event_name' => $event['name']
                        );
+
+                       $alarm['times'] = $alarm['time'];
                        $alarm['id'] = 
$this->save_alarm($alarm_type,$event['id'],$alarm);
-//_debug_array($alarm);

                        $event['alarm'][$alarm['id']] = $alarm;

@@ -339,6 +355,12 @@
                }


+               function test_cron()
+               {
+                       $this->async->check_run('crontab');
+               }
+
+
                function send_alarm($alarm)
                {


====================================================
Index: property/inc/class.boasync.inc.php
diff -u property/inc/class.boasync.inc.php:1.1 
property/inc/class.boasync.inc.php:1.2
--- property/inc/class.boasync.inc.php:1.1      Wed Jul 21 19:00:12 2004
+++ property/inc/class.boasync.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class boasync
        {

====================================================
Index: property/inc/class.bodrawing.inc.php
diff -u property/inc/class.bodrawing.inc.php:1.2 
property/inc/class.bodrawing.inc.php:1.3
--- property/inc/class.bodrawing.inc.php:1.2    Wed Jun  2 18:54:27 2004
+++ property/inc/class.bodrawing.inc.php        Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage document
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class bodrawing
        {

====================================================
Index: property/inc/class.boentity.inc.php
diff -u property/inc/class.boentity.inc.php:1.3 
property/inc/class.boentity.inc.php:1.4
--- property/inc/class.boentity.inc.php:1.3     Mon Jun 14 19:58:29 2004
+++ property/inc/class.boentity.inc.php Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage entity
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class boentity
        {
@@ -295,6 +305,9 @@
                        $soadmin_entity = 
CreateObject($this->currentapp.'.soadmin_entity');
                        $contacts                       = 
CreateObject('phpgwapi.contacts');

+                       $vendor = CreateObject($this->currentapp.'.soactor');
+                       $vendor->role = 'vendor';
+
                        $entity = $this->so->read_single($data);
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
                        $entity['date']  = 
$GLOBALS['phpgw']->common->show_date($entity['date'],$dateformat);
@@ -349,8 +362,8 @@
                                {
                                        if($entity['attributes'][$i]['value'])
                                        {
-                                               $contact_data                   
        = 
$contacts->read_single_entry($entity['attributes'][$i]['value'],array('org_name'=>'org_name','email'=>'email'));
-                                               
$entity['attributes'][$i]['org_name']   = $contact_data[0]['org_name'];
+                                               $contact_data                   
        = 
$contacts->read_single_entry($entity['attributes'][$i]['value'],array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
+                                               
$entity['attributes'][$i]['contact_name']       = $contact_data[0]['n_family'] 
. ', ' . $contact_data[0]['n_given'];
                                        }

                                        $insert_record_entity[] = 
$entity['attributes'][$i]['name'];
@@ -360,6 +373,29 @@
                                        $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
                                        $m++;
                                }
+                               
if($entity['attributes'][$i]['datatype']=='VENDOR')
+                               {
+                                       if($entity['attributes'][$i]['value'])
+                                       {
+                                               $vendor_data    = 
$vendor->read_single(array('actor_id'=>$entity['attributes'][$i]['value']));
+
+                                               for 
($n=0;$n<count($vendor_data['attributes']);$n++)
+                                               {
+                                                       
if($vendor_data['attributes'][$n]['name'] == 'org_name')
+                                                       {
+                                                               
$entity['attributes'][$i]['vendor_name']= 
$vendor_data['attributes'][$n]['value'];
+                                                               $n 
=count($vendor_data['attributes']);
+                                                       }
+                                               }
+                                       }
+
+                                       $insert_record_entity[] = 
$entity['attributes'][$i]['name'];
+                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.vendor&column='
 . $entity['attributes'][$i]['name']);
+
+                                       $lookup_functions[$m]['name'] = 
'lookup_'. $entity['attributes'][$i]['name'] .'()';
+                                       $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
+                                       $m++;
+                               }
                                if($entity['attributes'][$i]['datatype']=='R' 
|| $entity['attributes'][$i]['datatype']=='CH' || 
$entity['attributes'][$i]['datatype']=='LB')
                                {
                                        $entity['attributes'][$i]['choice']     
= 
$soadmin_entity->read_attrib_choice($data['entity_id'],$data['cat_id'],$entity['attributes'][$i]['attrib_id']);
@@ -413,7 +449,7 @@

                        
$GLOBALS['phpgw']->session->appsession('insert_record_entity',$this->currentapp,$insert_record_entity);

-//_debug_array($entity);
+//_debug_array($insert_record_entity);
                        return $entity;
                }


====================================================
Index: property/inc/class.sopricebook.inc.php
diff -u property/inc/class.sopricebook.inc.php:1.7 
property/inc/class.sopricebook.inc.php:1.8
--- property/inc/class.sopricebook.inc.php:1.7  Tue Nov  2 09:56:26 2004
+++ property/inc/class.sopricebook.inc.php      Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage agreement
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class sopricebook
        {
@@ -24,14 +34,15 @@
                        $this->db               = $GLOBALS['phpgw']->db;
                        $this->db2              = $this->db;
                        $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->socommon         = 
CreateObject($this->currentapp.'.socommon');
+                       $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');

-                       $this->join                     = $this->socommon->join;
+                       $this->join                     = $this->bocommon->join;
+                       $this->like                     = $this->bocommon->like;
                }

                function 
add_activity_first_prize($m_cost,$w_cost,$total_cost,$activity_id,$vendor_id,$date)
                {
-                       $this->db->query("update fm_activity_price_index  set 
index_count='1',this_index='1', 
m_cost='$m_cost',w_cost='$w_cost',total_cost='$total_cost',date='$date',current_index='1'
 where activity_id='$activity_id' and vendor_id= '$vendor_id' and index_count= 
'1'",__LINE__,__FILE__);
+                       $this->db->query("update fm_activity_price_index  set 
index_count='1',this_index='1', 
m_cost='$m_cost',w_cost='$w_cost',total_cost='$total_cost',index_date='$date',current_index='1'
 where activity_id='$activity_id' and vendor_id= '$vendor_id' and index_count= 
'1'",__LINE__,__FILE__);

                        $receipt['message'][] = array('msg'=>lang('First entry 
is added!'));

@@ -49,7 +60,7 @@
                                $this->db->query("update 
fm_activity_price_index set current_index = Null"
                                . " WHERE activity_id='" . 
$update[$i]['activity_id'] . "' and vendor_id='" . $update[$i]['vendor_id'] . 
"'",__LINE__,__FILE__);

-                               $this->db->query("insert into 
fm_activity_price_index (activity_id, vendor_id, index_count, this_index, 
m_cost, w_cost, total_cost, date,current_index) "
+                               $this->db->query("insert into 
fm_activity_price_index (activity_id, vendor_id, index_count, this_index, 
m_cost, w_cost, total_cost, index_date,current_index) "
                                . " values ('" .
                                        $update[$i]['activity_id'] . "','" .
                                        $update[$i]['vendor_id'] . "','" .
@@ -214,7 +225,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " AND (fm_activities.descr LIKE 
'%$query%' or fm_activities.num LIKE '%$query%')";
+                               $querymethod = " AND (fm_activities.descr 
$this->like '%$query%' or fm_activities.num $this->like '%$query%')";
                        }


@@ -234,8 +245,6 @@
 //echo $sql;


-
-
                        $this->db2->query($sql,__LINE__,__FILE__);
                        $this->total_records = $this->db2->num_rows();

@@ -314,7 +323,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " $where (descr LIKE '%$query%' 
or num LIKE '%$query%')";
+                               $querymethod = " $where (descr $this->like 
'%$query%' or num $this->like '%$query%')";
                        }

                        $sql = "SELECT * FROM  fm_agreement_group $filtermethod 
$querymethod";
@@ -401,10 +410,10 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " AND (fm_activities.descr LIKE 
'%$query%' or fm_activities.num LIKE '%$query%')";
+                               $querymethod = " AND (fm_activities.descr 
$this->like '%$query%' or fm_activities.num $this->like '%$query%')";
                        }

-                       $sql = "SELECT 
index_count,this_index,current_index,m_cost,w_cost,total_cost,date"
+                       $sql = "SELECT 
index_count,this_index,current_index,m_cost,w_cost,total_cost,index_date"
                                . " FROM fm_activity_price_index $this->join 
fm_agreement on fm_activity_price_index.agreement_id = fm_agreement.id "
                                . " Where activity_id= '$activity_id' and 
vendor_id= '$vendor_id'";

@@ -431,7 +440,7 @@
                                        'm_cost'                        => 
$this->db->f('m_cost'),
                                        'w_cost'                        => 
$this->db->f('w_cost'),
                                        'total_cost'            => 
$this->db->f('total_cost'),
-                                       'date'                          => 
$this->db->f('date')
+                                       'date'                          => 
$this->db->f('index_date')
                                );
                        }
 //             _debug_array($pricebook);
@@ -480,8 +489,8 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-//                             $querymethod = " AND (fm_activities.descr LIKE 
'%$query%' or fm_activities.num LIKE '%$query%')";
-                               $querymethod = " and (fm_activities.descr like 
'%$query%' or fm_activities.base_descr like '%$query%' or fm_activities.num 
like '%$query%') ";
+//                             $querymethod = " AND (fm_activities.descr 
$this->like '%$query%' or fm_activities.num $this->like '%$query%')";
+                               $querymethod = " and (fm_activities.descr 
$this->like '%$query%' or fm_activities.base_descr $this->like '%$query%' or 
fm_activities.num $this->like '%$query%') ";
                        }

                        $sql = "SELECT fm_activities.id AS activity_id, 
fm_activities.num, fm_activities.base_descr, fm_activities.unit, 
fm_activities.dim_d, fm_branch.descr as branch, fm_activities.descr, ns3420 "
@@ -562,16 +571,16 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " AND (fm_vendor.org_name LIKE 
'%$query%' or vendor_id LIKE '%$query%')";
+                               $querymethod = " AND (fm_vendor.org_name 
$this->like '%$query%' or vendor_id $this->like '%$query%')";
                        }

-                       $sql = "SELECT fm_activities.id as 
activity_id,fm_activities.num, fm_vendor.org_name,fm_branch.descr as branch 
,vendor_id "
+                       $sql = "SELECT fm_activities.id as 
activity_id,fm_activities.num, fm_vendor.org_name,fm_branch.descr as branch 
,fm_activity_price_index.vendor_id "
                                . " FROM (fm_activities  $this->join 
fm_activity_price_index ON fm_activities.id = 
fm_activity_price_index.activity_id) "
                                . " $this->join fm_agreement ON 
fm_activity_price_index.agreement_id = fm_agreement.id "
                                . " $this->join fm_vendor ON 
fm_agreement.vendor_id = fm_vendor.id "
                                . " $this->join fm_branch on fm_branch.id = 
fm_activities.branch_id "
                                . " Where fm_activity_price_index.activity_id= 
'$activity_id' $querymethod group by fm_activities.id,fm_activities.num,"
-                               . " fm_branch.descr,org_name ,vendor_id ";
+                               . " fm_branch.descr,org_name 
,fm_activity_price_index.vendor_id ";

                        $this->db2->query($sql,__LINE__,__FILE__);
                        $this->total_records = $this->db2->num_rows();
@@ -643,17 +652,24 @@
                        $values['descr'] = 
$this->db->db_addslashes($values['descr']);
                        $values['base_descr'] = 
$this->db->db_addslashes($values['base_descr']);

+                       $vals= array(
+                               $values['activity_id'],
+                               $values['num'] ,
+                               $values['unit'] ,
+                               $values['cat_id'] , // agreement_group
+                               $values['ns3420_id'] ,
+                               $values['dim_d'],
+                               $values['branch_id'],
+                               $values['descr'],
+                               $values['base_descr']
+                               );
+
+                       $vals   = $this->bocommon->validate_db_insert($vals);
+
+                       $this->db->transaction_begin();
                        $this->db->query("INSERT INTO fm_activities (id, 
num,unit,agreement_group_id,ns3420,dim_d,branch_id,descr,base_descr) "
-                               . "VALUES ('" .
-                               $values['activity_id']. "','" .
-                               $values['num'] . "','" .
-                               $values['unit'] . "','" .
-                               $values['cat_id'] . "','" . // agreement_group
-                               $values['ns3420_id'] . "','" .
-                               $values['dim_d']        . "','" .
-                               $values['branch_id'] ."','" .
-                               $values['descr'] ."','" .
-                               $values['base_descr']. "')",__LINE__,__FILE__);
+                               . "VALUES ($vals)",__LINE__,__FILE__);
+                       $this->db->transaction_commit();

                        $receipt['message'][] = array('msg'=>lang('Activity has 
been saved'));
                        $receipt['activity_id']= $values['activity_id'];
@@ -665,16 +681,21 @@
                        $values['descr'] = 
$this->db->db_addslashes($values['descr']);
                        $values['base_descr'] = 
$this->db->db_addslashes($values['base_descr']);

-                       $this->db->query("UPDATE fm_activities set
-                               num='" . $values['num'] . "',
-                               unit='" . $values['unit'] . "',
-                               agreement_group_id='" . $values['cat_id'] . "',
-                               ns3420='" . $values['ns3420_id'] . "',
-                               dim_d='" . $values['dim_d'] . "',
-                               branch_id='" . $values['branch_id'] . "',
-                               descr='" . $values['descr'] . "',
-                               base_descr='" . $values['base_descr']
-                               . "' WHERE id= '" . $values['activity_id'] . 
"'",__LINE__,__FILE__);
+                       $value_set=array(
+                               'num'                                   => 
$values['num'],
+                               'unit'                                  => 
$values['unit'],
+                               'agreement_group_id'    => $values['cat_id'],
+                               'ns3420'                                => 
$values['ns3420_id'],
+                               'dim_d'                                 => 
$values['dim_d'],
+                               'branch_id'                             => 
$values['branch_id'],
+                               'descr'                                 => 
$values['descr'],
+                               'base_descr'                    => 
$values['base_descr']
+                               );
+
+                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
+                       $this->db->transaction_begin();
+                       $this->db->query("UPDATE fm_activities set $value_set 
WHERE id= '" . $values['activity_id'] . "'",__LINE__,__FILE__);
+                       $this->db->transaction_commit();

                        $receipt['activity_id']= $values['activity_id'];
                        $receipt['message'][] = array('msg'=>lang('Activity has 
been edited'));
@@ -685,12 +706,15 @@
                {
                        $values['descr'] = 
$this->db->db_addslashes($values['descr']);

+                       $vals= array(
+                               $values['agreement_group_id'],
+                               $values['num'],
+                               $values['status'],
+                               $values['descr']
+                               );
+
                        $this->db->query("INSERT INTO fm_agreement_group 
(id,num,status,descr) "
-                               . "VALUES ('" .
-                               $values['agreement_group_id']. "','" .
-                               $values['num'] . "','" .
-                               $values['status'] . "','" .
-                               $values['descr']. "')",__LINE__,__FILE__);
+                               . "VALUES ($vals)",__LINE__,__FILE__);

                        $receipt['message'][] = array('msg'=>lang('Agreement 
group has been saved'));
                        $receipt['agreement_group_id'] = 
$values['agreement_group_id'];
@@ -701,11 +725,18 @@
                {
                        $values['descr'] = 
$this->db->db_addslashes($values['descr']);

-                       $this->db->query("UPDATE fm_agreement_group set
-                               num='" . $values['num'] . "',
-                               status='"       . $values['status'] . "',
-                               descr='" . $values['descr']
-                               . "' WHERE id= '" . 
$values['agreement_group_id'] . "'",__LINE__,__FILE__);
+                       $value_set=array(
+                               'num'   => $values['num'],
+                               'status'=> $values['status'],
+                               'descr' => $values['descr']
+                               );
+
+                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
+                       $this->db->transaction_begin();
+
+                       $this->db->query("UPDATE fm_agreement_group set 
$value_set WHERE id= '" . $values['agreement_group_id'] . 
"'",__LINE__,__FILE__);
+
+                       $this->db->transaction_commit();

                        $receipt['message'][] = 
array('msg'=>lang('Agreement_group has been edited'));
                        return $receipt;
@@ -726,7 +757,7 @@
                {
                        if ($index_count==1)
                        {
-                               $this->db->query("update 
fm_activity_price_index set index_count = '1', current_index = '0', 
this_index=Null, m_cost=Null,w_cost=Null,total_cost=Null,date=Null  where 
activity_id='$activity_id' and vendor_id= '$vendor_id' and index_count= 
'1'",__LINE__,__FILE__);
+                               $this->db->query("update 
fm_activity_price_index set index_count = '1', current_index = '0', 
this_index=Null, m_cost=Null,w_cost=Null,total_cost=Null,index_date=Null  where 
activity_id='$activity_id' and vendor_id= '$vendor_id' and index_count= 
'1'",__LINE__,__FILE__);
                        }
                        else
                        {

====================================================
Index: property/inc/class.bop_of_town.inc.php
diff -u property/inc/class.bop_of_town.inc.php:1.2 
property/inc/class.bop_of_town.inc.php:1.3
--- property/inc/class.bop_of_town.inc.php:1.2  Wed Jun  2 18:54:27 2004
+++ property/inc/class.bop_of_town.inc.php      Thu Jan 13 16:52:48 2005
@@ -1,20 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class bop_of_town
        {

====================================================
Index: property/inc/class.bopricebook.inc.php
diff -u property/inc/class.bopricebook.inc.php:1.3 
property/inc/class.bopricebook.inc.php:1.4
--- property/inc/class.bopricebook.inc.php:1.3  Fri Aug 20 15:15:21 2004
+++ property/inc/class.bopricebook.inc.php      Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage agreement
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class bopricebook
        {

====================================================
Index: property/inc/class.bolocation.inc.php
diff -u property/inc/class.bolocation.inc.php:1.3 
property/inc/class.bolocation.inc.php:1.4
--- property/inc/class.bolocation.inc.php:1.3   Sat Oct 30 15:32:38 2004
+++ property/inc/class.bolocation.inc.php       Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage location
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class bolocation
        {
@@ -335,6 +345,21 @@
                                        $location['location'][$i]['statustext'] 
                = lang('Klick this link to select') . ' ' . 
$location_types[($data[no_link]-2)]['name'];
                                }

+
+                               if($data['query_link'] && $i < 
($data['type_id']-1))
+                               {
+                                               for ($j=1;$j<$i+2;$j++)
+                                               {
+                                                       $temp_location[]= 
$data['values']['loc' . ($j)];
+                                               }
+
+
+                                       $data['link_data']['query_location']    
                = implode('-',$temp_location);
+                                       $location['location'][$i]['query_link'] 
                = $GLOBALS['phpgw']->link('/index.php',$data['link_data']);
+                                       unset($temp_location);
+                               }
+
+
                                $m=$i;
                        }

@@ -665,7 +690,7 @@
                        $m=count($values_attribute);
                        for ($i=0;$i<$m;$i++)
                        {
-                               if($values_attribute[$i]['datatype']=='AB')
+                               if($values_attribute[$i]['datatype']=='AB' || 
$values_attribute[$i]['datatype']=='VENDOR')
                                {
                                        $values_attribute[$i]['value'] = 
$_POST[$values_attribute[$i]['name']];
                                }
@@ -728,9 +753,9 @@
                        return $receipt;
                }

-               function delete($location_code,$type_id)
+               function delete($location_code)
                {
-                       $this->so->delete($location_code,$type_id);
+                       $this->so->delete($location_code);
                }

                function update_cat()

====================================================
Index: property/inc/class.boinvoice.inc.php
diff -u property/inc/class.boinvoice.inc.php:1.11 
property/inc/class.boinvoice.inc.php:1.12
--- property/inc/class.boinvoice.inc.php:1.11   Sat Oct 30 15:31:49 2004
+++ property/inc/class.boinvoice.inc.php        Thu Jan 13 16:52:48 2005
@@ -1,21 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-
-  /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage eco
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class boinvoice
        {
@@ -149,205 +157,12 @@
                        return $invoice;
                }

+
                function update_invoice($values)
                {

-//_debug_array($values);
-                       foreach($values['counter'] as $n)
-                       {
-                               $local_error='';
-
-                               if($values['voucher_id'][$n])
-                               {
-                                       $voucher_id=$values['voucher_id'][$n];
-
-                                       
$check_value=array('voucher_id'=>$voucher_id,
-                                                       'sign_orig'             
=> $values['sign_orig'][$n],
-                                                       'sign'                  
=> $values['sign'][$n],
-                                                       'transfer'              
=> $values['transfer'][$n],
-                                                       'kreditnota'    => 
$values['kreditnota'][$n],
-                                                       'num_days'              
=> $values['num_days'][$n]);
-
-                                       
if($this->so->check_for_updates($check_value))
-                                       {
-
-                                               $check_count = 
$this->so->check_count($voucher_id);
-
-                                               if 
(!($check_count['dima_count'] == $values['invoice_count'][$n]))
-                                               {
-                                                       $receipt['error'][] = 
array('msg'=>lang('Dima is missing from sub invoice in:'). " 
".$values['voucher_id'][$n]);
-                                                       $local_error= true;
-                                               }
-
+                       return $this->so->update_invoice($values);

-
-                                               if 
(!($check_count['spbudact_code_count'] == $values['invoice_count'][$n]))
-                                               {
-                                                       $receipt['error'][] = 
array('msg'=>lang('Budget code is missing from sub invoice in :'). " 
".$values['voucher_id'][$n]);
-                                                       $local_error= true;
-                                               }
-
-                                               if 
(!($check_count['kostra_count'] == $values['invoice_count'][$n]))
-                                               {
-                                                       $receipt['error'][] = 
array('msg'=>'Tjenestekode mangler for undebilag: ' . " 
".$values['voucher_id'][$n]);
-                                                       $local_error= true;
-                                               }
-
-
-                                               $blank_date = '';
-                                               $sign_field='';
-                                               $sign_id='';
-                                               $sign_date_field='';
-                                               $sign_date='';
-                                               $kommma='';
-                                               $wait_for_kreditnota='';
-                                               $user_lid       
=strtoupper($GLOBALS['phpgw_info']['user']['account_lid']);
-
-                                               if 
(($values['sign'][$n]=='sign_none') && 
($values['sign_orig'][$n]=='sign_janitor')):
-                                                       $blank_date = 
'oppsynsigndato= NULL';
-                                                       $sign_field='';
-                                                       $sign_id='';
-                                                       $sign_date_field='';
-                                                       $sign_date='';
-                                                       $kommma='';
-                                               elseif 
(($values['sign'][$n]=='sign_none') && 
($values['sign_orig'][$n]=='sign_supervisor')):
-                                                       $blank_date = 
'saksigndato= NULL';
-                                                       $sign_field='';
-                                                       $sign_id='';
-                                                       $sign_date_field='';
-                                                       $sign_date='';
-                                                       $kommma='';
-                                               elseif 
(($values['sign'][$n]=='sign_none') && 
($values['sign_orig'][$n]=='sign_budget_responsible')):
-                                                       $blank_date = 
'budsjettsigndato= NULL';
-                                                       $sign_field='';
-                                                       $sign_id='';
-                                                       $sign_date_field='';
-                                                       $sign_date='';
-                                                       $kommma='';
-                                               elseif 
($values['sign'][$n]=='sign_janitor' && !$values['sign_orig'][$n]):
-                                                       $blank_date = '';
-                                                       $sign_field = 
'oppsynsmannid=';
-                                                       $sign_id = 
"'$user_lid'";
-                                                       $sign_date_field = 
'oppsynsigndato=';
-                                                       $sign_date="'" . 
date($this->bocommon->datetimeformat) . "'";
-                                                       $kommma=",";
-                                               elseif 
($values['sign'][$n]=='sign_janitor' && 
$values['sign_orig'][$n]=='sign_supervisor'):
-                                                       $blank_date = 
'saksigndato= NULL';
-                                                       $sign_field = 
'oppsynsmannid=';
-                                                       $sign_id = 
"'$user_lid'";
-                                                       $sign_date_field = 
'oppsynsigndato=';
-                                                       $sign_date="'" . 
date($this->bocommon->datetimeformat) . "'";
-                                                       $kommma=",";
-                                               elseif 
($values['sign'][$n]=='sign_janitor' && 
$values['sign_orig'][$n]=='sign_budget_responsible'):
-                                                       $blank_date = 
'budsjettsigndato= NULL';
-                                                       $sign_field = 
'oppsynsmannid=';
-                                                       $sign_id = 
"'$user_lid'";
-                                                       $sign_date_field = 
'oppsynsigndato=';
-                                                       $sign_date="'" . 
date($this->bocommon->datetimeformat) . "'";
-                                                       $kommma=",";
-                                               elseif 
($values['sign'][$n]=='sign_supervisor' && !$values['sign_orig'][$n]):
-                                                       $blank_date = '';
-                                                       $sign_field = 
'saksbehandlerid=';
-                                                       $sign_id = 
"'$user_lid'";
-                                                       $sign_date_field = 
'saksigndato=';
-                                                       $sign_date="'" . 
date($this->bocommon->datetimeformat) . "'";
-                                                       $kommma=",";
-                                               elseif 
($values['sign'][$n]=='sign_supervisor' && 
$values['sign_orig'][$n]=='sign_janitor'):
-                                                       $blank_date = 
'oppsynsigndato= NULL';
-                                                       $sign_field = 
'saksbehandlerid=';
-                                                       $sign_id = 
"'$user_lid'";
-                                                       $sign_date_field = 
'saksigndato=';
-                                                       $sign_date="'" . 
date($this->bocommon->datetimeformat) . "'";
-                                                       $kommma=",";
-                                               elseif 
($values['sign'][$n]=='sign_supervisor' && 
$values['sign_orig'][$n]=='sign_budget_responsible'):
-                                                       $blank_date = 
'budsjettsigndato= NULL';
-                                                       $sign_field = 
'saksbehandlerid=';
-                                                       $sign_id = 
"'$user_lid'";
-                                                       $sign_date_field = 
'saksigndato=';
-                                                       $sign_date="'" . 
date($this->bocommon->datetimeformat) . "'";
-                                                       $kommma=",";
-                                               elseif 
($values['sign'][$n]=='sign_budget_responsible' && 
$values['sign_orig'][$n]=='sign_janitor'):
-                                                       $blank_date = 
'oppsynsigndato= NULL';
-                                                       $sign_field = 
'budsjettansvarligid=';
-                                                       $sign_id = 
"'$user_lid'";
-                                                       $sign_date_field = 
'budsjettsigndato=';
-                                                       $sign_date="'" . 
date($this->bocommon->datetimeformat) . "'";
-                                                       $kommma=",";
-                                               elseif 
($values['sign'][$n]=='sign_budget_responsible' && 
$values['sign_orig'][$n]=='sign_supervisor'):
-                                                       $blank_date = 
'saksigndato= NULL';
-                                                       $sign_field = 
'budsjettansvarligid=';
-                                                       $sign_id = 
"'$user_lid'";
-                                                       $sign_date_field = 
'budsjettsigndato=';
-                                                       $sign_date="'" . 
date($this->bocommon->datetimeformat) . "'";
-                                                       $kommma=",";
-                                               elseif 
($values['sign'][$n]=='sign_budget_responsible' && !$values['sign_orig'][$n]):
-                                                       $blank_date = '';
-                                                       $sign_field = 
'budsjettansvarligid=';
-                                                       $sign_id = 
"'$user_lid'";
-                                                       $sign_date_field = 
'budsjettsigndato=';
-                                                       $sign_date="'" . 
date($this->bocommon->datetimeformat) . "'";
-                                                       $kommma=",";
-                                               endif;
-
-
-                                               if($blank_date )
-                                               {
-                                                       $kommma_blank=",";
-                                               }
-                                               else
-                                               {
-                                                       $kommma_blank='';
-                                               }
-
-                                               
$transfer_sign_field='utbetalingid=';
-                                               
$transfer_date_field='utbetalingsigndato=';
-
-                                               if 
(!($values['num_days_orig'][$n]==$values['num_days'][$n]))
-                                               {
-                                                       $payment_date = 
date($this->bocommon->dateformat,$values['timestamp_voucher_date'][$n]+(24*3600*$values['num_days'][$n]));
-                                                       
$GLOBALS['phpgw']->db->query("update fm_ecobilag set forfallsdato= 
'$payment_date' where bilagsnr='$voucher_id'");
-                                               }
-
-                                               if ($values['transfer'][$n])
-                                               {
-
-                                                       
$transfer_id="'$user_lid',";
-                                                       $transfer_date="'" . 
date($this->bocommon->datetimeformat) . "'";
-                                               }
-                                               else
-                                               {
-                                                       $transfer_id="Null".",";
-                                                       $transfer_date="Null";
-                                               }
-
-                                               if ($values['kreditnota'][$n])
-                                               {
-                                                       $wait_for_kreditnota=1;
-                                                       $transfer_date="Null";
-                                               }
-                                               else
-                                               {
-                                                       
$wait_for_kreditnota='NULL';
-                                               }
-
-                                               if (! $local_error)
-                                               {
-                                                       $sql= "update 
fm_ecobilag set $blank_date $kommma_blank $sign_field $sign_id $kommma 
$sign_date_field $sign_date $kommma $transfer_sign_field $transfer_id 
$transfer_date_field $transfer_date ,kreditnota=$wait_for_kreditnota  where 
bilagsnr='$voucher_id'";
-                                                       $sql2= "update 
fm_ecobilag set utbetalingid = NULL, utbetalingsigndato = NULL WHERE 
budsjettsigndato IS NULL";
-                                                       $sql3= "update 
fm_ecobilag set utbetalingid = NULL, utbetalingsigndato = NULL WHERE 
oppsynsigndato IS NULL AND saksigndato IS NULL";
-                                                       
$GLOBALS['phpgw']->db->transaction_begin();
-                                                       
$GLOBALS['phpgw']->db->query($sql);
-                                                       
$GLOBALS['phpgw']->db->query($sql2);
-                                                       
$GLOBALS['phpgw']->db->query($sql3);
-                                                       
$GLOBALS['phpgw']->db->transaction_commit();
-
-                                                       $receipt['message'][] = 
array('msg'=> lang('voucher is updated: ') . $voucher_id);
-                                               }
-                                       }
-                               }
-                       }
-
-                       return $receipt;
                }



====================================================
Index: property/inc/class.bogab.inc.php
diff -u property/inc/class.bogab.inc.php:1.2 
property/inc/class.bogab.inc.php:1.3
--- property/inc/class.bogab.inc.php:1.2        Wed Jun  2 18:54:27 2004
+++ property/inc/class.bogab.inc.php    Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage location
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class bogab
        {

====================================================
Index: property/inc/class.boinvestment.inc.php
diff -u property/inc/class.boinvestment.inc.php:1.2 
property/inc/class.boinvestment.inc.php:1.3
--- property/inc/class.boinvestment.inc.php:1.2 Wed Jun  2 18:54:27 2004
+++ property/inc/class.boinvestment.inc.php     Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage eco
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class boinvestment
        {

====================================================
Index: property/inc/class.boagreement.inc.php
diff -u property/inc/class.boagreement.inc.php:1.2 
property/inc/class.boagreement.inc.php:1.3
--- property/inc/class.boagreement.inc.php:1.2  Mon Aug 30 14:02:48 2004
+++ property/inc/class.boagreement.inc.php      Thu Jan 13 16:52:48 2005
@@ -1,20 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage agreement
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class boagreement
        {
@@ -250,7 +259,7 @@

                        for ($i=0; $i<count($list); $i++)
                        {
-                               $list[$i]['date']  = 
$GLOBALS['phpgw']->common->show_date($list[$i]['date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+                               $list[$i]['index_date']  = 
$GLOBALS['phpgw']->common->show_date($list[$i]['index_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
                        }

                        return $list;
@@ -281,7 +290,7 @@
                        $this->vfs->override_acl = 1;

                        $agreement['files'] = $this->vfs->ls (array(
-                            'string' => $this->fakebase. '/' . 
'service_agreement' .  '/' . $data['agreement_id'],
+                            'string' => $this->fakebase. '/' . 'agreement' .  
'/' . $data['agreement_id'],
                             'relatives' => array(RELATIVE_NONE)));

                        $this->vfs->override_acl = 0;
@@ -310,6 +319,10 @@
                                $this->so->role = 'detail';
                        }
                        $contacts                       = 
CreateObject('phpgwapi.contacts');
+
+                       $vendor = CreateObject($this->currentapp.'.soactor');
+                       $vendor->role = 'vendor';
+
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];

                        $input_type_array = array(
@@ -339,8 +352,8 @@
                                {
                                        if($list['attributes'][$i]['value'])
                                        {
-                                               $contact_data   = 
$contacts->read_single_entry($list['attributes'][$i]['value'],array('org_name'=>'org_name','email'=>'email'));
-                                               
$list['attributes'][$i]['org_name']     = $contact_data[0]['org_name'];
+                                               $contact_data   = 
$contacts->read_single_entry($list['attributes'][$i]['value'],array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
+                                               
$list['attributes'][$i]['contact_name'] = $contact_data[0]['n_family'] . ', ' . 
$contact_data[0]['n_given'];
                                        }

                                        $insert_record_list[]   = 
$list['attributes'][$i]['name'];
@@ -350,6 +363,30 @@
                                        $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
                                        $m++;
                                }
+                               
if($list['attributes'][$i]['datatype']=='VENDOR')
+                               {
+                                       if($list['attributes'][$i]['value'])
+                                       {
+                                               $vendor_data    = 
$vendor->read_single(array('actor_id'=>$list['attributes'][$i]['value']));
+
+                                               for 
($n=0;$n<count($vendor_data['attributes']);$n++)
+                                               {
+                                                       
if($vendor_data['attributes'][$n]['name'] == 'org_name')
+                                                       {
+                                                               
$list['attributes'][$i]['vendor_name']= $vendor_data['attributes'][$n]['value'];
+                                                               $n 
=count($vendor_data['attributes']);
+                                                       }
+                                               }
+                                       }
+
+                                       $insert_record_list[]   = 
$list['attributes'][$i]['name'];
+                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.vendor&column='
 . $list['attributes'][$i]['name']);
+
+                                       $lookup_functions[$m]['name'] = 
'lookup_'. $list['attributes'][$i]['name'] .'()';
+                                       $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
+                                       $m++;
+                               }
+
                                if($list['attributes'][$i]['datatype']=='R' || 
$list['attributes'][$i]['datatype']=='CH' || 
$list['attributes'][$i]['datatype']=='LB')
                                {
                                        $list['attributes'][$i]['choice']       
= $this->so->read_attrib_choice($list['attributes'][$i]['attrib_id']);
@@ -442,7 +479,7 @@
                                        {
                                                for 
($i=0;$i<count($values['delete_file']);$i++)
                                                {
-                                                       $file = 
$this->fakebase. SEP . 'service_agreement' . SEP . $values['agreement_id'] . 
SEP . $values['delete_file'][$i];
+                                                       $file = 
$this->fakebase. SEP . 'agreement' . SEP . $values['agreement_id'] . SEP . 
$values['delete_file'][$i];

                                                        
if($this->vfs->file_exists(array(
                                                                        
'string' => $file,
@@ -458,11 +495,11 @@
                                                                     )
                                                                )))
                                                                {
-                                                                       
$receipt['error'][]=array('msg'=>lang('failed to delete file') . ' :'. 
$this->fakebase. SEP . 'service_agreement'. SEP . $values['agreement_id'] . SEP 
.$values['delete_file'][$i]);
+                                                                       
$receipt['error'][]=array('msg'=>lang('failed to delete file') . ' :'. 
$this->fakebase. SEP . 'agreement'. SEP . $values['agreement_id'] . SEP 
.$values['delete_file'][$i]);
                                                                }
                                                                else
                                                                {
-                                                                       
$receipt['message'][]=array('msg'=>lang('file deleted') . ' :'. 
$this->fakebase. SEP . 'service_agreement'. SEP . $values['id'] . SEP . 
$values['delete_file'][$i]);
+                                                                       
$receipt['message'][]=array('msg'=>lang('file deleted') . ' :'. 
$this->fakebase. SEP . 'agreement'. SEP . $values['id'] . SEP . 
$values['delete_file'][$i]);
                                                                }
                                                                
$this->vfs->override_acl = 0;
                                                        }
@@ -593,24 +630,24 @@
                function create_home_dir($receipt='')
                {
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase. SEP . 
'service_agreement',
+                                       'string' => $this->fakebase. SEP . 
'agreement',
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;

                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
'service_agreement',
+                                    'string' => $this->fakebase. SEP . 
'agreement',
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP . 'service_agreement');
+                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP . 'agreement');
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'service_agreement');
+                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'agreement');
                                }
                                $this->vfs->override_acl = 0;
                        }
@@ -622,23 +659,23 @@
                {

                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase. SEP . 
'service_agreement' .  SEP . $id,
+                                       'string' => $this->fakebase. SEP . 
'agreement' .  SEP . $id,
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
'service_agreement' .  SEP . $id,
+                                    'string' => $this->fakebase. SEP . 
'agreement' .  SEP . $id,
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP  . 'service_agreement' .  SEP . $id);
+                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP  . 'agreement' .  SEP . $id);
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'service_agreement' .  SEP . $id);
+                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'agreement' .  SEP . $id);
                                }
                                $this->vfs->override_acl = 0;
                        }

====================================================
Index: property/inc/class.boadmin_location.inc.php
diff -u property/inc/class.boadmin_location.inc.php:1.2 
property/inc/class.boadmin_location.inc.php:1.3
--- property/inc/class.boadmin_location.inc.php:1.2     Wed Jun  2 18:54:27 2004
+++ property/inc/class.boadmin_location.inc.php Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class boadmin_location
        {

====================================================
Index: property/inc/class.boactor.inc.php
diff -u property/inc/class.boactor.inc.php:1.3 
property/inc/class.boactor.inc.php:1.4
--- property/inc/class.boactor.inc.php:1.3      Sat Oct 23 22:11:00 2004
+++ property/inc/class.boactor.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,20 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class boactor
        {
@@ -195,6 +204,10 @@
                {
                        $contacts                       = 
CreateObject('phpgwapi.contacts');

+                       $vendor = CreateObject($this->currentapp.'.soactor');
+                       $vendor->role = 'vendor';
+
+
                        $actor  = $this->so->read_single($data);
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];

@@ -235,6 +248,29 @@
                                        $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
                                        $m++;
                                }
+                               
if($actor['attributes'][$i]['datatype']=='VENDOR')
+                               {
+                                       if($actor['attributes'][$i]['value'])
+                                       {
+                                               $vendor_data    = 
$vendor->read_single(array('actor_id'=>$actor['attributes'][$i]['value']));
+
+                                               for 
($n=0;$n<count($vendor_data['attributes']);$n++)
+                                               {
+                                                       
if($vendor_data['attributes'][$n]['name'] == 'org_name')
+                                                       {
+                                                               
$actor['attributes'][$i]['vendor_name']= 
$vendor_data['attributes'][$n]['value'];
+                                                               $n 
=count($vendor_data['attributes']);
+                                                       }
+                                               }
+                                       }
+
+                                       $insert_record_actor[]  = 
$actor['attributes'][$i]['name'];
+                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.vendor&column='
 . $actor['attributes'][$i]['name']);
+
+                                       $lookup_functions[$m]['name'] = 
'lookup_'. $actor['attributes'][$i]['name'] .'()';
+                                       $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
+                                       $m++;
+                               }
                                if($actor['attributes'][$i]['datatype']=='R' || 
$actor['attributes'][$i]['datatype']=='CH' || 
$actor['attributes'][$i]['datatype']=='LB')
                                {
                                        $actor['attributes'][$i]['choice']      
= $this->so->read_attrib_choice($actor['attributes'][$i]['attrib_id']);

====================================================
Index: property/inc/class.boadmin.inc.php
diff -u property/inc/class.boadmin.inc.php:1.2 
property/inc/class.boadmin.inc.php:1.3
--- property/inc/class.boadmin.inc.php:1.2      Wed Jun  2 18:54:27 2004
+++ property/inc/class.boadmin.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class boadmin
        {
@@ -49,6 +59,7 @@
        //              $location       = 
get_var('location',array('POST','GET')); // don't work for some reason...
                        $module = get_var('module',array('POST','GET'));
                        $granting_group = 
get_var('granting_group',array('POST','GET'));
+                       $allrows        = 
get_var('allrows',array('POST','GET'));

                        if ($start)
                        {
@@ -87,6 +98,10 @@
                        {
                                $this->granting_group = $granting_group;
                        }
+                       if(isset($allrows))
+                       {
+                               $this->allrows = $allrows;
+                       }

                }

@@ -103,6 +118,7 @@
                        $this->cat_id           = $data['cat_id'];
                        $this->location         = $data['location'];
                        $this->granting_group   = $data['granting_group'];
+                       $this->allrows  = $data['allrows'];
                }

                function save_sessiondata($data)
@@ -413,7 +429,7 @@
                                }
                        }

-                       $this->total_records = $this->total_records + 
count($user_list);
+                       $this->total_records = 
$GLOBALS['phpgw']->accounts->total;

 //_debug_array($user_list);

@@ -475,7 +491,7 @@
                                }
                        }

-                       $this->total_records = $this->total_records + 
count($user_list);
+                       $this->total_records = 
$GLOBALS['phpgw']->accounts->total;

                        return $user_list;
                }

====================================================
Index: property/inc/class.boadmin_entity.inc.php
diff -u property/inc/class.boadmin_entity.inc.php:1.3 
property/inc/class.boadmin_entity.inc.php:1.4
--- property/inc/class.boadmin_entity.inc.php:1.3       Fri Jun 11 17:13:13 2004
+++ property/inc/class.boadmin_entity.inc.php   Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class boadmin_entity
        {

====================================================
Index: property/inc/class.boXport.inc.php
diff -u property/inc/class.boXport.inc.php:1.6 
property/inc/class.boXport.inc.php:1.7
--- property/inc/class.boXport.inc.php:1.6      Tue Sep 14 09:18:20 2004
+++ property/inc/class.boXport.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,21 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-
-  /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class boXport
        {

====================================================
Index: property/inc/class.acl2.inc.php
diff -u property/inc/class.acl2.inc.php:1.2 property/inc/class.acl2.inc.php:1.3
--- property/inc/class.acl2.inc.php:1.2 Wed Jun  2 18:54:27 2004
+++ property/inc/class.acl2.inc.php     Thu Jan 13 16:52:47 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage core
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class acl2
        {
@@ -42,6 +52,17 @@
                        $this->account_id = $args['account_id'];
                        $this->host_id = $args['host_id'];
                        $this->app_id = $args['app_id'];
+
+                       if 
($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
+                       {
+                               $this->like = "ILIKE";
+                       }
+                       else
+                       {
+                               $this->like = "LIKE";
+                       }
+
+
                }

                function get_memberships ()
@@ -293,7 +314,7 @@
                                
$updated_locations[]=$this->db->f('acl_location');
                        }

-                       $sql = "SELECT id FROM fm_acl_location WHERE (id like 
'%".$args['location']."%') AND allow_grant=1";
+                       $sql = "SELECT id FROM fm_acl_location WHERE (id 
$this->like '%".$args['location']."%') AND allow_grant=1";
                        $this->db->query($sql,__LINE__,__FILE__);
                        while($this->db->next_record())
                        {
@@ -377,7 +398,7 @@
                                
$updated_locations[]=$this->db->f('acl_location');
                        }

-                       $sql = "SELECT id FROM fm_acl_location WHERE (id like 
'%".$args['location']."%')";
+                       $sql = "SELECT id FROM fm_acl_location WHERE (id 
$this->like '%".$args['location']."%')";
                        $this->db->query($sql,__LINE__,__FILE__);
                        while($this->db->next_record())
                        {
@@ -457,7 +478,7 @@
                                {
                                        $sql = "DELETE FROM fm_acl2";
                                }
-                               $sql .= " WHERE acl_host=".$this->host_id." AND 
acl_appid=".$args['app_id']." AND acl_account=".$args['account_id']." AND 
acl_location LIKE '%".$args['location']."%' AND acl_type=".$args['type'] . ' 
and grantor is NULL';
+                               $sql .= " WHERE acl_host=".$this->host_id." AND 
acl_appid=".$args['app_id']." AND acl_account=".$args['account_id']." AND 
acl_location $this->like '%".$args['location']."%' AND acl_type=".$args['type'] 
. ' and grantor is NULL';
                                $this->db->query($sql,__LINE__,__FILE__);
                                $this->rights_cache = Array();
                                $this->masks_cache = Array();
@@ -501,7 +522,7 @@
                                {
                                        $sql = "DELETE FROM fm_acl2";
                                }
-                               $sql .= " WHERE acl_host=".$this->host_id." AND 
acl_appid=".$args['app_id']." AND acl_account=".$args['account_id']." AND 
acl_location LIKE '%".$args['location']."%' AND acl_type=".$args['type'] . " 
and grantor = $grantor";
+                               $sql .= " WHERE acl_host=".$this->host_id." AND 
acl_appid=".$args['app_id']." AND acl_account=".$args['account_id']." AND 
acl_location $this->like '%".$args['location']."%' AND acl_type=".$args['type'] 
. " and grantor = $grantor";
                                $this->db->query($sql,__LINE__,__FILE__);
                                $this->rights_cache = Array();
                                $this->masks_cache = Array();

====================================================
Index: property/inc/class.boproject.inc.php
diff -u property/inc/class.boproject.inc.php:1.5 
property/inc/class.boproject.inc.php:1.6
--- property/inc/class.boproject.inc.php:1.5    Tue Sep 14 20:24:14 2004
+++ property/inc/class.boproject.inc.php        Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage project
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class boproject
        {

====================================================
Index: property/inc/class.bolookup.inc.php
diff -u property/inc/class.bolookup.inc.php:1.3 
property/inc/class.bolookup.inc.php:1.4
--- property/inc/class.bolookup.inc.php:1.3     Sat Oct 23 22:11:00 2004
+++ property/inc/class.bolookup.inc.php Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage core
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class bolookup
        {

====================================================
Index: property/inc/class.socommon.inc.php
diff -u property/inc/class.socommon.inc.php:1.5 
property/inc/class.socommon.inc.php:1.6
--- property/inc/class.socommon.inc.php:1.5     Tue Sep 14 09:18:20 2004
+++ property/inc/class.socommon.inc.php Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage core
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class socommon
        {
@@ -29,11 +39,12 @@
                        if 
($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
                        {
                                $this->join = " JOIN ";
+                               $this->like = "ILIKE";
                        }
                        else
                        {
                                $this->join = " INNER JOIN ";
-//                             $this->join = " LEFT JOIN ";
+                               $this->like = "LIKE";
                        }

                        $this->left_join = " LEFT JOIN ";
@@ -77,7 +88,7 @@
                                $security .= "," . $group['account_id'];
                        }

-                       $sql = "SELECT * FROM phpgw_accounts $this->join 
fm_acl2 on phpgw_accounts.account_id=fm_acl2.acl_account where acl_location 
LIKE '%$acl_location%' order by account_lastname ASC";
+                       $sql = "SELECT * FROM phpgw_accounts $this->join 
fm_acl2 on phpgw_accounts.account_id=fm_acl2.acl_account where acl_location 
$this->like '%$acl_location%' order by account_lastname ASC";
                        $this->db->query($sql,__LINE__,__FILE__);
                        while ($this->db->next_record())
                        {

====================================================
Index: property/inc/class.socustom.inc.php
diff -u property/inc/class.socustom.inc.php:1.2 
property/inc/class.socustom.inc.php:1.3
--- property/inc/class.socustom.inc.php:1.2     Wed Jun  2 18:54:28 2004
+++ property/inc/class.socustom.inc.php Thu Jan 13 16:52:48 2005
@@ -1,20 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage custom
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class socustom
        {
@@ -28,6 +37,7 @@
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->join                     = $this->bocommon->join;
+                       $this->like                     = $this->bocommon->like;
                }


@@ -67,7 +77,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " $where ( abid = '$query' or 
org_name LIKE '%$query%')";
+                               $querymethod = " $where ( abid = '$query' or 
org_name $this->like '%$query%')";
                        }

                        $sql = "SELECT * FROM fm_custom $filtermethod 
$querymethod";

====================================================
Index: property/inc/class.sodocument.inc.php
diff -u property/inc/class.sodocument.inc.php:1.3 
property/inc/class.sodocument.inc.php:1.4
--- property/inc/class.sodocument.inc.php:1.3   Thu Oct 21 19:54:15 2004
+++ property/inc/class.sodocument.inc.php       Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage document
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class sodocument
        {
@@ -33,6 +43,7 @@
                        $this->socommon         = 
CreateObject($this->currentapp.'.socommon');

                        $this->join                     = $this->socommon->join;
+                       $this->like                     = $this->socommon->like;
                }

                function select_doc_type_list()
@@ -102,6 +113,7 @@
                                $order = 
(isset($data['order'])?$data['order']:'');
                                $cat_id = 
(isset($data['cat_id'])?$data['cat_id']:0);
                                $entity_id = 
(isset($data['entity_id'])?$data['entity_id']:'');
+                               $doc_type = 
(isset($data['doc_type'])?$data['doc_type']:0);
                        }

                        $sql = $this->bocommon->fm_cache('sql_document_' . 
$entity_id);
@@ -199,6 +211,12 @@
                                $where= 'AND';
                        }

+                       if ($doc_type > 0)
+                       {
+                               $filtermethod .= " $where 
fm_document.category='$doc_type' ";
+                               $where= 'AND';
+                       }
+
                        if ($filter!='all' && $filter)
                        {
                                $filtermethod .= " $where 
fm_document.user_id='$filter' ";
@@ -209,7 +227,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " $where (fm_document.address 
LIKE '%$query%' or fm_document.location_code LIKE '%$query%')";
+                               $querymethod = " $where (fm_document.address 
$this->like '%$query%' or fm_document.location_code $this->like '%$query%')";
                        }


@@ -276,7 +294,7 @@
                                $ordermethod = ' order by location_code ASC';
                        }

-                       $filtermethod = " 
fm_document.location_code='$location_code'";
+                       $filtermethod = " fm_document.location_code $this->like 
'%$location_code%'";

                        if ($doc_type > 0)
                        {
@@ -298,7 +316,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " AND fm_document.title LIKE 
'%$query%' or fm_document.document_name LIKE '%$query%'";
+                               $querymethod = " AND fm_document.title 
$this->like '%$query%' or fm_document.document_name $this->like '%$query%'";
                        }

                        $sql = "SELECT fm_document.*, 
fm_document_category.descr as category FROM fm_document $this->join 
fm_document_category on fm_document.category = fm_document_category.id WHERE  
$filtermethod $querymethod ";

====================================================
Index: property/inc/class.socategory.inc.php
diff -u property/inc/class.socategory.inc.php:1.3 
property/inc/class.socategory.inc.php:1.4
--- property/inc/class.socategory.inc.php:1.3   Sun Jun  6 20:18:39 2004
+++ property/inc/class.socategory.inc.php       Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class socategory
        {
@@ -27,6 +37,7 @@
                        $this->socommon         = 
CreateObject($this->currentapp.'.socommon');

                        $this->join                     = $this->socommon->join;
+                       $this->like                     = $this->socommon->like;

                }

@@ -71,7 +82,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " where id LIKE '%$query%' or 
descr LIKE '%$query%'";
+                               $querymethod = " where id $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }

                        $sql = "SELECT * FROM $table $querymethod";

====================================================
Index: property/inc/class.borequest.inc.php
diff -u property/inc/class.borequest.inc.php:1.2 
property/inc/class.borequest.inc.php:1.3
--- property/inc/class.borequest.inc.php:1.2    Wed Jun  2 18:54:28 2004
+++ property/inc/class.borequest.inc.php        Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage project
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class borequest
        {

====================================================
Index: property/inc/class.soalarm.inc.php
diff -u property/inc/class.soalarm.inc.php:1.2 
property/inc/class.soalarm.inc.php:1.3
--- property/inc/class.soalarm.inc.php:1.2      Tue Sep 14 09:18:20 2004
+++ property/inc/class.soalarm.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,20 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class soalarm
        {
@@ -28,6 +37,7 @@
                        $this->socommon         = 
CreateObject($this->currentapp.'.socommon');

                        $this->join                     = $this->socommon->join;
+                       $this->like                     = $this->socommon->like;
                }

                function select_method_list()
@@ -85,7 +95,6 @@
                                $ordermethod = ' order by id DESC';
                        }

-
                        $where = 'WHERE';
                        if ($filter > 0)
                        {
@@ -94,18 +103,10 @@

                        }

-/*                     if($query)
-                       {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $querymethod = " $where ( abid = '$query' or 
org_name LIKE '%$query%')";
-                       }
-*/
                        $id = $this->db->db_addslashes($id);
                        if (strpos($id,'%') !== False || strpos($id,'_') !== 
False)
                        {
-                               $filtermethod = "$where id LIKE '%$id%' AND 
id!='##last-check-run##'";
+                               $filtermethod = "$where id $this->like '%$id%' 
AND id!='##last-check-run##'";
                        }
                        elseif (!$id)
                        {
@@ -116,7 +117,15 @@
                                $filtermethod = "$where id='$id'";
                        }

-                       $sql = "SELECT * FROM phpgw_async $filtermethod 
$querymethod";
+                       if($query)
+                       {
+                               $query = ereg_replace("'",'',$query);
+                               $query = ereg_replace('"','',$query);
+
+                               $querymethod = " AND (account_lid $this->like 
'%$query%' OR method $this->like '%$query%' OR id $this->like '%$query%')";
+                       }
+
+                       $sql = "SELECT 
phpgw_async.id,phpgw_async.next,phpgw_async.times,phpgw_async.method,phpgw_async.data,account_lid
 FROM phpgw_async $this->join phpgw_accounts on 
phpgw_async.account_id=phpgw_accounts.account_id $filtermethod $querymethod";

                        $this->db2->query($sql,__LINE__,__FILE__);
                        $this->total_records = $this->db2->num_rows();
@@ -143,7 +152,7 @@
                                        'method' => $this->db->f('method'),
                                        'data'   => $data,
                                        'enabled'   => (int)$data['enabled'],
-                                       'account_id'   => 
$this->db->f('account_id')
+                                       'user'   => $this->db->f('account_lid')
                                );
                        }
                        if (!count($jobs))
@@ -158,7 +167,7 @@
                        $id = $this->db->db_addslashes($id);
                        if (strpos($id,'%') !== False || strpos($id,'_') !== 
False)
                        {
-                               $where = "id LIKE '%$id%' AND 
id!='##last-check-run##'";
+                               $where = "id $this->like '%$id%' AND 
id!='##last-check-run##'";
                        }
                        elseif (!$id)
                        {
@@ -201,7 +210,7 @@
                        {
                                $owner['id']                    = 
(int)$this->db->f('owner_id');
                                $owner['abid']                  = 
$this->db->f('abid');
-                               $owner['org_name']              = 
stripslashes($this->db->f('org_name'));
+                               $owner['contact_name']          = 
stripslashes($this->db->f('contact_name'));
                                $owner['remark']                = 
stripslashes($this->db->f('remark'));
                                $owner['entry_date']            = 
$this->db->f('entry_date');
                                $owner['cat_id']                        = 
(int)$this->db->f('category');
@@ -214,8 +223,8 @@
                {
                        $owner['name'] = 
$this->db->db_addslashes($owner['name']);

-                       $this->db->query("INSERT INTO fm_owner 
(entry_date,remark,abid,org_name,category) "
-                               . "VALUES ('" . time() . "','" . 
$owner['remark'] . "','" . $owner['abid'] . "','" . $owner['org_name']
+                       $this->db->query("INSERT INTO fm_owner 
(entry_date,remark,abid,contact_name,category) "
+                               . "VALUES ('" . time() . "','" . 
$owner['remark'] . "','" . $owner['abid'] . "','" . $owner['contact_name']
                                . "','" . $owner['cat_id'] . 
"')",__LINE__,__FILE__);

                        $receipt['owner_id']= 
$this->db->get_last_insert_id('fm_owner','owner_id');
@@ -227,7 +236,7 @@
                {
                        $owner['name'] = 
$this->db->db_addslashes($owner['name']);

-                       $this->db->query("UPDATE fm_owner set remark='" . 
$owner['remark'] . "', entry_date='" . time() . "', abid='" . $owner['abid'] . 
"', org_name='" . $owner['org_name'] . "', category='"
+                       $this->db->query("UPDATE fm_owner set remark='" . 
$owner['remark'] . "', entry_date='" . time() . "', abid='" . $owner['abid'] . 
"', contact_name='" . $owner['contact_name'] . "', category='"
                                                        . $owner['cat_id'] . "' 
WHERE owner_id=" . intval($owner['owner_id']),__LINE__,__FILE__);

                        $receipt['owner_id']= $owner['owner_id'];

====================================================
Index: property/inc/class.soasync.inc.php
diff -u property/inc/class.soasync.inc.php:1.1 
property/inc/class.soasync.inc.php:1.2
--- property/inc/class.soasync.inc.php:1.1      Wed Jul 21 19:00:12 2004
+++ property/inc/class.soasync.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class soasync
        {
@@ -27,6 +37,7 @@
                        $this->socommon         = 
CreateObject($this->currentapp.'.socommon');

                        $this->join                     = $this->socommon->join;
+                       $this->like                     = $this->socommon->like;

                }

@@ -64,7 +75,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " where id LIKE '%$query%' or 
descr LIKE '%$query%'";
+                               $querymethod = " where id $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }

                        $sql = "SELECT * FROM $table $querymethod";
@@ -117,6 +128,7 @@
                        $this->db->query("INSERT INTO $table (id, name,data, 
descr) "
                                . "VALUES ('" . $method['id'] . "','" . 
$method['name'] . "','" . $method['data'] . "','" . $method['descr']. 
"')",__LINE__,__FILE__);

+                       $receipt['id'] = $method['id'];
                        $receipt['message'][] = array('msg' => lang('async 
method has been saved'));

                        return $receipt;
@@ -133,6 +145,7 @@
                        $this->db->query("UPDATE $table set descr='" . 
$method['descr'] . "', name='". $method['name'] . "', data='". $method['data']
                                                        . "' WHERE id='" . 
$method['id']. "'",__LINE__,__FILE__);

+                       $receipt['id'] = $method['id'];
                        $receipt['message'][] = array('msg' =>lang('method has 
been edited'));
                        return $receipt;
                }

====================================================
Index: property/inc/class.sodrawing.inc.php
diff -u property/inc/class.sodrawing.inc.php:1.2 
property/inc/class.sodrawing.inc.php:1.3
--- property/inc/class.sodrawing.inc.php:1.2    Wed Jun  2 18:54:28 2004
+++ property/inc/class.sodrawing.inc.php        Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage document
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class sodrawing
        {
@@ -32,6 +42,7 @@
                        $this->socommon         = 
CreateObject($this->currentapp.'.socommon');

                        $this->join                     = $this->socommon->join;
+                       $this->like                     = $this->socommon->like;
                }

                function select_category_list()
@@ -166,7 +177,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " $where (fm_drawing.address 
LIKE '%$query%' or fm_drawing.location_code LIKE '%$query%')";
+                               $querymethod = " $where (fm_drawing.address 
$this->like '%$query%' or fm_drawing.location_code $this->like '%$query%')";
                        }



====================================================
Index: property/inc/class.soentity.inc.php
diff -u property/inc/class.soentity.inc.php:1.2 
property/inc/class.soentity.inc.php:1.3
--- property/inc/class.soentity.inc.php:1.2     Wed Jun  2 18:54:28 2004
+++ property/inc/class.soentity.inc.php Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage entity
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class soentity
        {
@@ -27,6 +37,7 @@

                        $this->join                     = $this->bocommon->join;
                        $this->left_join        = $this->bocommon->left_join;
+                       $this->like                     = $this->bocommon->like;
                }

                function select_status_list($entity_id,$cat_id)
@@ -248,7 +259,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " $where ( 
$entity_table.location_code LIKE '%$query%' OR $entity_table.num LIKE 
'%$query%'  OR loc1_name LIKE '%$query%' OR address LIKE '%$query%')";
+                               $querymethod = " $where ( 
$entity_table.location_code $this->like '%$query%' OR $entity_table.num 
$this->like '%$query%'  OR loc1_name $this->like '%$query%' OR address 
$this->like '%$query%')";
                                $where = 'AND';
                        }

@@ -270,6 +281,8 @@
                        $j=0;
                        $n=count($cols_return);
 //_debug_array($cols_return);
+                       $contacts                       = 
CreateObject('phpgwapi.contacts');
+
                        while ($this->db->next_record())
                        {
                                for ($i=0;$i<$n;$i++)
@@ -298,7 +311,12 @@
                                        }
                                        
elseif($cols_return_extra[$i]['datatype']=='AB' && $value):
                                        {
-                                               $sql="SELECT org_name FROM 
phpgw_addressbook where id=$value";
+                                               $contact_data   = 
$contacts->read_single_entry($value,array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
+                                               
$entity_list[$j][$cols_return_extra[$i]['name']]        = 
$contact_data[0]['n_family'] . ', ' . $contact_data[0]['n_given'];
+                                       }
+                                       
elseif($cols_return_extra[$i]['datatype']=='VENDOR' && $value):
+                                       {
+                                               $sql="SELECT org_name FROM 
fm_vendor where id=$value";
                                                $this->db2->query($sql);
                                                $this->db2->next_record();
                                                
$entity_list[$j][$cols_return_extra[$i]['name']] = $this->db2->f('org_name');
@@ -542,7 +560,6 @@
                function edit($values,$values_attribute,$entity_id,$cat_id)
                {

-//_debug_array($values);
                        if($values['street_name'])
                        {
                                $address[]= $values['street_name'];
@@ -572,18 +589,18 @@
                                $value_set[$column]     = $value;
                        }

-
                        if (isset($values_attribute) AND 
is_array($values_attribute))
                        {
                                foreach($values_attribute as $entry)
                                {
-                                       if($entry['datatype']!='AB')
+                                       if($entry['datatype']!='AB' && 
$entry['datatype']!='VENDOR')
                                        {
                                                $value_set[$entry['name']]      
= $entry['value'];
                                        }
                                }
                        }

+
                        $value_set      = 
$this->bocommon->validate_db_update($value_set);

                        $table='fm_entity_' . $entity_id .'_' . $cat_id;

====================================================
Index: property/inc/class.solookup.inc.php
diff -u property/inc/class.solookup.inc.php:1.3 
property/inc/class.solookup.inc.php:1.4
--- property/inc/class.solookup.inc.php:1.3     Sat Oct 23 22:11:00 2004
+++ property/inc/class.solookup.inc.php Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage core
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class solookup
        {
@@ -28,7 +38,7 @@
                        $this->socommon         = 
CreateObject($this->currentapp.'.socommon');

                        $this->join                     = $this->socommon->join;
-
+                       $this->like                     = $this->socommon->like;

                }

@@ -66,7 +76,7 @@

                        if ($cat_id > 0)
                        {
-                               $filtermethod .= " $where cat_id LIKE 
'%,$cat_id,%' ";
+                               $filtermethod .= " $where cat_id $this->like 
'%,$cat_id,%' ";
                                $where= 'AND';
                        }

@@ -75,7 +85,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " $where (id LIKE '%$query%' or 
org_name LIKE '%$query%')";
+                               $querymethod = " $where (id $this->like 
'%$query%' or org_name $this->like '%$query%')";
                        }

                        $sql = "SELECT person_id,first_name,last_name FROM 
phpgw_contact_person $filtermethod $querymethod";
@@ -131,7 +141,7 @@

                        if ($cat_id > 0)
                        {
-                               $filtermethod .= " $where member_of LIKE 
'%,$cat_id,%' ";
+                               $filtermethod .= " $where member_of $this->like 
'%,$cat_id,%' ";
                                $where= 'AND';
                        }

@@ -140,7 +150,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " $where (id LIKE '%$query%' or 
org_name LIKE '%$query%')";
+                               $querymethod = " $where (id $this->like 
'%$query%' or org_name $this->like '%$query%')";
                        }

                        $sql = "SELECT id,org_name FROM fm_vendor $filtermethod 
$querymethod";
@@ -196,7 +206,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " where (id LIKE '%$query%' or 
descr LIKE '%$query%')";
+                               $querymethod = " where (id $this->like 
'%$query%' or descr $this->like '%$query%')";
                        }

                        $sql = "SELECT * FROM fm_b_account $querymethod  ";
@@ -251,7 +261,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " where ( descr LIKE 
'%$query%')";
+                               $querymethod = " where ( descr $this->like 
'%$query%')";
                        }

                        $sql = "SELECT * FROM fm_streetaddress $querymethod  ";
@@ -305,7 +315,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " where ( last_name LIKE 
'%$query%' or first_name LIKE '%$query%')";
+                               $querymethod = " where ( last_name $this->like 
'%$query%' or first_name $this->like '%$query%')";
                        }

                        $sql = "SELECT * FROM fm_tenant $querymethod  ";
@@ -360,7 +370,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " where ( tekst1 LIKE '%$query%' 
or tekst2 LIKE '%$query%' or tekst3 LIKE '%$query%' or tekst4 LIKE '%$query%' 
or tekst5 LIKE '%$query%' or tekst6 LIKE '%$query%')";
+                               $querymethod = " where ( tekst1 $this->like 
'%$query%' or tekst2 $this->like '%$query%' or tekst3 $this->like '%$query%' or 
tekst4 $this->like '%$query%' or tekst5 $this->like '%$query%' or tekst6 
$this->like '%$query%')";
                        }

                        $sql = "SELECT * FROM fm_ns3420  $querymethod  ";

====================================================
Index: property/inc/class.someter.inc.php
diff -u property/inc/class.someter.inc.php:1.2 
property/inc/class.someter.inc.php:1.3
--- property/inc/class.someter.inc.php:1.2      Wed Jun  2 18:54:28 2004
+++ property/inc/class.someter.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage entity
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class someter
        {
@@ -26,6 +36,7 @@
                        $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
                        $this->join                     = $this->bocommon->join;
+                       $this->like                     = $this->bocommon->like;
                }

                function get_category_list()
@@ -135,7 +146,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " $where (fm_meter.name LIKE 
'%$query%' OR fm_meter.num LIKE '%$query%' OR fm_meter.location_code LIKE 
'%$query%' OR fm_meter.address LIKE '%$query%')";
+                               $querymethod = " $where (fm_meter.name 
$this->like '%$query%' OR fm_meter.num $this->like '%$query%' OR 
fm_meter.location_code $this->like '%$query%' OR fm_meter.address $this->like 
'%$query%')";
                        }

                        $sql .= " $filtermethod $querymethod";

====================================================
Index: property/inc/class.sop_of_town.inc.php
diff -u property/inc/class.sop_of_town.inc.php:1.2 
property/inc/class.sop_of_town.inc.php:1.3
--- property/inc/class.sop_of_town.inc.php:1.2  Wed Jun  2 18:54:28 2004
+++ property/inc/class.sop_of_town.inc.php      Thu Jan 13 16:52:48 2005
@@ -1,20 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class sop_of_town
        {
@@ -28,6 +37,7 @@
                        $this->socommon         = 
CreateObject($this->currentapp.'.socommon');

                        $this->join                     = $this->socommon->join;
+                       $this->like                     = $this->socommon->like;
                }


@@ -74,7 +84,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " $where ( name LIKE 
'%$query%')";
+                               $querymethod = " $where ( name $this->like 
'%$query%')";
                        }

                        $sql = "SELECT fm_part_of_town.*, descr as category 
FROM fm_part_of_town $this->join fm_district on 
fm_part_of_town.district_id=fm_district.id $filtermethod $querymethod";

====================================================
Index: property/inc/class.solocation.inc.php
diff -u property/inc/class.solocation.inc.php:1.3 
property/inc/class.solocation.inc.php:1.4
--- property/inc/class.solocation.inc.php:1.3   Sat Oct 30 15:33:27 2004
+++ property/inc/class.solocation.inc.php       Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage location
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class solocation
        {
@@ -31,6 +41,7 @@

                        $this->join                     = $this->socommon->join;
                        $this->left_join        = $this->socommon->left_join;
+                       $this->like                     = $this->socommon->like;
                }

                function read_entity_to_link()
@@ -457,15 +468,15 @@

                                        if($sub_query_tenant)
                                        {
-                                               $sub_query = "OR 
fm_tenant.last_name LIKE '%$query%' OR fm_tenant.first_name LIKE '%$query%' OR 
fm_tenant.contact_phone LIKE '%$query%'";
+                                               $sub_query = "OR 
fm_tenant.last_name $this->like '%$query%' OR fm_tenant.first_name $this->like 
'%$query%' OR fm_tenant.contact_phone $this->like '%$query%'";
                                        }

                                        if($sub_query_street)
                                        {
-                                               $sub_query .= "OR 
fm_streetaddress.descr LIKE '%$query%'";
+                                               $sub_query .= "OR 
fm_streetaddress.descr $this->like '%$query%'";
                                        }

-                                       $querymethod = " $where (fm_location" . 
($type_id).".loc1 LIKE '%$query%' $sub_query OR fm_location" . 
($type_id).".location_code LIKE '%$query%' OR loc" . ($type_id)."_name LIKE 
'%$query%')";
+                                       $querymethod = " $where (fm_location" . 
($type_id).".loc1 $this->like '%$query%' $sub_query OR fm_location" . 
($type_id).".location_code $this->like '%$query%' OR loc" . ($type_id)."_name 
$this->like '%$query%')";
                                }
                                $where= 'AND';
                        }
@@ -858,13 +869,12 @@
                        return $receipt;
                }

-               function delete($location_code,$type_id )
+               function delete($location_code )
                {
+                       $location_array = split('-',$location_code);
+                       $type_id= count($location_array);

-//                     $location_array = split('-',$location_code);
-//                     $type_id= count($location_array);
-
-                       $this->db->query("DELETE FROM fm_location" . $type_id . 
" WHERE location_code='" . $location_code ."'",__LINE__,__FILE__);
+                       $this->db->query("DELETE FROM fm_location$type_id WHERE 
location_code='" . $location_code ."'",__LINE__,__FILE__);
 //                     $this->db->query("DELETE FROM fm_location WHERE 
location_code='" . $location_code ."'",__LINE__,__FILE__);
                }


====================================================
Index: property/inc/class.soinvoice.inc.php
diff -u property/inc/class.soinvoice.inc.php:1.5 
property/inc/class.soinvoice.inc.php:1.6
--- property/inc/class.soinvoice.inc.php:1.5    Sat Oct 30 15:56:35 2004
+++ property/inc/class.soinvoice.inc.php        Thu Jan 13 16:52:48 2005
@@ -1,20 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-  /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage eco
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class soinvoice
        {
@@ -31,7 +40,7 @@

                        $this->join                     = $this->bocommon->join;
                        $this->left_join        = $this->bocommon->left_join;
-
+                       $this->like                     = $this->bocommon->like;
                }


@@ -154,7 +163,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " $where ( spvend_code LIKE 
'%$query%' OR bilagsnr LIKE '%$query%' )";
+                               $querymethod = " $where ( spvend_code 
$this->like '%$query%' OR bilagsnr $this->like '%$query%' )";
                        }


@@ -251,7 +260,7 @@
                                        }

                                        $invoice[$i]['counter']                 
                = $i;
-                                       $invoice[$i]['current_user']            
        = strtoupper($GLOBALS['phpgw_info']['user']['account_lid']);
+                                       $invoice[$i]['current_user']            
        = $GLOBALS['phpgw_info']['user']['account_lid'];
                                        $invoice[$i]['voucher_id']              
                = $voucher_id;
                                        $invoice[$i]['invoice_count']           
        = $invoice_temp['invoice_count'];
                                        $invoice[$i]['vendor_id']               
                = $this->db->f('spvend_code');
@@ -459,7 +468,7 @@

                        if($loc1)
                        {
-                               $filtermethod .=" $where (dima like '%$loc1%')";
+                               $filtermethod .=" $where (dima $this->like 
'%$loc1%')";
                                $where= 'AND';
                        }

@@ -900,5 +909,227 @@
                }


+               function update_invoice($values)
+               {
+
+//_debug_array($values);
+                       foreach($values['counter'] as $n)
+                       {
+                               $local_error='';
+
+                               if($values['voucher_id'][$n])
+                               {
+                                       $voucher_id=$values['voucher_id'][$n];
+
+                                       
$check_value=array('voucher_id'=>$voucher_id,
+                                                       'sign_orig'             
=> $values['sign_orig'][$n],
+                                                       'sign'                  
=> $values['sign'][$n],
+                                                       'transfer'              
=> $values['transfer'][$n],
+                                                       'kreditnota'    => 
$values['kreditnota'][$n],
+                                                       'num_days'              
=> $values['num_days'][$n]);
+
+                                       
if($this->check_for_updates($check_value))
+                                       {
+
+                                               $check_count = 
$this->check_count($voucher_id);
+
+                                               if 
(!($check_count['dima_count'] == $values['invoice_count'][$n]))
+                                               {
+                                                       $receipt['error'][] = 
array('msg'=>lang('Dima is missing from sub invoice in:'). " 
".$values['voucher_id'][$n]);
+                                                       $local_error= true;
+                                               }
+
+
+
+                                               if 
(!($check_count['spbudact_code_count'] == $values['invoice_count'][$n]))
+                                               {
+                                                       $receipt['error'][] = 
array('msg'=>lang('Budget code is missing from sub invoice in :'). " 
".$values['voucher_id'][$n]);
+                                                       $local_error= true;
+                                               }
+
+                                               if 
(!($check_count['kostra_count'] == $values['invoice_count'][$n]))
+                                               {
+                                                       $receipt['error'][] = 
array('msg'=>'Tjenestekode mangler for undebilag: ' . " 
".$values['voucher_id'][$n]);
+                                                       $local_error= true;
+                                               }
+
+                                               $blank_date = '';
+                                               $sign_field='';
+                                               $sign_id='';
+                                               $sign_date_field='';
+                                               $sign_date='';
+                                               $kommma='';
+                                               $wait_for_kreditnota='';
+                                               $user_lid       
=$GLOBALS['phpgw_info']['user']['account_lid'];
+
+                                               if 
(($values['sign'][$n]=='sign_none') && 
($values['sign_orig'][$n]=='sign_janitor')):
+                                                       $blank_date = 
'oppsynsigndato= NULL';
+                                                       $sign_field='';
+                                                       $sign_id='';
+                                                       $sign_date_field='';
+                                                       $sign_date='';
+                                                       $kommma='';
+                                               elseif 
(($values['sign'][$n]=='sign_none') && 
($values['sign_orig'][$n]=='sign_supervisor')):
+                                                       $blank_date = 
'saksigndato= NULL';
+                                                       $sign_field='';
+                                                       $sign_id='';
+                                                       $sign_date_field='';
+                                                       $sign_date='';
+                                                       $kommma='';
+                                               elseif 
(($values['sign'][$n]=='sign_none') && 
($values['sign_orig'][$n]=='sign_budget_responsible')):
+                                                       $blank_date = 
'budsjettsigndato= NULL';
+                                                       $sign_field='';
+                                                       $sign_id='';
+                                                       $sign_date_field='';
+                                                       $sign_date='';
+                                                       $kommma='';
+                                               elseif 
($values['sign'][$n]=='sign_janitor' && !$values['sign_orig'][$n]):
+                                                       $blank_date = '';
+                                                       $sign_field = 
'oppsynsmannid=';
+                                                       $sign_id = 
"'$user_lid'";
+                                                       $sign_date_field = 
'oppsynsigndato=';
+                                                       $sign_date="'" . 
date($this->bocommon->datetimeformat) . "'";
+                                                       $kommma=",";
+                                               elseif 
($values['sign'][$n]=='sign_janitor' && 
$values['sign_orig'][$n]=='sign_supervisor'):
+                                                       $blank_date = 
'saksigndato= NULL';
+                                                       $sign_field = 
'oppsynsmannid=';
+                                                       $sign_id = 
"'$user_lid'";
+                                                       $sign_date_field = 
'oppsynsigndato=';
+                                                       $sign_date="'" . 
date($this->bocommon->datetimeformat) . "'";
+                                                       $kommma=",";
+                                               elseif 
($values['sign'][$n]=='sign_janitor' && 
$values['sign_orig'][$n]=='sign_budget_responsible'):
+                                                       $blank_date = 
'budsjettsigndato= NULL';
+                                                       $sign_field = 
'oppsynsmannid=';
+                                                       $sign_id = 
"'$user_lid'";
+                                                       $sign_date_field = 
'oppsynsigndato=';
+                                                       $sign_date="'" . 
date($this->bocommon->datetimeformat) . "'";
+                                                       $kommma=",";
+                                               elseif 
($values['sign'][$n]=='sign_supervisor' && !$values['sign_orig'][$n]):
+                                                       $blank_date = '';
+                                                       $sign_field = 
'saksbehandlerid=';
+                                                       $sign_id = 
"'$user_lid'";
+                                                       $sign_date_field = 
'saksigndato=';
+                                                       $sign_date="'" . 
date($this->bocommon->datetimeformat) . "'";
+                                                       $kommma=",";
+                                               elseif 
($values['sign'][$n]=='sign_supervisor' && 
$values['sign_orig'][$n]=='sign_janitor'):
+                                                       $blank_date = 
'oppsynsigndato= NULL';
+                                                       $sign_field = 
'saksbehandlerid=';
+                                                       $sign_id = 
"'$user_lid'";
+                                                       $sign_date_field = 
'saksigndato=';
+                                                       $sign_date="'" . 
date($this->bocommon->datetimeformat) . "'";
+                                                       $kommma=",";
+                                               elseif 
($values['sign'][$n]=='sign_supervisor' && 
$values['sign_orig'][$n]=='sign_budget_responsible'):
+                                                       $blank_date = 
'budsjettsigndato= NULL';
+                                                       $sign_field = 
'saksbehandlerid=';
+                                                       $sign_id = 
"'$user_lid'";
+                                                       $sign_date_field = 
'saksigndato=';
+                                                       $sign_date="'" . 
date($this->bocommon->datetimeformat) . "'";
+                                                       $kommma=",";
+                                               elseif 
($values['sign'][$n]=='sign_budget_responsible' && 
$values['sign_orig'][$n]=='sign_janitor'):
+                                                       $blank_date = 
'oppsynsigndato= NULL';
+                                                       $sign_field = 
'budsjettansvarligid=';
+                                                       $sign_id = 
"'$user_lid'";
+                                                       $sign_date_field = 
'budsjettsigndato=';
+                                                       $sign_date="'" . 
date($this->bocommon->datetimeformat) . "'";
+                                                       $kommma=",";
+                                               elseif 
($values['sign'][$n]=='sign_budget_responsible' && 
$values['sign_orig'][$n]=='sign_supervisor'):
+                                                       $blank_date = 
'saksigndato= NULL';
+                                                       $sign_field = 
'budsjettansvarligid=';
+                                                       $sign_id = 
"'$user_lid'";
+                                                       $sign_date_field = 
'budsjettsigndato=';
+                                                       $sign_date="'" . 
date($this->bocommon->datetimeformat) . "'";
+                                                       $kommma=",";
+                                               elseif 
($values['sign'][$n]=='sign_budget_responsible' && !$values['sign_orig'][$n]):
+                                                       $blank_date = '';
+                                                       $sign_field = 
'budsjettansvarligid=';
+                                                       $sign_id = 
"'$user_lid'";
+                                                       $sign_date_field = 
'budsjettsigndato=';
+                                                       $sign_date="'" . 
date($this->bocommon->datetimeformat) . "'";
+                                                       $kommma=",";
+                                               endif;
+
+
+                                               if($blank_date )
+                                               {
+                                                       $kommma_blank=",";
+                                               }
+                                               else
+                                               {
+                                                       $kommma_blank='';
+                                               }
+
+                                               
$transfer_sign_field='utbetalingid=';
+                                               
$transfer_date_field='utbetalingsigndato=';
+
+                                               if 
(!($values['num_days_orig'][$n]==$values['num_days'][$n]))
+                                               {
+                                                       $payment_date = 
date($this->bocommon->dateformat,$values['timestamp_voucher_date'][$n]+(24*3600*$values['num_days'][$n]));
+                                                       
$GLOBALS['phpgw']->db->query("update fm_ecobilag set forfallsdato= 
'$payment_date' where bilagsnr='$voucher_id'");
+                                               }
+
+                                               $transfer_id="Null".",";
+                                               $transfer_date="Null";
+
+                                               if ($values['transfer'][$n])
+                                               {
+                                                       if 
($this->check_for_transfer($voucher_id))
+                                                       {
+                                                               
$transfer_id="'$user_lid',";
+                                                               
$transfer_date="'" . date($this->bocommon->datetimeformat) . "'";
+                                                       }
+                                                       else
+                                                       {
+                                                               
$receipt['error'][] = array('msg'=>'Dette bilaget er ikkje godkjent: ' . " 
".$voucher_id);
+                                                               $local_error= 
true;
+                                                       }
+
+                                               }
+
+                                               if ($values['kreditnota'][$n])
+                                               {
+                                                       $wait_for_kreditnota=1;
+                                                       $transfer_date="Null";
+                                               }
+                                               else
+                                               {
+                                                       
$wait_for_kreditnota='NULL';
+                                               }
+
+                                               if (! $local_error)
+                                               {
+                                                       $sql= "update 
fm_ecobilag set $blank_date $kommma_blank $sign_field $sign_id $kommma 
$sign_date_field $sign_date $kommma $transfer_sign_field $transfer_id 
$transfer_date_field $transfer_date ,kreditnota=$wait_for_kreditnota  where 
bilagsnr='$voucher_id'";
+                                                       $sql2= "update 
fm_ecobilag set utbetalingid = NULL, utbetalingsigndato = NULL WHERE 
budsjettsigndato IS NULL";
+                                                       $sql3= "update 
fm_ecobilag set utbetalingid = NULL, utbetalingsigndato = NULL WHERE 
oppsynsigndato IS NULL AND saksigndato IS NULL";
+                                                       
$GLOBALS['phpgw']->db->transaction_begin();
+                                                       
$GLOBALS['phpgw']->db->query($sql);
+                                                       
$GLOBALS['phpgw']->db->query($sql2);
+                                                       
$GLOBALS['phpgw']->db->query($sql3);
+                                                       
$GLOBALS['phpgw']->db->transaction_commit();
+
+                                                       $receipt['message'][] = 
array('msg'=> lang('voucher is updated: ') . $voucher_id);
+                                               }
+                                       }
+                               }
+                       }
+                       return $receipt;
+               }
+
+               function check_for_transfer($voucher_id='')
+               {
+                       $allow_transfer=False;
+
+                       $sql = "SELECT * FROM fm_ecobilag WHERE 
bilagsnr='$voucher_id'";
+                       $this->db->limit_query($sql,0,__LINE__,__FILE__,1);
+
+                       $this->db->next_record();
+
+                       if ($this->db->f('budsjettsigndato') && 
($this->db->f('oppsynsigndato') || $this->db->f('saksigndato')))
+                       {
+                               $allow_transfer=True;
+                       }
+
+                       return $allow_transfer;
+               }
+
        }
 ?>

====================================================
Index: property/inc/class.sogab.inc.php
diff -u property/inc/class.sogab.inc.php:1.7 
property/inc/class.sogab.inc.php:1.8
--- property/inc/class.sogab.inc.php:1.7        Thu Oct 14 10:24:48 2004
+++ property/inc/class.sogab.inc.php    Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage location
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class sogab
        {
@@ -29,9 +39,9 @@
                        $this->socommon         = 
CreateObject($this->currentapp.'.socommon');

                        $this->join                     = $this->socommon->join;
+                       $this->like                     = $this->socommon->like;

                        $this->gab_insert_level = $gab_insert_level;
-
                }

                function read($data)
@@ -88,22 +98,22 @@

                        if ($gaards_nr)
                        {
-                               $filtermethod .= " $where SUBSTRING(gab_id,5,5) 
like '%$gaards_nr%' ";
+                               $filtermethod .= " $where SUBSTRING(gab_id,5,5) 
$this->like '%$gaards_nr%' ";
                                $where = 'AND';
                        }
                        if ($bruksnr)
                        {
-                               $filtermethod .= " $where 
SUBSTRING(gab_id,10,4) like '%$bruksnr%' ";
+                               $filtermethod .= " $where 
SUBSTRING(gab_id,10,4) $this->like '%$bruksnr%' ";
                                $where = 'AND';
                        }
                        if ($feste_nr)
                        {
-                               $filtermethod .= " $where 
SUBSTRING(gab_id,14,4) like '%$feste_nr%' ";
+                               $filtermethod .= " $where 
SUBSTRING(gab_id,14,4) $this->like '%$feste_nr%' ";
                                $where = 'AND';
                        }
                        if ($seksjons_nr)
                        {
-                               $filtermethod .= " $where 
SUBSTRING(gab_id,18,3) like '%$seksjons_nr%' ";
+                               $filtermethod .= " $where 
SUBSTRING(gab_id,18,3) $this->like '%$seksjons_nr%' ";
                                $where = 'AND';
                        }


====================================================
Index: property/inc/class.soinvestment.inc.php
diff -u property/inc/class.soinvestment.inc.php:1.2 
property/inc/class.soinvestment.inc.php:1.3
--- property/inc/class.soinvestment.inc.php:1.2 Wed Jun  2 18:54:28 2004
+++ property/inc/class.soinvestment.inc.php     Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage eco
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class soinvestment
        {
@@ -27,6 +37,7 @@
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');

                        $this->join                     = $this->bocommon->join;
+                       $this->like                     = $this->bocommon->like;
                }

                function get_type_list()
@@ -102,7 +113,7 @@
                        if ($cat_id=='property')
                        {
                                $sql = "SELECT fm_investment.entity_id as 
entity_id, fm_investment.descr as descr, 
fm_investment_value.invest_id,initial_value, fm_location1.loc1_name as name, 
fm_part_of_town.district_id, fm_part_of_town.name as part_of_town,"
-                               . " fm_investment_value.value, 
fm_investment_value.date, fm_investment_value.this_index, "
+                               . " fm_investment_value.value, 
fm_investment_value.index_date, fm_investment_value.this_index, "
                                . " fm_investment_value.index_count"
                                . " FROM (((fm_investment $this->join 
fm_investment_value ON ( fm_investment.entity_id = 
fm_investment_value.entity_id) AND "
                                . " (fm_investment.invest_id = 
fm_investment_value.invest_id )) "
@@ -114,7 +125,7 @@
                        else
                        {
                                $sql = "SELECT 
fm_investment.location_code,fm_investment.entity_id, fm_investment.descr as 
descr, fm_investment_value.invest_id,initial_value, 
fm_part_of_town.district_id, fm_part_of_town.name as part_of_town,"
-                               . " fm_investment_value.value, 
fm_investment_value.date, 
fm_investment_value.this_index,fm_entity_category.name as entity_name, "
+                               . " fm_investment_value.value, 
fm_investment_value.index_date, 
fm_investment_value.this_index,fm_entity_category.name as entity_name, "
                                . " fm_investment_value.index_count "
                                . " FROM ((((fm_investment $this->join "
                                . " fm_entity_category ON 
(fm_investment.p_entity_id = fm_entity_category.entity_id AND 
fm_investment.p_cat_id = fm_entity_category.id)) $this->join "
@@ -154,7 +165,7 @@
                                $investment[$i]['value']                        
= $this->db->f('value');
                                $investment[$i]['this_index']           = 
$this->db->f('this_index');
                                $investment[$i]['index_count']          = 
$this->db->f('index_count');
-                               $investment[$i]['date']                         
= $this->db->f('date');
+                               $investment[$i]['date']                         
= $this->db->f('index_date');
                                if ($cat_id=='property')
                                {
                                        $investment[$i]['entity_name']  = 
$this->db->f('name');
@@ -232,7 +243,7 @@
                        $this->db->query("insert into fm_investment (entity_id, 
invest_id,entity_type,location_code,writeoff_year, descr $cols) "
                        . " values ('$entity_id', 
'$next_invest_id','$entity_type','$location_code','$period','$descr' $vals )");

-                       $this->db->query("insert into fm_investment_value 
(entity_id, invest_id, index_count, this_index, current_index, 
value,initial_value, date) "
+                       $this->db->query("insert into fm_investment_value 
(entity_id, invest_id, index_count, this_index, current_index, 
value,initial_value, index_date) "
                        . " values ('$entity_id', '$next_invest_id','1', '0', 
'1','$initial_value','$initial_value','$date')");


@@ -273,7 +284,7 @@
                                        $insert = 
$this->bocommon->validate_db_insert($insert);


-                                       $this->db->query("insert into 
fm_investment_value (entity_id, invest_id, index_count, this_index, 
value,initial_value, date,current_index) "
+                                       $this->db->query("insert into 
fm_investment_value (entity_id, invest_id, index_count, this_index, 
value,initial_value, index_date,current_index) "
                                        . " values ($insert)");
                                }
                                $this->db->transaction_commit();
@@ -288,7 +299,7 @@
                        }


-                       $sql = "SELECT index_count, 
this_index,current_index,value, initial_value, date  "
+                       $sql = "SELECT index_count, 
this_index,current_index,value, initial_value, index_date  "
                        . " FROM fm_investment_value Where entity_id= 
'$entity_id' and invest_id= '$investment_id' order by index_count";

                        $this->db2->query($sql,__LINE__,__FILE__);
@@ -312,7 +323,7 @@
                                $investment[$i]['this_index']           = 
$this->db->f('this_index');
                                $investment[$i]['current_index']        = 
$this->db->f('current_index');
                                $investment[$i]['index_count']          = 
$this->db->f('index_count');
-                               $investment[$i]['date']                         
= $this->db->f('date');
+                               $investment[$i]['date']                         
= $this->db->f('index_date');
                                $investment[$i]['this_write_off']       = 
round(($this->db->f('this_index') * $this->db->f('initial_value')),2);
                                $i++;
                        }
@@ -341,7 +352,7 @@
                        $this->db->transaction_begin();
                        if ($index_count==1)
                        {
-                               $this->db->query("update fm_investment_value 
set current_index = '0', this_index=Null, 
value=Null,initial_value=Null,date=Null  where entity_id='$entity_id' and 
invest_id= '$invest_id' and index_count= '1'");
+                               $this->db->query("update fm_investment_value 
set current_index = '0', this_index=Null, 
value=Null,initial_value=Null,index_date=Null  where entity_id='$entity_id' and 
invest_id= '$invest_id' and index_count= '1'");
                        }
                        else
                        {

====================================================
Index: property/inc/class.soagreement.inc.php
diff -u property/inc/class.soagreement.inc.php:1.3 
property/inc/class.soagreement.inc.php:1.4
--- property/inc/class.soagreement.inc.php:1.3  Mon Aug 30 14:02:48 2004
+++ property/inc/class.soagreement.inc.php      Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage agreement
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class soagreement
        {
@@ -29,6 +39,7 @@

                        $this->join                     = $this->bocommon->join;
                        $this->left_join        = $this->bocommon->left_join;
+                       $this->like                     = $this->bocommon->like;
 //                     $this->role             = 'agreement';
                }

@@ -133,14 +144,21 @@
                        $uicols['descr'][]                      = 
lang('status');
                        $uicols['statustext'][]         = lang('status');

-                               if ($order)
+                       if ($order)
+                       {
+                               if ($order=='id')
                                {
                                        $ordermethod = " order by 
$entity_table.$order $sort";
                                }
                                else
                                {
-                                       $ordermethod = " order by 
$entity_table.id DESC";
+                                       $ordermethod = " order by $order $sort";
                                }
+                       }
+                       else
+                       {
+                               $ordermethod = " order by $entity_table.id 
DESC";
+                       }


                        $from .= " FROM $paranthesis $entity_table ";
@@ -240,7 +258,7 @@

                        if ($member_id>0)
                        {
-                               $filtermethod .= " $where fm_vendor.member_of 
LIKE '%,$member_id,%' ";
+                               $filtermethod .= " $where fm_vendor.member_of 
$this->like '%,$member_id,%' ";
                                $where= 'AND';
                        }

@@ -260,7 +278,14 @@

                                while ($this->db->next_record())
                                {
-                                       $querymethod[]= "$entity_table." . 
$this->db->f('column_name') . " LIKE '%$query%'";
+                                       if($this->db->f('datatype')=='V' || 
$this->db->f('datatype')=='email' || $this->db->f('datatype')=='CH')
+                                       {
+                                               $querymethod[]= 
"$entity_table." . $this->db->f('column_name') . " $this->like '%$query%'";
+                                       }
+                                       else
+                                       {
+                                               $querymethod[]= 
"$entity_table." . $this->db->f('column_name') . " = '$query'";
+                                       }
                                }

                                if (isset($querymethod) AND 
is_array($querymethod))
@@ -287,6 +312,9 @@
                        $j=0;
                        $n=count($cols_return);
 //_debug_array($cols_return);
+
+                       $contacts                       = 
CreateObject('phpgwapi.contacts');
+
                        while ($this->db->next_record())
                        {
                                for ($i=0;$i<$n;$i++)
@@ -309,10 +337,16 @@
                                        }
                                        
elseif($cols_return_extra[$i]['datatype']=='AB' && $value):
                                        {
-                                               $sql="SELECT org_name FROM 
phpgw_addressbook where id=$value";
+                                               $contact_data   = 
$contacts->read_single_entry($value,array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
+                                               
$agreement_list[$j][$cols_return_extra[$i]['name']]     = 
$contact_data[0]['n_family'] . ', ' . $contact_data[0]['n_given'];
+                                       }
+                                       
elseif($cols_return_extra[$i]['datatype']=='VENDOR' && $value):
+                                       {
+                                               $sql="SELECT org_name FROM 
fm_vendor where id=$value";
                                                $this->db2->query($sql);
                                                $this->db2->next_record();
                                                
$agreement_list[$j][$cols_return_extra[$i]['name']] = $this->db2->f('org_name');
+
                                        }
                                        
elseif($cols_return_extra[$i]['datatype']=='CH' && $value):
                                        {
@@ -374,7 +408,7 @@

                        $cols = "fm_activities.*, 
$entity_table.m_cost,$entity_table.w_cost,"
                                . " 
$entity_table.total_cost,$entity_table.index_count,"
-                               . " 
$entity_table.date,$entity_table.activity_id,"
+                               . " 
$entity_table.index_date,$entity_table.activity_id,"
                                . " 
$entity_table.this_index,$entity_table.agreement_id";


@@ -405,7 +439,7 @@
                        $uicols['name'][]                       = 'index_count';
                        $uicols['descr'][]                      = 
lang('index_count');

-                       $uicols['name'][]                       = 'date';
+                       $uicols['name'][]                       = 'index_date';
                        $uicols['descr'][]                      = lang('Date');

                        if ($order)
@@ -447,7 +481,7 @@

                        if ($member_id>0)
                        {
-                               $filtermethod .= " $where fm_vendor.member_of 
LIKE '%,$member_id,%' ";
+                               $filtermethod .= " $where fm_vendor.member_of 
$this->like '%,$member_id,%' ";
                                $where= 'AND';
                        }

@@ -489,7 +523,7 @@
                                        'total_cost'            => 
$this->db->f('total_cost'),
                                        'this_index'            => 
$this->db->f('this_index'),
                                        'index_count'           => 
$this->db->f('index_count'),
-                                       'date'                          => 
$GLOBALS['phpgw']->common->show_date($this->db->f('date'),$dateformat)
+                                       'date'                          => 
$GLOBALS['phpgw']->common->show_date($this->db->f('index_date'),$dateformat)
                                );
                        }
 //html_print_r($details);
@@ -507,7 +541,7 @@
                        $entity_table = 'fm_activity_price_index';

                        $cols = 
"fm_activity_price_index.m_cost,fm_activity_price_index.w_cost,fm_activity_price_index.total_cost,"
-                               . " 
fm_activity_price_index.index_count,fm_activity_price_index.date,fm_activity_price_index.activity_id,fm_activity_price_index.this_index";
+                               . " 
fm_activity_price_index.index_count,fm_activity_price_index.index_date,fm_activity_price_index.activity_id,fm_activity_price_index.this_index";

                        $cols_return[]                  = 'activity_id';
                        $uicols['input_type'][]         = 'text';
@@ -549,9 +583,9 @@
                        $uicols['descr'][]                      = 
lang('index_count');
                        $uicols['statustext'][]         = lang('index_count');

-                       $cols_return[]                  = 'date';
+                       $cols_return[]                  = 'index_date';
                        $uicols['input_type'][]         = 'text';
-                       $uicols['name'][]                       = 'date';
+                       $uicols['name'][]                       = 'index_date';
                        $uicols['descr'][]                      = lang('date');
                        $uicols['statustext'][]         = lang('date');

@@ -689,6 +723,7 @@
                                {
                                        $item['agreement_id']   = 
(int)$this->db->f('agreement_id');
                                        $item['id']                             
= (int)$this->db->f('id');
+                                       $item['num']                    = 
$this->db->f('num');
                                        $item['entry_date']             = 
$this->db->f('entry_date');
                                        $item['m_cost']                 = 
$this->db->f('m_cost');
                                        $item['w_cost']                 = 
$this->db->f('w_cost');
@@ -717,6 +752,20 @@
                                $agreement['member_of']=',' . 
implode(',',$agreement['member_of']) . ',';
                        }

+                       $this->db->transaction_begin();
+                       $id = $this->bocommon->next_id($table);
+                       $vals[] = $id;
+                       $vals[] = $agreement['name'];
+                       $vals[] = $agreement['descr'];
+                       $vals[] = time();
+                       $vals[] = $agreement['cat_id'];
+                       $vals[] = $agreement['start_date'];
+                       $vals[] = $agreement['end_date'];
+                       $vals[] = $agreement['termination_date'];
+                       $vals[] = $agreement['vendor_id'];
+                       $vals[] = $this->account;
+
+
                        while (is_array($agreement['extra']) && 
list($input_name,$value) = each($agreement['extra']))
                        {
                                if($value)
@@ -746,16 +795,11 @@
                        if($cols)
                        {
                                $cols   = "," . implode(",", $cols);
-                               $vals   = "," . 
$this->bocommon->validate_db_insert($vals);
+                               $vals   = 
$this->bocommon->validate_db_insert($vals);
                        }

-                       $this->db->transaction_begin();
-                       $id = $this->bocommon->next_id($table);
                        $this->db->query("INSERT INTO $table 
(id,name,descr,entry_date,category,start_date,end_date,termination_date,vendor_id,user_id
 $cols) "
-                               . "VALUES ($id,'" . $agreement['name'] ."','" . 
$agreement['descr'] ."','" . time() . "','" . $agreement['cat_id']
-                               . "','" . $agreement['start_date'] . "','" . 
$agreement['end_date'] . "','" . $agreement['termination_date']
-                               . "','" . $agreement['vendor_id']
-                               . "','" . $this->account . "' $vals)");
+                               . "VALUES ($vals)",__LINE__,__FILE__);

                        $receipt['agreement_id']= 
$id;//$this->db->get_last_insert_id($table,'id');

@@ -785,7 +829,7 @@

                        $sql = "UPDATE fm_activity_price_index SET "
                                . " index_count = 1,current_index = 
1,this_index = 1,"
-                               . " m_cost = $m_cost,w_cost = $w_cost 
,total_cost = $total_cost ,date = $start_date,"
+                               . " m_cost = $m_cost,w_cost = $w_cost 
,total_cost = $total_cost ,index_date = $start_date,"
                                . " entry_date = $entry_date ,user_id =" . 
$this->account . " WHERE agreement_id = $agreement_id AND activity_id = 
$activity_id AND index_count = -1";

                        $this->db->query($sql);
@@ -821,7 +865,7 @@
                        {
                                foreach($values_attribute as $entry)
                                {
-                                       if($entry['datatype']!='AB')
+                                       if($entry['datatype']!='AB' && 
$entry['datatype']!='VENDOR')
                                        {
                                                $value_set[$entry['name']]      
= $entry['value'];
                                        }
@@ -840,7 +884,7 @@
                        $this->db->query("UPDATE $table set entry_date='" . 
time() . "', category='"
                                                        . $values['cat_id'] . 
"', start_date=" . intval($values['start_date']) . ", end_date=" . 
intval($values['end_date']) . ", termination_date=" . 
intval($values['termination_date']) . "$value_set WHERE id=" . 
intval($values['agreement_id']));

-                       $this->db->query("UPDATE fm_activity_price_index set 
date=" . intval($values['start_date']) . " WHERE index_count=1 AND 
agreement_id= " . intval($values['agreement_id']));
+                       $this->db->query("UPDATE fm_activity_price_index set 
index_date=" . intval($values['start_date']) . " WHERE index_count=1 AND 
agreement_id= " . intval($values['agreement_id']));

                        $receipt['agreement_id']= $values['agreement_id'];
                        $receipt['message'][] = array('msg'=>lang('agreement %1 
has been edited',$values['agreement_id']));
@@ -883,7 +927,7 @@
                                {
                                        $this->db->query("UPDATE 
fm_activity_price_index set current_index = NULL WHERE agreement_id=" . 
intval($values['agreement_id']) . ' AND activity_id=' . intval($activity_id));

-                                       $this->db->query("INSERT INTO 
fm_activity_price_index 
(agreement_id,activity_id,index_count,current_index,this_index,m_cost,w_cost,total_cost,date,entry_date,user_id)"
+                                       $this->db->query("INSERT INTO 
fm_activity_price_index 
(agreement_id,activity_id,index_count,current_index,this_index,m_cost,w_cost,total_cost,index_date,entry_date,user_id)"
                                                . "VALUES (" . 
$values['agreement_id'] . "," . $activity_id ."," . 
($values['id'][$activity_id]+1) .",1,'" . $values['new_index'] . "','" . 
($values['m_cost'][$activity_id] * $values['new_index']) . "','" . 
($values['w_cost'][$activity_id] * $values['new_index']) . "','" . 
($values['total_cost'][$activity_id] * $values['new_index'])  . "'," . 
(int)$values['date'] . "," . time()
                                                . "," . $this->account . ")");

@@ -927,7 +971,7 @@
                        {
                                $sql = "UPDATE fm_activity_price_index SET "
                                        . " index_count = -1,current_index = 
1,this_index = 1,"
-                                       . " m_cost = NULL,w_cost = NULL 
,total_cost = NULL ,date = NULL,"
+                                       . " m_cost = NULL,w_cost = NULL 
,total_cost = NULL ,index_date = NULL,"
                                        . " entry_date = NULL ,user_id =" . 
$this->account . " WHERE agreement_id = $agreement_id AND activity_id = 
$activity_id";

                                $this->db->query($sql);
@@ -1004,7 +1048,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " $where 
($attribute_table.input_text LIKE '%$query%' or $attribute_table.column_name 
LIKE '%$query%')";
+                               $querymethod = " $where 
($attribute_table.input_text $this->like '%$query%' or 
$attribute_table.column_name $this->like '%$query%')";
                        }

                        $sql = "SELECT * FROM $attribute_table $filtermethod 
$querymethod";
@@ -1495,7 +1539,7 @@

                                foreach($values['select'] as $activity_id)
                                {
-                                       $this->db->query("INSERT INTO 
fm_activity_price_index ( agreement_id, 
activity_id,index_count,current_index,date,entry_date,user_id) "
+                                       $this->db->query("INSERT INTO 
fm_activity_price_index ( agreement_id, 
activity_id,index_count,current_index,index_date,entry_date,user_id) "
                                        . "VALUES 
($agreement_id,$activity_id,-1,1,$date," . time() . "," . $this->account . ")");
                                }


====================================================
Index: property/inc/class.sob_account.inc.php
diff -u property/inc/class.sob_account.inc.php:1.3 
property/inc/class.sob_account.inc.php:1.4
--- property/inc/class.sob_account.inc.php:1.3  Thu Aug 12 18:56:23 2004
+++ property/inc/class.sob_account.inc.php      Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class sob_account
        {
@@ -24,6 +34,8 @@
                        $this->db               = $GLOBALS['phpgw']->db;
                        $this->db2              = $this->db;
                        $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       $this->socommon         = 
CreateObject($this->currentapp.'.socommon');
+                       $this->like                     = $this->socommon->like;
                }

                function read($data)
@@ -61,7 +73,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " where id LIKE '%$query%' or 
descr LIKE '%$query%'";
+                               $querymethod = " where id $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }

                        $sql = "SELECT * FROM $table $querymethod";

====================================================
Index: property/inc/class.soadmin_location.inc.php
diff -u property/inc/class.soadmin_location.inc.php:1.2 
property/inc/class.soadmin_location.inc.php:1.3
--- property/inc/class.soadmin_location.inc.php:1.2     Wed Jun  2 18:54:28 2004
+++ property/inc/class.soadmin_location.inc.php Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class soadmin_location
        {
@@ -28,7 +38,7 @@
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');

                        $this->join                     = $this->bocommon->join;
-
+                       $this->like                     = $this->bocommon->like;
                }


@@ -71,7 +81,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " where name LIKE '%$query%' or 
descr LIKE '%$query%'";
+                               $querymethod = " where name $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }

                        $sql = "SELECT * FROM $table $querymethod";
@@ -93,18 +103,19 @@
                        return $standard;
                }

-               function read_config($data)
+               function read_config($data=0)
                {
+                       if ($data['start'])
+                       {
+                               $start=$data['start'];
+                       }
+                       else
+                       {
+                               $start=0;
+                       }
+
                        if(is_array($data))
                        {
-                               if ($data['start'])
-                               {
-                                       $start=$data['start'];
-                               }
-                               else
-                               {
-                                       $start=0;
-                               }
                                $query = 
(isset($data['query'])?$data['query']:'');
                                $sort = 
(isset($data['sort'])?$data['sort']:'DESC');
                                $order = 
(isset($data['order'])?$data['order']:'');
@@ -125,7 +136,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " where name LIKE '%$query%' or 
column_name LIKE '%$query%'";
+                               $querymethod = " where name $this->like 
'%$query%' or column_name $this->like '%$query%'";
                        }

                        $sql = "SELECT fm_location_config.* 
,fm_location_type.name as name FROM fm_location_config  $this->join 
fm_location_type on fm_location_config.location_type=fm_location_type.id 
$querymethod";
@@ -150,7 +161,6 @@
                                        'location_type'         => 
$this->db->f('location_type')
                                );
                        }
-//_debug_array($config);
                        return $config;
                }

@@ -400,7 +410,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " and ($table.name LIKE 
'%$query%' or $table.descr LIKE '%$query%')";
+                               $querymethod = " and ($table.name $this->like 
'%$query%' or $table.descr $this->like '%$query%')";
                        }

                        $sql = "SELECT 
$table.id,$table.type_id,$table.list,$table.attrib_sort,$table.location_form,lookup_form,$table.column_name,$table.size
 ,statustext,$table.input_text,"

====================================================
Index: property/inc/class.botts.inc.php
diff -u property/inc/class.botts.inc.php:1.3 
property/inc/class.botts.inc.php:1.4
--- property/inc/class.botts.inc.php:1.3        Sat Oct 23 18:33:14 2004
+++ property/inc/class.botts.inc.php    Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage helpdesk
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class botts
        {

====================================================
Index: property/inc/class.bowo_hour.inc.php
diff -u property/inc/class.bowo_hour.inc.php:1.2 
property/inc/class.bowo_hour.inc.php:1.3
--- property/inc/class.bowo_hour.inc.php:1.2    Wed Jun  2 18:54:28 2004
+++ property/inc/class.bowo_hour.inc.php        Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage project
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class bowo_hour
        {

====================================================
Index: property/inc/class.bostandard_entity.inc.php
diff -u property/inc/class.bostandard_entity.inc.php:1.2 
property/inc/class.bostandard_entity.inc.php:1.3
--- property/inc/class.bostandard_entity.inc.php:1.2    Wed Jun  2 18:54:28 2004
+++ property/inc/class.bostandard_entity.inc.php        Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class bostandard_entity
        {

====================================================
Index: property/inc/class.bostandard_3.inc.php
diff -u property/inc/class.bostandard_3.inc.php:1.2 
property/inc/class.bostandard_3.inc.php:1.3
--- property/inc/class.bostandard_3.inc.php:1.2 Wed Jun  2 18:54:28 2004
+++ property/inc/class.bostandard_3.inc.php     Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class bostandard_3
        {

====================================================
Index: property/inc/class.bos_agreement.inc.php
diff -u property/inc/class.bos_agreement.inc.php:1.7 
property/inc/class.bos_agreement.inc.php:1.8
--- property/inc/class.bos_agreement.inc.php:1.7        Wed Jun 30 13:24:55 2004
+++ property/inc/class.bos_agreement.inc.php    Thu Jan 13 16:52:48 2005
@@ -1,20 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage agreement
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class bos_agreement
        {
@@ -237,7 +246,7 @@

                        for ($i=0; $i<count($list); $i++)
                        {
-                               $list[$i]['date']  = 
$GLOBALS['phpgw']->common->show_date($list[$i]['date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+                               $list[$i]['index_date']  = 
$GLOBALS['phpgw']->common->show_date($list[$i]['index_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
                        }

                        return $list;
@@ -252,7 +261,7 @@

                        for ($i=0; $i<count($list); $i++)
                        {
-                               $list[$i]['date']  = 
$GLOBALS['phpgw']->common->show_date($list[$i]['date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+                               $list[$i]['index_date']  = 
$GLOBALS['phpgw']->common->show_date($list[$i]['index_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
                        }

                        return $list;
@@ -330,6 +339,10 @@
                                $this->so->role = 'detail';
                        }
                        $contacts                       = 
CreateObject('phpgwapi.contacts');
+
+                       $vendor = CreateObject($this->currentapp.'.soactor');
+                       $vendor->role = 'vendor';
+
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];

                        $input_type_array = array(
@@ -359,8 +372,8 @@
                                {
                                        if($list['attributes'][$i]['value'])
                                        {
-                                               $contact_data   = 
$contacts->read_single_entry($list['attributes'][$i]['value'],array('org_name'=>'org_name','email'=>'email'));
-                                               
$list['attributes'][$i]['org_name']     = $contact_data[0]['org_name'];
+                                               $contact_data   = 
$contacts->read_single_entry($list['attributes'][$i]['value'],array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
+                                               
$list['attributes'][$i]['contact_name'] = $contact_data[0]['n_family'] . ', ' . 
$contact_data[0]['n_given'];
                                        }

                                        $insert_record_list[]   = 
$list['attributes'][$i]['name'];
@@ -370,6 +383,29 @@
                                        $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
                                        $m++;
                                }
+                               
if($list['attributes'][$i]['datatype']=='VENDOR')
+                               {
+                                       if($list['attributes'][$i]['value'])
+                                       {
+                                               $vendor_data    = 
$vendor->read_single(array('actor_id'=>$list['attributes'][$i]['value']));
+
+                                               for 
($n=0;$n<count($vendor_data['attributes']);$n++)
+                                               {
+                                                       
if($vendor_data['attributes'][$n]['name'] == 'org_name')
+                                                       {
+                                                               
$list['attributes'][$i]['vendor_name']= $vendor_data['attributes'][$n]['value'];
+                                                               $n 
=count($vendor_data['attributes']);
+                                                       }
+                                               }
+                                       }
+
+                                       $insert_record_list[]   = 
$list['attributes'][$i]['name'];
+                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.vendor&column='
 . $list['attributes'][$i]['name']);
+
+                                       $lookup_functions[$m]['name'] = 
'lookup_'. $list['attributes'][$i]['name'] .'()';
+                                       $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
+                                       $m++;
+                               }
                                if($list['attributes'][$i]['datatype']=='R' || 
$list['attributes'][$i]['datatype']=='CH' || 
$list['attributes'][$i]['datatype']=='LB')
                                {
                                        $list['attributes'][$i]['choice']       
= $this->so->read_attrib_choice($list['attributes'][$i]['attrib_id']);

====================================================
Index: property/inc/class.bostandard_2.inc.php
diff -u property/inc/class.bostandard_2.inc.php:1.2 
property/inc/class.bostandard_2.inc.php:1.3
--- property/inc/class.bostandard_2.inc.php:1.2 Wed Jun  2 18:54:28 2004
+++ property/inc/class.bostandard_2.inc.php     Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class bostandard_2
        {

====================================================
Index: property/inc/class.boworkorder.inc.php
diff -u property/inc/class.boworkorder.inc.php:1.2 
property/inc/class.boworkorder.inc.php:1.3
--- property/inc/class.boworkorder.inc.php:1.2  Wed Jun  2 18:54:28 2004
+++ property/inc/class.boworkorder.inc.php      Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage project
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class boworkorder
        {

====================================================
Index: property/inc/class.botemplate.inc.php
diff -u property/inc/class.botemplate.inc.php:1.2 
property/inc/class.botemplate.inc.php:1.3
--- property/inc/class.botemplate.inc.php:1.2   Wed Jun  2 18:54:28 2004
+++ property/inc/class.botemplate.inc.php       Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage project
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class botemplate
        {

====================================================
Index: property/inc/class.soactor.inc.php
diff -u property/inc/class.soactor.inc.php:1.4 
property/inc/class.soactor.inc.php:1.5
--- property/inc/class.soactor.inc.php:1.4      Fri Aug 20 15:15:21 2004
+++ property/inc/class.soactor.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class soactor
        {
@@ -29,6 +39,7 @@

                        $this->join                     = $this->bocommon->join;
                        $this->left_join        = $this->bocommon->left_join;
+                       $this->like                     = $this->bocommon->like;
                }

                function select_category_list()
@@ -201,7 +212,7 @@

                        if ($member_id>0)
                        {
-                               $filtermethod .= " $where 
$entity_table.member_of LIKE '%,$member_id,%' ";
+                               $filtermethod .= " $where 
$entity_table.member_of $this->like '%,$member_id,%' ";
                                $where= 'AND';
                        }

@@ -217,11 +228,21 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

+                               $filtermethod .= " $where $entity_table.id ='" 
. (int)$query . "'";
+                               $where= 'OR';
+
                                $this->db->query("SELECT * FROM 
$attribute_table where search='1'");

                                while ($this->db->next_record())
                                {
-                                       $querymethod[]= "$entity_table." . 
$this->db->f('column_name') . " LIKE '%$query%'";
+                                       if($this->db->f('datatype')=='V' || 
$this->db->f('datatype')=='email' || $this->db->f('datatype')=='CH')
+                                       {
+                                               $querymethod[]= 
"$entity_table." . $this->db->f('column_name') . " $this->like '%$query%'";
+                                       }
+                                       else
+                                       {
+                                               $querymethod[]= 
"$entity_table." . $this->db->f('column_name') . " = '$query'";
+                                       }
                                }

                                if (isset($querymethod) AND 
is_array($querymethod))
@@ -248,6 +269,8 @@
                        $j=0;
                        $n=count($cols_return);
 //_debug_array($cols_return);
+                       $contacts                       = 
CreateObject('phpgwapi.contacts');
+
                        while ($this->db->next_record())
                        {
                                for ($i=0;$i<$n;$i++)
@@ -270,7 +293,18 @@
                                        }
                                        
elseif($cols_return_extra[$i]['datatype']=='AB' && $value):
                                        {
-                                               $sql="SELECT org_name FROM 
phpgw_addressbook where id=$value";
+                                               $contact_data   = 
$contacts->read_single_entry($value,array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
+                                               
$actor_list[$j][$cols_return_extra[$i]['name']] = $contact_data[0]['n_family'] 
. ', ' . $contact_data[0]['n_given'];
+
+/*                                             $sql="SELECT org_name FROM 
phpgw_addressbook where id=$value";
+                                               $this->db2->query($sql);
+                                               $this->db2->next_record();
+                                               
$actor_list[$j][$cols_return_extra[$i]['name']] = $this->db2->f('org_name');
+*/
+                                       }
+                                       
elseif($cols_return_extra[$i]['datatype']=='VENDOR' && $value):
+                                       {
+                                               $sql="SELECT org_name FROM 
fm_vendor where id=$value";
                                                $this->db2->query($sql);
                                                $this->db2->next_record();
                                                
$actor_list[$j][$cols_return_extra[$i]['name']] = $this->db2->f('org_name');
@@ -394,7 +428,14 @@
                        }

                        $this->db->transaction_begin();
-                       $id = $this->bocommon->next_id($table);
+                       if($actor['new_actor_id'])
+                       {
+                               $id = $actor['new_actor_id'];
+                       }
+                       else
+                       {
+                               $id = $this->bocommon->next_id($table);
+                       }

                        $this->db->query("INSERT INTO $table 
(id,entry_date,category,member_of $cols) "
                                . "VALUES ($id,'" . time() . "','" . 
$actor['cat_id'] . "','" . $actor['member_of'] . "' $vals)");
@@ -427,7 +468,7 @@
                        {
                                foreach($values_attribute as $entry)
                                {
-                                       if($entry['datatype']!='AB')
+                                       if($entry['datatype']!='AB' && 
$entry['datatype']!='VENDOR')
                                        {
                                                $value_set[$entry['name']]      
= $entry['value'];
                                        }
@@ -496,7 +537,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " $where 
($attribute_table.input_text LIKE '%$query%' or $attribute_table.column_name 
LIKE '%$query%')";
+                               $querymethod = " $where 
($attribute_table.input_text $this->like '%$query%' or 
$attribute_table.column_name $this->like '%$query%')";
                        }

                        $sql = "SELECT * FROM $attribute_table $filtermethod 
$querymethod";

====================================================
Index: property/inc/class.soadmin.inc.php
diff -u property/inc/class.soadmin.inc.php:1.2 
property/inc/class.soadmin.inc.php:1.3
--- property/inc/class.soadmin.inc.php:1.2      Wed Jun  2 18:54:28 2004
+++ property/inc/class.soadmin.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class soadmin
        {
@@ -27,6 +37,7 @@
                        $this->socommon         = 
CreateObject($this->currentapp.'.socommon');

                        $this->join                     = $this->socommon->join;
+                       $this->like                     = $this->socommon->like;
                }



====================================================
Index: property/inc/class.excel.inc.php
diff -u property/inc/class.excel.inc.php:1.3 
property/inc/class.excel.inc.php:1.4
--- property/inc/class.excel.inc.php:1.3        Tue Sep 28 08:17:44 2004
+++ property/inc/class.excel.inc.php    Thu Jan 13 16:52:48 2005
@@ -1,21 +1,25 @@
 <?php
-// +----------------------------------------------------------------------+
-// | PHP Class for generating Excel binary data. (PHP 4 >= 4.0b1)          |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 2001 by KVN                              |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.0 of the PHP license,       |
-// | that is bundled with this package in the file LICENSE, and is        |
-// | available at through the world-wide-web at                           |
-// | http://www.php.net/license/2_02.txt.                                 |
-// | If you did not receive a copy of the PHP license and are unable to   |
-// | obtain it through the world-wide-web, please send a note to          |
-// | address@hidden so we can mail you a copy immediately.               |
-// +----------------------------------------------------------------------+
-// | Author: Vitaliy N. Kravchenko <address@hidden>           |
-// +----------------------------------------------------------------------+
-//
-// $Id$ Thu Jul 11 EEST 2002 version 2.5
+       /**
+       * PHP Class for generating Excel binary data. (PHP 4 >= 4.0b1)
+       *
+       * Copyright (c) 2001 by KVN
+       *
+       * This source file is subject to version 2.0 of the PHP license,
+       * that is bundled with this package in the file LICENSE, and is
+       * available at through the world-wide-web at
+       * http://www.php.net/license/2_02.txt.
+       * If you did not receive a copy of the PHP license and are unable to
+       * obtain it through the world-wide-web, please send a note to
+       * address@hidden http://address@hidden so we can mail you a copy 
immediately.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Vitaliy N. Kravchenko}
+       * @author Vitaliy N. Kravchenko
+       * @package Excel
+       * @version Thu Jul 11 EEST 2002 version 2.5
+       * $Id$
+       */
+
+

 /*
 Usage Example:

====================================================
Index: property/inc/class.soXport.inc.php
diff -u property/inc/class.soXport.inc.php:1.10 
property/inc/class.soXport.inc.php:1.11
--- property/inc/class.soXport.inc.php:1.10     Wed Sep 15 19:51:09 2004
+++ property/inc/class.soXport.inc.php  Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class soXport
        {
@@ -31,6 +41,7 @@

                        $this->join                             = 
$this->bocommon->join;
                        $this->datetimeformat   = 
$this->bocommon->datetimeformat;
+                       $this->like                             = 
$this->bocommon->like;
                        $this->account_id               = 
$GLOBALS['phpgw_info']['user']['account_id'];
                }


====================================================
Index: property/inc/class.soadmin_entity.inc.php
diff -u property/inc/class.soadmin_entity.inc.php:1.2 
property/inc/class.soadmin_entity.inc.php:1.3
--- property/inc/class.soadmin_entity.inc.php:1.2       Wed Jun  2 18:54:28 2004
+++ property/inc/class.soadmin_entity.inc.php   Thu Jan 13 16:52:48 2005
@@ -1,19 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class soadmin_entity
        {
@@ -28,6 +38,7 @@
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');

                        $this->join                     = $this->bocommon->join;
+                       $this->like                     = $this->bocommon->like;

                        if($entity_id && $cat_id)
                        {
@@ -75,7 +86,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " where name LIKE '%$query%' or 
descr LIKE '%$query%'";
+                               $querymethod = " where name $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }

                        $sql = "SELECT * FROM $table $querymethod";
@@ -141,7 +152,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " AND name LIKE '%$query%' or 
descr LIKE '%$query%'";
+                               $querymethod = " AND name $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }

                        $sql = "SELECT * FROM $table WHERE entity_id=$entity_id 
$querymethod";
@@ -208,7 +219,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " AND name LIKE '%$query%' or 
descr LIKE '%$query%'";
+                               $querymethod = " AND name $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }

                        $sql = "SELECT * FROM $table $querymethod";
@@ -292,6 +303,7 @@
                                $category['location_level']     = 
$this->db->f('location_level');
                                $category['fileupload'] = 
$this->db->f('fileupload');
                                $category['loc_link']   = 
$this->db->f('loc_link');
+                               $category['start_project']      = 
$this->db->f('start_project');
                                return $category;
                        }
                }
@@ -402,7 +414,8 @@
                                $values['tracking'],
                                $values['location_level'],
                                $values['fileupload'],
-                               $values['loc_link']
+                               $values['loc_link'],
+                               $values['start_project']
                                );

                        $values_insert  = 
$this->bocommon->validate_db_insert($values_insert);
@@ -410,7 +423,7 @@

                        $this->db->transaction_begin();

-                       $this->db->query("INSERT INTO fm_entity_category 
(entity_id,id,name, 
descr,prefix,lookup_tenant,tracking,location_level,fileupload,loc_link) "
+                       $this->db->query("INSERT INTO fm_entity_category 
(entity_id,id,name, 
descr,prefix,lookup_tenant,tracking,location_level,fileupload,loc_link,start_project)
 "
                                . "VALUES ($values_insert)",__LINE__,__FILE__);

                        $values_acl_location= array(
@@ -441,7 +454,7 @@
                                $fd['loc' . $i] = array('type' => 'varchar', 
'precision' => 4, 'nullable' => True);
                        }

-                       $fd['address'] = array('type' => 'varchar', 'precision' 
=> 100, 'nullable' => True);
+                       $fd['address'] = array('type' => 'varchar', 'precision' 
=> 150, 'nullable' => True);
                        $fd['tenant_id'] = array('type' => 'int', 'precision' 
=> 4, 'nullable' => True);
                        $fd['contact_phone'] = array('type' => 'varchar', 
'precision' => 30, 'nullable' => True);
                        $fd['status'] = array('type' => 'int', 'precision' => 
4, 'nullable' => True);
@@ -615,7 +628,8 @@
                                        'tracking'              => 
$entity['tracking'],
                                        'location_level'=> 
$entity['location_level'],
                                        'fileupload'    => 
$entity['fileupload'],
-                                       'loc_link'      => $entity['loc_link']
+                                       'loc_link'              => 
$entity['loc_link'],
+                                       'start_project' => 
$entity['start_project']
                                        );

                                $value_set      = 
$this->bocommon->validate_db_update($value_set);
@@ -647,8 +661,8 @@
                        $this->db->query("DELETE FROM fm_entity WHERE 
id=$id",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM fm_entity_category WHERE 
entity_id=$id",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM fm_entity_attribute WHERE 
entity_id=$id",__LINE__,__FILE__);
-                       $this->db->query("DELETE FROM fm_acl_location WHERE id 
LIKE '.entity." . $id ."%'",__LINE__,__FILE__);
-                       $this->db->query("DELETE FROM fm_acl2 WHERE 
acl_location LIKE '.entity." . $id ."%'",__LINE__,__FILE__);
+                       $this->db->query("DELETE FROM fm_acl_location WHERE id 
$this->like '.entity." . $id ."%'",__LINE__,__FILE__);
+                       $this->db->query("DELETE FROM fm_acl2 WHERE 
acl_location $this->like '.entity." . $id ."%'",__LINE__,__FILE__);
                        if (isset($category_list) AND is_array($category_list))
                        {
                                $this->init_process();
@@ -745,7 +759,7 @@
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);

-                               $querymethod = " AND (fm_entity_attribute.name 
LIKE '%$query%' or fm_entity_attribute.descr LIKE '%$query%')";
+                               $querymethod = " AND (fm_entity_attribute.name 
$this->like '%$query%' or fm_entity_attribute.descr $this->like '%$query%')";
                        }

                        $sql = "SELECT * FROM fm_entity_attribute WHERE 
entity_id=$entity_id AND cat_id = $cat_id $filtermethod $querymethod";

====================================================
Index: property/inc/class.historylog.inc.php
diff -u property/inc/class.historylog.inc.php:1.2 
property/inc/class.historylog.inc.php:1.3
--- property/inc/class.historylog.inc.php:1.2   Wed Jun  2 18:54:28 2004
+++ property/inc/class.historylog.inc.php       Thu Jan 13 16:52:48 2005
@@ -1,26 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare API - Record history logging                             
   *
-       * This file written by Joseph Engo <address@hidden>                *
-       * Copyright (C) 2001 Joseph Engo                                        
   *
-       * 
-------------------------------------------------------------------------*
-       * This library is part of the phpGroupWare API                          
   *
-       * http://www.phpgroupware.org/api                                       
   *
-       * 
------------------------------------------------------------------------ *
-       * This library is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU Lesser General Public License as published 
by *
-       * the Free Software Foundation; either version 2.1 of the License,      
   *
-       * or any later version.                                                 
   *
-       * This library is distributed in the hope that it will be useful, but   
   *
-       * WITHOUT ANY WARRANTY; without even the implied warranty of            
   *
-       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                  
   *
-       * See the GNU Lesser General Public License for more details.           
   *
-       * You should have received a copy of the GNU Lesser General Public 
License *
-       * along with this library; if not, write to the Free Software 
Foundation,  *
-       * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA         
   *
-       
\**************************************************************************/
-
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage core
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class historylog
        {
@@ -80,7 +83,7 @@
                                . 
"history_appname,history_owner,history_status,history_new_value,history_timestamp)
 "
                                . "values ('$record_id','" . $this->appname . 
"','"
                                . $GLOBALS['phpgw_info']['user']['account_id'] 
. "','$status','"
-                               . addslashes($new_value) . "','" . 
$this->db->to_timestamp(time())
+                               . $this->db->db_addslashes($new_value) . "','" 
. $this->db->to_timestamp(time())
                                . "')",__LINE__,__FILE__);
                }


====================================================
Index: property/inc/class.menu.inc.php
diff -u property/inc/class.menu.inc.php:1.6 property/inc/class.menu.inc.php:1.7
--- property/inc/class.menu.inc.php:1.6 Sat Aug 21 14:30:48 2004
+++ property/inc/class.menu.inc.php     Thu Jan 13 16:52:48 2005
@@ -1,20 +1,29 @@
 <?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-       /* $Id$ */
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package property
+       * @subpackage core
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */

        class menu
        {
@@ -208,6 +217,24 @@
                                        $menu['sub_menu'][$i]['name']           
        =       lang('consume');
                                        $menu['sub_menu'][$i]['statustext']     
        =       lang('consume');

+                                       $i++;
+                                       if($page=='b_account')
+                                       {
+                                               
$menu['sub_menu'][$i]['this']=True;
+                                       }
+                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uib_account.index');
+                                       $menu['sub_menu'][$i]['name']           
        =       lang('b_account');
+                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('b_account');
+
+                                       $i++;
+                                       if($page=='vendor')
+                                       {
+                                               
$menu['sub_menu'][$i]['this']=True;
+                                       }
+                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiactor.index&role=vendor');
+                                       $menu['sub_menu'][$i]['name']           
        =       lang('Vendor');
+                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Vendor');
+
                                        if ($this->acl2->check('.invoice',16))
                                        {
                                                $i++;

====================================================
Index: property/inc/class.pdf.inc.php
diff -u property/inc/class.pdf.inc.php:1.2 property/inc/class.pdf.inc.php:1.3
--- property/inc/class.pdf.inc.php:1.2  Wed Jun  2 18:54:28 2004
+++ property/inc/class.pdf.inc.php      Thu Jan 13 16:52:48 2005
@@ -1,4 +1,23 @@
 <?php
+       /**
+       * phpGroupWare - property
+       * address@hidden http://www.phpgroupware.org}
+       *
+       * Property: a Facilities Management System.
+       *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc
+       * This program is part of the GNU project, see address@hidden 
http://www.gnu.org/}
+       *
+       * This program is free software; you can redistribute it and/or modify 
it
+       * under the terms of the GNU General Public License as published by the
+       * Free Software Foundation; either version 2 of the License, or (at your
+       * option) any later version.
+       *
+       * To contact the author write to address@hidden mailto:address@hidden 
Sigurd Nes}
+       * @author Sigurd Nes
+       * @package Cpdf
+       * @version $Id$
+       */

        include (PHPGW_APP_INC . '/pdf/class.pdf.php');
        include (PHPGW_APP_INC . '/pdf/class.ezpdf.php');






reply via email to

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