phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property templates/base/cat_filter.xsl template...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property templates/base/cat_filter.xsl template...
Date: Mon, 17 Apr 2006 11:36:06 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Branch:         
Changes by:     Sigurd Nes <address@hidden>     06/04/17 11:36:05

Modified files:
        templates/base : cat_filter.xsl cat_select.xsl document.xsl 
                         invoice.xsl 
        inc            : class.boactor.inc.php class.boadmin.inc.php 
                         class.boadmin_location.inc.php 
                         class.boagreement.inc.php 
                         class.bocommon.inc.php class.bodocument.inc.php 
                         class.boentity.inc.php 
                         class.boinvestment.inc.php 
                         class.boinvoice.inc.php 
                         class.bolocation.inc.php class.bometer.inc.php 
                         class.bopricebook.inc.php 
                         class.boproject.inc.php 
                         class.bor_agreement.inc.php 
                         class.borequest.inc.php 
                         class.bos_agreement.inc.php 
                         class.bostandard_entity.inc.php 
                         class.botemplate.inc.php 
                         class.botenant_claim.inc.php 
                         class.botts.inc.php class.bowo_hour.inc.php 
                         class.boworkorder.inc.php class.soactor.inc.php 
                         class.soagreement.inc.php 
                         class.socategory.inc.php class.socommon.inc.php 
                         class.sodocument.inc.php 
                         class.soinvestment.inc.php 
                         class.soinvoice.inc.php 
                         class.solocation.inc.php 
                         class.soproject.inc.php 
                         class.sor_agreement.inc.php 
                         class.sorequest.inc.php 
                         class.sos_agreement.inc.php 
                         class.sotemplate.inc.php 
                         class.sotenant_claim.inc.php 
                         class.sotts.inc.php class.soworkorder.inc.php 
                         class.uiactor.inc.php class.uiadmin.inc.php 
                         class.uiagreement.inc.php 
                         class.uidocument.inc.php class.uientity.inc.php 
                         class.uiinvestment.inc.php 
                         class.uiinvoice.inc.php 
                         class.uilocation.inc.php 
                         class.uipricebook.inc.php 
                         class.uiproject.inc.php 
                         class.uir_agreement.inc.php 
                         class.uirequest.inc.php 
                         class.uis_agreement.inc.php 
                         class.uitemplate.inc.php 
                         class.uitenant_claim.inc.php 
                         class.uitts.inc.php class.uiwo_hour.inc.php 
                         class.uiworkorder.inc.php hook_admin.inc.php 
                         hook_settings.inc.php 
        inc/custom     : lag_lang_filer.php 
        setup          : tables_current.inc.php tables_update.inc.php 

Log message:
        no message

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/base/cat_filter.xsl.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/base/cat_select.xsl.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/base/document.xsl.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/base/invoice.xsl.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.boactor.inc.php.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.boadmin.inc.php.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.boadmin_location.inc.php.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.boagreement.inc.php.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.bocommon.inc.php.diff?tr1=1.29&tr2=1.30&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.bodocument.inc.php.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.boentity.inc.php.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.boinvestment.inc.php.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.boinvoice.inc.php.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.bolocation.inc.php.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.bometer.inc.php.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.bopricebook.inc.php.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.boproject.inc.php.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.bor_agreement.inc.php.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.borequest.inc.php.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.bos_agreement.inc.php.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.bostandard_entity.inc.php.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.botemplate.inc.php.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.botenant_claim.inc.php.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.botts.inc.php.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.bowo_hour.inc.php.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.boworkorder.inc.php.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.soactor.inc.php.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.soagreement.inc.php.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.socategory.inc.php.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.socommon.inc.php.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sodocument.inc.php.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.soinvestment.inc.php.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.soinvoice.inc.php.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.solocation.inc.php.diff?tr1=1.28&tr2=1.29&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.soproject.inc.php.diff?tr1=1.27&tr2=1.28&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sor_agreement.inc.php.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sorequest.inc.php.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sos_agreement.inc.php.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sotemplate.inc.php.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sotenant_claim.inc.php.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sotts.inc.php.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.soworkorder.inc.php.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uiactor.inc.php.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uiadmin.inc.php.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uiagreement.inc.php.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uidocument.inc.php.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uientity.inc.php.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uiinvestment.inc.php.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uiinvoice.inc.php.diff?tr1=1.23&tr2=1.24&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uilocation.inc.php.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uipricebook.inc.php.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uiproject.inc.php.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uir_agreement.inc.php.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uirequest.inc.php.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uis_agreement.inc.php.diff?tr1=1.27&tr2=1.28&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uitemplate.inc.php.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uitenant_claim.inc.php.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uitts.inc.php.diff?tr1=1.32&tr2=1.33&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uiwo_hour.inc.php.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uiworkorder.inc.php.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/hook_admin.inc.php.diff?tr1=1.23&tr2=1.24&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/hook_settings.inc.php.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/custom/lag_lang_filer.php.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/setup/tables_current.inc.php.diff?tr1=1.56&tr2=1.57&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/setup/tables_update.inc.php.diff?tr1=1.41&tr2=1.42&r1=text&r2=text

Patches:
Index: property/inc/class.boactor.inc.php
diff -u property/inc/class.boactor.inc.php:1.9 
property/inc/class.boactor.inc.php:1.10
--- property/inc/class.boactor.inc.php:1.9      Thu Mar  2 11:30:27 2006
+++ property/inc/class.boactor.inc.php  Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.boactor.inc.php,v 1.9 2006/03/02 11:30:27 
sigurdne Exp $
+       * @version $Id: class.boactor.inc.php,v 1.10 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -135,47 +135,6 @@
                }
 
 
-               function select_category_list($format='',$selected='')
-               {
-                       switch($format)
-                       {
-                               case 'select':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
-                                       break;
-                               case 'filter':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
-                                       break;
-                       }
-
-                       $categories= $this->so->select_category_list();
-
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['name'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
-                       return $category_list;
-               }
-
                function read()
                {
                        $actor = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
Index: property/inc/class.boadmin.inc.php
diff -u property/inc/class.boadmin.inc.php:1.9 
property/inc/class.boadmin.inc.php:1.10
--- property/inc/class.boadmin.inc.php:1.9      Wed Mar 22 11:17:08 2006
+++ property/inc/class.boadmin.inc.php  Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.boadmin.inc.php,v 1.9 2006/03/22 11:17:08 
sigurdne Exp $
+       * @version $Id: class.boadmin.inc.php,v 1.10 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -182,37 +182,12 @@
                                        break;
                        }
 
-
                        $categories[0]['id']    = 'groups';
                        $categories[0]['name']  = lang('Groups');
                        $categories[1]['id']    = 'accounts';
                        $categories[1]['name']  = lang('Users');
-
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['name'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
-                       return $category_list;
+                       
+                       return $$this->select_list($selected,$categories);
                }
 
                function set_permission2($values,$r_processed,$type)
Index: property/inc/class.boadmin_location.inc.php
diff -u property/inc/class.boadmin_location.inc.php:1.9 
property/inc/class.boadmin_location.inc.php:1.10
--- property/inc/class.boadmin_location.inc.php:1.9     Fri Feb  3 12:05:49 2006
+++ property/inc/class.boadmin_location.inc.php Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.boadmin_location.inc.php,v 1.9 2006/02/03 
12:05:49 sigurdne Exp $
+       * @version $Id: class.boadmin_location.inc.php,v 1.10 2006/04/17 
11:36:05 sigurdne Exp $
        */
 
        /**
@@ -239,33 +239,7 @@
                function select_location_type($selected='')
                {
                        $location_types= $this->so->select_location_type();
-
-                       while (is_array($location_types) && list(,$type) = 
each($location_types))
-                       {
-                               $sel_type = '';
-                               if ($type['id']==$selected)
-                               {
-                                       $sel_type = 'selected';
-                               }
-
-                               $location_type_list[] = array
-                               (
-                                       'id'    => $type['id'],
-                                       'name'          => $type['name'],
-                                       'selected'      => $sel_type
-                               );
-                       }
-
-                       for ($i=0;$i<count($location_type_list);$i++)
-                       {
-                               if ($location_type_list[$i]['selected'] != 
'selected')
-                               {
-                                       
unset($location_type_list[$i]['selected']);
-                               }
-                       }
-
-//_debug_array($location_type_list);
-                       return $location_type_list;
+                       return 
$this->bocommon->select_list($selected,$location_types);
                }
 
                function select_nullable($selected='')
@@ -275,30 +249,7 @@
                        $nullable[1]['id']= 'False';
                        $nullable[1]['name']= lang('False');
 
-                       while (is_array($nullable) && list(,$type) = 
each($nullable))
-                       {
-                               $sel_type = '';
-                               if ($type['id']==$selected)
-                               {
-                                       $sel_type = 'selected';
-                               }
-
-                               $nullable_list[] = array
-                               (
-                                       'id'    => $type['id'],
-                                       'name'          => $type['name'],
-                                       'selected'      => $sel_type
-                               );
-                       }
-
-                       for ($i=0;$i<count($nullable_list);$i++)
-                       {
-                               if ($nullable_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($nullable_list[$i]['selected']);
-                               }
-                       }
-                       return $nullable_list;
+                       return 
$this->bocommon->select_list($selected,$nullable);
                }
        }
 ?>
Index: property/inc/class.boagreement.inc.php
diff -u property/inc/class.boagreement.inc.php:1.8 
property/inc/class.boagreement.inc.php:1.9
--- property/inc/class.boagreement.inc.php:1.8  Fri Feb  3 12:05:49 2006
+++ property/inc/class.boagreement.inc.php      Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.boagreement.inc.php,v 1.8 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.boagreement.inc.php,v 1.9 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -143,48 +143,6 @@
                        return (!!($has & $needed) == True);
                }
 
-
-               function select_category_list($format='',$selected='')
-               {
-                       switch($format)
-                       {
-                               case 'select':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
-                                       break;
-                               case 'filter':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
-                                       break;
-                       }
-
-                       $categories= $this->so->select_category_list();
-
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['name'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
-                       return $category_list;
-               }
-
                function select_vendor_list($format='',$selected='')
                {
                        switch($format)
@@ -678,32 +636,7 @@
                function get_agreement_group_list($selected='')
                {
                        $agreement_groups= 
$this->so->get_agreement_group_list();
-
-                       while (is_array($agreement_groups) && 
list(,$agreement_group_entry) = each($agreement_groups))
-                       {
-                               $sel_agreement_group_entry = '';
-                               if ($agreement_group_entry['id']==$selected)
-                               {
-                                       $sel_agreement_group_entry = 'selected';
-                               }
-
-                               $agreement_group_list[] = array
-                               (
-                                       'id'    => $agreement_group_entry['id'],
-                                       'name'          => 
$agreement_group_entry['name'],
-                                       'selected'      => 
$sel_agreement_group_entry
-                               );
-                       }
-
-                       for ($i=0;$i<count($agreement_group_list);$i++)
-                       {
-                               if ($agreement_group_list[$i]['selected'] != 
'selected')
-                               {
-                                       
unset($agreement_group_list[$i]['selected']);
-                               }
-                       }
-
-                       return $agreement_group_list;
+                       return 
$this->bocommon->select_list($selected,$agreement_groups);
                }
 
                function read_group_activity($group_id='',$agreement_id='')
@@ -732,31 +665,7 @@
 
                        $status_entries= $this->so->select_status_list();
 
-                       while (is_array($status_entries) && list(,$status) = 
each($status_entries))
-                       {
-                               $sel_status = '';
-                               if ($status['id']==$selected)
-                               {
-                                       $sel_status = 'selected';
-                               }
-
-                               $status_list[] = array
-                               (
-                                       'id'            => $status['id'],
-                                       'name'          => $status['name'],
-                                       'selected'      => $sel_status
-                               );
-                       }
-
-                       for ($i=0;$i<count($status_list);$i++)
-                       {
-                               if ($status_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($status_list[$i]['selected']);
-                               }
-                       }
-
-                       return $status_list;
+                       return 
$this->bocommon->select_list($selected,$status_entries);
                }
                
                function get_activity_descr($id)
Index: property/inc/class.bocommon.inc.php
diff -u property/inc/class.bocommon.inc.php:1.29 
property/inc/class.bocommon.inc.php:1.30
--- property/inc/class.bocommon.inc.php:1.29    Wed Apr 12 10:24:43 2006
+++ property/inc/class.bocommon.inc.php Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage core
-       * @version $Id: class.bocommon.inc.php,v 1.29 2006/04/12 10:24:43 
sigurdne Exp $
+       * @version $Id: class.bocommon.inc.php,v 1.30 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -211,18 +211,27 @@
 
                function date_array($date)
                {
-                       $dateformat = 
strtolower($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
-                       $dateformat = str_replace(".","",$dateformat);
-                       $dateformat = str_replace("-","",$dateformat);
-                       $dateformat = str_replace("/","",$dateformat);
-                       $y=strpos($dateformat,'y');
-                       $d=strpos($dateformat,'d');
-                       $m=strpos($dateformat,'m');
-
-                       $dateparts = explode('/', $date);
-                       $date_array['day']              = $dateparts[$d];
-                       $date_array['month']    = $dateparts[$m];
-                       $date_array['year']             = $dateparts[$y];
+                       if(!$date)
+                       {
+                               $date_array['day']      = date("d");
+                               $date_array['month']    = date("m");
+                               $date_array['year']     = date("Y");
+                       }
+                       else
+                       {
+                               $dateformat = 
strtolower($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+                               $dateformat = str_replace(".","",$dateformat);
+                               $dateformat = str_replace("-","",$dateformat);
+                               $dateformat = str_replace("/","",$dateformat);
+                               $y=strpos($dateformat,'y');
+                               $d=strpos($dateformat,'d');
+                               $m=strpos($dateformat,'m');
+
+                               $dateparts = explode('/', $date);
+                               $date_array['day']      = $dateparts[$d];
+                               $date_array['month']    = $dateparts[$m];
+                               $date_array['year']     = $dateparts[$y];
+                       }
 
                        return $date_array;
                }
@@ -288,8 +297,6 @@
                        return $output_list;
                }
 
-
-
                function select_list($selected='',$input_list='')
                {
                        if (isset($input_list) AND is_array($input_list))
@@ -1177,47 +1184,6 @@
                        return $part_of_town_list;
                }
 
-               function select_category_property_list($format='',$selected='')
-               {
-                       switch($format)
-                       {
-                               case 'select':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
-                                       break;
-                               case 'filter':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
-                                       break;
-                       }
-
-                       $categories= 
$this->socommon->select_category_property_list();
-
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['name'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
-                       return $category_list;
-               }
-
                function select_district_list($format='',$selected='')
                {
                        switch($format)
@@ -1232,31 +1198,7 @@
 
                        $districts= $this->socommon->select_district_list();
 
-                       while (is_array($districts) && list(,$district) = 
each($districts))
-                       {
-                               $sel_district = '';
-                               if ($district['id']==$selected)
-                               {
-                                       $sel_district = 'selected';
-                               }
-
-                               $district_list[] = array
-                               (
-                                       'id'    => $district['id'],
-                                       'name'          => $district['name'],
-                                       'selected'      => $sel_district
-                               );
-                       }
-
-                       for ($i=0;$i<count($district_list);$i++)
-                       {
-                               if ($district_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($district_list[$i]['selected']);
-                               }
-                       }
-
-                       return $district_list;
+                       return $this->select_list($selected,$districts);
                }
 
 
@@ -1277,36 +1219,12 @@
                                $socategory = 
CreateObject($this->currentapp.'.socategory');
                        }
                        
-                       $categories= 
$socategory->select_category_list(array('type'     =>$data['type'],
+                       $categories= 
$socategory->select_category_list(array('type'=>$data['type'],
                                                                                
'type_id'=>$data['type_id'],
                                                                                
'order' =>$data['order']));
 
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$data['selected'])
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['name'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
+                       return 
$this->select_list($data['selected'],$categories);
 
-                       return $category_list;
                }
 
 
@@ -1479,17 +1397,6 @@
                        return $link;
                }
 
-               function select_wo_hours_category_list($selected='')
-               {
-                       $category_list= 
$this->socommon->select_wo_hours_category_list();
-                       if($selected)
-                       {
-                               $category_list = 
$this->select_list($selected,$category_list);
-                       }
-
-                       return $category_list;
-               }
-
                function new_db()
                {
                        return $this->socommon->new_db();
Index: property/inc/class.bodocument.inc.php
diff -u property/inc/class.bodocument.inc.php:1.7 
property/inc/class.bodocument.inc.php:1.8
--- property/inc/class.bodocument.inc.php:1.7   Fri Feb  3 12:05:49 2006
+++ property/inc/class.bodocument.inc.php       Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage document
-       * @version $Id: class.bodocument.inc.php,v 1.7 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.bodocument.inc.php,v 1.8 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -27,10 +27,10 @@
 
                var $public_functions = array
                (
-                       'read'                          => True,
+                       'read'                  => True,
                        'read_single'           => True,
-                       'save'                          => True,
-                       'delete'                        => True,
+                       'save'                  => True,
+                       'delete'                => True,
                        'check_perms'           => True
                );
 
@@ -152,109 +152,15 @@
                        }
 
                        $status_entries= $this->so->select_status_list();
-
-                       while (is_array($status_entries) && list(,$status) = 
each($status_entries))
-                       {
-                               $sel_status = '';
-                               if ($status['id']==$selected)
-                               {
-                                       $sel_status = 'selected';
-                               }
-
-                               $status_list[] = array
-                               (
-                                       'id'            => $status['id'],
-                                       'name'          => $status['name'],
-                                       'selected'      => $sel_status
-                               );
-                       }
-
-                       for ($i=0;$i<count($status_list);$i++)
-                       {
-                               if ($status_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($status_list[$i]['selected']);
-                               }
-                       }
-
-                       return $status_list;
+                       return 
$this->bocommon->select_list($selected,$status_entries);
                }
 
                function select_branch_list($selected='')
                {
-
                        $branch_entries= $this->so->select_branch_list();
-
-                       while (is_array($branch_entries) && list(,$branch) = 
each($branch_entries))
-                       {
-                               $sel_branch = '';
-                               if ($branch['id']==$selected)
-                               {
-                                       $sel_branch = 'selected';
-                               }
-
-                               $branch_list[] = array
-                               (
-                                       'id'            => $branch['id'],
-                                       'name'          => $branch['name'],
-                                       'selected'      => $sel_branch
-                               );
-                       }
-
-                       for ($i=0;$i<count($branch_list);$i++)
-                       {
-                               if ($branch_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($branch_list[$i]['selected']);
-                               }
-                       }
-
-                       return $branch_list;
-               }
-
-
-               function select_doc_type_list($format='',$selected='')
-               {
-                       switch($format)
-                       {
-                               case 'select':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
-                                       break;
-                               case 'filter':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
-                                       break;
-                       }
-
-                       $categories= $this->so->select_doc_type_list();
-
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['name'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
-                       return $category_list;
+                       return 
$this->bocommon->select_list($selected,$branch_entries);
                }
 
-
                function read()
                {
                        $document = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
@@ -344,48 +250,11 @@
 
                function select_category_list($format='',$selected='')
                {
-/*                     switch($format)
-                       {
-                               case 'select':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
-                                       break;
-                               case 'filter':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
-                                       break;
-                       }
-
-
-*/
-
                        $soadmin_entity         = 
CreateObject($this->currentapp.'.soadmin_entity');
-                       $categories                     = 
$soadmin_entity->read_category(array('allrows'=>True,'entity_id'=>$this->entity_id));
+                       $categories             = 
$soadmin_entity->read_category(array('allrows'=>True,'entity_id'=>$this->entity_id));
 
                        $category_list  = 
$this->bocommon->select_multi_list($selected,$categories);
 
-/*                     while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['name'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-*/
                        return $category_list;
                }
 
Index: property/inc/class.boentity.inc.php
diff -u property/inc/class.boentity.inc.php:1.18 
property/inc/class.boentity.inc.php:1.19
--- property/inc/class.boentity.inc.php:1.18    Mon Feb  6 22:47:37 2006
+++ property/inc/class.boentity.inc.php Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage entity
-       * @version $Id: class.boentity.inc.php,v 1.18 2006/02/06 22:47:37 
sigurdne Exp $
+       * @version $Id: class.boentity.inc.php,v 1.19 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -189,31 +189,7 @@
 
                        $categories= 
$this->soadmin_entity->read_category(array('allrows'=>True,'entity_id'=>$this->entity_id));
 
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['name'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
-                       return $category_list;
+                       return 
$this->bocommon->select_list($selected,$categories);
                }
 
 
@@ -231,31 +207,7 @@
 
                        $status_entries= 
$this->so->select_status_list($this->entity_id,$this->cat_id);
 
-                       while (is_array($status_entries) && list(,$status) = 
each($status_entries))
-                       {
-                               $sel_status = '';
-                               if ($status['id']==$selected)
-                               {
-                                       $sel_status = 'selected';
-                               }
-
-                               $status_list[] = array
-                               (
-                                       'id'            => $status['id'],
-                                       'name'          => $status['name'],
-                                       'selected'      => $sel_status
-                               );
-                       }
-
-                       for ($i=0;$i<count($status_list);$i++)
-                       {
-                               if ($status_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($status_list[$i]['selected']);
-                               }
-                       }
-
-                       return $status_list;
+                       return 
$this->bocommon->select_list($selected,$status_entries);
                }
 
                function read($data='')
@@ -617,7 +569,7 @@
                                        include (PHPGW_APP_INC . SEP . 'custom' 
. SEP . $entry['file_name']);
                                }
                        }
-                       return receipt;
+                       return $receipt;
                }
 
 
Index: property/inc/class.boinvestment.inc.php
diff -u property/inc/class.boinvestment.inc.php:1.7 
property/inc/class.boinvestment.inc.php:1.8
--- property/inc/class.boinvestment.inc.php:1.7 Fri Feb  3 12:05:49 2006
+++ property/inc/class.boinvestment.inc.php     Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage eco
-       * @version $Id: class.boinvestment.inc.php,v 1.7 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.boinvestment.inc.php,v 1.8 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -167,31 +167,7 @@
 
                        $categories= $this->so->get_type_list();
 
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['num'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
-                       return $category_list;
+                       return 
$this->bocommon->select_list($selected,$categories);
                }
 
                function write_off_period_list($selected='')
@@ -212,7 +188,7 @@
 
                                $category_list[] = array
                                (
-                                       'cat_id'        => $category['period'],
+                                       'id'            => $category['period'],
                                        'name'          => $category['period'],
                                        'selected'      => $sel_category
                                );
@@ -341,34 +317,9 @@
                        $filters[1][id]='funding';
                        $filters[1][name]=lang('Funding');
 
-                       while (is_array($filters) && list(,$filter) = 
each($filters))
-                       {
-                               $sel_filter = '';
-                               if ($filter['id']==$selected)
-                               {
-                                       $sel_filter = 'selected';
-                               }
-
-                               $filter_list[] = array
-                               (
-                                       'id'    => $filter['id'],
-                                       'name'          => $filter['name'],
-                                       'selected'      => $sel_filter
-                               );
-                       }
-
-                       for ($i=0;$i<count($filter_list);$i++)
-                       {
-                               if ($filter_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($filter_list[$i]['selected']);
-                               }
-                       }
-
-                       return $filter_list;
+                       return $this->bocommon->select_list($selected,$filters);
                }
 
-
                function read_single($entity_id,$investment_id)
                {
                        $history        = 
$this->so->read_single($entity_id,$investment_id,$this->start,$this->allrows);
Index: property/inc/class.boinvoice.inc.php
diff -u property/inc/class.boinvoice.inc.php:1.17 
property/inc/class.boinvoice.inc.php:1.18
--- property/inc/class.boinvoice.inc.php:1.17   Fri Feb  3 12:05:49 2006
+++ property/inc/class.boinvoice.inc.php        Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage eco
-       * @version $Id: class.boinvoice.inc.php,v 1.17 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.boinvoice.inc.php,v 1.18 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -165,38 +165,10 @@
 
                function select_account_class($selected='')
                {
-
                        $b_account_class_list= 
$this->so->select_account_class();
-
-                       while (is_array($b_account_class_list) && list(,$class) 
= each($b_account_class_list))
-                       {
-                               $sel_class = '';
-                               if ($class['id']==$selected)
-                               {
-                                       $sel_class = 'selected';
-                               }
-
-                               $class_list[] = array
-                               (
-                                       'id'    => $class['id'],
-                                       'name'          => $class['name'],
-                                       'selected'      => $sel_class
-                               );
-                       }
-
-                       for ($i=0;$i<count($class_list);$i++)
-                       {
-                               if ($class_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($class_list[$i]['selected']);
-                               }
-                       }
-
-                       return $class_list;
+                       return 
$this->bocommon->select_list($selected,$b_account_class_list);
                }
 
-
-
                function period_list($selected='')
                {
                        for ($i=1; $i<=12; $i++)
@@ -264,36 +236,10 @@
                        return $this->so->check_vendor($vendor_id);
                }
 
-
                function get_lisfm_ecoart($selected='')
                {
                        $arts=$this->so->get_lisfm_ecoart();
-
-                       while (is_array($arts) && list(,$art) = each($arts))
-                       {
-                               $sel_art = '';
-                               if ($art['id']==$selected)
-                               {
-                                       $sel_art = 'selected';
-                               }
-
-                               $art_list[] = array
-                               (
-                                       'id'            => $art['id'],
-                                       'num'           => $art['num'],
-                                       'selected'      => $sel_art
-                               );
-                       }
-
-                       for ($i=0;$i<count($art_list);$i++)
-                       {
-                               if ($art_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($art_list[$i]['selected']);
-                               }
-                       }
-
-                       return $art_list;
+                       return $this->bocommon->select_list($selected,$arts);
                }
        //----------
 
@@ -311,31 +257,7 @@
 
                        $categories= $this->so->get_type_list();
 
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['num'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
-                       return $category_list;
+                       return 
$this->bocommon->select_list($selected,$categories);
                }
 
 
@@ -402,131 +324,30 @@
                        return $user_list;
                }
 
-
-
                function get_type_list($selected='')
                {
                        $types=$this->so->get_type_list();
-
-                       while (is_array($types) && list(,$type) = each($types))
-                       {
-                               $sel_type = '';
-                               if ($type['id']==$selected)
-                               {
-                                       $sel_type = 'selected';
-                               }
-
-                               $type_list[] = array
-                               (
-                                       'id'            => $type['id'],
-                                       'num'           => $type['num'],
-                                       'selected'      => $sel_type
-                               );
-                       }
-
-                       for ($i=0;$i<count($type_list);$i++)
-                       {
-                               if ($type_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($type_list[$i]['selected']);
-                               }
-                       }
-
-                       return $type_list;
+                       return $this->bocommon->select_list($selected,$types);
                }
 
        //----------
                function select_dimb_list($selected='')
                {
                        $dimbs=$this->so->select_dimb_list();
-
-                       while (is_array($dimbs) && list(,$dimb) = each($dimbs))
-                       {
-                               $sel_dimb = '';
-                               if ($dimb['id']==$selected)
-                               {
-                                       $sel_dimb = 'selected';
-                               }
-
-                               $dimb_list[] = array
-                               (
-                                       'id'            => $dimb['id'],
-                                       'num'           => $dimb['num'],
-                                       'selected'      => $sel_dimb
-                               );
-                       }
-
-                       for ($i=0;$i<count($dimb_list);$i++)
-                       {
-                               if ($dimb_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($dimb_list[$i]['selected']);
-                               }
-                       }
-
-                       return $dimb_list;
+                       return $this->bocommon->select_list($selected,$dimbs);
                }
 
        //-------------------
                function select_dimd_list($selected='')
                {
                        $dimds=$this->so->select_dimd_list();
-
-                       while (is_array($dimds) && list(,$dimd) = each($dimds))
-                       {
-                               $sel_dimd = '';
-                               if ($dimd['id']==$selected)
-                               {
-                                       $sel_dimd = 'selected';
-                               }
-
-                               $dimd_list[] = array
-                               (
-                                       'id'            => $dimd['id'],
-                                       'num'           => $dimd['num'],
-                                       'selected'      => $sel_dimd
-                               );
-                       }
-
-                       for ($i=0;$i<count($dimd_list);$i++)
-                       {
-                               if ($dimd_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($dimd_list[$i]['selected']);
-                               }
-                       }
-
-                       return $dimd_list;
+                       return $this->bocommon->select_list($selected,$dimds);
                }
 
                function select_tax_code_list($selected='')
                {
                        $tax_codes=$this->so->select_tax_code_list();
-
-                       while (is_array($tax_codes) && list(,$tax_code) = 
each($tax_codes))
-                       {
-                               $sel_tax_code = '';
-                               if ($tax_code['id']==$selected)
-                               {
-                                       $sel_tax_code = 'selected';
-                               }
-
-                               $tax_code_list[] = array
-                               (
-                                       'id'            => $tax_code['id'],
-                                       'num'           => $tax_code['num'],
-                                       'selected'      => $sel_tax_code
-                               );
-                       }
-
-                       for ($i=0;$i<count($tax_code_list);$i++)
-                       {
-                               if ($tax_code_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($tax_code_list[$i]['selected']);
-                               }
-                       }
-                       return $tax_code_list;
+                       return 
$this->bocommon->select_list($selected,$tax_codes);
                }
 
                function delete($params)
Index: property/inc/class.bolocation.inc.php
diff -u property/inc/class.bolocation.inc.php:1.14 
property/inc/class.bolocation.inc.php:1.15
--- property/inc/class.bolocation.inc.php:1.14  Tue Apr 11 15:09:01 2006
+++ property/inc/class.bolocation.inc.php       Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage location
-       * @version $Id: class.bolocation.inc.php,v 1.14 2006/04/11 15:09:01 
sigurdne Exp $
+       * @version $Id: class.bolocation.inc.php,v 1.15 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -193,32 +193,7 @@
 
                        $owners = $this->so->get_owner_list();
 
-                       while (is_array($owners) && list(,$owner) = 
each($owners))
-                       {
-                               $sel_owner = '';
-                               if ($owner['id']==$selected)
-                               {
-                                       $sel_owner = 'selected';
-                               }
-
-                               $owner_list[] = array
-                               (
-                                       'id'            => $owner['id'],
-                                       'name'          => $owner['name'],
-                                       'selected'      => $sel_owner
-                               );
-                       }
-
-                       $owner_count=count($owner_list);
-                       for ($i=0;$i<$owner_count;$i++)
-                       {
-                               if ($owner_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($owner_list[$i]['selected']);
-                               }
-                       }
-
-                       return $owner_list;
+                       return $this->bocommon->select_list($selected,$owners);
                }
 
                function get_owner_type_list($format='',$selected='')
@@ -236,33 +211,7 @@
 
                        $owners = $this->so->get_owner_type_list();
 
-                       while (is_array($owners) && list(,$owner) = 
each($owners))
-                       {
-                               $sel_owner = '';
-                               if ($owner['id']==$selected)
-                               {
-                                       $sel_owner = 'selected';
-                               }
-
-                               $owner_list[] = array
-                               (
-                                       'id'            => $owner['id'],
-                                       'name'          => $owner['name'],
-                                       'selected'      => $sel_owner
-                               );
-                       }
-
-                       $owner_count=count($owner_list);
-
-                       for ($i=0;$i<$owner_count;$i++)
-                       {
-                               if ($owner_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($owner_list[$i]['selected']);
-                               }
-                       }
-
-                       return $owner_list;
+                       return $this->bocommon->select_list($selected,$owners);
                }
 
 
@@ -570,49 +519,6 @@
 
                }
 
-               function 
select_category_list($format='',$selected='',$type_id='')
-               {
-                       switch($format)
-                       {
-                               case 'select':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
-                                       break;
-                               case 'filter':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
-                                       break;
-                       }
-
-                       $categories= $this->so->select_category_list($type_id);
-
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['name'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       $category_count=count($category_list);
-                       for ($i=0;$i<$category_count;$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
-                       return $category_list;
-               }
-
-
                function read($data='')
                {
                        $location = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
@@ -790,35 +696,12 @@
 
                function select_change_type($selected='')
                {
-                       $nullable[0]['id']= 1;
-                       $nullable[0]['name']= lang('Correct error');
-                       $nullable[1]['id']= 2;
-                       $nullable[1]['name']= lang('New values');
-
-                       while (is_array($nullable) && list(,$type) = 
each($nullable))
-                       {
-                               $sel_type = '';
-                               if ($type['id']==$selected)
-                               {
-                                       $sel_type = 'selected';
-                               }
-
-                               $change_type_list[] = array
-                               (
-                                       'id'    => $type['id'],
-                                       'name'          => $type['name'],
-                                       'selected'      => $sel_type
-                               );
-                       }
+                       $change_type[0]['id']= 1;
+                       $change_type[0]['name']= lang('Correct error');
+                       $change_type[1]['id']= 2;
+                       $change_type[1]['name']= lang('New values');
 
-                       for ($i=0;$i<count($change_type_list);$i++)
-                       {
-                               if ($change_type_list[$i]['selected'] != 
'selected')
-                               {
-                                       
unset($change_type_list[$i]['selected']);
-                               }
-                       }
-                       return $change_type_list;
+                       return 
$this->bocommon->select_list($selected,$change_type);
                }
 
                function check_history($location_code)
Index: property/inc/class.bometer.inc.php
diff -u property/inc/class.bometer.inc.php:1.7 
property/inc/class.bometer.inc.php:1.8
--- property/inc/class.bometer.inc.php:1.7      Fri Feb  3 12:05:49 2006
+++ property/inc/class.bometer.inc.php  Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage entity
-       * @version $Id: class.bometer.inc.php,v 1.7 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.bometer.inc.php,v 1.8 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -137,31 +137,7 @@
 
                        $categories= $this->so->get_category_list();
 
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['name'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
-                       return $category_list;
+                       return 
$this->bocommon->select_list($selected,$categories);
                }
 
                function read()
Index: property/inc/class.bopricebook.inc.php
diff -u property/inc/class.bopricebook.inc.php:1.8 
property/inc/class.bopricebook.inc.php:1.9
--- property/inc/class.bopricebook.inc.php:1.8  Fri Feb  3 12:05:49 2006
+++ property/inc/class.bopricebook.inc.php      Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.bopricebook.inc.php,v 1.8 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.bopricebook.inc.php,v 1.9 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -126,7 +126,7 @@
                        $this->start    = $data['start'];
                        $this->query    = $data['query'];
                        $this->filter   = $data['filter'];
-                       $this->sort             = $data['sort'];
+                       $this->sort     = $data['sort'];
                        $this->order    = $data['order'];
                        $this->cat_id   = $data['cat_id'];
                }
@@ -145,32 +145,7 @@
                        }
 
                        $status_entries= $this->so->select_status_list();
-
-                       while (is_array($status_entries) && list(,$status) = 
each($status_entries))
-                       {
-                               $sel_status = '';
-                               if ($status['id']==$selected)
-                               {
-                                       $sel_status = 'selected';
-                               }
-
-                               $status_list[] = array
-                               (
-                                       'id'            => $status['id'],
-                                       'name'          => $status['name'],
-                                       'selected'      => $sel_status
-                               );
-                       }
-
-                       for ($i=0;$i<count($status_list);$i++)
-                       {
-                               if ($status_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($status_list[$i]['selected']);
-                               }
-                       }
-
-                       return $status_list;
+                       return 
$this->bocommon->select_list($selected,$status_entries);
                }
 
                function read()
@@ -335,32 +310,7 @@
                        }
 
                        $vendors= $this->so->get_vendor_list();
-
-                       while (is_array($vendors) && list(,$vendor_entry) = 
each($vendors))
-                       {
-                               $sel_vendor_entry = '';
-                               if ($vendor_entry['id']==$selected)
-                               {
-                                       $sel_vendor_entry = 'selected';
-                               }
-
-                               $vendor_list[] = array
-                               (
-                                       'cat_id'        => $vendor_entry['id'],
-                                       'name'          => 
$vendor_entry['name'],
-                                       'selected'      => $sel_vendor_entry
-                               );
-                       }
-
-                       for ($i=0;$i<count($vendor_list);$i++)
-                       {
-                               if ($vendor_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($vendor_list[$i]['selected']);
-                               }
-                       }
-
-                       return $vendor_list;
+                       return $this->bocommon->select_list($selected,$vendors);
                }
 
                function get_dim_d_list($selected='')
@@ -369,31 +319,7 @@
 
                        $dim_ds= $this->so->get_dim_d_list();
 
-                       while (is_array($dim_ds) && list(,$dim_d_entry) = 
each($dim_ds))
-                       {
-                               $sel_dim_d_entry = '';
-                               if ($dim_d_entry['id']==$selected)
-                               {
-                                       $sel_dim_d_entry = 'selected';
-                               }
-
-                               $dim_d_list[] = array
-                               (
-                                       'id'            => $dim_d_entry['id'],
-                                       'name'          => $dim_d_entry['name'],
-                                       'selected'      => $sel_dim_d_entry
-                               );
-                       }
-
-                       for ($i=0;$i<count($dim_d_list);$i++)
-                       {
-                               if ($dim_d_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($dim_d_list[$i]['selected']);
-                               }
-                       }
-
-                       return $dim_d_list;
+                       return $this->bocommon->select_list($selected,$dim_ds);
                }
 
                function get_unit_list($selected='')
@@ -402,31 +328,7 @@
 
                        $units= $this->so->get_unit_list();
 
-                       while (is_array($units) && list(,$unit_entry) = 
each($units))
-                       {
-                               $sel_unit_entry = '';
-                               if ($unit_entry['id']==$selected)
-                               {
-                                       $sel_unit_entry = 'selected';
-                               }
-
-                               $unit_list[] = array
-                               (
-                                       'id'            => $unit_entry['id'],
-                                       'name'          => $unit_entry['name'],
-                                       'selected'      => $sel_unit_entry
-                               );
-                       }
-
-                       for ($i=0;$i<count($unit_list);$i++)
-                       {
-                               if ($unit_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($unit_list[$i]['selected']);
-                               }
-                       }
-
-                       return $unit_list;
+                       return $this->bocommon->select_list($selected,$units);
                }
 
                function get_branch_list($selected='')
@@ -435,31 +337,7 @@
 
                        $branches= $this->so->get_branch_list();
 
-                       while (is_array($branches) && list(,$branch_entry) = 
each($branches))
-                       {
-                               $sel_branch_entry = '';
-                               if ($branch_entry['id']==$selected)
-                               {
-                                       $sel_branch_entry = 'selected';
-                               }
-
-                               $branch_list[] = array
-                               (
-                                       'id'            => $branch_entry['id'],
-                                       'name'          => 
$branch_entry['name'],
-                                       'selected'      => $sel_branch_entry
-                               );
-                       }
-
-                       for ($i=0;$i<count($branch_list);$i++)
-                       {
-                               if ($branch_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($branch_list[$i]['selected']);
-                               }
-                       }
-
-                       return $branch_list;
+                       return 
$this->bocommon->select_list($selected,$branches);
                }
 
                function get_agreement_group_list($format='',$selected='')
@@ -476,31 +354,7 @@
 
                        $agreement_groups= 
$this->so->get_agreement_group_list();
 
-                       while (is_array($agreement_groups) && 
list(,$agreement_group_entry) = each($agreement_groups))
-                       {
-                               $sel_agreement_group_entry = '';
-                               if ($agreement_group_entry['id']==$selected)
-                               {
-                                       $sel_agreement_group_entry = 'selected';
-                               }
-
-                               $agreement_group_list[] = array
-                               (
-                                       'cat_id'        => 
$agreement_group_entry['id'],
-                                       'name'          => 
$agreement_group_entry['name'],
-                                       'selected'      => 
$sel_agreement_group_entry
-                               );
-                       }
-
-                       for ($i=0;$i<count($agreement_group_list);$i++)
-                       {
-                               if ($agreement_group_list[$i]['selected'] != 
'selected')
-                               {
-                                       
unset($agreement_group_list[$i]['selected']);
-                               }
-                       }
-
-                       return $agreement_group_list;
+                       return 
$this->bocommon->select_list($selected,$agreement_groups);
                }
 
 
Index: property/inc/class.boproject.inc.php
diff -u property/inc/class.boproject.inc.php:1.14 
property/inc/class.boproject.inc.php:1.15
--- property/inc/class.boproject.inc.php:1.14   Fri Feb  3 12:05:49 2006
+++ property/inc/class.boproject.inc.php        Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.boproject.inc.php,v 1.14 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.boproject.inc.php,v 1.15 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -131,63 +131,13 @@
 
                        $status_entries= $this->so->select_status_list();
 
-                       while (is_array($status_entries) && list(,$status) = 
each($status_entries))
-                       {
-                               $sel_status = '';
-                               if ($status['id']==$selected)
-                               {
-                                       $sel_status = 'selected';
-                               }
-
-                               $status_list[] = array
-                               (
-                                       'id'            => $status['id'],
-                                       'name'          => $status['name'],
-                                       'selected'      => $sel_status
-                               );
-                       }
-
-                       for ($i=0;$i<count($status_list);$i++)
-                       {
-                               if ($status_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($status_list[$i]['selected']);
-                               }
-                       }
-
-                       return $status_list;
+                       return 
$this->bocommon->select_list($selected,$status_entries);
                }
 
                function select_branch_list($selected='')
                {
-
                        $branch_entries= $this->so->select_branch_list();
-
-                       while (is_array($branch_entries) && list(,$branch) = 
each($branch_entries))
-                       {
-                               $sel_branch = '';
-                               if ($branch['id']==$selected)
-                               {
-                                       $sel_branch = 'selected';
-                               }
-
-                               $branch_list[] = array
-                               (
-                                       'id'            => $branch['id'],
-                                       'name'          => $branch['name'],
-                                       'selected'      => $sel_branch
-                               );
-                       }
-
-                       for ($i=0;$i<count($branch_list);$i++)
-                       {
-                               if ($branch_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($branch_list[$i]['selected']);
-                               }
-                       }
-
-                       return $branch_list;
+                       return 
$this->bocommon->select_list($selected,$branch_entries);
                }
 
                function select_branch_p_list($project_id='')
@@ -229,75 +179,9 @@
 
                        $key_location_entries= 
$this->so->select_key_location_list();
 
-                       while (is_array($key_location_entries) && 
list(,$key_location) = each($key_location_entries))
-                       {
-                               $sel_key_location = '';
-                               if ($key_location['id']==$selected)
-                               {
-                                       $sel_key_location = 'selected';
-                               }
-
-                               $key_location_list[] = array
-                               (
-                                       'id'            => $key_location['id'],
-                                       'name'          => 
$key_location['name'],
-                                       'selected'      => $sel_key_location
-                               );
-                       }
-
-                       for ($i=0;$i<count($key_location_list);$i++)
-                       {
-                               if ($key_location_list[$i]['selected'] != 
'selected')
-                               {
-                                       
unset($key_location_list[$i]['selected']);
-                               }
-                       }
-
-                       return $key_location_list;
-               }
-
-               function select_category_project_list($format='',$selected='')
-               {
-                       switch($format)
-                       {
-                               case 'select':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
-                                       break;
-                               case 'filter':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
-                                       break;
-                       }
-
-                       $categories= 
$this->so->select_category_workorder_list();
-
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['name'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
-                       return $category_list;
+                       return 
$this->bocommon->select_list($selected,$key_location_entries);
                }
 
-
                function read($start_date='',$end_date='',$allrows='')
                {
                        $start_date     = 
$this->bocommon->date_to_timestamp($start_date);
Index: property/inc/class.bor_agreement.inc.php
diff -u property/inc/class.bor_agreement.inc.php:1.8 
property/inc/class.bor_agreement.inc.php:1.9
--- property/inc/class.bor_agreement.inc.php:1.8        Tue Feb 21 14:48:22 2006
+++ property/inc/class.bor_agreement.inc.php    Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.bor_agreement.inc.php,v 1.8 2006/02/21 14:48:22 
sigurdne Exp $
+       * @version $Id: class.bor_agreement.inc.php,v 1.9 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -165,47 +165,6 @@
                }
 
 
-               function select_category_list($format='',$selected='')
-               {
-                       switch($format)
-                       {
-                               case 'select':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
-                                       break;
-                               case 'filter':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
-                                       break;
-                       }
-
-                       $categories= $this->so->select_category_list();
-
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['name'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
-                       return $category_list;
-               }
-
                function select_vendor_list($format='',$selected='')
                {
                        switch($format)
Index: property/inc/class.borequest.inc.php
diff -u property/inc/class.borequest.inc.php:1.11 
property/inc/class.borequest.inc.php:1.12
--- property/inc/class.borequest.inc.php:1.11   Thu Feb  9 13:22:56 2006
+++ property/inc/class.borequest.inc.php        Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.borequest.inc.php,v 1.11 2006/02/09 13:22:56 
sigurdne Exp $
+       * @version $Id: class.borequest.inc.php,v 1.12 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -314,75 +314,10 @@
 
                        $status_entries= $this->so->select_status_list();
 
-                       while (is_array($status_entries) && list(,$status) = 
each($status_entries))
-                       {
-                               $sel_status = '';
-                               if ($status['id']==$selected)
-                               {
-                                       $sel_status = 'selected';
-                               }
-
-                               $status_list[] = array
-                               (
-                                       'id'            => $status['id'],
-                                       'name'          => $status['name'],
-                                       'selected'      => $sel_status
-                               );
-                       }
-
-                       for ($i=0;$i<count($status_list);$i++)
-                       {
-                               if ($status_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($status_list[$i]['selected']);
-                               }
-                       }
-
-                       return $status_list;
+                       return 
$this->bocommon->select_list($selected,$status_entries);
                }
 
 
-               function select_category_request_list($format='',$selected='')
-               {
-                       switch($format)
-                       {
-                               case 'select':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
-                                       break;
-                               case 'filter':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
-                                       break;
-                       }
-
-                       $categories= 
$this->so->select_category_workorder_list();
-
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['name'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
-                       return $category_list;
-               }
-
                function read_priority_key()
                {
                        return  $this->so->read_priority_key();
Index: property/inc/class.bos_agreement.inc.php
diff -u property/inc/class.bos_agreement.inc.php:1.12 
property/inc/class.bos_agreement.inc.php:1.13
--- property/inc/class.bos_agreement.inc.php:1.12       Fri Feb  3 12:05:49 2006
+++ property/inc/class.bos_agreement.inc.php    Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.bos_agreement.inc.php,v 1.12 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.bos_agreement.inc.php,v 1.13 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -143,48 +143,6 @@
                        return (!!($has & $needed) == True);
                }
 
-
-               function select_category_list($format='',$selected='')
-               {
-                       switch($format)
-                       {
-                               case 'select':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
-                                       break;
-                               case 'filter':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
-                                       break;
-                       }
-
-                       $categories= $this->so->select_category_list();
-
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['name'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
-                       return $category_list;
-               }
-
                function select_vendor_list($format='',$selected='')
                {
                        switch($format)
@@ -476,7 +434,10 @@
                        $values['end_date']     = 
$this->bocommon->date_to_timestamp($values['end_date']);
                        $values['termination_date']     = 
$this->bocommon->date_to_timestamp($values['termination_date']);
 
-                       $values_attribute = 
$this->convert_attribute_save($values_attribute);
+                       if (is_array($values_attribute))
+                       {
+                               $values_attribute = 
$this->convert_attribute_save($values_attribute);
+                       }
 
                        if ($action=='edit')
 //                     if ($values['s_agreement_id'])
@@ -537,7 +498,10 @@
 
                        $values['location_code'address@hidden("-", $location);
 
-                       $values_attribute = 
$this->convert_attribute_save($values_attribute);
+                       if (is_array($values_attribute))
+                       {
+                               $values_attribute = 
$this->convert_attribute_save($values_attribute);
+                       }
 
                        if ($values['id'])
                        {
Index: property/inc/class.bostandard_entity.inc.php
diff -u property/inc/class.bostandard_entity.inc.php:1.7 
property/inc/class.bostandard_entity.inc.php:1.8
--- property/inc/class.bostandard_entity.inc.php:1.7    Fri Feb  3 12:05:49 2006
+++ property/inc/class.bostandard_entity.inc.php        Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.bostandard_entity.inc.php,v 1.7 2006/02/03 
12:05:49 sigurdne Exp $
+       * @version $Id: class.bostandard_entity.inc.php,v 1.8 2006/04/17 
11:36:05 sigurdne Exp $
        */
 
        /**
@@ -207,32 +207,7 @@
                function select_entity_type($type='',$selected='')
                {
                        $entity_types= $this->so->select_entity_type($type);
-
-                       while (is_array($entity_types) && list(,$type) = 
each($entity_types))
-                       {
-                               $sel_type = '';
-                               if ($type['id']==$selected)
-                               {
-                                       $sel_type = 'selected';
-                               }
-
-                               $entity_type_list[] = array
-                               (
-                                       'id'    => $type['id'],
-                                       'name'          => $type['name'],
-                                       'selected'      => $sel_type
-                               );
-                       }
-
-                       for ($i=0;$i<count($entity_type_list);$i++)
-                       {
-                               if ($entity_type_list[$i]['selected'] != 
'selected')
-                               {
-                                       
unset($entity_type_list[$i]['selected']);
-                               }
-                       }
-
-                       return $entity_type_list;
+                       return 
$this->bocommon->select_list($selected,$entity_types);
                }
 
                function select_datatype($selected='')
Index: property/inc/class.botemplate.inc.php
diff -u property/inc/class.botemplate.inc.php:1.7 
property/inc/class.botemplate.inc.php:1.8
--- property/inc/class.botemplate.inc.php:1.7   Fri Feb  3 12:05:49 2006
+++ property/inc/class.botemplate.inc.php       Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.botemplate.inc.php,v 1.7 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.botemplate.inc.php,v 1.8 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -38,6 +38,7 @@
                {
                        $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject($this->currentapp.'.sotemplate');
+                       $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
 
                        if ($session)
                        {
@@ -51,7 +52,8 @@
                        $order  = get_var('order',array('POST','GET'));
                        $filter = get_var('filter',array('POST','GET'));
                        $cat_id = get_var('cat_id',array('POST','GET'));
-                       $allrows        = 
get_var('allrows',array('POST','GET'));
+                       $allrows= get_var('allrows',array('POST','GET'));
+                       $chapter_id     = 
get_var('chapter_id',array('POST','GET'));
 
                        if ($start)
                        {
@@ -86,6 +88,10 @@
                        {
                                $this->allrows = $allrows;
                        }
+                       if(isset($chapter_id))
+                       {
+                               $this->chapter_id = $chapter_id;
+                       }
                }
 
 
@@ -101,13 +107,14 @@
                {
                        $data = 
$GLOBALS['phpgw']->session->appsession('session_data','template');
 
-                       $this->start    = $data['start'];
-                       $this->query    = $data['query'];
-                       $this->filter   = $data['filter'];
+                       $this->start            = $data['start'];
+                       $this->query            = $data['query'];
+                       $this->filter           = $data['filter'];
                        $this->sort             = $data['sort'];
-                       $this->order    = $data['order'];
-                       $this->cat_id   = $data['cat_id'];
-                       $this->allrows  = $data['allrows'];
+                       $this->order            = $data['order'];
+                       $this->cat_id           = $data['cat_id'];
+                       $this->allrows          = $data['allrows'];
+                       $this->chapter_id       = $data['chapter_id'];
                }
 
 
@@ -159,34 +166,8 @@
                function get_grouping_list($selected='',$template_id)
                {
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('grouping_select'));
-
                        $groupings= $this->so->get_grouping_list($template_id);
-
-                       while (is_array($groupings) && list(,$grouping_entry) = 
each($groupings))
-                       {
-                               $sel_grouping_entry = '';
-                               if ($grouping_entry['id']==$selected)
-                               {
-                                       $sel_grouping_entry = 'selected';
-                               }
-
-                               $grouping_list[] = array
-                               (
-                                       'id'            => 
$grouping_entry['id'],
-                                       'name'          => 
$grouping_entry['name'],
-                                       'selected'      => $sel_grouping_entry
-                               );
-                       }
-
-                       for ($i=0;$i<count($grouping_list);$i++)
-                       {
-                               if ($grouping_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($grouping_list[$i]['selected']);
-                               }
-                       }
-
-                       return $grouping_list;
+                       return 
$this->bocommon->select_list($selected,$groupings);
                }
 
                function save_template($values)
Index: property/inc/class.botenant_claim.inc.php
diff -u property/inc/class.botenant_claim.inc.php:1.7 
property/inc/class.botenant_claim.inc.php:1.8
--- property/inc/class.botenant_claim.inc.php:1.7       Fri Feb  3 12:05:49 2006
+++ property/inc/class.botenant_claim.inc.php   Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.botenant_claim.inc.php,v 1.7 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.botenant_claim.inc.php,v 1.8 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -144,31 +144,7 @@
                                $status[1][name]=lang('Open');
                        }
 
-                       while (is_array($status) && list(,$entry) = 
each($status))
-                       {
-                               $sel_status = '';
-                               if ($entry['id']==$selected)
-                               {
-                                       $sel_status = 'selected';
-                               }
-
-                               $status_list[] = array
-                               (
-                                       'id'    => $entry['id'],
-                                       'name'          => $entry['name'],
-                                       'selected'      => $sel_status
-                               );
-                       }
-
-                       for ($i=0;$i<count($status_list);$i++)
-                       {
-                               if ($status_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($status_list[$i]['selected']);
-                               }
-                       }
-
-                       return $status_list;
+                       return $this->bocommon->select_list($selected,$status);
                }
 
                function read_category_name($cat_id='')
@@ -176,47 +152,6 @@
                        return $this->so->read_category_name($cat_id);
                }
 
-               function select_category_list($format='',$selected='')
-               {
-                       switch($format)
-                       {
-                               case 'select':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
-                                       break;
-                               case 'filter':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
-                                       break;
-                       }
-
-                       $categories= $this->so->select_category_list();
-
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['name'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
-                       return $category_list;
-               }
-
                function read($data=0)
                {
                        $claim = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
Index: property/inc/class.botts.inc.php
diff -u property/inc/class.botts.inc.php:1.22 
property/inc/class.botts.inc.php:1.23
--- property/inc/class.botts.inc.php:1.22       Wed Apr 12 10:24:43 2006
+++ property/inc/class.botts.inc.php    Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage helpdesk
-       * @version $Id: class.botts.inc.php,v 1.22 2006/04/12 10:24:43 sigurdne 
Exp $
+       * @version $Id: class.botts.inc.php,v 1.23 2006/04/17 11:36:05 sigurdne 
Exp $
        */
 
        /**
@@ -182,31 +182,7 @@
                        $filters[1][id]='all';
                        $filters[1][name]=lang('All');
 
-                       while (is_array($filters) && list(,$filter) = 
each($filters))
-                       {
-                               $sel_filter = '';
-                               if ($filter['id']==$selected)
-                               {
-                                       $sel_filter = 'selected';
-                               }
-
-                               $filter_list[] = array
-                               (
-                                       'id'    => $filter['id'],
-                                       'name'          => $filter['name'],
-                                       'selected'      => $sel_filter
-                               );
-                       }
-
-                       for ($i=0;$i<count($filter_list);$i++)
-                       {
-                               if ($filter_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($filter_list[$i]['selected']);
-                               }
-                       }
-
-                       return $filter_list;
+                       return $this->bocommon->select_list($selected,$filters);
                }
 
                function get_status_list($selected)
@@ -217,37 +193,12 @@
                        $filters[1][id]='O';
                        $filters[1][name]=lang('Open');
 
-                       while (is_array($filters) && list(,$filter) = 
each($filters))
-                       {
-                               $sel_filter = '';
-                               if ($filter['id']==$selected)
-                               {
-                                       $sel_filter = 'selected';
-                               }
-
-                               $filter_list[] = array
-                               (
-                                       'id'    => $filter['id'],
-                                       'name'          => $filter['name'],
-                                       'selected'      => $sel_filter
-                               );
-                       }
-
-                       for ($i=0;$i<count($filter_list);$i++)
-                       {
-                               if ($filter_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($filter_list[$i]['selected']);
-                               }
-                       }
-
-                       return $filter_list;
+                       return $this->bocommon->select_list($selected,$filters);
                }
 
 
                function get_priority_list($selected='')
                {
-
                        if(!$selected)
                        {
                                $selected = 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['prioritydefault'];
@@ -263,32 +214,7 @@
                                $priorities[$i]['name'] =$i . 
$priority_comment[$i];
                        }
 
-                       while (is_array($priorities) && list(,$priority) = 
each($priorities))
-                       {
-                               $sel_priority = '';
-                               if ($priority['id']==$selected)
-                               {
-                                       $sel_priority = 'selected';
-                               }
-
-                               $priority_list[] = array
-                               (
-                                       'id'    => $priority['id'],
-                                       'name'          => $priority['name'],
-                                       'selected'      => $sel_priority
-                               );
-                       }
-
-                       for ($i=0;$i<count($priority_list);$i++)
-                       {
-                               if ($priority_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($priority_list[$i]['selected']);
-                               }
-                       }
-
-//_debug_array($priority_list);
-                       return $priority_list;
+                       return 
$this->bocommon->select_list($selected,$priorities);
                }
 
                function get_category_name($cat_id)
@@ -296,46 +222,6 @@
                        return $this->so->get_category_name($cat_id);
                }
 
-               function select_category_list($format='',$selected='')
-               {
-                       switch($format)
-                       {
-                               case 'select':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
-                                       break;
-                               case 'filter':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
-                                       break;
-                       }
-
-                       $categories= $this->so->select_category_list();
-
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['name'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
-                       return $category_list;
-               }
 
                function read($start_date='',$end_date='')
                {
Index: property/inc/class.bowo_hour.inc.php
diff -u property/inc/class.bowo_hour.inc.php:1.10 
property/inc/class.bowo_hour.inc.php:1.11
--- property/inc/class.bowo_hour.inc.php:1.10   Fri Mar 10 09:24:30 2006
+++ property/inc/class.bowo_hour.inc.php        Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.bowo_hour.inc.php,v 1.10 2006/03/10 09:24:30 
sigurdne Exp $
+       * @version $Id: class.bowo_hour.inc.php,v 1.11 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -130,31 +130,7 @@
 
                        $chapters= $this->so->get_chapter_list();
 
-                       while (is_array($chapters) && list(,$chapter_entry) = 
each($chapters))
-                       {
-                               $sel_chapter_entry = '';
-                               if ($chapter_entry['id']==$selected)
-                               {
-                                       $sel_chapter_entry = 'selected';
-                               }
-
-                               $chapter_list[] = array
-                               (
-                                       'id'            => $chapter_entry['id'],
-                                       'name'          => 
$chapter_entry['name'],
-                                       'selected'      => $sel_chapter_entry
-                               );
-                       }
-
-                       for ($i=0;$i<count($chapter_list);$i++)
-                       {
-                               if ($chapter_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($chapter_list[$i]['selected']);
-                               }
-                       }
-
-                       return $chapter_list;
+                       return 
$this->bocommon->select_list($selected,$chapters);
                }
 
                function get_tolerance_list($selected='')
@@ -195,34 +171,8 @@
                function get_grouping_list($selected='',$workorder_id)
                {
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('grouping_select'));
-
                        $groupings= $this->so->get_grouping_list($workorder_id);
-
-                       while (is_array($groupings) && list(,$grouping_entry) = 
each($groupings))
-                       {
-                               $sel_grouping_entry = '';
-                               if ($grouping_entry['id']==$selected)
-                               {
-                                       $sel_grouping_entry = 'selected';
-                               }
-
-                               $grouping_list[] = array
-                               (
-                                       'id'            => 
$grouping_entry['id'],
-                                       'name'          => 
$grouping_entry['name'],
-                                       'selected'      => $sel_grouping_entry
-                               );
-                       }
-
-                       for ($i=0;$i<count($grouping_list);$i++)
-                       {
-                               if ($grouping_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($grouping_list[$i]['selected']);
-                               }
-                       }
-
-                       return $grouping_list;
+                       return 
$this->bocommon->select_list($selected,$groupings);
                }
 
                function get_building_part_list($selected='')
@@ -478,7 +428,6 @@
                        return  $email_list;
                }
 
-
                function update_email($to_email,$workorder_id)
                {
                        $this->so->update_email($to_email,$workorder_id);
Index: property/inc/class.boworkorder.inc.php
diff -u property/inc/class.boworkorder.inc.php:1.10 
property/inc/class.boworkorder.inc.php:1.11
--- property/inc/class.boworkorder.inc.php:1.10 Fri Feb  3 12:05:49 2006
+++ property/inc/class.boworkorder.inc.php      Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.boworkorder.inc.php,v 1.10 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.boworkorder.inc.php,v 1.11 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -153,63 +153,13 @@
 
                        $status_entries= $this->so->select_status_list();
 
-                       while (is_array($status_entries) && list(,$status) = 
each($status_entries))
-                       {
-                               $sel_status = '';
-                               if ($status['id']==$selected)
-                               {
-                                       $sel_status = 'selected';
-                               }
-
-                               $status_list[] = array
-                               (
-                                       'id'            => $status['id'],
-                                       'name'          => $status['name'],
-                                       'selected'      => $sel_status
-                               );
-                       }
-
-                       for ($i=0;$i<count($status_list);$i++)
-                       {
-                               if ($status_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($status_list[$i]['selected']);
-                               }
-                       }
-
-                       return $status_list;
+                       return 
$this->bocommon->select_list($selected,$status_entries);
                }
 
                function select_branch_list($selected='')
                {
-
                        $branch_entries= $this->so->select_branch_list();
-
-                       while (is_array($branch_entries) && list(,$branch) = 
each($branch_entries))
-                       {
-                               $sel_branch = '';
-                               if ($branch['id']==$selected)
-                               {
-                                       $sel_branch = 'selected';
-                               }
-
-                               $branch_list[] = array
-                               (
-                                       'id'            => $branch['id'],
-                                       'name'          => $branch['name'],
-                                       'selected'      => $sel_branch
-                               );
-                       }
-
-                       for ($i=0;$i<count($branch_list);$i++)
-                       {
-                               if ($branch_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($branch_list[$i]['selected']);
-                               }
-                       }
-
-                       return $branch_list;
+                       return 
$this->bocommon->select_list($selected,$branch_entries);
                }
 
                function select_branch_p_list($project_id='')
@@ -248,78 +198,10 @@
 
                function select_key_location_list($selected='')
                {
-
                        $key_location_entries= 
$this->so->select_key_location_list();
-
-                       while (is_array($key_location_entries) && 
list(,$key_location) = each($key_location_entries))
-                       {
-                               $sel_key_location = '';
-                               if ($key_location['id']==$selected)
-                               {
-                                       $sel_key_location = 'selected';
-                               }
-
-                               $key_location_list[] = array
-                               (
-                                       'id'            => $key_location['id'],
-                                       'name'          => 
$key_location['name'],
-                                       'selected'      => $sel_key_location
-                               );
-                       }
-
-                       for ($i=0;$i<count($key_location_list);$i++)
-                       {
-                               if ($key_location_list[$i]['selected'] != 
'selected')
-                               {
-                                       
unset($key_location_list[$i]['selected']);
-                               }
-                       }
-
-                       return $key_location_list;
+                       return 
$this->bocommon->select_list($selected,$key_location_entries);
                }
 
-               function select_category_workorder_list($format='',$selected='')
-               {
-                       switch($format)
-                       {
-                               case 'select':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
-                                       break;
-                               case 'filter':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
-                                       break;
-                       }
-
-                       $categories= 
$this->so->select_category_workorder_list();
-
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['name'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
-                       return $category_list;
-               }
-
-
                function read($start_date='',$end_date='',$allrows='')
                {
                        $start_date     = 
$this->bocommon->date_to_timestamp($start_date);
Index: property/inc/class.soactor.inc.php
diff -u property/inc/class.soactor.inc.php:1.14 
property/inc/class.soactor.inc.php:1.15
--- property/inc/class.soactor.inc.php:1.14     Thu Mar  2 12:45:16 2006
+++ property/inc/class.soactor.inc.php  Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.soactor.inc.php,v 1.14 2006/03/02 12:45:16 
sigurdne Exp $
+       * @version $Id: class.soactor.inc.php,v 1.15 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -23,29 +23,14 @@
                function soactor()
                {
                        $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
                        $this->db               = $this->bocommon->new_db();
                        $this->db2              = $this->bocommon->new_db();
 
-                       $this->join                     = $this->bocommon->join;
+                       $this->join             = $this->bocommon->join;
                        $this->left_join        = $this->bocommon->left_join;
-                       $this->like                     = $this->bocommon->like;
-               }
-
-               function select_category_list()
-               {
-                       $table = 'fm_' . $this->role . '_category';
-                       $this->db->query("SELECT id,descr FROM $table  ORDER BY 
descr ");
-
-                       $i = 0;
-                       while ($this->db->next_record())
-                       {
-                               $categories[$i]['id']                           
= $this->db->f('id');
-                               $categories[$i]['name']                         
= stripslashes($this->db->f('descr'));
-                               $i++;
-                       }
-                       return $categories;
+                       $this->like             = $this->bocommon->like;
                }
 
                function read($data)
Index: property/inc/class.soagreement.inc.php
diff -u property/inc/class.soagreement.inc.php:1.14 
property/inc/class.soagreement.inc.php:1.15
--- property/inc/class.soagreement.inc.php:1.14 Fri Mar 10 14:40:11 2006
+++ property/inc/class.soagreement.inc.php      Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.soagreement.inc.php,v 1.14 2006/03/10 14:40:11 
sigurdne Exp $
+       * @version $Id: class.soagreement.inc.php,v 1.15 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -34,21 +34,6 @@
 //                     $this->role             = 'agreement';
                }
 
-               function select_category_list()
-               {
-                       $table = 'fm_branch';
-                       $this->db->query("SELECT id,descr FROM $table  ORDER BY 
descr ");
-
-                       $i = 0;
-                       while ($this->db->next_record())
-                       {
-                               $categories[$i]['id']                           
= $this->db->f('id');
-                               $categories[$i]['name']                         
= stripslashes($this->db->f('descr'));
-                               $i++;
-                       }
-                       return $categories;
-               }
-
                function select_vendor_list()
                {
                        $table = 'fm_agreement';
Index: property/inc/class.socategory.inc.php
diff -u property/inc/class.socategory.inc.php:1.15 
property/inc/class.socategory.inc.php:1.16
--- property/inc/class.socategory.inc.php:1.15  Wed Apr 12 10:24:43 2006
+++ property/inc/class.socategory.inc.php       Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.socategory.inc.php,v 1.15 2006/04/12 10:24:43 
sigurdne Exp $
+       * @version $Id: class.socategory.inc.php,v 1.16 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -117,6 +117,9 @@
                                case 'request':
                                        $table='fm_request_category';
                                        break;
+                               case 'project':
+                                       $table='fm_workorder_category';
+                                       break;
                                case 'wo':
                                        $table='fm_workorder_category';
                                        break;
@@ -162,6 +165,9 @@
                                case 'b_account':
                                        $table='fm_b_account_category';
                                        break;
+                               case 'branch':
+                                       $table='fm_branch';
+                                       break;
 
                        }
 
Index: property/inc/class.socommon.inc.php
diff -u property/inc/class.socommon.inc.php:1.18 
property/inc/class.socommon.inc.php:1.19
--- property/inc/class.socommon.inc.php:1.18    Wed Mar  1 19:30:04 2006
+++ property/inc/class.socommon.inc.php Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage core
-       * @version $Id: class.socommon.inc.php,v 1.18 2006/03/01 19:30:04 
sigurdne Exp $
+       * @version $Id: class.socommon.inc.php,v 1.19 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -321,21 +321,6 @@
                        return $next_id;
                }
 
-               function select_wo_hours_category_list()
-               {
-                       $this->db->query("SELECT id, descr FROM 
fm_wo_hours_category ORDER BY id ");
-
-                       $i = 0;
-                       while ($this->db->next_record())
-                       {
-                               $category_list[$i]['id'] = $this->db->f('id');
-                               $category_list[$i]['name'] = 
stripslashes($this->db->f('descr'));
-                               $i++;
-                       }
-
-                       return $category_list;
-               }
-
                function new_db()
                {
                        $db = CreateObject('phpgwapi.db');
Index: property/inc/class.sodocument.inc.php
diff -u property/inc/class.sodocument.inc.php:1.10 
property/inc/class.sodocument.inc.php:1.11
--- property/inc/class.sodocument.inc.php:1.10  Mon Mar  6 14:02:19 2006
+++ property/inc/class.sodocument.inc.php       Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage document
-       * @version $Id: class.sodocument.inc.php,v 1.10 2006/03/06 14:02:19 
sigurdne Exp $
+       * @version $Id: class.sodocument.inc.php,v 1.11 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -36,19 +36,6 @@
                        $this->like                     = $this->socommon->like;
                }
 
-               function select_doc_type_list()
-               {
-                       $this->db->query("SELECT id, descr FROM 
fm_document_category  ORDER BY descr ");
-
-                       $i = 0;
-                       while ($this->db->next_record())
-                       {
-                               $categories[$i]['id']                           
= $this->db->f('id');
-                               $categories[$i]['name']                         
= stripslashes($this->db->f('descr'));
-                               $i++;
-                       }
-                       return $categories;
-               }
 
                function read_single_category($id='')
                {
Index: property/inc/class.soinvestment.inc.php
diff -u property/inc/class.soinvestment.inc.php:1.8 
property/inc/class.soinvestment.inc.php:1.9
--- property/inc/class.soinvestment.inc.php:1.8 Mon Jan 30 22:14:19 2006
+++ property/inc/class.soinvestment.inc.php     Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage eco
-       * @version $Id: class.soinvestment.inc.php,v 1.8 2006/01/30 22:14:19 
sigurdne Exp $
+       * @version $Id: class.soinvestment.inc.php,v 1.9 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -36,7 +36,7 @@
                        {
                                $type_list[] = Array(
                                        'id'        => 
$this->db->f('entity_type'),
-                                       'num'       => 
lang($this->db->f('entity_type'))
+                                       'name'       => 
lang($this->db->f('entity_type'))
                                );
                        }
                        return $type_list;
Index: property/inc/class.soinvoice.inc.php
diff -u property/inc/class.soinvoice.inc.php:1.19 
property/inc/class.soinvoice.inc.php:1.20
--- property/inc/class.soinvoice.inc.php:1.19   Mon Jan 30 22:14:19 2006
+++ property/inc/class.soinvoice.inc.php        Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage eco
-       * @version $Id: class.soinvoice.inc.php,v 1.19 2006/01/30 22:14:19 
sigurdne Exp $
+       * @version $Id: class.soinvoice.inc.php,v 1.20 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -449,13 +449,13 @@
 
                        if($b_account_class)
                        {
-                               $filtermethod= " $where 
fm_b_account.grouping='$b_account_class'";
+                               $filtermethod= " $where 
fm_b_account.category='$b_account_class'";
                                $where= 'AND';
                        }
                        else
                        {
-                               $select_account_class=',fm_b_account.grouping 
as b_account_class';
-                               $group_account_class=', 
spbudact_code,fm_b_account.grouping';
+                               $select_account_class=',fm_b_account.category 
as b_account_class';
+                               $group_account_class=', 
spbudact_code,fm_b_account.category';
                        }
 
                        if ($vendor_id)
@@ -798,7 +798,7 @@
                        {
                                $art_list[] = Array(
                                        'id'        => $this->db->f('id'),
-                                       'num'       => $this->db->f('name')
+                                       'name'       => $this->db->f('name')
                                );
                        }
 
@@ -814,7 +814,7 @@
                        {
                                $art_list[] = Array(
                                        'id'        => $this->db->f('id'),
-                                       'num'       => $this->db->f('name')
+                                       'name'       => $this->db->f('name')
                                );
                        }
                        return $art_list;
@@ -828,7 +828,7 @@
                        {
                                $dimb_list[] = Array(
                                        'id'        => $this->db->f('id'),
-                                       'num'       => $this->db->f('name')
+                                       'name'       => $this->db->f('name')
                                );
                        }
                        return $dimb_list;
@@ -842,7 +842,7 @@
                        {
                                $dimd_list[] = Array(
                                        'id'        => $this->db->f('id'),
-                                       'num'       => $this->db->f('name')
+                                       'name'       => $this->db->f('name')
                                );
                        }
                        return $dimd_list;
@@ -856,7 +856,7 @@
                        {
                                $tax_code_list[] = Array(
                                        'id'        => $this->db->f('id'),
-                                       'num'       => $this->db->f('name')
+                                       'name'       => $this->db->f('name')
                                );
                        }
                        return $tax_code_list;
@@ -891,13 +891,13 @@
 
                function select_account_class()
                {
-                       $sql = "SELECT DISTINCT grouping as id from 
fm_b_account ";
+                       $sql = "SELECT DISTINCT category from fm_b_account ";
                        $this->db->query($sql,__LINE__,__FILE__);
 
                        while ($this->db->next_record())
                        {
                                $class[] = Array(
-                                       'id'        => $this->db->f('id')
+                                       'id'    => $this->db->f('category')
                                );
                        }
                        return $class;
Index: property/inc/class.solocation.inc.php
diff -u property/inc/class.solocation.inc.php:1.28 
property/inc/class.solocation.inc.php:1.29
--- property/inc/class.solocation.inc.php:1.28  Thu Mar  9 13:07:12 2006
+++ property/inc/class.solocation.inc.php       Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage location
-       * @version $Id: class.solocation.inc.php,v 1.28 2006/03/09 13:07:12 
sigurdne Exp $
+       * @version $Id: class.solocation.inc.php,v 1.29 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -154,28 +154,6 @@
                        }
                }
 
-
-               function select_category_list($type_id='')
-               {
-                       if (!$type_id)
-                       {
-                               return;
-                       }
-
-                       $table= 'fm_location'. $type_id . '_category';
-                       $this->db->query("SELECT id, descr FROM $table where id 
>'0' ORDER BY id asc ");
-
-                       $i = 0;
-                       while ($this->db->next_record())
-                       {
-                               $categories[$i]['id']                           
= $this->db->f('id');
-                               $categories[$i]['name']                         
= stripslashes($this->db->f('descr'));
-                               $i++;
-                       }
-                       return $categories;
-               }
-
-
                function read($data)
                {
                        if(is_array($data))
Index: property/inc/class.soproject.inc.php
diff -u property/inc/class.soproject.inc.php:1.27 
property/inc/class.soproject.inc.php:1.28
--- property/inc/class.soproject.inc.php:1.27   Thu Mar 16 19:28:42 2006
+++ property/inc/class.soproject.inc.php        Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.soproject.inc.php,v 1.27 2006/03/16 19:28:42 
sigurdne Exp $
+       * @version $Id: class.soproject.inc.php,v 1.28 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -42,21 +42,6 @@
                }
 
 
-               function select_category_workorder_list()
-               {
-
-                       $this->db->query("SELECT id, descr FROM 
fm_workorder_category  ORDER BY descr ");
-
-                       $i = 0;
-                       while ($this->db->next_record())
-                       {
-                               $categories[$i]['id']                           
= $this->db->f('id');
-                               $categories[$i]['name']                         
= stripslashes($this->db->f('descr'));
-                               $i++;
-                       }
-                       return $categories;
-               }
-
                function read_single_project_category($id='')
                {
                        $this->db->query("SELECT descr FROM 
fm_workorder_category where id='$id' ");
Index: property/inc/class.sor_agreement.inc.php
diff -u property/inc/class.sor_agreement.inc.php:1.13 
property/inc/class.sor_agreement.inc.php:1.14
--- property/inc/class.sor_agreement.inc.php:1.13       Tue Feb 21 19:40:19 2006
+++ property/inc/class.sor_agreement.inc.php    Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.sor_agreement.inc.php,v 1.13 2006/02/21 19:40:19 
sigurdne Exp $
+       * @version $Id: class.sor_agreement.inc.php,v 1.14 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -33,21 +33,6 @@
                        $this->like                     = $this->bocommon->like;
                }
 
-               function select_category_list()
-               {
-                       $table = 'fm_r_agreement' . '_category';
-                       $this->db->query("SELECT id,descr FROM $table  ORDER BY 
descr ");
-
-                       $i = 0;
-                       while ($this->db->next_record())
-                       {
-                               $categories[$i]['id']                           
= $this->db->f('id');
-                               $categories[$i]['name']                         
= stripslashes($this->db->f('descr'));
-                               $i++;
-                       }
-                       return $categories;
-               }
-
                function select_vendor_list()
                {
                        return ;
Index: property/inc/class.sorequest.inc.php
diff -u property/inc/class.sorequest.inc.php:1.14 
property/inc/class.sorequest.inc.php:1.15
--- property/inc/class.sorequest.inc.php:1.14   Thu Feb  9 13:22:56 2006
+++ property/inc/class.sorequest.inc.php        Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.sorequest.inc.php,v 1.14 2006/02/09 13:22:56 
sigurdne Exp $
+       * @version $Id: class.sorequest.inc.php,v 1.15 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -31,19 +31,6 @@
                        $this->like                     = $this->bocommon->like;
                }
 
-               function select_category_workorder_list()
-               {
-                       $this->db->query("SELECT id, descr FROM 
fm_workorder_category  ORDER BY descr ");
-                       $i = 0;
-                       while ($this->db->next_record())
-                       {
-                               $categories[$i]['id']                           
= $this->db->f('id');
-                               $categories[$i]['name']                         
= stripslashes($this->db->f('descr'));
-                               $i++;
-                       }
-                       return $categories;
-               }
-
                function read_priority_key()
                {
                        $this->db->query("SELECT * FROM 
fm_request_condition_type",__LINE__,__FILE__);
Index: property/inc/class.sos_agreement.inc.php
diff -u property/inc/class.sos_agreement.inc.php:1.20 
property/inc/class.sos_agreement.inc.php:1.21
--- property/inc/class.sos_agreement.inc.php:1.20       Tue Feb 14 19:32:20 2006
+++ property/inc/class.sos_agreement.inc.php    Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.sos_agreement.inc.php,v 1.20 2006/02/14 19:32:20 
sigurdne Exp $
+       * @version $Id: class.sos_agreement.inc.php,v 1.21 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -33,21 +33,6 @@
                        $this->like                     = $this->bocommon->like;
                }
 
-               function select_category_list()
-               {
-                       $table = 'fm_s_agreement' . '_category';
-                       $this->db->query("SELECT id,descr FROM $table  ORDER BY 
descr ");
-
-                       $i = 0;
-                       while ($this->db->next_record())
-                       {
-                               $categories[$i]['id']                           
= $this->db->f('id');
-                               $categories[$i]['name']                         
= stripslashes($this->db->f('descr'));
-                               $i++;
-                       }
-                       return $categories;
-               }
-
                function select_vendor_list()
                {
                        $table = 'fm_s_agreement';
Index: property/inc/class.sotemplate.inc.php
diff -u property/inc/class.sotemplate.inc.php:1.7 
property/inc/class.sotemplate.inc.php:1.8
--- property/inc/class.sotemplate.inc.php:1.7   Mon Jan 30 22:14:19 2006
+++ property/inc/class.sotemplate.inc.php       Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.sotemplate.inc.php,v 1.7 2006/01/30 22:14:19 
sigurdne Exp $
+       * @version $Id: class.sotemplate.inc.php,v 1.8 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -251,6 +251,7 @@
 
                function add_custom_hour($hour,$template_id)
                {
+                       $this->db->transaction_begin();
 
                        $hour['record'] = $this->next_record($template_id);
 
@@ -282,28 +283,36 @@
                                $hour['grouping_descr'] = $hour['new_grouping'];
                        }
 
-                       $this->db->query("insert into fm_template_hours 
(owner,hours_descr,unit,cost,quantity,billperae,ns3420_id,dim_d,"
+                       $values= array(
+                               $this->account,
+                               $this->db->db_addslashes($hour['descr']),
+                               $hour['unit'],
+                               $hour['cost'],
+                               $hour['quantity'],
+                               $hour['billperae'],
+                               $hour['ns3420_id'],
+                               $hour['dim_d'],
+                               $hour['grouping_id'],
+                               
$this->db->db_addslashes($hour['grouping_descr']),
+                               $hour['record'],
+                               $hour['building_part_id'],
+                               $hour['tolerance_id'],
+                               $this->db->db_addslashes($hour['remark']),
+                               time(),
+                               $template_id);
+
+
+                       $values = $this->bocommon->validate_db_insert($values);
+
+
+                       $this->db->query("INSERT INTO fm_template_hours 
(owner,hours_descr,unit,cost,quantity,billperae,ns3420_id,dim_d,"
                                . " 
grouping_id,grouping_descr,record,building_part,tolerance,remark,entry_date,template_id)
 "
-                               . " values ('" .
-                                       $this->account . "','" .
-                                       $hour['descr'] . "','" .
-                                       $hour['unit'] . "','" .
-                                       $hour['cost'] . "','" .
-                                       $hour['quantity'] . "','" .
-                                       $hour['billperae'] . "','" .
-                                       $hour['ns3420_id'] . "','" .
-                                       $hour['dim_d'] . "','" .
-                                       $hour['grouping_id'] . "','" .
-                                       $hour['grouping_descr'] . "','" .
-                                       $hour['record'] . "','" .
-                                       $hour['building_part_id'] . "','" .
-                                       $hour['tolerance_id'] . "','" .
-                                       $hour['remark'] . "','" .
-                                       time() . "','" .
-                                       $template_id . "')",__LINE__,__FILE__);
+                               . " VALUES ($values)",__LINE__,__FILE__);
 
                        $receipt['hour_id'] = 
$this->db->get_last_insert_id('fm_template_hours','id');
 
+                       $this->db->transaction_commit();
+
                        $receipt['message'][] = array('msg'=>lang('hour %1 is 
added!',$hour['record']));
 
                        return $receipt;
@@ -313,6 +322,8 @@
                function edit_hour($hour,$template_id)
                {
 
+                       $this->db->transaction_begin();
+
                        $hour['descr'] = 
$this->db->db_addslashes($hour['descr']);
                        $hour['remark'] = 
$this->db->db_addslashes($hour['remark']);
 
@@ -378,25 +389,32 @@
                        $this->db->next_record();
                        $hour['record'] = $this->db->f('record');
 
-                       $this->db->query("UPDATE fm_template_hours set
-                               hours_descr                     ='" . 
$hour['descr'] . "',
-                               remark                          ='" . 
$hour['remark'] . "',
-                               billperae                       ='" . 
$hour['billperae'] . "',
-                               unit                            ='" . 
$hour['unit'] . "',
-                               quantity                        ='" . 
$hour['quantity'] . "',
-                               cost                            ='" . 
$hour['cost'] . "',
-                               ns3420_id                       ='" . 
$hour['ns3420_id'] . "',
-                               tolerance                       ='" . 
$hour['tolerance_id'] . "',
-                               building_part           ='" . 
$hour['building_part_id'] . "',
-                               dim_d                           ='" . 
$hour['dim_d'] . "',
-                               grouping_id                     ='" . 
$hour['grouping_id'] . "',
-                               grouping_descr          ='" . 
$hour['grouping_descr']
-                               . "' WHERE id= '" . $hour['hour_id'] 
."'",__LINE__,__FILE__);
+
+                       $value_set=array(
+                               'hours_descr'           => $hour['descr'],
+                               'remark'                => $hour['remark'],
+                               'billperae'             => $hour['billperae'],
+                               'unit'                  => $hour['unit'],
+                               'quantity'              => $hour['quantity'],
+                               'cost'                  => $hour['cost'],
+                               'ns3420_id'             => $hour['ns3420_id'],
+                               'tolerance'             => 
$hour['tolerance_id'],
+                               'building_part'         => 
$hour['building_part_id'],
+                               'dim_d'                 => $hour['dim_d'],
+                               'grouping_id'           => $hour['grouping_id'],
+                               'grouping_descr'        => 
$hour['grouping_descr']
+                               );
+
+                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
+
+                       $this->db->query("UPDATE fm_template_hours set 
$value_set WHERE id= '" . $hour['hour_id'] ."'",__LINE__,__FILE__);
 
                        $receipt['hour_id'] = $hour['hour_id'];
+
+                       $this->db->transaction_commit();
+
                        $receipt['message'][] = array('msg'=>lang('hour %1 has 
been edited',$hour['record']));
                        return $receipt;
-
                }
 
                function get_grouping_list($template_id='')
@@ -406,8 +424,8 @@
                        $i = 0;
                        while ($this->db->next_record())
                        {
-                               $grouping_entries[$i]['id']                     
        = $this->db->f('grouping_id');
-                               $grouping_entries[$i]['name']                   
        = stripslashes($this->db->f('grouping_descr'));
+                               $grouping_entries[$i]['id']             = 
$this->db->f('grouping_id');
+                               $grouping_entries[$i]['name']           = 
stripslashes($this->db->f('grouping_descr'));
                                $i++;
                        }
                        return $grouping_entries;
@@ -415,19 +433,26 @@
 
                function add_template($values)
                {
-
+                       $this->db->transaction_begin();
                        $values['name'] = 
$this->db->db_addslashes($values['name']);
 
-                       $this->db->query("insert into fm_template 
(owner,name,descr,chapter_id,entry_date) "
-                               . " values ('" .
-                                       $this->account . "','" .
-                                       $values['name'] . "','" .
-                                       $values['descr'] . "','" .
-                                       $values['chapter_id'] . "','" .
-                                       time() . "')",__LINE__,__FILE__);
+                       $values= array(
+                               $this->account,
+                               $values['name'],
+                               $values['descr'],
+                               $values['chapter_id'],
+                               time()
+                               );
+
+                       $values = $this->bocommon->validate_db_insert($values);
+
+                       $this->db->query("INSERT INTO fm_template 
(owner,name,descr,chapter_id,entry_date) "
+                               . " VALUES ($values)",__LINE__,__FILE__);
 
                        $template_id = 
$this->db->get_last_insert_id('fm_template','id');
 
+                       $this->db->transaction_commit();
+
                        $receipt['template_id'] = $template_id;
                        $receipt['message'][] = array('msg'=>lang('template %1 
is added',$values['name']));
                        return $receipt;
@@ -438,22 +463,34 @@
                        $values['name'] = 
$this->db->db_addslashes($values['name']);
                        $values['descr'] = 
$this->db->db_addslashes($values['descr']);
 
-                       $this->db->query("UPDATE fm_template set name='" . 
$values['name'] . "', descr='" . $values['descr'] . "', chapter_id='"
-                                                       . 
(int)$values['chapter_id']
-                                                       . "' WHERE id='" . 
$values['template_id'] . "'",__LINE__,__FILE__);
+                       $this->db->transaction_begin();
+
+                       $value_set=array(
+                               'name'          =>$values['name'],
+                               'descr'         =>$values['descr'],
+                               'chapter_id'    =>$values['chapter_id']
+                               );
+
+                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
+
+                       $this->db->query("UPDATE fm_template set $value_set 
WHERE id='" . $values['template_id'] . "'",__LINE__,__FILE__);
 
-                       $receipt['message'][]=array('msg'=>lang('Property has 
been edited'));
+                       $this->db->transaction_commit();
+                       $receipt['message'][]=array('msg'=>lang('template has 
been edited'));
                        return $receipt;
                }
 
                function delete($id)
                {
+                       $this->db->transaction_begin();
                        $this->db->query("DELETE FROM fm_template WHERE 
id='$id'",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM fm_template_hours  WHERE 
template_id='$id'",__LINE__,__FILE__);
+                       $this->db->transaction_commit();
                }
 
                function delete_hour($hour_id,$template_id )
                {
+                       $this->db->transaction_begin();
                        $this->db->query("SELECT record FROM fm_template_hours 
where id ='$hour_id'",__LINE__,__FILE__);
                        $this->db->next_record();
                        $old_record     = $this->db->f('record');
@@ -464,6 +501,7 @@
                                $this->db->query("UPDATE fm_template_hours set 
record   = record - 1 where  template_id= '$template_id' and record > 
$old_record ",__LINE__,__FILE__);
                        }
 
+                       $this->db->transaction_commit();
                        $receipt['message'][] = array('msg'=>lang('hour %1 has 
been deleted',$hour_id));
                        return $receipt;
 
Index: property/inc/class.sotenant_claim.inc.php
diff -u property/inc/class.sotenant_claim.inc.php:1.9 
property/inc/class.sotenant_claim.inc.php:1.10
--- property/inc/class.sotenant_claim.inc.php:1.9       Mon Jan 30 22:14:19 2006
+++ property/inc/class.sotenant_claim.inc.php   Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.sotenant_claim.inc.php,v 1.9 2006/01/30 22:14:19 
sigurdne Exp $
+       * @version $Id: class.sotenant_claim.inc.php,v 1.10 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -29,20 +29,6 @@
                        $this->join                     = $this->bocommon->join;
                }
 
-               function select_category_list()
-               {
-                       $this->db->query("SELECT id,descr FROM 
fm_tenant_claim_category  ORDER BY descr ",__LINE__,__FILE__);
-
-                       $i = 0;
-                       while ($this->db->next_record())
-                       {
-                               $categories[$i]['id']           = 
$this->db->f('id');
-                               $categories[$i]['name']         = 
stripslashes($this->db->f('descr'));
-                               $i++;
-                       }
-                       return $categories;
-               }
-
                function read($data)
                {
                        if(is_array($data))
Index: property/inc/class.sotts.inc.php
diff -u property/inc/class.sotts.inc.php:1.15 
property/inc/class.sotts.inc.php:1.16
--- property/inc/class.sotts.inc.php:1.15       Sat Mar  4 19:48:39 2006
+++ property/inc/class.sotts.inc.php    Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage helpdesk
-       * @version $Id: class.sotts.inc.php,v 1.15 2006/03/04 19:48:39 sigurdne 
Exp $
+       * @version $Id: class.sotts.inc.php,v 1.16 2006/04/17 11:36:05 sigurdne 
Exp $
        */
 
        /**
@@ -41,21 +41,6 @@
                        return stripslashes($this->db->f('descr'));
                }
 
-               function select_category_list()
-               {
-                       $this->db->query("SELECT id, descr FROM fm_tts_category 
 ORDER BY descr ");
-
-                       $i = 0;
-                       while ($this->db->next_record())
-                       {
-                               $categories[$i]['id']                           
= $this->db->f('id');
-                               $categories[$i]['name']                         
= stripslashes($this->db->f('descr'));
-                               $i++;
-                       }
-                       return $categories;
-               }
-
-
                function read($data)
                {
 
Index: property/inc/class.soworkorder.inc.php
diff -u property/inc/class.soworkorder.inc.php:1.14 
property/inc/class.soworkorder.inc.php:1.15
--- property/inc/class.soworkorder.inc.php:1.14 Mon Jan 30 22:14:19 2006
+++ property/inc/class.soworkorder.inc.php      Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.soworkorder.inc.php,v 1.14 2006/01/30 22:14:19 
sigurdne Exp $
+       * @version $Id: class.soworkorder.inc.php,v 1.15 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -52,20 +52,6 @@
                        return $id;
                }
 
-               function select_category_workorder_list()
-               {
-
-                       $this->db->query("SELECT id, descr FROM 
fm_workorder_category  ORDER BY descr ");
-
-                       $i = 0;
-                       while ($this->db->next_record())
-                       {
-                               $categories[$i]['id']                           
= $this->db->f('id');
-                               $categories[$i]['name']                         
= stripslashes($this->db->f('descr'));
-                               $i++;
-                       }
-                       return $categories;
-               }
 
                function read_single_project_category($id='')
                {
@@ -464,8 +450,14 @@
                        $workorder['descr'] = 
$this->db->db_addslashes($workorder['descr']);
                        $workorder['title'] = 
$this->db->db_addslashes($workorder['title']);
 
+                       if(!$workorder['workorder_num'])
+                       {
+                               $workorder['workorder_num'] = 
$workorder['workorder_id'];
+                       }
+                       
                        $values= array(
                                $workorder['workorder_id'],
+                               $workorder['workorder_num'],
                                $workorder['project_id'],
                                $workorder['title'],
                                'public',
@@ -488,7 +480,7 @@
 
                        $this->db->transaction_begin();
 
-                       $this->db->query("INSERT INTO fm_workorder 
(id,project_id,title,access,entry_date,start_date,end_date,status,"
+                       $this->db->query("INSERT INTO fm_workorder 
(id,num,project_id,title,access,entry_date,start_date,end_date,status,"
                                . 
"descr,budget,account_id,rig_addition,addition,key_deliver,key_fetch,vendor_id,charge_tenant,user_id)
 "
                                . "VALUES ( $values )",__LINE__,__FILE__);
 
Index: property/inc/class.uiactor.inc.php
diff -u property/inc/class.uiactor.inc.php:1.17 
property/inc/class.uiactor.inc.php:1.18
--- property/inc/class.uiactor.inc.php:1.17     Mon Mar 13 14:37:28 2006
+++ property/inc/class.uiactor.inc.php  Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.uiactor.inc.php,v 1.17 2006/03/13 14:37:28 
sigurdne Exp $
+       * @version $Id: class.uiactor.inc.php,v 1.18 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
 
@@ -333,7 +333,8 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the actor belongs to. To do not use a category select 
NO CATEGORY'),
                                'select_name'                                   
=> 'cat_id',
-                               'cat_list'                                      
        => $this->bo->select_category_list('filter',$this->cat_id),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'filter','selected' => 
$this->cat_id,'type' => $this->role,'order'=>'descr')),
+
                                'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
 
                                'lang_no_member'                                
=> lang('no member'),
@@ -486,7 +487,7 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the actor belongs to. To do not use a category select 
NO CATEGORY'),
                                'select_name'                                   
=> 'values[cat_id]',
-                               'cat_list'                                      
        => $this->bo->select_category_list('select',$this->cat_id),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$this->cat_id,'type' => $this->role,'order'=>'descr')),
 
                                'lang_member_of'                                
=> lang('member of'),
                                'member_of_name'                                
=> 'member_id',
@@ -595,7 +596,8 @@
                                'lang_category'                         => 
lang('category'),
                                'lang_time_created'                     => 
lang('time created'),
                                'lang_done'                                     
=> lang('done'),
-                               'cat_list'                                      
=> $this->bo->select_category_list('',$actor['cat_id']),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$actor['cat_id'],'type' => $this->role,'order'=>'descr')),
+
                                'lang_member_of'                        => 
lang('member of'),
                                'member_of_list'                        => 
$member_of_data['cat_list'],
 
Index: property/inc/class.uiadmin.inc.php
diff -u property/inc/class.uiadmin.inc.php:1.13 
property/inc/class.uiadmin.inc.php:1.14
--- property/inc/class.uiadmin.inc.php:1.13     Thu Mar 23 09:18:55 2006
+++ property/inc/class.uiadmin.inc.php  Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.uiadmin.inc.php,v 1.13 2006/03/23 09:18:55 
sigurdne Exp $
+       * @version $Id: class.uiadmin.inc.php,v 1.14 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -227,9 +227,9 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the permissions belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'cat_id',
-                               'cat_list'                                      
        => $this->bo->select_category_list('filter',$this->cat_id),
+                               'cat_list'                                      
=> $this->bo->select_category_list('filter',$this->cat_id),
                                'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'cat_id'                                        
        => $this->cat_id,
+                               'cat_id'                                        
=> $this->cat_id,
                                'permission'                                    
=> False,
                                'grant'                                         
        => 1,
 
@@ -491,9 +491,9 @@
                                'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
 
                                'lang_no_cat'                                   
=> lang('no category'),
-                               'lang_cat_statustext'                   => 
lang('Select the category the permissions belongs to. To do not use a category 
select NO CATEGORY'),
+                               'lang_cat_statustext'                           
=> lang('Select the category the permissions belongs to. To do not use a 
category select NO CATEGORY'),
                                'select_name'                                   
=> 'cat_id',
-                               'cat_list'                                      
        => $this->bo->select_category_list('filter',$this->cat_id),
+                               'cat_list'                                      
=> $this->bo->select_category_list('filter',$this->cat_id),
                                'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'cat_id'                                        
        => $this->cat_id,
                                'permission'                                    
=> 1,
Index: property/inc/class.uiagreement.inc.php
diff -u property/inc/class.uiagreement.inc.php:1.21 
property/inc/class.uiagreement.inc.php:1.22
--- property/inc/class.uiagreement.inc.php:1.21 Mon Mar 13 14:37:28 2006
+++ property/inc/class.uiagreement.inc.php      Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.uiagreement.inc.php,v 1.21 2006/03/13 14:37:28 
sigurdne Exp $
+       * @version $Id: class.uiagreement.inc.php,v 1.22 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -361,7 +361,8 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the agreement belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'cat_id',
-                               'cat_list'                                      
        => $this->bo->select_category_list('filter',$this->cat_id),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'filter','selected' => 
$this->cat_id,'type' =>'branch','order'=>'descr')),
+
                                'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
 
                                'lang_no_vendor'                                
=> lang('no vendor'),
@@ -534,7 +535,7 @@
                                'lang_descr'                                    
=> lang('descr'),
                                'value_descr'                                   
=> $agreement['descr'],
                                'lang_select_all'                               
=> lang('Select All'),
-                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.gif',
+                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
                                'check_source'                                  
=> './'.$this->currentapp.'/inc/check.js',
                                'add_action'                                    
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiagreement.add_activity&group_id='
 . $group_id . '&agreement_id=' . $agreement_id),
                                'agreement_id'                                  
=> $agreement_id,
@@ -988,7 +989,7 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the agreement belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'values[cat_id]',
-                               'cat_list'                                      
        => $this->bo->select_category_list('select',$this->cat_id),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$this->cat_id,'type' =>'branch','order'=>'descr')),
 
                                'lang_member_of'                                
=> lang('member of'),
                                'member_of_name'                                
=> 'member_id',
@@ -1037,7 +1038,7 @@
                                'table_update'                                  
=> $table_update,
                                'update_action'                                 
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiagreement.edit&id='
 . $id),
                                'lang_select_all'                               
=> lang('Select All'),
-                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.gif',
+                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
                                'check_source'                                  
=> './'.$this->currentapp.'/inc/check.js',
                                'check_all_script'                              
=> $check_all_script,
                                'set_column'                                    
=> $set_column,
@@ -1301,7 +1302,7 @@
                                'table_update'                                  
=> $table_update,
                                'update_action'                                 
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiagreement.edit_item&agreement_id='
 . $agreement_id . '&id=' . $id),
                                'lang_select_all'                               
=> lang('Select All'),
-                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.gif',
+                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
                                'check_source'                                  
=> './'.$this->currentapp.'/inc/check.js',
 
                                'lang_m_cost'                                   
=> lang('Material cost'),
@@ -1579,7 +1580,7 @@
                                'lang_apply'                                    
=> lang('apply'),
                                'value_cat'                                     
        => $agreement['cat'],
                                'lang_cancel_statustext'                => 
lang('return back to the list'),
-                               'cat_list'                                      
        => $this->bo->select_category_list('select',$this->cat_id),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$this->cat_id,'type' =>'branch','order'=>'descr')),
 
                                'lang_member_of'                                
=> lang('member of'),
                                'member_of_name'                                
=> 'member_id',
Index: property/inc/class.uidocument.inc.php
diff -u property/inc/class.uidocument.inc.php:1.12 
property/inc/class.uidocument.inc.php:1.13
--- property/inc/class.uidocument.inc.php:1.12  Fri Feb  3 12:05:49 2006
+++ property/inc/class.uidocument.inc.php       Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage document
-       * @version $Id: class.uidocument.inc.php,v 1.12 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.uidocument.inc.php,v 1.13 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -269,6 +269,7 @@
                        {
                                $boentity               = 
CreateObject($this->currentapp.'.boentity');
                                $boentity->entity_id=$this->entity_id;
+
                                $cat_list       = 
$this->bo->select_category_list('filter',$this->cat_id);
                                $entity         = 
$this->boadmin_entity->read_single($this->entity_id,false);
                                $appname_sub    = $entity['name'];
@@ -301,12 +302,11 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category. To do not use a category select NO CATEGORY'),
                                'select_name'                                   
=> 'cat_id',
-                               'cat_list'                                      
        => $cat_list,
+                               '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),
-
+                               'doc_type'                                      
=> $this->bocommon->select_category_list(array('format'=>'filter','selected' => 
$this->doc_type,'type' =>'document','order'=>'descr')),
 
                                'lang_status_statustext'                => 
lang('Select the status the document belongs to. To do not use a category 
select NO STATUS'),
                                'status_name'                                   
=> 'status_id',
@@ -561,7 +561,7 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the document belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'doc_type',
-                               'cat_list'                                      
        => $this->bo->select_doc_type_list('filter',$this->doc_type),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'filter','selected' => 
$this->doc_type,'type' =>'document','order'=>'descr')),
 
 //                             'district_list'                                 
=> $this->bocommon->select_district_list('filter',$this->district_id),
 //                             'lang_no_district'                              
=> lang('no district'),
@@ -973,7 +973,7 @@
                                'lang_cat_statustext'                   => 
lang('Select the category the document belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'values[doc_type]',
                                'value_cat_id'                                  
=> $values['doc_type'],
-                               'cat_list'                                      
        => $this->bo->select_doc_type_list('select',$values['doc_type']),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$values['doc_type'],'type' =>'document','order'=>'descr')),
 
                                'lang_coordinator'                              
=> lang('Coordinator'),
                                'lang_user_statustext'                  => 
lang('Select the coordinator the document belongs to. To do not use a category 
select NO USER'),
@@ -1157,7 +1157,7 @@
                                'lang_cat_statustext'                   => 
lang('Select the category the document belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'values[doc_type]',
                                'value_cat_id'                                  
=> $values['doc_type'],
-                               'cat_list'                                      
        => $this->bo->select_doc_type_list('select',$values['doc_type']),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$values['doc_type'],'type' =>'document','order'=>'descr')),
 
                                'lang_coordinator'                              
=> lang('Coordinator'),
                                'lang_user_statustext'                  => 
lang('Select the coordinator the document belongs to. To do not use a category 
select NO USER'),
Index: property/inc/class.uientity.inc.php
diff -u property/inc/class.uientity.inc.php:1.21 
property/inc/class.uientity.inc.php:1.22
--- property/inc/class.uientity.inc.php:1.21    Fri Mar 24 19:30:21 2006
+++ property/inc/class.uientity.inc.php Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage entity
-       * @version $Id: class.uientity.inc.php,v 1.21 2006/03/24 19:30:21 
sigurdne Exp $
+       * @version $Id: class.uientity.inc.php,v 1.22 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -676,6 +676,7 @@
                                {
                                        $receipt        = 
$this->bo->create_home_dir($receipt);
                                        $receipt = 
$this->bo->save($values,$values_attribute,$action,$this->entity_id,$this->cat_id);
+
                                        $id = $values['id'];
                                        $function_msg = lang('edit entity');
 
Index: property/inc/class.uiinvestment.inc.php
diff -u property/inc/class.uiinvestment.inc.php:1.11 
property/inc/class.uiinvestment.inc.php:1.12
--- property/inc/class.uiinvestment.inc.php:1.11        Fri Mar 10 14:40:11 2006
+++ property/inc/class.uiinvestment.inc.php     Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage eco
-       * @version $Id: class.uiinvestment.inc.php,v 1.11 2006/03/10 14:40:11 
sigurdne Exp $
+       * @version $Id: class.uiinvestment.inc.php,v 1.12 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -241,7 +241,7 @@
 //                             'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'form_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiinvestment.index'),
                                'lang_select_all'                               
=> lang('Select All'),
-                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.gif',
+                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
                                'check_source'                                  
=> './'.$this->currentapp.'/inc/check.js',
                                'allow_allrows'                                 
=> true,
                                'allrows'                                       
        => $this->allrows,
Index: property/inc/class.uiinvoice.inc.php
diff -u property/inc/class.uiinvoice.inc.php:1.23 
property/inc/class.uiinvoice.inc.php:1.24
--- property/inc/class.uiinvoice.inc.php:1.23   Mon Mar 13 14:37:28 2006
+++ property/inc/class.uiinvoice.inc.php        Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage eco
-       * @version $Id: class.uiinvoice.inc.php,v 1.23 2006/03/13 14:37:28 
sigurdne Exp $
+       * @version $Id: class.uiinvoice.inc.php,v 1.24 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -400,7 +400,7 @@
                                $data['user_list']                              
                = 
$this->bo->get_invoice_user_list('filter',$this->user_lid,array('all'),$default='none');
                                $data['cat_list']                               
                = $this->bo->select_category('filter',$this->cat_id);
                                $data['table_done']                             
                = $table_done;
-                               $data['img_check']                              
                = 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.gif';
+                               $data['img_check']                              
                = 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png';
                                $data['check_source']                           
        = './'.$this->currentapp.'/inc/check.js';
                                $data['lang_save']                              
                = lang('save');
                                $data['done_action']                            
        = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiinvoice.index');
@@ -576,7 +576,7 @@
 
                        $data = array
                        (
-                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.gif',
+                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
                                'check_source'                                  
=> './'.$this->currentapp.'/inc/check.js',
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'sum'                                           
        => number_format($sum, 2, ',', ''),
Index: property/inc/class.uilocation.inc.php
diff -u property/inc/class.uilocation.inc.php:1.25 
property/inc/class.uilocation.inc.php:1.26
--- property/inc/class.uilocation.inc.php:1.25  Tue Apr 11 15:09:01 2006
+++ property/inc/class.uilocation.inc.php       Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage location
-       * @version $Id: class.uilocation.inc.php,v 1.25 2006/04/11 15:09:01 
sigurdne Exp $
+       * @version $Id: class.uilocation.inc.php,v 1.26 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -409,9 +409,9 @@
                                'select_district_name'                  => 
'district_id',
 
                                'lang_no_cat'                                   
=> lang('no category'),
-                               'lang_cat_statustext'                   => 
lang('Select the category the location belongs to. To do not use a category 
select NO CATEGORY'),
+                               'lang_cat_statustext'                           
=> lang('Select the category the location belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'cat_id',
-                               'cat_list'                                      
        => $this->bo->select_category_list('filter',$this->cat_id,$type_id),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'filter','selected' => 
$this->cat_id,'type' =>'location','type_id' =>$type_id,'order'=>'descr')),
                                'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'owner_name'                                    
=> 'filter',
                                'owner_list'                                    
=> $owner_list,
@@ -970,7 +970,7 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the location belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'cat_id',
-                               'cat_list'                                      
        => $this->bo->select_category_list('select',$values['cat_id'],$type_id)
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$values['cat_id'],'type' =>'location','type_id' =>$type_id,'order'=>'descr')),
                        );
 
                        $appname                                                
= lang('location');
@@ -1368,7 +1368,7 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the location belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'cat_id',
-                               'cat_list'                                      
        => $this->bo->select_category_list('select',$values['cat_id'],$type_id)
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$values['cat_id'],'type' =>'location','type_id' =>$type_id,'order'=>'descr')),
                        );
 
                        $appname                                                
= lang('location');
Index: property/inc/class.uipricebook.inc.php
diff -u property/inc/class.uipricebook.inc.php:1.15 
property/inc/class.uipricebook.inc.php:1.16
--- property/inc/class.uipricebook.inc.php:1.15 Fri Mar 10 14:40:11 2006
+++ property/inc/class.uipricebook.inc.php      Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.uipricebook.inc.php,v 1.15 2006/03/10 14:40:11 
sigurdne Exp $
+       * @version $Id: class.uipricebook.inc.php,v 1.16 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -286,7 +286,7 @@
                                'num_records'                                   
=> count($pricebook_list),
                                'all_records'                                   
=> $this->bo->total_records,
                                'lang_select_all'                               
=> lang('Select All'),
-                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.gif',
+                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
                                'check_source'                                  
=> './'.$this->currentapp.'/inc/check.js',
                                'link_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
@@ -404,7 +404,7 @@
                                'num_records'                                   
=> count($agreement_list),
                                'all_records'                                   
=> $this->bo->total_records,
                                'lang_select_all'                               
=> lang('Select All'),
-                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.gif',
+                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
                                'check_source'                                  
=> './'.$this->currentapp.'/inc/check.js',
                                'link_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
Index: property/inc/class.uiproject.inc.php
diff -u property/inc/class.uiproject.inc.php:1.25 
property/inc/class.uiproject.inc.php:1.26
--- property/inc/class.uiproject.inc.php:1.25   Fri Mar 10 14:40:11 2006
+++ property/inc/class.uiproject.inc.php        Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.uiproject.inc.php,v 1.25 2006/03/10 14:40:11 
sigurdne Exp $
+       * @version $Id: class.uiproject.inc.php,v 1.26 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -390,7 +390,7 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the project belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'cat_id',
-                               'cat_list'                                      
        => $this->bo->select_category_project_list('filter',$this->cat_id),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'filter','selected' => 
$this->cat_id,'type' =>'project','order'=>'descr')),
                                'district_list'                                 
=> $this->bocommon->select_district_list('filter',$this->district_id),
                                'lang_no_district'                              
=> lang('no district'),
                                'lang_district_statustext'              => 
lang('Select the district the selection belongs to. To do not use a district 
select NO DISTRICT'),
@@ -402,22 +402,22 @@
                                'lang_no_status'                                
=> lang('No status'),
                                'status_list'                                   
=> $this->bo->select_status_list('filter',$this->status_id),
 
-                               'lang_wo_hour_cat_statustext'           => 
lang('Select the workorder hour category'),
-                               'lang_no_wo_hour_cat'                   => 
lang('no hour category'),
-                               'wo_hour_cat_list'                              
=> $this->bocommon->select_wo_hours_category_list($this->wo_hour_cat_id),
+                               'lang_wo_hour_cat_statustext'                   
=> lang('Select the workorder hour category'),
+                               'lang_no_wo_hour_cat'                           
=> lang('no hour category'),
+                               'wo_hour_cat_list'                              
=> $this->bocommon->select_category_list(array('format'=>'filter','selected' => 
$this->wo_hour_cat_id,'type' =>'wo_hours','order'=>'id')),
 
-                               'lang_user_statustext'                  => 
lang('Select the user the project belongs to. To do not use a category select 
NO USER'),
+                               'lang_user_statustext'                          
=> lang('Select the user the project 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_right2('filter',4,$this->filter,$this->acl2_location,array('all'),$default=$this->account),
+                               'user_list'                                     
=> 
$this->bocommon->get_user_list_right2('filter',4,$this->filter,$this->acl2_location,array('all'),$default=$this->account),
 
-                               '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'),
+                               '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'),
                                'query'                                         
        => $this->query,
                                'lang_search'                                   
=> lang('search'),
                                'table_header'                                  
=> $table_header,
-                               'values'                                        
        => $content,
-                               'table_add'                                     
        => $table_add
+                               'values'                                        
=> $content,
+                               'table_add'                                     
=> $table_add
                        );
 
                        $appname                                                
= lang('Project');
@@ -1022,7 +1022,7 @@
                                'lang_cat_statustext'                   => 
lang('Select the category the project belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'values[cat_id]',
                                'value_cat_id'                                  
=> $values['cat_id'],
-                               'cat_list'                                      
        => $this->bo->select_category_project_list('select',$values['cat_id']),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$values['cat_id'],'type' =>'project','order'=>'descr')),
 
                                'lang_workorder_id'                             
=> lang('Workorder ID'),
                                'sum_workorder_budget'                  => 
$values['sum_workorder_budget'],
@@ -1278,7 +1278,7 @@
                                'value_descr'                                   
=> $values['descr'],
                                'lang_done_statustext'                  => 
lang('Back to the list'),
                                'select_name'                                   
=> 'values[cat_id]',
-                               'cat_list'                                      
        => $this->bo->select_category_project_list('select',$values['cat_id']),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$values['cat_id'],'type' =>'project','order'=>'descr')),
 
                                'lang_workorder_id'                             
=> lang('Workorder ID'),
                                'sum_workorder_budget'                  => 
$values['sum_workorder_budget'],
Index: property/inc/class.uir_agreement.inc.php
diff -u property/inc/class.uir_agreement.inc.php:1.14 
property/inc/class.uir_agreement.inc.php:1.15
--- property/inc/class.uir_agreement.inc.php:1.14       Mon Mar 13 14:37:28 2006
+++ property/inc/class.uir_agreement.inc.php    Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.uir_agreement.inc.php,v 1.14 2006/03/13 14:37:28 
sigurdne Exp $
+       * @version $Id: class.uir_agreement.inc.php,v 1.15 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -365,9 +365,10 @@
                                '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'),
-                               'lang_cat_statustext'                   => 
lang('Select the category the r_agreement belongs to. To do not use a category 
select NO CATEGORY'),
+                               'lang_cat_statustext'                           
=> lang('Select the category the r_agreement belongs to. To do not use a 
category select NO CATEGORY'),
                                'select_name'                                   
=> 'cat_id',
-                               'cat_list'                                      
        => $this->bo->select_category_list('select',$this->cat_id),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$this->cat_id,'type' =>'r_agreement','order'=>'descr')),
+
                                'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
 
 //                             'lang_no_vendor'                                
=> lang('no vendor'),
@@ -930,7 +931,7 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the r_agreement belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'values[cat_id]',
-                               'cat_list'                                      
        => $this->bo->select_category_list('select',$this->cat_id),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$this->cat_id,'type' =>'r_agreement','order'=>'descr')),
 
                                'lang_member_of'                                
=> lang('member of'),
                                'member_of_name'                                
=> 'member_id',
@@ -983,7 +984,7 @@
                                'table_update'                                  
=> $table_update,
                                'update_action'                                 
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uir_agreement.edit&id='
 . $id),
                                'lang_select_all'                               
=> lang('Select All'),
-                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.gif',
+                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
                                'check_source'                                  
=> './'.$this->currentapp.'/inc/check.js',
                                'check_all_script'                              
=> $check_all_script,
                                'set_column'                                    
=> $set_column,
@@ -1302,7 +1303,7 @@
                                'table_update_item'                             
        => $table_update,
                                'update_action'                                 
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uir_agreement.edit_item&r_agreement_id='
 . $r_agreement_id . '&id=' . $id),
                                'lang_select_all'                               
=> lang('Select All'),
-                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.gif',
+                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
                                'check_source'                                  
=> './'.$this->currentapp.'/inc/check.js',
                                'location_data'                                 
=> $location_data,
 
@@ -1594,7 +1595,7 @@
                                'lang_apply'                                    
=> lang('apply'),
                                'value_cat'                                     
        => $r_agreement['cat'],
                                'lang_cancel_statustext'                => 
lang('return back to the list'),
-                               'cat_list'                                      
        => $this->bo->select_category_list('select',$this->cat_id),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$this->cat_id,'type' =>'r_agreement','order'=>'descr')),
 
                                'lang_member_of'                                
=> lang('member of'),
                                'member_of_name'                                
=> 'member_id',
Index: property/inc/class.uirequest.inc.php
diff -u property/inc/class.uirequest.inc.php:1.21 
property/inc/class.uirequest.inc.php:1.22
--- property/inc/class.uirequest.inc.php:1.21   Fri Mar 10 14:40:11 2006
+++ property/inc/class.uirequest.inc.php        Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.uirequest.inc.php,v 1.21 2006/03/10 14:40:11 
sigurdne Exp $
+       * @version $Id: class.uirequest.inc.php,v 1.22 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -440,7 +440,9 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the request belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'cat_id',
-                               'cat_list'                                      
        => $this->bo->select_category_request_list('filter',$this->cat_id),
+
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'filter','selected' => 
$this->cat_id,'type' =>'request','order'=>'descr')),
+
                                'district_list'                                 
=> $this->bocommon->select_district_list('filter',$this->district_id),
                                'lang_no_district'                              
=> lang('no district'),
                                'lang_district_statustext'              => 
lang('Select the district the selection belongs to. To do not use a district 
select NO DISTRICT'),
@@ -643,9 +645,9 @@
                                        $values['request_id']=$id;
                                        $action='edit';
                                }
-                               else
+                               elseif(!$receipt['error'])
                                {
-                                               
$values['request_id']=$this->bo->next_id();
+                                       
$values['request_id']=$this->bo->next_id();
                                }
 
                                $values['file_name']=str_replace(" 
","_",$_FILES['file']['name']);
@@ -971,7 +973,7 @@
                                'lang_cat_statustext'                   => 
lang('Select the category the request belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'values[cat_id]',
                                'value_cat_id'                                  
=> $values['cat_id'],
-                               'cat_list'                                      
        => $this->bo->select_category_request_list('select',$values['cat_id']),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$values['cat_id'],'type' =>'request','order'=>'descr')),
 
                                'lang_coordinator'                              
=> lang('Coordinator'),
                                'lang_user_statustext'                  => 
lang('Select the coordinator the request belongs to. To do not use a category 
select NO USER'),
@@ -1247,9 +1249,9 @@
                                'value_descr'                                   
=> $values['descr'],
                                'lang_score'                                    
=> lang('Score'),
                                'value_score'                                   
=> $values['score'],
-                               'lang_done_statustext'                  => 
lang('Back to the list'),
+                               'lang_done_statustext'                          
=> lang('Back to the list'),
                                'value_cat_id'                                  
=> $values['cat_id'],
-                               'cat_list'                                      
        => $this->bo->select_category_request_list('select',$values['cat_id']),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$values['cat_id'],'type' =>'request','order'=>'descr')),
 
                                'lang_coordinator'                              
=> lang('Coordinator'),
                                'lang_no_user'                                  
=> lang('Select coordinator'),
Index: property/inc/class.uis_agreement.inc.php
diff -u property/inc/class.uis_agreement.inc.php:1.27 
property/inc/class.uis_agreement.inc.php:1.28
--- property/inc/class.uis_agreement.inc.php:1.27       Mon Mar 13 14:37:28 2006
+++ property/inc/class.uis_agreement.inc.php    Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.uis_agreement.inc.php,v 1.27 2006/03/13 14:37:28 
sigurdne Exp $
+       * @version $Id: class.uis_agreement.inc.php,v 1.28 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -361,7 +361,8 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the s_agreement belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'cat_id',
-                               'cat_list'                                      
        => $this->bo->select_category_list('filter',$this->cat_id),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'filter','selected' => 
$this->cat_id,'type' =>'s_agreement','order'=>'descr')),
+
                                'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
 
                                'lang_no_vendor'                                
=> lang('no vendor'),
@@ -817,7 +818,7 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the s_agreement belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'values[cat_id]',
-                               'cat_list'                                      
        => $this->bo->select_category_list('select',$this->cat_id),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$this->cat_id,'type' =>'s_agreement','order'=>'descr')),
 
                                'lang_member_of'                                
=> lang('member of'),
                                'member_of_name'                                
=> 'member_id',
@@ -868,7 +869,7 @@
                                'table_update'                                  
=> $table_update,
                                'update_action'                                 
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uis_agreement.edit&id='
 . $id),
                                'lang_select_all'                               
=> lang('Select All'),
-                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.gif',
+                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
                                'check_source'                                  
=> './'.$this->currentapp.'/inc/check.js',
                                'check_all_script'                              
=> $check_all_script,
                                'set_column'                                    
=> $set_column,
@@ -1152,7 +1153,7 @@
                                'table_update'                                  
=> $table_update,
                                'update_action'                                 
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uis_agreement.edit_item&s_agreement_id='
 . $s_agreement_id . '&id=' . $id),
                                'lang_select_all'                               
=> lang('Select All'),
-                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.gif',
+                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
                                'check_source'                                  
=> './'.$this->currentapp.'/inc/check.js',
                                'location_data'                                 
=> $location_data,
 
@@ -1414,7 +1415,7 @@
                                'lang_apply'                                    
=> lang('apply'),
                                'value_cat'                                     
        => $s_agreement['cat'],
                                'lang_cancel_statustext'                => 
lang('return back to the list'),
-                               'cat_list'                                      
        => $this->bo->select_category_list('select',$this->cat_id),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$this->cat_id,'type' =>'s_agreement','order'=>'descr')),
 
                                'lang_member_of'                                
=> lang('member of'),
                                'member_of_name'                                
=> 'member_id',
Index: property/inc/class.uitemplate.inc.php
diff -u property/inc/class.uitemplate.inc.php:1.10 
property/inc/class.uitemplate.inc.php:1.11
--- property/inc/class.uitemplate.inc.php:1.10  Fri Feb  3 12:05:49 2006
+++ property/inc/class.uitemplate.inc.php       Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.uitemplate.inc.php,v 1.10 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.uitemplate.inc.php,v 1.11 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -69,7 +69,7 @@
                                'order'                         => $this->order,
                                'filter'                        => 
$this->filter,
                                'cat_id'                        => 
$this->cat_id,
-                               'chapter_id'            => $this->chapter_id,
+                               'chapter_id'                    => 
$this->chapter_id,
                                'allrows'                       => 
$this->allrows
                        );
                        $this->bo->save_sessiondata($data);
@@ -95,23 +95,23 @@
                                (
                                        'workorder_id'                  => 
$workorder_id,
                                        'template_id'                   => 
$template['template_id'],
-                                       'name'                                  
=> $template['name'],
-                                       'descr'                                 
=> $template['descr'],
-                                       'owner'                                 
=> $template['owner'],
+                                       'name'                          => 
$template['name'],
+                                       'descr'                         => 
$template['descr'],
+                                       'owner'                         => 
$template['owner'],
                                        'entry_date'                    => 
$template['entry_date'],
-                                       'chapter'                               
=> $template['chapter'],
+                                       'chapter'                       => 
$template['chapter'],
                                        'lang_select'                   => 
lang('Select'),
-                                       'form_action_select'    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiwo_hour.template'),
-                                       'lang_select_statustext' => 
lang('Select this template to view the details'),
-                                       'link_view'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uitemplate.hour&template_id='
 . $template['template_id']),
-                                       'link_edit'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uitemplate.edit_template&template_id='
 . $template['template_id']),
-                                       'link_delete'                           
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uitemplate.delete&id='
 . $template['template_id']),
+                                       'form_action_select'            => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiwo_hour.template'),
+                                       'lang_select_statustext'        => 
lang('Select this template to view the details'),
+                                       'link_view'                     => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uitemplate.hour&template_id='
 . $template['template_id']),
+                                       'link_edit'                     => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uitemplate.edit_template&template_id='
 . $template['template_id']),
+                                       'link_delete'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uitemplate.delete&id='
 . $template['template_id']),
                                        'lang_view_statustext'          => 
lang('view the template'),
                                        'lang_edit_statustext'          => 
lang('edit the template'),
                                        'lang_delete_statustext'        => 
lang('delete the template'),
-                                       'text_view'                             
        => lang('view'),
-                                       'text_edit'                             
        => lang('edit'),
-                                       'text_delete'                           
=> lang('delete')
+                                       'text_view'                     => 
lang('view'),
+                                       'text_edit'                     => 
lang('edit'),
+                                       'text_delete'                   => 
lang('delete')
                                );
 
                                $i++;
Index: property/inc/class.uitenant_claim.inc.php
diff -u property/inc/class.uitenant_claim.inc.php:1.11 
property/inc/class.uitenant_claim.inc.php:1.12
--- property/inc/class.uitenant_claim.inc.php:1.11      Fri Mar 10 14:40:11 2006
+++ property/inc/class.uitenant_claim.inc.php   Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.uitenant_claim.inc.php,v 1.11 2006/03/10 14:40:11 
sigurdne Exp $
+       * @version $Id: class.uitenant_claim.inc.php,v 1.12 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -258,7 +258,8 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the claim belongs to. To do not use a category select 
NO CATEGORY'),
                                'select_name'                                   
=> 'cat_id',
-                               'cat_list'                                      
        => $this->bo->select_category_list('filter',$this->cat_id),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'filter','selected' => 
$this->cat_id,'type' =>'tenant_claim','order'=>'descr')),
+
                                'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'filter_list'                                   
=> $this->nextmatchs->xslt_filter(array('filter' => $this->filter)),
                                'lang_filter_statustext'                => 
lang('Select the filter. To show all entries select SHOW ALL'),
@@ -537,7 +538,7 @@
 
                                'lang_select_workorder_statustext'      => 
lang('Include the workorder to this claim'),
 
-                               'cat_list_project'                              
        => 
$this->boproject->select_category_project_list('select',$project_values['cat_id']),
+                               'cat_list_project'                              
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$project_values['cat_id'],'type' =>'project','order'=>'descr')),
 
 //------------------
 
@@ -578,7 +579,7 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the claim belongs to. To do not use a category select 
NO CATEGORY'),
                                'select_name'                                   
=> 'values[cat_id]',
-                               'cat_list'                                      
        => $this->bo->select_category_list('select',$this->cat_id)
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$this->cat_id,'type' =>'tenant_claim','order'=>'descr')),
                        );
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('Tenant claim') . ': ' . ($claim_id?lang('edit claim'):lang('add claim'));
 
@@ -794,7 +795,7 @@
 
                                'b_account_data'                                
=> $b_account_data,
 
-                               'cat_list_project'                              
        => 
$this->boproject->select_category_project_list('select',$project_values['cat_id']),
+                               'cat_list_project'                              
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$project_values['cat_id'],'type' =>'project','order'=>'descr')),
 
 //------------------
 
@@ -820,7 +821,7 @@
                                'lang_apply'                                    
=> lang('apply'),
                                'value_remark'                                  
=> $values['remark'],
                                'value_cat'                                     
        => $values['cat'],
-                               'cat_list'                                      
        => $this->bo->select_category_list('select',$values['cat_id']),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$values['cat_id'],'type' =>'tenant_claim','order'=>'descr')),
 
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uitenant_claim.index'),
                                'lang_done'                     => lang('done'),
Index: property/inc/class.uitts.inc.php
diff -u property/inc/class.uitts.inc.php:1.32 
property/inc/class.uitts.inc.php:1.33
--- property/inc/class.uitts.inc.php:1.32       Wed Apr 12 10:24:43 2006
+++ property/inc/class.uitts.inc.php    Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage helpdesk
-       * @version $Id: class.uitts.inc.php,v 1.32 2006/04/12 10:24:43 sigurdne 
Exp $
+       * @version $Id: class.uitts.inc.php,v 1.33 2006/04/17 11:36:05 sigurdne 
Exp $
        */
 
        /**
@@ -526,7 +526,8 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the ticket belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'cat_id',
-                               'cat_list'                                      
        => $this->bo->select_category_list($group_filters,$this->cat_id),
+                               'cat_list'                                      
=> 
$this->bocommon->select_category_list(array('format'=>$group_filters,'selected' 
=> $this->cat_id,'type' =>'ticket','order'=>'descr')),
+
                                'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'filter_name'                                   
=> 'filter',
                                'filter_list'                                   
=> $this->bo->filter(array('format' => $group_filters, 'filter'=> 
$this->filter,'default' => 'open')),
@@ -762,7 +763,8 @@
                                'lang_town_statustext'                  => 
lang('Select the part of town the building belongs to. To do not use a part of 
town -  select NO PART OF TOWN'),
                                'lang_part_of_town'                             
=> lang('Part of town'),
                                'lang_no_part_of_town'                  => 
lang('No part of town'),
-                               'cat_list'                                      
=> $this->bo->select_category_list('select',$this->cat_id),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$this->cat_id,'type' =>'ticket','order'=>'descr')),
+
                                'mailnotification'                              
=> $this->bo->config->config_data['mailnotification'],
                                'lang_mailnotification'                 => 
lang('Send e-mail'),
                                'lang_mailnotification_statustext'      => 
lang('Choose to send mailnotification'),
@@ -1063,7 +1065,8 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the building belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'values[cat_id]',
-                               'cat_list'                                      
        => $this->bo->select_category_list('select',$this->cat_id),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$this->cat_id,'type' =>'ticket','order'=>'descr')),
+
                                'lang_category'                                 
=> lang('category'),
                                'value_category_name'                   => 
$ticket['category_name'],
 
Index: property/inc/class.uiwo_hour.inc.php
diff -u property/inc/class.uiwo_hour.inc.php:1.21 
property/inc/class.uiwo_hour.inc.php:1.22
--- property/inc/class.uiwo_hour.inc.php:1.21   Thu Mar 23 11:57:40 2006
+++ property/inc/class.uiwo_hour.inc.php        Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.uiwo_hour.inc.php,v 1.21 2006/03/23 11:57:40 
sigurdne Exp $
+       * @version $Id: class.uiwo_hour.inc.php,v 1.22 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -1203,7 +1203,8 @@
                                'table_sum'                             => 
$common_data['table_sum'],
                                'table_done'                            => 
$table_done,
                                'lang_no_wo_hour_cat'                   => 
lang('no category'),
-                               'wo_hour_cat_list'                      => 
$this->bocommon->select_wo_hours_category_list(),
+                               'wo_hour_cat_list'                      => 
$this->bocommon->select_category_list(array('format'=>'filter','selected' => 
$this->wo_hour_cat_id,'type' =>'wo_hours','order'=>'id')),
+
                        );
 //_debug_array($data);
 
@@ -1401,7 +1402,7 @@
                        (
                                'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'lang_select_all'                       => 
lang('Select All'),
-                               'img_check'                             => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.gif',
+                               'img_check'                             => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
                                'check_source'                          => 
'./'.$this->currentapp.'/inc/check.js',
 
                                'template_id'                           => 
$template_id,
@@ -1437,7 +1438,8 @@
                                'table_done'                            => 
$table_done,
                                'lang_wo_hour_category'                 => 
lang('category'),
                                'lang_select_wo_hour_category'          => 
lang('no category'),
-                               'wo_hour_cat_list'                      => 
$this->bocommon->select_wo_hours_category_list($values['wo_hour_cat']),
+                               'wo_hour_cat_list'                      => 
$this->bocommon->select_category_list(array('format'=>'select','selected' => 
$values['wo_hour_cat'],'type' =>'wo_hours','order'=>'id')),
+
                                'lang_cat_per_cent_statustext'          => 
lang('the percentage of the category'),
                                'value_cat_per_cent'                    => 
$values['cat_per_cent'],
                                'lang_per_cent'                         => 
lang('Per Cent')
@@ -1618,7 +1620,7 @@
                                'currency'                                      
        => $GLOBALS['phpgw_info']['user']['preferences']['common']['currency'],
                                'lang_wo_hour_category'                 => 
lang('category'),
                                'lang_select_wo_hour_category'          => 
lang('no category'),
-                               'wo_hour_cat_list'                      => 
$this->bocommon->select_wo_hours_category_list($values['wo_hour_cat']),
+                               'wo_hour_cat_list'                      => 
$this->bocommon->select_category_list(array('format'=>'select','selected' => 
$values['wo_hour_cat'],'type' =>'wo_hours','order'=>'id')),
                                'lang_cat_per_cent_statustext'          => 
lang('the percentage of the category'),
                                'value_cat_per_cent'                    => 
$values['cat_per_cent'],
                                'lang_per_cent'                         => 
lang('Per Cent')
Index: property/inc/class.uiworkorder.inc.php
diff -u property/inc/class.uiworkorder.inc.php:1.19 
property/inc/class.uiworkorder.inc.php:1.20
--- property/inc/class.uiworkorder.inc.php:1.19 Fri Mar 10 14:40:11 2006
+++ property/inc/class.uiworkorder.inc.php      Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.uiworkorder.inc.php,v 1.19 2006/03/10 14:40:11 
sigurdne Exp $
+       * @version $Id: class.uiworkorder.inc.php,v 1.20 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -416,7 +416,8 @@
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the workorder belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'cat_id',
-                               'cat_list'                                      
        => 
$this->bo->select_category_workorder_list($group_filters,$this->cat_id),
+                               'cat_list'                                      
=> 
$this->bocommon->select_category_list(array('format'=>$group_filters,'selected' 
=> $this->cat_id,'type' =>'wo','order'=>'descr')),
+
                                'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
 
                                'lang_status_statustext'                => 
lang('Select the status the agreement belongs to. To do not use a category 
select NO STATUS'),
@@ -426,7 +427,7 @@
 
                                'lang_wo_hour_cat_statustext'           => 
lang('Select the workorder hour category'),
                                'lang_no_wo_hour_cat'                   => 
lang('no hour category'),
-                               'wo_hour_cat_list'                              
=> $this->bocommon->select_wo_hours_category_list($this->wo_hour_cat_id),
+                               'wo_hour_cat_list'                              
=> $this->bocommon->select_category_list(array('format'=>'filter','selected' => 
$this->wo_hour_cat_id,'type' =>'wo_hours','order'=>'id')),
 
                                'lang_user_statustext'                  => 
lang('Select the user the workorder belongs to. To do not use a category select 
NO USER'),
                                'select_user_name'                              
=> 'filter',
@@ -822,7 +823,7 @@
                                'lang_cat_statustext'                   => 
lang('Select the category the project belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'values[cat_id]',
                                'value_cat_id'                                  
=> $values['cat_id'],
-                               'cat_list'                                      
        => 
$this->bo->select_category_workorder_list('select',$project['cat_id']),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$project['cat_id'],'type' =>'wo','order'=>'descr')),
 
                                'sum_workorder_budget'                  => 
$values['sum_workorder_budget'],
                                'workorder_budget'                              
=> $values['workorder_budget'],
@@ -1080,7 +1081,7 @@
                                'lang_descr'                                    
=> lang('Description'),
                                'value_descr'                                   
=> $values['descr'],
                                'lang_done_statustext'                  => 
lang('Back to the list'),
-                               'cat_list'                                      
        => 
$this->bo->select_category_workorder_list('select',$project['cat_id']),
+                               'cat_list'                                      
=> $this->bocommon->select_category_list(array('format'=>'select','selected' => 
$project['cat_id'],'type' =>'wo','order'=>'descr')),
 
                                'lang_workorder_id'                             
=> lang('Workorder ID'),
                                'value_workorder_id'                    => 
$values['workorder_id'],
Index: property/inc/custom/lag_lang_filer.php
diff -u property/inc/custom/lag_lang_filer.php:1.5 
property/inc/custom/lag_lang_filer.php:1.6
--- property/inc/custom/lag_lang_filer.php:1.5  Wed Feb  8 09:21:48 2006
+++ property/inc/custom/lag_lang_filer.php      Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage custom
-       * @version $Id: lag_lang_filer.php,v 1.5 2006/02/08 09:21:48 sigurdne 
Exp $
+       * @version $Id: lag_lang_filer.php,v 1.6 2006/04/17 11:36:05 sigurdne 
Exp $
        */
 
        /**
@@ -25,110 +25,27 @@
                        $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
                        $this->db               = $this->bocommon->new_db();
-               }
-
-               function pre_run($data='')
-               {
-                       if($data['enabled']==1)
-                       {
-                               $confirm        = True;
-                               $cron           = True;
-                       }
-                       else
-                       {
-                               $confirm        = 
get_var('confirm',array('POST'));
-                               $execute        = 
get_var('execute',array('GET'));
-                       }
-
-                       if ($confirm)
-                       {
-                               $this->execute($cron);
-                       }
-                       else
-                       {
-                               $this->confirm($execute=False);
-                       }
-               }
-
-
-               function confirm($execute='')
-               {
-                       $link_data = array
-                       (
-                               'menuaction' => 
$this->currentapp.'.custom_functions.index',
-                               'function'      =>$this->function_name,
-                               'execute'       => $execute,
-                       );
-
-
-                       if(!$execute)
-                       {
-                               $lang_confirm_msg       = 'Vil du virkelig 
utføre denne operasjonen';
-                       }
-
+               }
+               
+               function pre_run($data='')
+               {
+                       if($data['enabled']==1)
+                       {
+                               $confirm        = True;
+                               $cron           = True;
+                       }
+                       else
+                       {
+                               $confirm        = 
get_var('confirm',array('POST'));
+                               $execute        = 
get_var('execute',array('GET'));
+                       }
+                       if ($confirm)
+                       {
+                               $this->execute($cron);
+                       }
+                       else
+                       {
                                $this->confirm($execute=False);
                        }
                }


                function confirm($execute='')
                {
                        $link_data = array
                        (
                                'menuaction' => 
$this->currentapp.'.custom_functions.index',
                                'function'      =>$this->function_name,
                                'execute'       => $execute,
                        );

                        if(!$execute)
                        {
                                $lang_confirm_msg       = 'Vil du virkelig 
utføre denne operasjonen';
                        }
                        $lang_yes                       = lang('yes');
-
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('confirm_custom'));
-
-
                        $msgbox_data = 
$this->bocommon->msgbox_data($this->receipt);
-
-                       $data = array
-                       (
-                               'msgbox_data'                   => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php'),
-                               'run_action'                    => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'message'                               => 
$this->receipt['message'],
-                               'lang_confirm_msg'              => 
$lang_confirm_msg,
-                               'lang_yes'                              => 
$lang_yes,
-                               'lang_yes_statustext'   => 'lag_lang_filer fra 
database',
-                               'lang_no_statustext'    => 'tilbake',
-                               'lang_no'                               => 
lang('no'),
-                               'lang_done'                             => 
'Avbryt',
-                               'lang_done_statustext'  => 'tilbake'
-                       );
-
-                       $appname                = lang('location');
-                       $function_msg   = 'lag_lang_filer';
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('confirm' => $data));
-                       $GLOBALS['phpgw']->xslttpl->pp();
-               }
-
-               function execute($cron='')
-               {
-
-                       $sql = "SELECT * from phpgw_lang WHERE app_name = 
'property' AND lang='no' ORDER BY message_id ASC";
-
-                       $this->db->query($sql,__LINE__,__FILE__);
-
-                       $i=0;
-                       while ($this->db->next_record())
-                       {
-                                       $str.=$this->db->f('message_id') ."\t";
-                                       $str.=$this->db->f('app_name') ."\t";
-                                       $str.=$this->db->f('lang') ."\t";
-                                       $str.=$this->db->f('content') ."\n";
-                                       $i++;
-                       }
-
-_debug_array($str);
-/*                        $filename= 'phpgw_no_lang';
-
-                               $size=strlen($str);
-
-                               $browser = CreateObject('phpgwapi.browser');
-                               
$browser->content_header($filename,'application/txt',$size);
-
-                               echo $str;
-*/
-
-                       $this->receipt['message'][]=array('msg'=> $i . ' 
tekster lagt til');
-
-                       if(!$cron)
-                       {
-                               $this->confirm($execute=False);
-                       }
-               }
-       }
-?>
+                       $data = array
                        (
                                'msgbox_data'                   => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php'),
                                'run_action'                    => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
                                'message'                               => 
$this->receipt['message'],
                                'lang_confirm_msg'              => 
$lang_confirm_msg,
                                'lang_yes'                              => 
$lang_yes,
                                'lang_yes_statustext'   => 'lag_lang_filer fra 
database',
                                'lang_no_statustext'    => 'tilbake',
                                'lang_no'                               => 
lang('no'),
                                'lang_done'                             => 
'Avbryt',
                                'lang_done_statustext'  => 'tilbake'
                        );

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

                function execute($cron='')
                {

                        $sql = "SELECT * from phpgw_lang WHERE app_name = 
'property' AND lang='no' ORDER BY message_id ASC";

                        $this->db->query($sql,__LINE__,__FILE__);

                        $i=0;
                        while ($this->db->next_record())
                        {
                                        $str.=$this->db->f('message_id') ."\t";
                                        $str.=$this->db->f('app_name') ."\t";
                                        $str.=$this->db->f('lang') ."\t";
                                        $str.=$this->db->f('content') ."\n";
                                        $i++;
                        }

_debug_array($str);
/*                         $filename= 'phpgw_no_lang';

                                $size=strlen($str);

                                $browser = CreateObject('phpgwapi.browser');
                                
$browser->content_header($filename,'application/txt',$size);

                                echo $str;
*/

                        $this->receipt['message'][]=array('msg'=> $i . ' 
tekster lagt til');

                        if(!$cron)
                        {
                                $this->confirm($execute=False);
                        }
                }
        }
?>
Index: property/inc/hook_admin.inc.php
diff -u property/inc/hook_admin.inc.php:1.23 
property/inc/hook_admin.inc.php:1.24
--- property/inc/hook_admin.inc.php:1.23        Wed Apr 12 10:24:43 2006
+++ property/inc/hook_admin.inc.php     Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: hook_admin.inc.php,v 1.23 2006/04/12 10:24:43 sigurdne 
Exp $
+       * @version $Id: hook_admin.inc.php,v 1.24 2006/04/17 11:36:05 sigurdne 
Exp $
        */
 
                {
@@ -21,7 +21,7 @@
                                'Admin entity'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiadmin_entity.index'),
                                'Admin Location'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiadmin_location.index'),
                                'Update the not active category for 
locations'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uilocation.update_cat'),
-//                             'Request Categories'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=request'),
+                               'Request Categories'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=request'),
                                'Workorder Categories' => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=wo'),
                                'Workorder Detail Categories'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=wo_hours'),
                                'Ticket Categories'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=ticket'),
Index: property/inc/hook_settings.inc.php
diff -u property/inc/hook_settings.inc.php:1.14 
property/inc/hook_settings.inc.php:1.15
--- property/inc/hook_settings.inc.php:1.14     Fri Mar  3 09:13:42 2006
+++ property/inc/hook_settings.inc.php  Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage core
-       * @version $Id: hook_settings.inc.php,v 1.14 2006/03/03 09:13:42 
sigurdne Exp $
+       * @version $Id: hook_settings.inc.php,v 1.15 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
@@ -72,10 +72,11 @@
        }
        create_select_box('Default Priority 
TTS','prioritydefault',$priority,'The default priority for tickets in the 
Helpdesk-submodule');
 
+       $socategory = CreateObject($this->currentapp.'.socategory');
 
-       $sotts= CreateObject($this->currentapp.'.sotts');
-       $category_tts= $sotts->select_category_list();
-       if ($category_tts)
+       $category_tts= 
$socategory->select_category_list(array('type'=>'ticket'));
+
+       if (is_array($category_tts))
        {
                while (list($key,$entry) = each($category_tts))
                {
@@ -116,7 +117,8 @@
        $socommon= CreateObject($this->currentapp.'.socommon');
 
        $status_list= $soworkorder->select_status_list();
-       $category_list= $soworkorder->select_category_workorder_list();
+       $category_list= $socategory->select_category_list(array('type'=>'wo'));
+
        $district_list= $socommon->select_district_list();
 
        if ($status_list)
Index: property/setup/tables_current.inc.php
diff -u property/setup/tables_current.inc.php:1.56 
property/setup/tables_current.inc.php:1.57
--- property/setup/tables_current.inc.php:1.56  Wed Apr 12 10:24:43 2006
+++ property/setup/tables_current.inc.php       Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage setup
-       * @version $Id: tables_current.inc.php,v 1.56 2006/04/12 10:24:43 
sigurdne Exp $
+       * @version $Id: tables_current.inc.php,v 1.57 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        $phpgw_baseline = array(
@@ -546,12 +546,12 @@
                                'project_id' => array('type' => 
'int','precision' => '4','nullable' => False),
                                'user_id' => array('type' => 'int','precision' 
=> '4','nullable' => False),
                                'access' => array('type' => 
'varchar','precision' => '7','nullable' => True),
-                               'category' => array('type' => 'int','precision' 
=> '4','nullable' => False),
+                               'category' => array('type' => 'int','precision' 
=> '4','nullable' => True),
                                'chapter_id' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'entry_date' => array('type' => 
'int','precision' => '4','nullable' => False),
                                'start_date' => array('type' => 
'int','precision' => '4','nullable' => False),
                                'end_date' => array('type' => 'int','precision' 
=> '4','nullable' => False),
-                               'coordinator' => array('type' => 
'int','precision' => '4','nullable' => False),
+                               'coordinator' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'vendor_id' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'status' => array('type' => 
'varchar','precision' => '20','nullable' => False,'default' => 'active'),
                                'descr' => array('type' => 'text','nullable' => 
True),
@@ -800,7 +800,6 @@
                                'template_id' => array('type' => 
'int','precision' => '4','nullable' => False),
                                'record' => array('type' => 'int','precision' 
=> '4','nullable' => True),
                                'owner' => array('type' => 'int','precision' => 
'4','nullable' => False),
-                               'workorder_id' => array('type' => 
'int','precision' => '4','nullable' => False),
                                'activity_id' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'activity_num' => array('type' => 
'varchar','precision' => '15','nullable' => True),
                                'grouping_id' => array('type' => 
'int','precision' => '4','nullable' => True),
@@ -815,7 +814,8 @@
                                'building_part' => array('type' => 
'varchar','precision' => '4','nullable' => True),
                                'quantity' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True),
                                'cost' => array('type' => 'decimal','precision' 
=> '20','scale' => '2','nullable' => True),
-                               'dim_d' => array('type' => 'int','precision' => 
'4','nullable' => True)
+                               'dim_d' => array('type' => 'int','precision' => 
'4','nullable' => True),
+                               'entry_date' => array('type' => 
'int','precision' => '4','nullable' => True)
                        ),
                        'pk' => array('id'),
                        'fk' => array(),
@@ -2016,7 +2016,7 @@
                'fm_r_agreement' => array(
                        'fd' => array(
                                'id' => array('type' => 'int', 'precision' => 
4,'nullable' => False,'default' => '0'),
-                               'custom_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                               'customer_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
                                'customer_name' => array('type' => 'varchar', 
'precision' => 255,'nullable' => True),
                                'name' => array('type' => 'varchar', 
'precision' => 100,'nullable' => False),
                                'descr' => array('type' => 'text','nullable' => 
True),
Index: property/setup/tables_update.inc.php
diff -u property/setup/tables_update.inc.php:1.41 
property/setup/tables_update.inc.php:1.42
--- property/setup/tables_update.inc.php:1.41   Wed Apr 12 10:24:43 2006
+++ property/setup/tables_update.inc.php        Mon Apr 17 11:36:05 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage setup
-       * @version $Id: tables_update.inc.php,v 1.41 2006/04/12 10:24:43 
sigurdne Exp $
+       * @version $Id: tables_update.inc.php,v 1.42 2006/04/17 11:36:05 
sigurdne Exp $
        */
 
        /**
@@ -1240,3 +1240,20 @@
                $GLOBALS['setup_info']['property']['currentver'] = '0.9.17.518';
                return $GLOBALS['setup_info']['property']['currentver'];
        }
+
+       /**
+       * Update property version from 0.9.17.518 to 0.9.17.519
+       */
+
+       $test[] = '0.9.17.518';
+       function property_upgrade0_9_17_518()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_template_hours','entry_date',array('type'
 => 'int','precision' => 4,'nullable' => True));
+               
$GLOBALS['phpgw_setup']->oProc->DropColumn('fm_template_hours',null,'workorder_id');
+               
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+               $GLOBALS['setup_info']['property']['currentver'] = '0.9.17.519';
+               return $GLOBALS['setup_info']['property']['currentver'];
+       }
Index: property/templates/base/cat_filter.xsl
diff -u property/templates/base/cat_filter.xsl:1.1 
property/templates/base/cat_filter.xsl:1.2
--- property/templates/base/cat_filter.xsl:1.1  Mon Jan 17 10:03:18 2005
+++ property/templates/base/cat_filter.xsl      Mon Apr 17 11:36:05 2006
@@ -1,4 +1,4 @@
-<!-- $Id: cat_filter.xsl,v 1.1 2005/01/17 10:03:18 sigurdne Exp $ -->
+<!-- $Id: cat_filter.xsl,v 1.2 2006/04/17 11:36:05 sigurdne Exp $ -->
 
        <xsl:template name="cat_filter">
                <xsl:variable name="select_action"><xsl:value-of 
select="select_action"/></xsl:variable>
@@ -22,13 +22,13 @@
        </xsl:template>
 
        <xsl:template match="cat_list">
-       <xsl:variable name="cat_id"><xsl:value-of 
select="cat_id"/></xsl:variable>
+       <xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
                <xsl:choose>
                        <xsl:when test="selected='selected'">
-                               <option value="{$cat_id}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="name"/></option>
+                               <option value="{$id}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="name"/></option>
                        </xsl:when>
                        <xsl:otherwise>
-                               <option value="{$cat_id}"><xsl:value-of 
disable-output-escaping="yes" select="name"/></option>
+                               <option value="{$id}"><xsl:value-of 
disable-output-escaping="yes" select="name"/></option>
                        </xsl:otherwise>
                </xsl:choose>
        </xsl:template>
Index: property/templates/base/cat_select.xsl
diff -u property/templates/base/cat_select.xsl:1.1 
property/templates/base/cat_select.xsl:1.2
--- property/templates/base/cat_select.xsl:1.1  Mon Jan 17 10:03:18 2005
+++ property/templates/base/cat_select.xsl      Mon Apr 17 11:36:05 2006
@@ -1,4 +1,4 @@
-<!-- $Id: cat_select.xsl,v 1.1 2005/01/17 10:03:18 sigurdne Exp $ -->
+<!-- $Id: cat_select.xsl,v 1.2 2006/04/17 11:36:05 sigurdne Exp $ -->
 
        <xsl:template name="cat_select">
        <xsl:variable name="lang_cat_statustext"><xsl:value-of 
select="lang_cat_statustext"/></xsl:variable>
@@ -10,13 +10,13 @@
        </xsl:template>
 
        <xsl:template match="cat_list">
-       <xsl:variable name="cat_id"><xsl:value-of 
select="cat_id"/></xsl:variable>
+       <xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
                <xsl:choose>
                        <xsl:when test="selected='selected'">
-                               <option value="{$cat_id}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="name"/></option>
+                               <option value="{$id}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="name"/></option>
                        </xsl:when>
                        <xsl:otherwise>
-                               <option value="{$cat_id}"><xsl:value-of 
disable-output-escaping="yes" select="name"/></option>
+                               <option value="{$id}"><xsl:value-of 
disable-output-escaping="yes" select="name"/></option>
                        </xsl:otherwise>
                </xsl:choose>
        </xsl:template>
Index: property/templates/base/document.xsl
diff -u property/templates/base/document.xsl:1.1 
property/templates/base/document.xsl:1.2
--- property/templates/base/document.xsl:1.1    Mon Jan 17 10:03:18 2005
+++ property/templates/base/document.xsl        Mon Apr 17 11:36:05 2006
@@ -1,4 +1,4 @@
-<!-- $Id: document.xsl,v 1.1 2005/01/17 10:03:18 sigurdne Exp $ -->
+<!-- $Id: document.xsl,v 1.2 2006/04/17 11:36:05 sigurdne Exp $ -->
 
        <xsl:template name="app_data">
                <xsl:choose>
@@ -84,7 +84,7 @@
 
 
        <xsl:template match="doc_type">
-       <xsl:variable name="id"><xsl:value-of select="cat_id"/></xsl:variable>
+       <xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
                <xsl:choose>
                        <xsl:when test="selected">
                                <option value="{$id}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="name"/></option>
Index: property/templates/base/invoice.xsl
diff -u property/templates/base/invoice.xsl:1.10 
property/templates/base/invoice.xsl:1.11
--- property/templates/base/invoice.xsl:1.10    Mon Apr 10 09:39:13 2006
+++ property/templates/base/invoice.xsl Mon Apr 17 11:36:05 2006
@@ -1,4 +1,4 @@
-<!-- $Id: invoice.xsl,v 1.10 2006/04/10 09:39:13 sigurdne Exp $ -->
+<!-- $Id: invoice.xsl,v 1.11 2006/04/17 11:36:05 sigurdne Exp $ -->
 
        <xsl:template name="app_data">
                <xsl:choose>
@@ -1908,10 +1908,10 @@
        <xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
                <xsl:choose>
                        <xsl:when test="selected">
-                               <option value="{$id}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="num"/></option>
+                               <option value="{$id}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="name"/></option>
                        </xsl:when>
                        <xsl:otherwise>
-                               <option value="{$id}"><xsl:value-of 
disable-output-escaping="yes" select="num"/></option>
+                               <option value="{$id}"><xsl:value-of 
disable-output-escaping="yes" select="name"/></option>
                        </xsl:otherwise>
                </xsl:choose>
        </xsl:template>
@@ -1922,10 +1922,10 @@
        <xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
                <xsl:choose>
                        <xsl:when test="selected">
-                               <option value="{$id}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="num"/></option>
+                               <option value="{$id}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="name"/></option>
                        </xsl:when>
                        <xsl:otherwise>
-                               <option value="{$id}"><xsl:value-of 
disable-output-escaping="yes" select="num"/></option>
+                               <option value="{$id}"><xsl:value-of 
disable-output-escaping="yes" select="name"/></option>
                        </xsl:otherwise>
                </xsl:choose>
        </xsl:template>
@@ -1936,10 +1936,10 @@
        <xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
                <xsl:choose>
                        <xsl:when test="selected">
-                               <option value="{$id}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="num"/></option>
+                               <option value="{$id}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="name"/></option>
                        </xsl:when>
                        <xsl:otherwise>
-                               <option value="{$id}"><xsl:value-of 
disable-output-escaping="yes" select="num"/></option>
+                               <option value="{$id}"><xsl:value-of 
disable-output-escaping="yes" select="name"/></option>
                        </xsl:otherwise>
                </xsl:choose>
        </xsl:template>




reply via email to

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