phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] hrm/inc class.socategory.inc.php, 1.5 class.soadmin.i


From: sigurdne
Subject: [Phpgroupware-cvs] hrm/inc class.socategory.inc.php, 1.5 class.soadmin.inc.php, 1.4 class.socommon.inc.php, 1.4 class.sojob.inc.php, 1.9 class.souser.inc.php, 1.6 class.soplace.inc.php, 1.3 class.menu.inc.php, 1.5 class.bouser.inc.php, 1.7 class.bocategory.inc.php, 1.4 class.boadmin.inc.php, 1.5 class.bocommon.inc.php, 1.6 class.bojob.inc.php, 1.8 class.boplace.inc.php, 1.4 class.uiadmin.inc.php, 1.5 class.uicategory.inc.php, 1.3 hook_settings.inc.php, 1.2 hook_preferences.inc.php, 1.3 hook_manual.inc.php, 1.4 class.uiplace.inc.php, 1.4 class.uijob.inc.php, 1.8 class.uiuser.inc.php, 1.8 hook_admin.inc.php, 1.5 hook_help.inc.php, 1.3 class.acl2.inc.php, 1.4
Date: Wed, 30 Nov 2005 18:07:00 +0100

Update of hrm/inc

Modified Files:
     Branch: MAIN
            class.socategory.inc.php lines: +196 -197
            class.soadmin.inc.php lines: +31 -33
            class.socommon.inc.php lines: +88 -93
            class.sojob.inc.php lines: +2 -2
            class.souser.inc.php lines: +309 -319
            class.soplace.inc.php lines: +220 -220
            class.menu.inc.php lines: +91 -91
            class.bouser.inc.php lines: +247 -247
            class.bocategory.inc.php lines: +180 -180
            class.boadmin.inc.php lines: +404 -404
            class.bocommon.inc.php lines: +657 -659
            class.bojob.inc.php lines: +256 -262
            class.boplace.inc.php lines: +231 -231
            class.uiadmin.inc.php lines: +598 -599
            class.uicategory.inc.php lines: +289 -289
            hook_settings.inc.php lines: +170 -170
            hook_preferences.inc.php lines: +20 -20
            hook_manual.inc.php lines: +21 -21
            class.uiplace.inc.php lines: +370 -370
            class.uijob.inc.php lines: +960 -808
            class.uiuser.inc.php lines: +694 -714
            hook_admin.inc.php lines: +32 -32
            hook_help.inc.php lines: +46 -46
            class.acl2.inc.php lines: +2 -2

Log Message:
no message

====================================================
Index: hrm/inc/class.socategory.inc.php
diff -u hrm/inc/class.socategory.inc.php:1.4 
hrm/inc/class.socategory.inc.php:1.5
--- hrm/inc/class.socategory.inc.php:1.4        Tue Nov 29 15:07:58 2005
+++ hrm/inc/class.socategory.inc.php    Wed Nov 30 17:07:22 2005
@@ -1,197 +1,196 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage admin
-       * @version $Id$
-       */
-
-       /**
-        * Description
-        * @package hrm
-        */
-
-       class socategory
-       {
-
-               function socategory()
-               {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->db               = $GLOBALS['phpgw']->db;
-                       $this->db2              = $this->db;
-                       $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->socommon         = 
CreateObject($this->currentapp.'.socommon');
-
-                       $this->join                     = $this->socommon->join;
-                       $this->like                     = $this->socommon->like;
-
-               }
-
-               function read($data)
-               {
-                       if(is_array($data))
-                       {
-                               if ($data['start'])
-                               {
-                                       $start=$data['start'];
-                               }
-                               else
-                               {
-                                       $start=0;
-                               }
-                               $query          = 
(isset($data['query'])?$data['query']:'');
-                               $sort           = 
(isset($data['sort'])?$data['sort']:'DESC');
-                               $order          = 
(isset($data['order'])?$data['order']:'');
-                               $type           = 
(isset($data['type'])?$data['type']:'');
-                               $type_id                = 
(isset($data['type_id'])?$data['type_id']:'');
-                               $allrows        = 
(isset($data['allrows'])?$data['allrows']:'');
-                       }
-
-                       if(!$type)
-                       {
-                               return;
-                       }
-                       if ($order)
-                       {
-                               $ordermethod = " order by $order $sort";
-
-                       }
-                       else
-                       {
-                               $ordermethod = ' order by id asc';
-                       }
-
-                       $table = $this->select_table($type,$type_id);
-
-                       if($query)
-                       {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $querymethod = " where id $this->like 
'%$query%' or descr $this->like '%$query%'";
-                       }
-
-                       $sql = "SELECT * FROM $table $querymethod";
-
-                       $this->db2->query($sql,__LINE__,__FILE__);
-                       $this->total_records = $this->db2->num_rows();
-
-                       if(!$allrows)
-                       {
-                               $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
-                       }
-                       else
-                       {
-                               $this->db->query($sql . 
$ordermethod,__LINE__,__FILE__);
-                       }
-
-                       while ($this->db->next_record())
-                       {
-                               $category[] = array
-                               (
-                                       'id'    => $this->db->f('id'),
-                                       'descr' => 
stripslashes($this->db->f('descr'))
-                               );
-                       }
-                       return $category;
-               }
-
-
-               function select_table($type,$type_id)
-               {
-
-                       switch($type)
-                       {
-                               case 'training':
-                                       $table='hrm_training_category';
-                                       break;
-                               case 'experience':
-                                       $table='hrm_experience_category';
-                                       break;
-                               case 'skill_level':
-                                       $table='hrm_skill_level';
-                                       break;
-                               case 'task':
-                                       $table='hrm_task_category';
-                                       break;
-                       }
-
-                       return $table;
-               }
-
-
-               function read_single($id,$type,$type_id)
-               {
-
-                       $table = $this->select_table($type,$type_id);
-
-                       $sql = "SELECT * FROM $table  where id='$id'";
-
-                       $this->db->query($sql,__LINE__,__FILE__);
-
-                       if ($this->db->next_record())
-                       {
-                               $category['id']         = $this->db->f('id');
-                               $category['descr']      = 
stripslashes($this->db->f('descr'));
-
-                               return $category;
-                       }
-               }
-
-               function add($category,$type,$type_id)
-               {
-                       $table = $this->select_table($type,$type_id);
-
-                       $category['descr'] = 
$this->db->db_addslashes($category['descr']);
-
-                       $this->db->query("INSERT INTO $table (id, descr) "
-                               . "VALUES ('" . $category['id'] . "','" . 
$category['descr']. "')",__LINE__,__FILE__);
-
-                       $receipt['message'][]=array('msg'=>lang('category has 
been saved'));
-                       return $receipt;
-               }
-
-               function edit($category,$type,$type_id)
-               {
-
-                       $table = $this->select_table($type,$type_id);
-
-                       $category['descr'] = 
$this->db->db_addslashes($category['descr']);
-
-                       $this->db->query("UPDATE $table set descr='" . 
$category['descr']
-                                                       . "' WHERE id='" . 
$category['id']. "'",__LINE__,__FILE__);
-
-
-                       $receipt['message'][]=array('msg'=>lang('category has 
been edited'));
-                       return $receipt;
-               }
-
-               function delete($id,$type,$type_id)
-               {
-                       $table = $this->select_table($type,$type_id);
-
-                       $this->db->query("DELETE FROM $table WHERE id='" . $id 
. "'",__LINE__,__FILE__);
-               }
-
-               function select_category_list($type)
-               {
-                       $table = $this->select_table($type,$type_id);
-
-                       $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;
-               }
-
-       }
\ No newline at end of file
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package hrm
+        */
+
+       class socategory
+       {
+
+               function socategory()
+               {
+                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->db               = $GLOBALS['phpgw']->db;
+                       $this->db2              = $this->db;
+                       $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       $this->socommon         = 
CreateObject($this->currentapp.'.socommon');
+
+                       $this->join                     = $this->socommon->join;
+                       $this->like                     = $this->socommon->like;
+
+               }
+
+               function read($data)
+               {
+                       if(is_array($data))
+                       {
+                               if ($data['start'])
+                               {
+                                       $start=$data['start'];
+                               }
+                               else
+                               {
+                                       $start=0;
+                               }
+                               $query          = 
(isset($data['query'])?$data['query']:'');
+                               $sort           = 
(isset($data['sort'])?$data['sort']:'DESC');
+                               $order          = 
(isset($data['order'])?$data['order']:'');
+                               $type           = 
(isset($data['type'])?$data['type']:'');
+                               $type_id                = 
(isset($data['type_id'])?$data['type_id']:'');
+                               $allrows        = 
(isset($data['allrows'])?$data['allrows']:'');
+                       }
+
+                       if(!$type)
+                       {
+                               return;
+                       }
+                       if ($order)
+                       {
+                               $ordermethod = " order by $order $sort";
+
+                       }
+                       else
+                       {
+                               $ordermethod = ' order by id asc';
+                       }
+
+                       $table = $this->select_table($type,$type_id);
+
+                       if($query)
+                       {
+                               $query = ereg_replace("'",'',$query);
+                               $query = ereg_replace('"','',$query);
+
+                               $querymethod = " where id $this->like 
'%$query%' or descr $this->like '%$query%'";
+                       }
+
+                       $sql = "SELECT * FROM $table $querymethod";
+
+                       $this->db2->query($sql,__LINE__,__FILE__);
+                       $this->total_records = $this->db2->num_rows();
+
+                       if(!$allrows)
+                       {
+                               $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
+                       }
+                       else
+                       {
+                               $this->db->query($sql . 
$ordermethod,__LINE__,__FILE__);
+                       }
+
+                       while ($this->db->next_record())
+                       {
+                               $category[] = array
+                               (
+                                       'id'    => $this->db->f('id'),
+                                       'descr' => 
stripslashes($this->db->f('descr'))
+                               );
+                       }
+                       return $category;
+               }
+
+
+               function select_table($type,$type_id)
+               {
+
+                       switch($type)
+                       {
+                               case 'training':
+                                       $table='hrm_training_category';
+                                       break;
+                               case 'experience':
+                                       $table='hrm_experience_category';
+                                       break;
+                               case 'skill_level':
+                                       $table='hrm_skill_level';
+                                       break;
+                               case 'task':
+                                       $table='hrm_task_category';
+                                       break;
+                       }
+
+                       return $table;
+               }
+
+
+               function read_single($id,$type,$type_id)
+               {
+
+                       $table = $this->select_table($type,$type_id);
+
+                       $sql = "SELECT * FROM $table  where id='$id'";
+
+                       $this->db->query($sql,__LINE__,__FILE__);
+
+                       if ($this->db->next_record())
+                       {
+                               $category['id']         = $this->db->f('id');
+                               $category['descr']      = 
stripslashes($this->db->f('descr'));
+
+                               return $category;
+                       }
+               }
+
+               function add($category,$type,$type_id)
+               {
+                       $table = $this->select_table($type,$type_id);
+
+                       $category['descr'] = 
$this->db->db_addslashes($category['descr']);
+
+                       $this->db->query("INSERT INTO $table (id, descr) "
+                               . "VALUES ('" . $category['id'] . "','" . 
$category['descr']. "')",__LINE__,__FILE__);
+
+                       $receipt['message'][]=array('msg'=>lang('category has 
been saved'));
+                       return $receipt;
+               }
+
+               function edit($category,$type,$type_id)
+               {
+
+                       $table = $this->select_table($type,$type_id);
+
+                       $category['descr'] = 
$this->db->db_addslashes($category['descr']);
+
+                       $this->db->query("UPDATE $table set descr='" . 
$category['descr']
+                                                       . "' WHERE id='" . 
$category['id']. "'",__LINE__,__FILE__);
+
+
+                       $receipt['message'][]=array('msg'=>lang('category has 
been edited'));
+                       return $receipt;
+               }
+
+               function delete($id,$type,$type_id)
+               {
+                       $table = $this->select_table($type,$type_id);
+
+                       $this->db->query("DELETE FROM $table WHERE id='" . $id 
. "'",__LINE__,__FILE__);
+               }
+
+               function select_category_list($type)
+               {
+                       $table = $this->select_table($type,$type_id);
+
+                       $this->db->query("SELECT id, descr FROM $table ORDER BY 
id ");
+
+                       $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;
+               }
+       }

====================================================
Index: hrm/inc/class.soadmin.inc.php
diff -u hrm/inc/class.soadmin.inc.php:1.3 hrm/inc/class.soadmin.inc.php:1.4
--- hrm/inc/class.soadmin.inc.php:1.3   Fri Nov 25 11:58:29 2005
+++ hrm/inc/class.soadmin.inc.php       Wed Nov 30 17:07:22 2005
@@ -1,33 +1,31 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage admin
-       * @version $Id$
-       */
-
-       /**
-        * Description
-        * @package hrm
-        */
-
-       class soadmin
-       {
-
-               function soadmin()
-               {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->db               = $GLOBALS['phpgw']->db;
-                       $this->db2              = $this->db;
-                       $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->socommon         = 
CreateObject($this->currentapp.'.socommon');
-
-                       $this->join                     = $this->socommon->join;
-                       $this->like                     = $this->socommon->like;
-               }
-       }
\ No newline at end of file
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package hrm
+        */
+
+       class soadmin
+       {
+               function soadmin()
+               {
+                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->db               = $GLOBALS['phpgw']->db;
+                       $this->db2              = $this->db;
+                       $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       $this->socommon         = 
CreateObject($this->currentapp.'.socommon');
+                       $this->join                     = $this->socommon->join;
+                       $this->like                     = $this->socommon->like;
+               }
+       }

====================================================
Index: hrm/inc/class.socommon.inc.php
diff -u hrm/inc/class.socommon.inc.php:1.3 hrm/inc/class.socommon.inc.php:1.4
--- hrm/inc/class.socommon.inc.php:1.3  Fri Nov 25 11:58:29 2005
+++ hrm/inc/class.socommon.inc.php      Wed Nov 30 17:07:22 2005
@@ -1,93 +1,88 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage core
-       * @version $Id$
-       */
-
-       /**
-        * Description
-        * @package hrm
-        */
-
-       class socommon
-       {
-
-               function socommon()
-               {
-                       //$GLOBALS['phpgw_info']['flags']['currentapp'] =       
'hrm';
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->db               = $GLOBALS['phpgw']->db;
-                       $this->db2              = $this->db;
-                       $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
-
-                       if 
($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
-                       {
-                               $this->join = " JOIN ";
-                               $this->like = "ILIKE";
-                       }
-                       else
-                       {
-                               $this->join = " INNER JOIN ";
-                               $this->like = "LIKE";
-                       }
-
-                       $this->left_join = " LEFT JOIN ";
-
-
-               }
-
-               function fm_cache($name='',$value='')
-               {
-                       if($value)
-                       {
-                               $value = serialize($value);
-                               $this->db->query("INSERT INTO fm_cache 
(name,value)VALUES ('$name','$value')",__LINE__,__FILE__);
-                       }
-                       else
-                       {
-                               $this->db->query("SELECT value FROM fm_cache 
where name='$name'");
-                               $this->db->next_record();
-                               $value= unserialize($this->db->f('value'));
-                               return $value;
-
-                       }
-               }
-
-               function create_preferences($app='',$user_id='')
-               {
-                               $this->db->query("SELECT preference_value FROM 
phpgw_preferences where preference_app = '$app' AND 
preference_owner=".(int)$user_id );
-                               $this->db->next_record();
-                               $value= 
unserialize($this->db->f('preference_value'));
-                               return $value;
-               }
-
-
-               function next_id($table='',$key='')
-               {
-                       if(is_array($key))
-                       {
-                               while (is_array($key) && list($column,$value) = 
each($key))
-                               {
-                                       if($value)
-                                       {
-                                               $condition[] = $column . '=' . 
$value;
-                                       }
-                               }
-
-                               $where=' WHERE ' . implode(" AND ", $condition);
-                       }
-
-                       $this->db->query("SELECT max(id) as maximum FROM $table 
$where",__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $next_id = $this->db->f('maximum')+1;
-                       return "$next_id";
-               }
-
-       }
\ No newline at end of file
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage core
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package hrm
+        */
+
+       class socommon
+       {
+               function socommon()
+               {
+                       //$GLOBALS['phpgw_info']['flags']['currentapp'] =       
'hrm';
+                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->db               = $GLOBALS['phpgw']->db;
+                       $this->db2              = $this->db;
+                       $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
+
+                       if 
($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
+                       {
+                               $this->join = " JOIN ";
+                               $this->like = "ILIKE";
+                       }
+                       else
+                       {
+                               $this->join = " INNER JOIN ";
+                               $this->like = "LIKE";
+                       }
+
+                       $this->left_join = " LEFT JOIN ";
+               }
+
+               function fm_cache($name='',$value='')
+               {
+                       if($value)
+                       {
+                               $value = serialize($value);
+                               $this->db->query("INSERT INTO fm_cache 
(name,value)VALUES ('$name','$value')",__LINE__,__FILE__);
+                       }
+                       else
+                       {
+                               $this->db->query("SELECT value FROM fm_cache 
where name='$name'");
+                               $this->db->next_record();
+                               $value= unserialize($this->db->f('value'));
+                               return $value;
+                       }
+               }
+
+               function create_preferences($app='',$user_id='')
+               {
+                               $this->db->query("SELECT preference_value FROM 
phpgw_preferences where preference_app = '$app' AND 
preference_owner=".(int)$user_id );
+                               $this->db->next_record();
+                               $value= 
unserialize($this->db->f('preference_value'));
+                               return $value;
+               }
+
+
+               function next_id($table='',$key='')
+               {
+                       if(is_array($key))
+                       {
+                               while (is_array($key) && list($column,$value) = 
each($key))
+                               {
+                                       if($value)
+                                       {
+                                               $condition[] = $column . '=' . 
$value;
+                                       }
+                               }
+
+                               $where=' WHERE ' . implode(" AND ", $condition);
+                       }
+
+                       $this->db->query("SELECT max(id) as maximum FROM $table 
$where",__LINE__,__FILE__);
+                       $this->db->next_record();
+                       $next_id = $this->db->f('maximum')+1;
+                       return "$next_id";
+               }
+       }

====================================================
Index: hrm/inc/class.sojob.inc.php
diff -u hrm/inc/class.sojob.inc.php:1.8 hrm/inc/class.sojob.inc.php:1.9
--- hrm/inc/class.sojob.inc.php:1.8     Tue Nov 29 20:22:03 2005
+++ hrm/inc/class.sojob.inc.php Wed Nov 30 17:07:22 2005
@@ -508,4 +508,4 @@
                {
                        $this->db->query('DELETE FROM hrm_task WHERE id='  . 
intval($id) . ' AND job_id='  . intval($job_id),__LINE__,__FILE__);
                }
-       }
\ No newline at end of file
+       }

====================================================
Index: hrm/inc/class.souser.inc.php
diff -u hrm/inc/class.souser.inc.php:1.5 hrm/inc/class.souser.inc.php:1.6
--- hrm/inc/class.souser.inc.php:1.5    Tue Nov 29 15:07:58 2005
+++ hrm/inc/class.souser.inc.php        Wed Nov 30 17:07:22 2005
@@ -1,331 +1,321 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage user
-       * @version $Id$
-       */
-
-       /**
-        * Description
-        * @package hrm
-        */
-
-       class souser
-       {
-               var $grants;
-               var $db;
-               var $db2;
-               var $account;
-
-               function souser()
-               {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->db               = $GLOBALS['phpgw']->db;
-                       $this->db2              = $this->db;
-                       $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
-
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage user
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package hrm
+        */
+
+       class souser
+       {
+               var $grants;
+               var $db;
+               var $db2;
+               var $account;
+
+               function souser()
+               {
+                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->db               = $GLOBALS['phpgw']->db;
+                       $this->db2              = $this->db;
+                       $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
+
                        $this->acl              = 
CreateObject($this->currentapp.'.acl2');
-                       $this->grants           = 
$this->acl->get_grants('hrm','user');
-                       $this->left_join        = $this->bocommon->left_join;
-                       $this->join             = $this->bocommon->join;
+                       $this->grants           = 
$this->acl->get_grants('hrm','user');
+                       $this->left_join        = $this->bocommon->left_join;
+                       $this->join             = $this->bocommon->join;
                        $this->like             = $this->bocommon->like;
-               }
-
-               function read($data)
-               {
-                       if(is_array($data))
-                       {
-                               if ($data['start'])
-                               {
-                                       $start=$data['start'];
-                               }
-                               else
-                               {
-                                       $start=0;
-                               }
-                               $query          = 
(isset($data['query'])?$data['query']:'');
-                               $sort           = 
(isset($data['sort'])?$data['sort']:'DESC');
-                               $order          = 
(isset($data['order'])?$data['order']:'');
-                               $allrows        = 
(isset($data['allrows'])?$data['allrows']:'');
-                       }
-
-/*                     $filtermethod = ' AND ( account_id=' . $this->account;
-                       if (is_array($this->grants))
+               }
+
+               function read($data)
+               {
+                       if(is_array($data))
                        {
-                               $grants = $this->grants;
-                               while (list($user) = each($grants))
+                               if ($data['start'])
+                               {
+                                       $start=$data['start'];
+                               }
+                               else
                                {
-                                       $public_user_list[] = $user;
+                                       $start=0;
                                }
-                               reset($public_user_list);
-                               $filtermethod .= " OR ( account_id IN(" . 
implode(',',$public_user_list) . ")))";
+                               $query          = 
(isset($data['query'])?$data['query']:'');
+                               $sort           = 
(isset($data['sort'])?$data['sort']:'DESC');
+                               $order          = 
(isset($data['order'])?$data['order']:'');
+                               $allrows        = 
(isset($data['allrows'])?$data['allrows']:'');
+                       }
+
+/*                     $filtermethod = ' AND ( account_id=' . $this->account;  
                if (is_array($this->grants))
+                       {                               $grants = $this->grants;
+                               while (list($user) = each($grants))             
                {
+                                       $public_user_list[] = $user;            
                }
+                               reset($public_user_list);                       
        $filtermethod .= " OR ( account_id IN(" . 
implode(',',$public_user_list) . ")))";
+                       }                       else
+                       {                               $filtermethod .= ' )';
+                       }
+*/                     if ($order)
+                       {
+                               $ordermethod = " order by $order $sort";
+
                        }
                        else
                        {
-                               $filtermethod .= ' )';
+                               $ordermethod = ' order by account_lastname asc';
                        }

-*/                     if ($order)
-                       {
-                               $ordermethod = " order by $order $sort";
-
-                       }
-                       else
-                       {
-                               $ordermethod = ' order by account_lastname asc';
-                       }
-
-                       $table = 'phpgw_accounts';
-
-                       if($query)
-                       {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $querymethod = " AND account_firstname 
$this->like '%$query%' or account_lastname $this->like '%$query%'";
-                       }
-
-                       $sql = "SELECT * FROM $table WHERE account_type = 'u' 
AND account_status = 'A' $filtermethod $querymethod";
-
-                       $this->db2->query($sql,__LINE__,__FILE__);
-                       $this->total_records = $this->db2->num_rows();
-
-                       if(!$allrows)
-                       {
-                               $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
-                       }
-                       else
-                       {
-                               $this->db->query($sql . 
$ordermethod,__LINE__,__FILE__);
-                       }
-
-                       while ($this->db->next_record())
-                       {
-                               $ngrants = 
$this->grants[$this->db->f('account_id')];
-                               $account_info[] = array
-                               (
-                                       'account_id'            => 
$this->db->f('account_id'),
-                                       'account_firstname'     => 
stripslashes($this->db->f('account_firstname')),
+                       $table = 'phpgw_accounts';
+
+                       if($query)
+                       {
+                               $query = ereg_replace("'",'',$query);
+                               $query = ereg_replace('"','',$query);
+
+                               $querymethod = " AND account_firstname 
$this->like '%$query%' or account_lastname $this->like '%$query%'";
+                       }
+
+                       $sql = "SELECT * FROM $table WHERE account_type = 'u' 
AND account_status = 'A' $filtermethod $querymethod";
+
+                       $this->db2->query($sql,__LINE__,__FILE__);
+                       $this->total_records = $this->db2->num_rows();
+
+                       if(!$allrows)
+                       {
+                               $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
+                       }
+                       else
+                       {
+                               $this->db->query($sql . 
$ordermethod,__LINE__,__FILE__);
+                       }
+
+                       while ($this->db->next_record())
+                       {
+                               $ngrants = 
$this->grants[$this->db->f('account_id')];                           
$account_info[] = array
+                               (
+                                       'account_id'            => 
$this->db->f('account_id'),
+                                       'account_firstname'     => 
stripslashes($this->db->f('account_firstname')),
                                        'account_lastname'      => 
stripslashes($this->db->f('account_lastname')),
-                                       'grants'                => $ngrants
-                               );
-                       }
-
-                       return $account_info;
-               }
-
-
-               function read_single_training($id)
-               {
-
-                       $sql = 'SELECT * FROM hrm_training where id=' . 
intval($id);
-
-                       $this->db->query($sql,__LINE__,__FILE__);
-
-                       if ($this->db->next_record())
-                       {
-                               $values['id']           = $id;
-                               $values['descr']        = 
stripslashes($this->db->f('descr'));
-                               $values['user_id']      = 
$this->db->f('user_id');
-                               $values['cat_id']       = 
$this->db->f('category');
-                               $values['title']        = 
stripslashes($this->db->f('title'));
-                               $values['start_date']   = 
$this->db->f('start_date');
-                               $values['end_date']     = 
$this->db->f('end_date');
-                               $values['reference']    = 
stripslashes($this->db->f('reference'));
-                               $values['skill']        = $this->db->f('skill');
-                               $values['place_id']     = 
$this->db->f('place_id');
-                               $values['entry_date']   = 
$this->db->f('entry_date');
-                               $values['owner']        = $this->db->f('owner');
-                       }
-                       return $values;
-               }
-
-               function read_training($data)
-               {
-                       if(is_array($data))
-                       {
-                               if ($data['start'])
-                               {
-                                       $start=$data['start'];
-                               }
-                               else
-                               {
-                                       $start=0;
-                               }
-                               $query          = 
(isset($data['query'])?$data['query']:'');
-                               $sort           = 
(isset($data['sort'])?$data['sort']:'DESC');
-                               $order          = 
(isset($data['order'])?$data['order']:'');
-                               $allrows        = 
(isset($data['allrows'])?$data['allrows']:'');
-                       }
-
-                       $user_id = $data['user_id'];
-
-                       if ($order)
-                       {
-                               $ordermethod = " order by $order $sort";
-
-                       }
-                       else
-                       {
-                               $ordermethod = ' order by start_date asc';
-                       }
-
-                       $sql = "SELECT hrm_training.id as 
training_id,hrm_training.title as title, 
hrm_training.start_date,hrm_training.end_date,hrm_training_place.name as place 
FROM hrm_training $this->left_join hrm_training_place on 
hrm_training.place_id=hrm_training_place.id WHERE hrm_training.user_id=" . 
intval($user_id);
-
-                       $this->db->query($sql . $ordermethod 
,__LINE__,__FILE__);
-
-                       while ($this->db->next_record())
-                       {
-                               $training[] = array
-                               (
-                                       'training_id'   => 
$this->db->f('training_id'),
-                                       'start_date'    => 
$this->db->f('start_date'),
-                                       'end_date'      => 
$this->db->f('end_date'),
-                                       'title' => 
stripslashes($this->db->f('title')),
-                                       'place' => 
stripslashes($this->db->f('place'))
-                               );
-
-                       }
-                       return $training;
-               }
-
-               function add_place($values)
-               {
-                       $values['new_place_name'] = 
$this->db->db_addslashes($values['new_place_name']);
-                       $values['new_place_address'] = 
$this->db->db_addslashes($values['new_place_address']);
-                       $values['new_place_town'] = 
$this->db->db_addslashes($values['new_place_town']);
-                       $values['new_place_descr'] = 
$this->db->db_addslashes($values['new_place_descr']);
-                       $values['place_id'] = 
$this->bocommon->next_id('hrm_training_place');
-
-                       $insert_values=array(
-                               $values['place_id'],
-                               $values['new_place_name'],
-                               $values['new_place_address'],
-                               $values['new_place_zip'],
-                               $values['new_place_town'],
-                               $values['new_place_remark'],
-                               );
-
-                       $insert_values  = 
$this->bocommon->validate_db_insert($insert_values);
-                       $this->db->query("INSERT INTO hrm_training_place 
(id,name,address,zip,town, remark) "
-                               . "VALUES ($insert_values)",__LINE__,__FILE__);
-
-                       return $values['place_id'];
-               }
-
-               function add_training($values)
-               {
-                       $values['descr'] = 
$this->db->db_addslashes($values['descr']);
-                       $values['title'] = 
$this->db->db_addslashes($values['title']);
-
-                       $this->db->transaction_begin();
-
-                       if($values['new_place_name'] && 
$values['place_id']=='new_place')
-                       {
-                               $values['place_id'] = $this->add_place($values);
-                       }
-
-                       $training_id = $this->bocommon->next_id('hrm_training');
-
-                       $insert_values=array(
-                               $training_id,
-                               $values['user_id'],
-                               $values['cat_id'],
-                               $values['title'],
-                               $values['start_date'],
-                               $values['end_date'],
-                               $values['reference'],
-                               $values['skill'],
-                               $values['place_id'],
-                               $values['descr'],
-                               time(),
-                               $this->account
-                               );
-
-                       $insert_values  = 
$this->bocommon->validate_db_insert($insert_values);
-
-                       $this->db->query("INSERT INTO hrm_training 
(id,user_id,category,title,start_date,end_date,reference,skill,place_id,descr,entry_date,owner)
 "
-                               . "VALUES ($insert_values)",__LINE__,__FILE__);
-
-                       $receipt['message'][]=array('msg'=>lang('training item 
has been saved'));
-
-                       $receipt['training_id']= $training_id;
-
-                       $this->db->transaction_commit();
-                       return $receipt;
-               }
-
-               function edit_training($values)
-               {
-                       $this->db->transaction_begin();
-
-                       if($values['new_place_name'] && 
$values['place_id']=='new_place')
-                       {
-                               $values['place_id'] = $this->add_place($values);
-                       }
-
-                       $value_set['descr']                     = 
$this->db->db_addslashes($values['descr']);
-                       $value_set['category']          = $values['cat_id'];
-                       $value_set['title']                     = 
$this->db->db_addslashes($values['title']);
-                       $value_set['start_date']        = $values['start_date'];
-                       $value_set['end_date']          = $values['end_date'];
-                       $value_set['reference']         = 
$this->db->db_addslashes($values['reference']);
-                       $value_set['skill']                     = 
$values['skill'];
-                       $value_set['place_id']          = $values['place_id'];
-
-                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                       $table='hrm_training';
-
-                       $this->db->query("UPDATE $table set $value_set WHERE 
id=" . $values['training_id'],__LINE__,__FILE__);
-
-                       $this->db->transaction_commit();
-
-                       $receipt['message'][]=array('msg'=>lang('Training item 
has been edited'));
-
-                       $receipt['training_id']= $values['training_id'];
-                       return $receipt;
-               }
-
-               function delete_training($user_id,$id)
-               {
-
-                       $this->db->query('DELETE FROM hrm_training WHERE id='  
. intval($id) . ' AND user_id='  . intval($user_id),__LINE__,__FILE__);
-               }
-
-               function select_category_list()
-               {
-                       $this->db->query("SELECT id, descr FROM 
hrm_training_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 select_place_list()
-               {
-                       $this->db->query("SELECT * FROM hrm_training_place  
ORDER BY name ");
-
-                       $i = 0;
-                       while ($this->db->next_record())
-                       {
-                               $place[$i]['id']                                
= $this->db->f('id');
-                               $place[$i]['name']                              
= stripslashes($this->db->f('name'));
-                               $i++;
-                       }
-                       return $place;
-               }
-
+                                       'grants'                => $ngrants
+                               );
+                       }
+
+                       return $account_info;
+               }
+
+
+               function read_single_training($id)
+               {
+
+                       $sql = 'SELECT * FROM hrm_training where id=' . 
intval($id);
+
+                       $this->db->query($sql,__LINE__,__FILE__);
+
+                       if ($this->db->next_record())
+                       {
+                               $values['id']           = $id;
+                               $values['descr']        = 
stripslashes($this->db->f('descr'));
+                               $values['user_id']      = 
$this->db->f('user_id');
+                               $values['cat_id']       = 
$this->db->f('category');
+                               $values['title']        = 
stripslashes($this->db->f('title'));
+                               $values['start_date']   = 
$this->db->f('start_date');
+                               $values['end_date']     = 
$this->db->f('end_date');
+                               $values['reference']    = 
stripslashes($this->db->f('reference'));
+                               $values['skill']        = $this->db->f('skill');
+                               $values['place_id']     = 
$this->db->f('place_id');
+                               $values['entry_date']   = 
$this->db->f('entry_date');
+                               $values['owner']        = $this->db->f('owner');
+                       }
+                       return $values;
+               }
+
+               function read_training($data)
+               {
+                       if(is_array($data))
+                       {
+                               if ($data['start'])
+                               {
+                                       $start=$data['start'];
+                               }
+                               else
+                               {
+                                       $start=0;
+                               }
+                               $query          = 
(isset($data['query'])?$data['query']:'');
+                               $sort           = 
(isset($data['sort'])?$data['sort']:'DESC');
+                               $order          = 
(isset($data['order'])?$data['order']:'');
+                               $allrows        = 
(isset($data['allrows'])?$data['allrows']:'');
+                       }
+
+                       $user_id = $data['user_id'];
+
+                       if ($order)
+                       {
+                               $ordermethod = " order by $order $sort";
+
+                       }
+                       else
+                       {
+                               $ordermethod = ' order by start_date asc';
+                       }
+
+                       $sql = "SELECT hrm_training.id as 
training_id,hrm_training.title as title, 
hrm_training.start_date,hrm_training.end_date,hrm_training_place.name as place 
FROM hrm_training $this->left_join hrm_training_place on 
hrm_training.place_id=hrm_training_place.id WHERE hrm_training.user_id=" . 
intval($user_id);
+
+                       $this->db->query($sql . $ordermethod 
,__LINE__,__FILE__);
+
+                       while ($this->db->next_record())
+                       {                               $training[] = array
+                               (
+                                       'training_id'   => 
$this->db->f('training_id'),
+                                       'start_date'    => 
$this->db->f('start_date'),
+                                       'end_date'      => 
$this->db->f('end_date'),
+                                       'title' => 
stripslashes($this->db->f('title')),
+                                       'place' => 
stripslashes($this->db->f('place'))
+                               );
+
+                       }
+                       return $training;
+               }
+
+               function add_place($values)
+               {
+                       $values['new_place_name'] = 
$this->db->db_addslashes($values['new_place_name']);
+                       $values['new_place_address'] = 
$this->db->db_addslashes($values['new_place_address']);
+                       $values['new_place_town'] = 
$this->db->db_addslashes($values['new_place_town']);
+                       $values['new_place_descr'] = 
$this->db->db_addslashes($values['new_place_descr']);
+                       $values['place_id'] = 
$this->bocommon->next_id('hrm_training_place');
+
+                       $insert_values=array(
+                               $values['place_id'],
+                               $values['new_place_name'],
+                               $values['new_place_address'],
+                               $values['new_place_zip'],
+                               $values['new_place_town'],
+                               $values['new_place_remark'],
+                               );
+
+                       $insert_values  = 
$this->bocommon->validate_db_insert($insert_values);
+                       $this->db->query("INSERT INTO hrm_training_place 
(id,name,address,zip,town, remark) "
+                               . "VALUES ($insert_values)",__LINE__,__FILE__);
+
+                       return $values['place_id'];
+               }
+
+               function add_training($values)
+               {
+                       $values['descr'] = 
$this->db->db_addslashes($values['descr']);
+                       $values['title'] = 
$this->db->db_addslashes($values['title']);
+
+                       $this->db->transaction_begin();
+
+                       if($values['new_place_name'] && 
$values['place_id']=='new_place')
+                       {
+                               $values['place_id'] = $this->add_place($values);
+                       }
+
+                       $training_id = $this->bocommon->next_id('hrm_training');
+
+                       $insert_values=array(
+                               $training_id,
+                               $values['user_id'],
+                               $values['cat_id'],
+                               $values['title'],
+                               $values['start_date'],
+                               $values['end_date'],
+                               $values['reference'],
+                               $values['skill'],
+                               $values['place_id'],
+                               $values['descr'],
+                               time(),
+                               $this->account
+                               );
+
+                       $insert_values  = 
$this->bocommon->validate_db_insert($insert_values);
+
+                       $this->db->query("INSERT INTO hrm_training 
(id,user_id,category,title,start_date,end_date,reference,skill,place_id,descr,entry_date,owner)
 "
+                               . "VALUES ($insert_values)",__LINE__,__FILE__);
+
+                       $receipt['message'][]=array('msg'=>lang('training item 
has been saved'));
+
+                       $receipt['training_id']= $training_id;
+
+                       $this->db->transaction_commit();
+                       return $receipt;
+               }
+
+               function edit_training($values)
+               {
+                       $this->db->transaction_begin();
+
+                       if($values['new_place_name'] && 
$values['place_id']=='new_place')
+                       {
+                               $values['place_id'] = $this->add_place($values);
+                       }
+
+                       $value_set['descr']                     = 
$this->db->db_addslashes($values['descr']);
+                       $value_set['category']          = $values['cat_id'];
+                       $value_set['title']                     = 
$this->db->db_addslashes($values['title']);
+                       $value_set['start_date']        = $values['start_date'];
+                       $value_set['end_date']          = $values['end_date'];
+                       $value_set['reference']         = 
$this->db->db_addslashes($values['reference']);
+                       $value_set['skill']                     = 
$values['skill'];
+                       $value_set['place_id']          = $values['place_id'];
+
+                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
+
+                       $table='hrm_training';
+
+                       $this->db->query("UPDATE $table set $value_set WHERE 
id=" . $values['training_id'],__LINE__,__FILE__);
+
+                       $this->db->transaction_commit();
+
+                       $receipt['message'][]=array('msg'=>lang('Training item 
has been edited'));
+
+                       $receipt['training_id']= $values['training_id'];
+                       return $receipt;
+               }
+
+               function delete_training($user_id,$id)
+               {
+
+                       $this->db->query('DELETE FROM hrm_training WHERE id='  
. intval($id) . ' AND user_id='  . intval($user_id),__LINE__,__FILE__);
+               }
+
+               function select_category_list()
+               {
+                       $this->db->query("SELECT id, descr FROM 
hrm_training_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 select_place_list()
+               {
+                       $this->db->query("SELECT * FROM hrm_training_place  
ORDER BY name ");
+
+                       $i = 0;
+                       while ($this->db->next_record())
+                       {
+                               $place[$i]['id']                                
= $this->db->f('id');
+                               $place[$i]['name']                              
= stripslashes($this->db->f('name'));
+                               $i++;
+                       }
+                       return $place;
+               }
+
        }

====================================================
Index: hrm/inc/class.soplace.inc.php
diff -u hrm/inc/class.soplace.inc.php:1.2 hrm/inc/class.soplace.inc.php:1.3
--- hrm/inc/class.soplace.inc.php:1.2   Tue Nov 22 18:20:09 2005
+++ hrm/inc/class.soplace.inc.php       Wed Nov 30 17:07:22 2005
@@ -1,220 +1,220 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage place
-       * @version $Id$
-       */
-
-       /**
-        * Description
-        * @package hrm
-        */
-
-       class soplace
-       {
-               var $grants;
-               var $db;
-               var $db2;
-               var $account;
-
-               function soplace()
-               {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->db               = $GLOBALS['phpgw']->db;
-                       $this->db2              = $this->db;
-                       $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
-
-                       $this->grants   = 
$GLOBALS['phpgw']->acl->get_grants('hrm');
-                       $this->left_join                = 
$this->bocommon->left_join;
-                       $this->join                     = $this->bocommon->join;
-                       $this->like                     = $this->bocommon->like;
-               }
-
-               function read($data)
-               {
-                       if(is_array($data))
-                       {
-                               if ($data['start'])
-                               {
-                                       $start=$data['start'];
-                               }
-                               else
-                               {
-                                       $start=0;
-                               }
-                               $query          = 
(isset($data['query'])?$data['query']:'');
-                               $sort           = 
(isset($data['sort'])?$data['sort']:'DESC');
-                               $order          = 
(isset($data['order'])?$data['order']:'');
-                               $allrows        = 
(isset($data['allrows'])?$data['allrows']:'');
-                       }
-
-                       if ($order)
-                       {
-                               $ordermethod = " order by $order $sort";
-
-                       }
-                       else
-                       {
-                               $ordermethod = ' order by name asc';
-                       }
-
-                       $table = 'hrm_training_place';
-
-                       if($query)
-                       {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $querymethod = " WHERE name $this->like 
'%$query%'";
-                       }
-
-                       $sql = "SELECT * FROM $table $querymethod";
-
-                       $this->db2->query($sql,__LINE__,__FILE__);
-                       $this->total_records = $this->db2->num_rows();
-
-                       if(!$allrows)
-                       {
-                               $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
-                       }
-                       else
-                       {
-                               $this->db->query($sql . 
$ordermethod,__LINE__,__FILE__);
-                       }
-
-                       while ($this->db->next_record())
-                       {
-                               $place_info[] = array
-                               (
-                                       'id'    => $this->db->f('id'),
-                                       'name'  => 
stripslashes($this->db->f('name')),
-                                       'descr' => 
stripslashes($this->db->f('descr'))
-                               );
-                       }
-
-                       return $place_info;
-               }
-
-
-               function read_single($id)
-               {
-                       $sql = 'SELECT * FROM hrm_training_place where id=' . 
intval($id);
-
-                       $this->db->query($sql,__LINE__,__FILE__);
-
-                       if ($this->db->next_record())
-                       {
-                               $values['id']           = $id;
-                               $values['name'] = 
stripslashes($this->db->f('name'));
-                               $values['address']      = 
stripslashes($this->db->f('address'));
-                               $values['remark']       = 
stripslashes($this->db->f('remark'));
-                               $values['town'] = 
stripslashes($this->db->f('town'));
-                               $values['zip']  = $this->db->f('zip');
-                               $values['entry_date']   = 
$this->db->f('entry_date');
-                               $values['owner']        = $this->db->f('owner');
-                       }
-                       return $values;
-               }
-
-               function read_training($id)
-               {
-                       $sql = "SELECT hrm_training.id as 
training_id,hrm_training.title as title, 
hrm_training.start_date,hrm_training.end_date,hrm_training_place.name as place 
FROM hrm_training $this->left_join hrm_training_place on 
hrm_training.place_id=hrm_training_place.id WHERE hrm_training.user_id=" . 
intval($id);
-
-                       $this->db->query($sql,__LINE__,__FILE__);
-
-                       while ($this->db->next_record())
-                       {
-                               $training[] = array
-                               (
-                                       'training_id'   => 
$this->db->f('training_id'),
-                                       'start_date'    => 
$this->db->f('start_date'),
-                                       'end_date'      => 
$this->db->f('end_date'),
-                                       'title' => 
stripslashes($this->db->f('title')),
-                                       'place' => 
stripslashes($this->db->f('place'))
-                               );
-
-                       }
-                       return $training;
-               }
-
-               function add($values)
-               {
-                       $this->db->transaction_begin();
-
-                       $values['name'] = 
$this->db->db_addslashes($values['name']);
-                       $values['address'] = 
$this->db->db_addslashes($values['address']);
-                       $values['town'] = 
$this->db->db_addslashes($values['town']);
-                       $values['descr'] = 
$this->db->db_addslashes($values['descr']);
-                       $values['place_id'] = 
$this->bocommon->next_id('hrm_training_place');
-
-                       $insert_values=array(
-                               $values['place_id'],
-                               $values['name'],
-                               $values['address'],
-                               $values['zip'],
-                               $values['town'],
-                               $values['remark'],
-                               );
-
-                       $insert_values  = 
$this->bocommon->validate_db_insert($insert_values);
-                       $this->db->query("INSERT INTO hrm_training_place 
(id,name,address,zip,town, remark) "
-                               . "VALUES ($insert_values)",__LINE__,__FILE__);
-
-                       $receipt['message'][]=array('msg'=>lang('training item 
has been saved'));
-                       $receipt['place_id']= $values['place_id'];
-
-                       $this->db->transaction_commit();
-
-                       return $receipt;
-               }
-
-               function edit($values)
-               {
-                       $this->db->transaction_begin();
-
-                       $value_set['name']                      = 
$this->db->db_addslashes($values['name']);
-                       $value_set['address']                   = 
$this->db->db_addslashes($values['address']);
-                       $value_set['zip']       = $values['zip'];
-                       $value_set['remark']            = 
$this->db->db_addslashes($values['remark']);
-                       $value_set['town']                      = 
$this->db->db_addslashes($values['town']);
-
-                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-
-                       $this->db->query("UPDATE hrm_training_place set 
$value_set WHERE id=" . $values['place_id'],__LINE__,__FILE__);
-
-                       $this->db->transaction_commit();
-
-                       $receipt['message'][]=array('msg'=>lang('Place item has 
been edited'));
-
-                       $receipt['place_id']= $values['place_id'];
-                       return $receipt;
-               }
-
-               function delete($id)
-               {
-
-                       $this->db->query('DELETE FROM hrm_training_place WHERE 
id='  . intval($id),__LINE__,__FILE__);
-               }
-
-               function select_place_list()
-               {
-                       $this->db->query("SELECT * FROM hrm_training_place  
ORDER BY name ");
-
-                       $i = 0;
-                       while ($this->db->next_record())
-                       {
-                               $place[$i]['id']                                
= $this->db->f('id');
-                               $place[$i]['name']                              
= stripslashes($this->db->f('name'));
-                               $i++;
-                       }
-                       return $place;
-               }
-       }
\ No newline at end of file
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage place
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package hrm
+        */
+
+       class soplace
+       {
+               var $grants;
+               var $db;
+               var $db2;
+               var $account;
+
+               function soplace()
+               {
+                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->db               = $GLOBALS['phpgw']->db;
+                       $this->db2              = $this->db;
+                       $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
+
+                       $this->grants   = 
$GLOBALS['phpgw']->acl->get_grants('hrm');
+                       $this->left_join                = 
$this->bocommon->left_join;
+                       $this->join                     = $this->bocommon->join;
+                       $this->like                     = $this->bocommon->like;
+               }
+
+               function read($data)
+               {
+                       if(is_array($data))
+                       {
+                               if ($data['start'])
+                               {
+                                       $start=$data['start'];
+                               }
+                               else
+                               {
+                                       $start=0;
+                               }
+                               $query          = 
(isset($data['query'])?$data['query']:'');
+                               $sort           = 
(isset($data['sort'])?$data['sort']:'DESC');
+                               $order          = 
(isset($data['order'])?$data['order']:'');
+                               $allrows        = 
(isset($data['allrows'])?$data['allrows']:'');
+                       }
+
+                       if ($order)
+                       {
+                               $ordermethod = " order by $order $sort";
+
+                       }
+                       else
+                       {
+                               $ordermethod = ' order by name asc';
+                       }
+
+                       $table = 'hrm_training_place';
+
+                       if($query)
+                       {
+                               $query = ereg_replace("'",'',$query);
+                               $query = ereg_replace('"','',$query);
+
+                               $querymethod = " WHERE name $this->like 
'%$query%'";
+                       }
+
+                       $sql = "SELECT * FROM $table $querymethod";
+
+                       $this->db2->query($sql,__LINE__,__FILE__);
+                       $this->total_records = $this->db2->num_rows();
+
+                       if(!$allrows)
+                       {
+                               $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
+                       }
+                       else
+                       {
+                               $this->db->query($sql . 
$ordermethod,__LINE__,__FILE__);
+                       }
+
+                       while ($this->db->next_record())
+                       {
+                               $place_info[] = array
+                               (
+                                       'id'    => $this->db->f('id'),
+                                       'name'  => 
stripslashes($this->db->f('name')),
+                                       'descr' => 
stripslashes($this->db->f('descr'))
+                               );
+                       }
+
+                       return $place_info;
+               }
+
+
+               function read_single($id)
+               {
+                       $sql = 'SELECT * FROM hrm_training_place where id=' . 
intval($id);
+
+                       $this->db->query($sql,__LINE__,__FILE__);
+
+                       if ($this->db->next_record())
+                       {
+                               $values['id']           = $id;
+                               $values['name'] = 
stripslashes($this->db->f('name'));
+                               $values['address']      = 
stripslashes($this->db->f('address'));
+                               $values['remark']       = 
stripslashes($this->db->f('remark'));
+                               $values['town'] = 
stripslashes($this->db->f('town'));
+                               $values['zip']  = $this->db->f('zip');
+                               $values['entry_date']   = 
$this->db->f('entry_date');
+                               $values['owner']        = $this->db->f('owner');
+                       }
+                       return $values;
+               }
+
+               function read_training($id)
+               {
+                       $sql = "SELECT hrm_training.id as 
training_id,hrm_training.title as title, 
hrm_training.start_date,hrm_training.end_date,hrm_training_place.name as place 
FROM hrm_training $this->left_join hrm_training_place on 
hrm_training.place_id=hrm_training_place.id WHERE hrm_training.user_id=" . 
intval($id);
+
+                       $this->db->query($sql,__LINE__,__FILE__);
+
+                       while ($this->db->next_record())
+                       {
+                               $training[] = array
+                               (
+                                       'training_id'   => 
$this->db->f('training_id'),
+                                       'start_date'    => 
$this->db->f('start_date'),
+                                       'end_date'      => 
$this->db->f('end_date'),
+                                       'title' => 
stripslashes($this->db->f('title')),
+                                       'place' => 
stripslashes($this->db->f('place'))
+                               );
+
+                       }
+                       return $training;
+               }
+
+               function add($values)
+               {
+                       $this->db->transaction_begin();
+
+                       $values['name'] = 
$this->db->db_addslashes($values['name']);
+                       $values['address'] = 
$this->db->db_addslashes($values['address']);
+                       $values['town'] = 
$this->db->db_addslashes($values['town']);
+                       $values['descr'] = 
$this->db->db_addslashes($values['descr']);
+                       $values['place_id'] = 
$this->bocommon->next_id('hrm_training_place');
+
+                       $insert_values=array(
+                               $values['place_id'],
+                               $values['name'],
+                               $values['address'],
+                               $values['zip'],
+                               $values['town'],
+                               $values['remark'],
+                               );
+
+                       $insert_values  = 
$this->bocommon->validate_db_insert($insert_values);
+                       $this->db->query("INSERT INTO hrm_training_place 
(id,name,address,zip,town, remark) "
+                               . "VALUES ($insert_values)",__LINE__,__FILE__);
+
+                       $receipt['message'][]=array('msg'=>lang('training item 
has been saved'));
+                       $receipt['place_id']= $values['place_id'];
+
+                       $this->db->transaction_commit();
+
+                       return $receipt;
+               }
+
+               function edit($values)
+               {
+                       $this->db->transaction_begin();
+
+                       $value_set['name']                      = 
$this->db->db_addslashes($values['name']);
+                       $value_set['address']                   = 
$this->db->db_addslashes($values['address']);
+                       $value_set['zip']       = $values['zip'];
+                       $value_set['remark']            = 
$this->db->db_addslashes($values['remark']);
+                       $value_set['town']                      = 
$this->db->db_addslashes($values['town']);
+
+                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
+
+
+                       $this->db->query("UPDATE hrm_training_place set 
$value_set WHERE id=" . $values['place_id'],__LINE__,__FILE__);
+
+                       $this->db->transaction_commit();
+
+                       $receipt['message'][]=array('msg'=>lang('Place item has 
been edited'));
+
+                       $receipt['place_id']= $values['place_id'];
+                       return $receipt;
+               }
+
+               function delete($id)
+               {
+
+                       $this->db->query('DELETE FROM hrm_training_place WHERE 
id='  . intval($id),__LINE__,__FILE__);
+               }
+
+               function select_place_list()
+               {
+                       $this->db->query("SELECT * FROM hrm_training_place  
ORDER BY name ");
+
+                       $i = 0;
+                       while ($this->db->next_record())
+                       {
+                               $place[$i]['id']                                
= $this->db->f('id');
+                               $place[$i]['name']                              
= stripslashes($this->db->f('name'));
+                               $i++;
+                       }
+                       return $place;
+               }
+       }

====================================================
Index: hrm/inc/class.menu.inc.php
diff -u hrm/inc/class.menu.inc.php:1.4 hrm/inc/class.menu.inc.php:1.5
--- hrm/inc/class.menu.inc.php:1.4      Tue Nov 22 15:25:21 2005
+++ hrm/inc/class.menu.inc.php  Wed Nov 30 17:07:22 2005
@@ -1,91 +1,91 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage core
-       * @version $Id$
-       */
-
-       /**
-        * Description
-        * @package hrm
-        */
-
-       class menu
-       {
-               var $sub;
-
-               var $public_functions = array
-               (
-                       'links' => True,
-               );
-
-               function menu($sub='')
-               {
-                       $this->sub              = $sub;
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-               }
-
-               function links($page='',$page_2='')
-               {
-                       $currentapp=$this->currentapp;
-                       $sub = $this->sub;
-
-                       $i=0;
-                       if($sub=='user')
-                       {
-                               $menu['module'][$i]['this']=True;
-                       }
-                       $menu['module'][$i]['link']             = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiuser.index');
-                       $menu['module'][$i]['name']             = lang('User');
-                       $menu['module'][$i]['statustext']       = lang('User');
-                       $i++;
-
-                       if($sub=='job')
-                       {
-                               $menu['module'][$i]['this']=True;
-                       }
-                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uijob.index');
-                       $menu['module'][$i]['name']                     =       
lang('Job');
-                       $menu['module'][$i]['statustext']       =       
lang('Job');
-                       $i++;
-
-                       if($sub=='place')
-                       {
-                               $menu['module'][$i]['this']=True;
-                       }
-                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiplace.index');
-                       $menu['module'][$i]['name']                     =       
lang('PLace');
-                       $menu['module'][$i]['statustext']       =       
lang('Place');
-                       $i++;
-
-                       $j=0;
-                       if ($sub == 'job')
-                       {
-                               if($page=='job_type')
-                               {
-                                       $menu['sub_menu'][$j]['this']=True;
-                               }
-                               $menu['sub_menu'][$j]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uijob.index');
-                               $menu['sub_menu'][$j]['name']                   
=       lang('Job type');
-                               $menu['sub_menu'][$j]['statustext']             
=       lang('Job type');
-                               $j++;
-
-                               if($page=='hierarchy')
-                               {
-                                       $menu['sub_menu'][$j]['this']=True;
-                               }
-                               $menu['sub_menu'][$j]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uijob.hierarchy&paid=true');
-                               $menu['sub_menu'][$j]['name']                   
=       lang('Organisation');
-                               $menu['sub_menu'][$j]['statustext']             
=       lang('Organisation');
-                               $j++;
-                       }
-
-                       return $menu;
-               }
-       }
\ No newline at end of file
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage core
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package hrm
+        */
+
+       class menu
+       {
+               var $sub;
+
+               var $public_functions = array
+               (
+                       'links' => True,
+               );
+
+               function menu($sub='')
+               {
+                       $this->sub              = $sub;
+                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               }
+
+               function links($page='',$page_2='')
+               {
+                       $currentapp=$this->currentapp;
+                       $sub = $this->sub;
+
+                       $i=0;
+                       if($sub=='user')
+                       {
+                               $menu['module'][$i]['this']=True;
+                       }
+                       $menu['module'][$i]['link']             = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiuser.index');
+                       $menu['module'][$i]['name']             = lang('User');
+                       $menu['module'][$i]['statustext']       = lang('User');
+                       $i++;
+
+                       if($sub=='job')
+                       {
+                               $menu['module'][$i]['this']=True;
+                       }
+                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uijob.index');
+                       $menu['module'][$i]['name']                     =       
lang('Job');
+                       $menu['module'][$i]['statustext']       =       
lang('Job');
+                       $i++;
+
+                       if($sub=='place')
+                       {
+                               $menu['module'][$i]['this']=True;
+                       }
+                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiplace.index');
+                       $menu['module'][$i]['name']                     =       
lang('PLace');
+                       $menu['module'][$i]['statustext']       =       
lang('Place');
+                       $i++;
+
+                       $j=0;
+                       if ($sub == 'job')
+                       {
+                               if($page=='job_type')
+                               {
+                                       $menu['sub_menu'][$j]['this']=True;
+                               }
+                               $menu['sub_menu'][$j]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uijob.index');
+                               $menu['sub_menu'][$j]['name']                   
=       lang('Job type');
+                               $menu['sub_menu'][$j]['statustext']             
=       lang('Job type');
+                               $j++;
+
+                               if($page=='hierarchy')
+                               {
+                                       $menu['sub_menu'][$j]['this']=True;
+                               }
+                               $menu['sub_menu'][$j]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uijob.hierarchy&paid=true');
+                               $menu['sub_menu'][$j]['name']                   
=       lang('Organisation');
+                               $menu['sub_menu'][$j]['statustext']             
=       lang('Organisation');
+                               $j++;
+                       }
+
+                       return $menu;
+               }
+       }

====================================================
Index: hrm/inc/class.bouser.inc.php
diff -u hrm/inc/class.bouser.inc.php:1.6 hrm/inc/class.bouser.inc.php:1.7
--- hrm/inc/class.bouser.inc.php:1.6    Tue Nov 29 13:09:40 2005
+++ hrm/inc/class.bouser.inc.php        Wed Nov 30 17:07:22 2005
@@ -1,249 +1,249 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage user
-       * @version $Id$
-       */
-
-       /**
-        * Description
-        * @package hrm
-        */
-
-       class bouser
-       {
-               var $start;
-               var $query;
-               var $filter;
-               var $sort;
-               var $order;
-               var $cat_id;
-
-               var $public_functions = array
-               (
-                       'read'                  => True,
-                       'read_single'           => True,
-                       'save'                  => True,
-                       'delete'                => True,
-                       'check_perms'           => True
-               );
-
-               var $soap_functions = array(
-                       'list' => array(
-                               'in'  => 
array('int','int','struct','string','int'),
-                               'out' => array('array')
-                       ),
-                       'read' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array('array')
-                       ),
-                       'save' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array()
-                       ),
-                       'delete' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array()
-                       )
-               );
-
-               function bouser($session=False)
-               {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->so               = 
CreateObject($this->currentapp.'.souser');
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage user
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package hrm
+        */
+
+       class bouser
+       {
+               var $start;
+               var $query;
+               var $filter;
+               var $sort;
+               var $order;
+               var $cat_id;
+
+               var $public_functions = array
+               (
+                       'read'                  => True,
+                       'read_single'           => True,
+                       'save'                  => True,
+                       'delete'                => True,
+                       'check_perms'           => True
+               );
+
+               var $soap_functions = array(
+                       'list' => array(
+                               'in'  => 
array('int','int','struct','string','int'),
+                               'out' => array('array')
+                       ),
+                       'read' => array(
+                               'in'  => array('int','struct'),
+                               'out' => array('array')
+                       ),
+                       'save' => array(
+                               'in'  => array('int','struct'),
+                               'out' => array()
+                       ),
+                       'delete' => array(
+                               'in'  => array('int','struct'),
+                               'out' => array()
+                       )
+               );
+
+               function bouser($session=False)
+               {
+                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->so               = 
CreateObject($this->currentapp.'.souser');
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
-                       $this->grants = $this->so->grants;
-
-                       if ($session)
-                       {
-                               $this->read_sessiondata();
-                               $this->use_session = True;
-                       }
-
-                       $start  = get_var('start',array('POST','GET'));
-                       $query  = get_var('query',array('POST','GET'));
-                       $sort   = get_var('sort',array('POST','GET'));
-                       $order  = get_var('order',array('POST','GET'));
-                       $filter = get_var('filter',array('POST','GET'));
-                       $cat_id = get_var('cat_id',array('POST','GET'));
-                       $allrows= get_var('allrows',array('POST','GET'));
-
-                       if ($start)
-                       {
-                               $this->start=$start;
-                       }
-                       else
-                       {
-                               $this->start=0;
-                       }
-
-                       if(array_key_exists('query',$_POST) || 
array_key_exists('query',$_GET))
-                       {
-                               $this->query = $query;
-                       }
-                       if(array_key_exists('filter',$_POST) || 
array_key_exists('filter',$_GET))
-                       {
-                               $this->filter = $filter;
-                       }
-                       if(array_key_exists('sort',$_POST) || 
array_key_exists('sort',$_GET))
-                       {
-                               $this->sort = $sort;
-                       }
-                       if(array_key_exists('order',$_POST) || 
array_key_exists('order',$_GET))
-                       {
-                               $this->order = $order;
-                       }
-                       if(array_key_exists('cat_id',$_POST) || 
array_key_exists('cat_id',$_GET))
-                       {
-                               $this->cat_id = $cat_id;
-                       }
-                       if ($allrows)
-                       {
-                               $this->allrows = $allrows;
-                       }
-               }
-
-
-               function save_sessiondata($data)
-               {
-                       if ($this->use_session)
-                       {
-                               
$GLOBALS['phpgw']->session->appsession('session_data','hr_user',$data);
-                       }
-               }
-
-               function read_sessiondata()
-               {
-                       $data = 
$GLOBALS['phpgw']->session->appsession('session_data','hr_user');
-
-                       $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'];
-               }
-
-
-               function read()
-               {
-                       $account_info = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-                                                                               
        'allrows'=>$this->allrows));
-                       $this->total_records = $this->so->total_records;
-                       return $account_info;
-               }
-
-               function read_single_training($id)
-               {
-                       $values =$this->so->read_single_training($id);
-                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-                       if($values['start_date'])
-                       {
-                               $values['start_date']   = 
$GLOBALS['phpgw']->common->show_date($values['start_date'],$dateformat);
-                       }
-                       if($values['end_date'])
-                       {
-                               $values['end_date']     = 
$GLOBALS['phpgw']->common->show_date($values['end_date'],$dateformat);
-                       }
-                       if($values['entry_date'])
-                       {
-                               $values['entry_date']   = 
$GLOBALS['phpgw']->common->show_date($values['entry_date'],$dateformat);
-                       }
-
-                       return $values;
-               }
-
-               function read_training($user_id)
-               {
-                       $values = 
$this->so->read_training(array('user_id'=>$user_id, 'start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-                                                                               
        'allrows'=>$this->allrows));
-                       return $values;
-               }
-
-
-               function save($values,$action='')
-               {
-                       $values['start_date']   = 
$this->bocommon->date_to_timestamp($values['start_date']);
-                       $values['end_date']     = 
$this->bocommon->date_to_timestamp($values['end_date']);
-
-                       if ($action=='edit')
-                       {
-                               if ($values['training_id'] != '')
-                               {
-
-                                       $receipt = 
$this->so->edit_training($values);
-                               }
-                               else
-                               {
-                                       
$receipt['error'][]=array('msg'=>lang('Error'));
-                               }
-                       }
-                       else
-                       {
-                               $receipt = $this->so->add_training($values);
-                       }
-
-                       return $receipt;
-               }
-
-               function delete_training($user_id,$id)
-               {
-                       $this->so->delete_training($user_id,$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 select_place_list($selected='')
-               {
-                       $places= $this->so->select_place_list();
-                       $place_list = 
$this->bocommon->select_list($selected,$places);
-                       return $place_list;
-               }
+                       $this->grants = $this->so->grants;
+
+                       if ($session)
+                       {
+                               $this->read_sessiondata();
+                               $this->use_session = True;
+                       }
+
+                       $start  = get_var('start',array('POST','GET'));
+                       $query  = get_var('query',array('POST','GET'));
+                       $sort   = get_var('sort',array('POST','GET'));
+                       $order  = get_var('order',array('POST','GET'));
+                       $filter = get_var('filter',array('POST','GET'));
+                       $cat_id = get_var('cat_id',array('POST','GET'));
+                       $allrows= get_var('allrows',array('POST','GET'));
+
+                       if ($start)
+                       {
+                               $this->start=$start;
+                       }
+                       else
+                       {
+                               $this->start=0;
+                       }
+
+                       if(array_key_exists('query',$_POST) || 
array_key_exists('query',$_GET))
+                       {
+                               $this->query = $query;
+                       }
+                       if(array_key_exists('filter',$_POST) || 
array_key_exists('filter',$_GET))
+                       {
+                               $this->filter = $filter;
+                       }
+                       if(array_key_exists('sort',$_POST) || 
array_key_exists('sort',$_GET))
+                       {
+                               $this->sort = $sort;
+                       }
+                       if(array_key_exists('order',$_POST) || 
array_key_exists('order',$_GET))
+                       {
+                               $this->order = $order;
+                       }
+                       if(array_key_exists('cat_id',$_POST) || 
array_key_exists('cat_id',$_GET))
+                       {
+                               $this->cat_id = $cat_id;
+                       }
+                       if ($allrows)
+                       {
+                               $this->allrows = $allrows;
+                       }
+               }
+
+
+               function save_sessiondata($data)
+               {
+                       if ($this->use_session)
+                       {
+                               
$GLOBALS['phpgw']->session->appsession('session_data','hr_user',$data);
+                       }
+               }
+
+               function read_sessiondata()
+               {
+                       $data = 
$GLOBALS['phpgw']->session->appsession('session_data','hr_user');
+
+                       $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'];
+               }
+
+
+               function read()
+               {
+                       $account_info = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
+                                                                               
        'allrows'=>$this->allrows));
+                       $this->total_records = $this->so->total_records;
+                       return $account_info;
+               }
+
+               function read_single_training($id)
+               {
+                       $values =$this->so->read_single_training($id);
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       if($values['start_date'])
+                       {
+                               $values['start_date']   = 
$GLOBALS['phpgw']->common->show_date($values['start_date'],$dateformat);
+                       }
+                       if($values['end_date'])
+                       {
+                               $values['end_date']     = 
$GLOBALS['phpgw']->common->show_date($values['end_date'],$dateformat);
+                       }
+                       if($values['entry_date'])
+                       {
+                               $values['entry_date']   = 
$GLOBALS['phpgw']->common->show_date($values['entry_date'],$dateformat);
+                       }
+
+                       return $values;
+               }
+
+               function read_training($user_id)
+               {
+                       $values = 
$this->so->read_training(array('user_id'=>$user_id, 'start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
+                                                                               
        'allrows'=>$this->allrows));
+                       return $values;
+               }
+
+
+               function save($values,$action='')
+               {
+                       $values['start_date']   = 
$this->bocommon->date_to_timestamp($values['start_date']);
+                       $values['end_date']     = 
$this->bocommon->date_to_timestamp($values['end_date']);
+
+                       if ($action=='edit')
+                       {
+                               if ($values['training_id'] != '')
+                               {
+
+                                       $receipt = 
$this->so->edit_training($values);
+                               }
+                               else
+                               {
+                                       
$receipt['error'][]=array('msg'=>lang('Error'));
+                               }
+                       }
+                       else
+                       {
+                               $receipt = $this->so->add_training($values);
+                       }
+
+                       return $receipt;
+               }
+
+               function delete_training($user_id,$id)
+               {
+                       $this->so->delete_training($user_id,$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 select_place_list($selected='')
+               {
+                       $places= $this->so->select_place_list();
+                       $place_list = 
$this->bocommon->select_list($selected,$places);
+                       return $place_list;
+               }
        }

====================================================
Index: hrm/inc/class.bocategory.inc.php
diff -u hrm/inc/class.bocategory.inc.php:1.3 
hrm/inc/class.bocategory.inc.php:1.4
--- hrm/inc/class.bocategory.inc.php:1.3        Mon Nov 28 15:06:48 2005
+++ hrm/inc/class.bocategory.inc.php    Wed Nov 30 17:07:22 2005
@@ -1,180 +1,180 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage admin
-       * @version $Id$
-       */
-
-       /**
-        * Description
-        * @package hrm
-        */
-
-       class bocategory
-       {
-               var $start;
-               var $query;
-               var $filter;
-               var $sort;
-               var $order;
-               var $cat_id;
-
-               var $public_functions = array
-               (
-                       'read'                          => True,
-                       'read_single'           => True,
-                       'save'                          => True,
-                       'delete'                        => True,
-                       'check_perms'           => True
-               );
-
-               var $soap_functions = array(
-                       'list' => array(
-                               'in'  => 
array('int','int','struct','string','int'),
-                               'out' => array('array')
-                       ),
-                       'read' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array('array')
-                       ),
-                       'save' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array()
-                       ),
-                       'delete' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array()
-                       )
-               );
-
-               function bocategory($session=False)
-               {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->so               = 
CreateObject($this->currentapp.'.socategory');
-                       $this->bocommon = 
CreateObject($this->currentapp.'.bocommon');
-
-                       if ($session)
-                       {
-                               $this->read_sessiondata();
-                               $this->use_session = True;
-                       }
-
-                       $start  = get_var('start',array('POST','GET'));
-                       $query  = get_var('query',array('POST','GET'));
-                       $sort   = get_var('sort',array('POST','GET'));
-                       $order  = get_var('order',array('POST','GET'));
-                       $filter = get_var('filter',array('POST','GET'));
-                       $cat_id = get_var('cat_id',array('POST','GET'));
-                       $allrows= get_var('allrows',array('POST','GET'));
-
-                       if ($start)
-                       {
-                               $this->start=$start;
-                       }
-                       else
-                       {
-                               $this->start=0;
-                       }
-
-                       if(isset($query))
-                       {
-                               $this->query = $query;
-                       }
-                       if(!empty($filter))
-                       {
-                               $this->filter = $filter;
-                       }
-                       if(isset($sort))
-                       {
-                               $this->sort = $sort;
-                       }
-                       if(isset($order))
-                       {
-                               $this->order = $order;
-                       }
-                       if(isset($cat_id))
-                       {
-                               $this->cat_id = $cat_id;
-                       }
-                       if(isset($allrows))
-                       {
-                               $this->allrows = $allrows;
-                       }
-               }
-
-
-               function save_sessiondata($data)
-               {
-                       if ($this->use_session)
-                       {
-                               
$GLOBALS['phpgw']->session->appsession('session_data','category',$data);
-                       }
-               }
-
-               function read_sessiondata()
-               {
-                       $data = 
$GLOBALS['phpgw']->session->appsession('session_data','category');
-
-                       //_debug_array($data);
-
-                       $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'];
-               }
-
-
-               function read($type='',$type_id='')
-               {
-                       $category = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-                                                                               
        'type' => $type,type_id=>$type_id,'allrows'=>$this->allrows));
-
-                       $this->total_records = $this->so->total_records;
-
-                       return $category;
-               }
-
-               function read_single($id,$type,$type_id)
-               {
-                       return $this->so->read_single($id,$type,$type_id);
-               }
-
-               function select_category_list($type,$selected)
-               {
-                       $category_list = $this->so->select_category_list($type);
-                       $category_list = 
$this->bocommon->select_list($selected,$category_list);
-                       return $category_list;
-               }
-
-               function save($category,$action='',$type ='',$type_id)
-               {
-                       if ($action=='edit')
-                       {
-                               if ($category['id'] != '')
-                               {
-
-                                       $receipt = 
$this->so->edit($category,$type,$type_id);
-                               }
-                       }
-                       else
-                       {
-                               $receipt = 
$this->so->add($category,$type,$type_id);
-                       }
-
-                       return $receipt;
-               }
-
-               function delete($id,$type,$type_id)
-               {
-                       $this->so->delete($id,$type,$type_id);
-               }
-       }
\ No newline at end of file
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package hrm
+        */
+
+       class bocategory
+       {
+               var $start;
+               var $query;
+               var $filter;
+               var $sort;
+               var $order;
+               var $cat_id;
+
+               var $public_functions = array
+               (
+                       'read'                          => True,
+                       'read_single'           => True,
+                       'save'                          => True,
+                       'delete'                        => True,
+                       'check_perms'           => True
+               );
+
+               var $soap_functions = array(
+                       'list' => array(
+                               'in'  => 
array('int','int','struct','string','int'),
+                               'out' => array('array')
+                       ),
+                       'read' => array(
+                               'in'  => array('int','struct'),
+                               'out' => array('array')
+                       ),
+                       'save' => array(
+                               'in'  => array('int','struct'),
+                               'out' => array()
+                       ),
+                       'delete' => array(
+                               'in'  => array('int','struct'),
+                               'out' => array()
+                       )
+               );
+
+               function bocategory($session=False)
+               {
+                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->so               = 
CreateObject($this->currentapp.'.socategory');
+                       $this->bocommon = 
CreateObject($this->currentapp.'.bocommon');
+
+                       if ($session)
+                       {
+                               $this->read_sessiondata();
+                               $this->use_session = True;
+                       }
+
+                       $start  = get_var('start',array('POST','GET'));
+                       $query  = get_var('query',array('POST','GET'));
+                       $sort   = get_var('sort',array('POST','GET'));
+                       $order  = get_var('order',array('POST','GET'));
+                       $filter = get_var('filter',array('POST','GET'));
+                       $cat_id = get_var('cat_id',array('POST','GET'));
+                       $allrows= get_var('allrows',array('POST','GET'));
+
+                       if ($start)
+                       {
+                               $this->start=$start;
+                       }
+                       else
+                       {
+                               $this->start=0;
+                       }
+
+                       if(isset($query))
+                       {
+                               $this->query = $query;
+                       }
+                       if(!empty($filter))
+                       {
+                               $this->filter = $filter;
+                       }
+                       if(isset($sort))
+                       {
+                               $this->sort = $sort;
+                       }
+                       if(isset($order))
+                       {
+                               $this->order = $order;
+                       }
+                       if(isset($cat_id))
+                       {
+                               $this->cat_id = $cat_id;
+                       }
+                       if(isset($allrows))
+                       {
+                               $this->allrows = $allrows;
+                       }
+               }
+
+
+               function save_sessiondata($data)
+               {
+                       if ($this->use_session)
+                       {
+                               
$GLOBALS['phpgw']->session->appsession('session_data','category',$data);
+                       }
+               }
+
+               function read_sessiondata()
+               {
+                       $data = 
$GLOBALS['phpgw']->session->appsession('session_data','category');
+
+                       //_debug_array($data);
+
+                       $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'];
+               }
+
+
+               function read($type='',$type_id='')
+               {
+                       $category = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
+                                                                               
        'type' => $type,type_id=>$type_id,'allrows'=>$this->allrows));
+
+                       $this->total_records = $this->so->total_records;
+
+                       return $category;
+               }
+
+               function read_single($id,$type,$type_id)
+               {
+                       return $this->so->read_single($id,$type,$type_id);
+               }
+
+               function select_category_list($type,$selected)
+               {
+                       $category_list = $this->so->select_category_list($type);
+                       $category_list = 
$this->bocommon->select_list($selected,$category_list);
+                       return $category_list;
+               }
+
+               function save($category,$action='',$type ='',$type_id)
+               {
+                       if ($action=='edit')
+                       {
+                               if ($category['id'] != '')
+                               {
+
+                                       $receipt = 
$this->so->edit($category,$type,$type_id);
+                               }
+                       }
+                       else
+                       {
+                               $receipt = 
$this->so->add($category,$type,$type_id);
+                       }
+
+                       return $receipt;
+               }
+
+               function delete($id,$type,$type_id)
+               {
+                       $this->so->delete($id,$type,$type_id);
+               }
+       }

====================================================
Index: hrm/inc/class.boadmin.inc.php
diff -u hrm/inc/class.boadmin.inc.php:1.4 hrm/inc/class.boadmin.inc.php:1.5
--- hrm/inc/class.boadmin.inc.php:1.4   Tue Nov 29 13:09:39 2005
+++ hrm/inc/class.boadmin.inc.php       Wed Nov 30 17:07:22 2005
@@ -1,404 +1,404 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage admin
-       * @version $Id$
-       */
-
-       /**
-        * Description
-        * @package property
-        */
-
-       class boadmin
-       {
-               var $start;
-               var $query;
-               var $filter;
-               var $sort;
-               var $order;
-               var $cat_id;
-
-               function boadmin($session='')
-               {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->so                       = 
CreateObject($this->currentapp.'.soadmin');
-                       $this->catbo = createobject('phpgwapi.categories');
-
-//                     $this->acl              = $GLOBALS['phpgw']->acl;
-                       $this->acl              = 
CreateObject($this->currentapp.'.acl2');
-                       $this->right            = array(1,2,4,8,16);
-
-                       if ($session)
-                       {
-                               $this->read_sessiondata();
-                               $this->use_session = True;
-                       }
-
-                       $acl_app        = 
get_var('acl_app',array('POST','GET'));
-                       $start  = get_var('start',array('POST','GET'));
-                       $query  = get_var('query',array('POST','GET'));
-                       $sort   = get_var('sort',array('POST','GET'));
-                       $order  = get_var('order',array('POST','GET'));
-                       $filter = get_var('filter',array('POST','GET'));
-                       $cat_id = get_var('cat_id',array('POST','GET'));
-                       $permission     = 
get_var('permission',array('POST','GET'));
-                       $module = get_var('module',array('POST','GET'));
-                       $granting_group = 
get_var('granting_group',array('POST','GET'));
-                       $allrows        = 
get_var('allrows',array('POST','GET'));
-
-                       if ($start)
-                       {
-                               $this->start=$start;
-                       }
-                       else
-                       {
-                               $this->start=0;
-                       }
-
-                       if($acl_app)
-                       {
-                               $this->acl_app = $acl_app;
-                       }
-                       else
-                       {
-                               $this->acl_app = $this->currentapp;
-                       }
-                       if(isset($query))
-                       {
-                               $this->query = $query;
-                       }
-                       if(isset($filter))
-                       {
-                               $this->filter = $filter;
-                       }
-                       if(isset($sort))
-                       {
-                               $this->sort = $sort;
-                       }
-                       if(isset($order))
-                       {
-                               $this->order = $order;
-                       }
-                       if(isset($cat_id))
-                       {
-                               $this->cat_id = $cat_id;
-                       }
-                       if(isset($module))
-                       {
-                               $this->location = $module;
-                       }
-                       if(isset($granting_group))
-                       {
-                               $this->granting_group = $granting_group;
-                       }
-                       if(isset($allrows))
-                       {
-                               $this->allrows = $allrows;
-                       }
-               }
-
-
-               function read_sessiondata()
-               {
-                       $data = 
$GLOBALS['phpgw']->session->appsession('session_data','fm_admin');
-
-                       $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->location         = $data['location'];
-                       $this->granting_group   = $data['granting_group'];
-                       $this->allrows  = $data['allrows'];
-               }
-
-               function save_sessiondata($data)
-               {
-                       if ($this->use_session)
-                       {
-                               
$GLOBALS['phpgw']->session->appsession('session_data','fm_admin',$data);
-                       }
-               }
-
-               function select_location($format='',$selected='',$grant='')
-               {
-
-                       switch($format)
-                       {
-                               case 'select':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('select_location'));
-                                       break;
-                               case 'filter':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('filter_location'));
-                                       break;
-                       }
-
-//                     $locations= $this->so->select_location($grant);
-                       $i=0;
-                       $locations[$i]['id']                    = 'run';
-                       $locations[$i]['descr']         = 'Hrm-main';
-                       $i++;
-                       $locations[$i]['id']                    = 'user';
-                       $locations[$i]['descr']         = 'Hrm-user';
-                       $i++;
-                       $locations[$i]['id']                    = 'C-1';
-                       $locations[$i]['descr']         = 
lang('contact_information');
-                       $i++;
-                       $locations[$i]['id']                    = 'C-2';
-                       $locations[$i]['descr']         = lang('photo');
-                       $i++;
-
-
-                       $api_cats = $this->catbo->return_array('all', 0, True, 
False, False, 'cat_name', True);
-                       if ( is_array($api_cats) )
-                       {
-                               foreach ($api_cats as $cat)
-                               {
-                                       $locations[$i]['id']    = 'C' . 
$cat['id'];
-                                       $locations[$i]['descr'] = $cat['name'];
-                                       $i++;
-                               }
-                       }
-                       unset($api_cats);
-
-                       while (is_array($locations) && list(,$loc) = 
each($locations))
-                       {
-                               $sel_loc = '';
-                               if ($loc['id']==$selected)
-                               {
-                                       $sel_loc = 'selected';
-                               }
-
-                               $location_list[] = array
-                               (
-                                       'id'            => $loc['id'],
-                                       'descr'         => $loc['id'] . ' [' . 
$loc['descr'] . ']',
-                                       'selected'      => $sel_loc
-                               );
-                       }
-
-                       for ($i=0;$i<count($location_list);$i++)
-                       {
-                               if ($location_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($location_list[$i]['selected']);
-                               }
-                       }
-
-                       return $location_list;
-               }
-
-               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[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;
-               }
-
-
-               function set_permission2($values,$r_processed, $grantor = 
False, $type = False)
-               {
-                       @reset($values);
-                       $totalacl = array();
-                       while(list($rowinfo,$perm) = each($values))
-                       {
-                               list($user_id,$rights) = split('_',$rowinfo);
-                               $totalacl[$user_id] += $rights;
-                       }
-                       @reset($totalacl);
-                       while(list($user_id,$rights) = @each($totalacl))
-                       {
-                               $user_checked[]=$user_id;
-
-                               $this->acl->account_id=$user_id;
-                               $this->acl->read_repository();
-                               $this->acl->delete($appname = $this->acl_app, 
$this->location,$grantor,$type);
-                               $this->acl->add($appname = $this->acl_app, 
$this->location, $rights,$grantor,$type);
-                               $this->acl->save_repository();
-                       }
-
-                       if(is_array($r_processed) && is_array($user_checked))
-                       {
-                               $user_delete    = array_diff($r_processed, 
$user_checked);
-                       }
-                       else
-                       {
-                               $user_delete    = $r_processed;
-                       }
-                       if(is_array($user_delete) && count($user_delete)>0)
-                       {
-                               while(list(,$user_id) = each($user_delete))
-                               {
-                                       $this->acl->account_id=$user_id;
-                                       $this->acl->read_repository();
-                                       $this->acl->delete($appname = 
$this->acl_app, $this->location,$grantor,$type);
-                                       $this->acl->save_repository();
-                               }
-                       }
-               }
-
-               function set_permission($values,$r_processed,$set_grant = '')
-               {
-
-                       $r_processed=explode("_",$r_processed);
-
-                       if(!$values['right'])
-                       {
-                               $values['right'] = array();
-                       }
-                       if(!$values['mask'])
-                       {
-                               $values['mask'] = array();
-                       }
-
-                       if($set_grant)
-                       {
-                               if($this->granting_group)
-                               {
-                                       $grantor = $this->granting_group;
-                               }
-                               else
-                               {
-                                       $grantor = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                               }
-                       }
-
-                       
$this->set_permission2($values['right'],$r_processed,$grantor,0);
-                       
$this->set_permission2($values['mask'],$r_processed,$grantor,1);
-
-                       $receipt['message'][] = array('msg' => 
lang('permissions are updated!'));
-                       return $receipt;
-               }
-
-
-               function get_user_list($type='',$get_grants='')
-               {
-                       if($type == 'groups')
-                       {
-                               $check_account_type = array('accounts');
-                       }
-                       else
-                       {
-                               $check_account_type = 
array('groups','accounts');
-                       }
-
-                       if($get_grants)
-                       {
-                               if($this->granting_group)
-                               {
-                                       $grantor = $this->granting_group;
-                               }
-                               else
-                               {
-                                       $grantor = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                               }
-                       }
-
-                       $right=$this->right;
-
-                       if ($this->allrows)
-                       {
-                               $this->start = -1;
-                               $offset = -1;
-                       }
-
-                       $allusers = 
$GLOBALS['phpgw']->accounts->get_list($type, $this->start,$this->sort, 
$this->order, $this->query, $offset);
-
-                       if (isSet($allusers) AND is_array($allusers))
-                       {
-                               $j=0;
-                               foreach($allusers as $account)
-                               {
-                                       $user_list[$j]['account_id']            
= $account['account_id'];
-                                       $user_list[$j]['account_lid']           
= $account['account_lid'];
-                                       $user_list[$j]['account_firstname']     
= $account['account_firstname'];
-                                       $user_list[$j]['account_lastname']      
= $account['account_lastname'];
-
-                                       
$this->acl->account_id=$account['account_id'];
-
-                                       $this->acl->read_repository();
-
-                                       $count_right=count($right);
-                                       for ($i=0;$i<$count_right;$i++)
-                                       {
-                                               
if($this->acl->check_brutto($this->location, 
$right[$i],$this->acl_app,$grantor,0,$check_account_type))
-                                               {
-                                                       
if($this->acl->account_type == 'g')
-                                                       {
-                                                               
$user_list[$j]['right'][$right[$i]] = 'from_group';
-                                                       }
-                                                       else
-                                                       {
-                                                               
$user_list[$j]['right'][$right[$i]] = 'checked';
-                                                       }
-                                                       
$user_list[$j]['result'][$right[$i]] = 'checked';
-                                               }
-                                               
if($this->acl->check_brutto($this->location, 
$right[$i],$this->acl_app,$grantor,1,$check_account_type))
-                                               {
-                                                       
if($this->acl->account_type == 'g')
-                                                       {
-                                                               
$user_list[$j]['mask'][$right[$i]] = 'from_group';
-                                                       }
-                                                       else
-                                                       {
-                                                               
$user_list[$j]['mask'][$right[$i]] = 'checked';
-                                                       }
-                                                       
unset($user_list[$j]['result'][$right[$i]]);
-                                               }
-                                       }
-
-                                       $j++;
-                               }
-                       }
-
-                       $this->total_records = 
$GLOBALS['phpgw']->accounts->total;
-
-                       return $user_list;
-               }
-       }
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package property
+        */
+
+       class boadmin
+       {
+               var $start;
+               var $query;
+               var $filter;
+               var $sort;
+               var $order;
+               var $cat_id;
+
+               function boadmin($session='')
+               {
+                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->so                       = 
CreateObject($this->currentapp.'.soadmin');
+                       $this->catbo = createobject('phpgwapi.categories');
+
+//                     $this->acl              = $GLOBALS['phpgw']->acl;
+                       $this->acl              = 
CreateObject($this->currentapp.'.acl2');
+                       $this->right            = array(1,2,4,8,16);
+
+                       if ($session)
+                       {
+                               $this->read_sessiondata();
+                               $this->use_session = True;
+                       }
+
+                       $acl_app        = 
get_var('acl_app',array('POST','GET'));
+                       $start  = get_var('start',array('POST','GET'));
+                       $query  = get_var('query',array('POST','GET'));
+                       $sort   = get_var('sort',array('POST','GET'));
+                       $order  = get_var('order',array('POST','GET'));
+                       $filter = get_var('filter',array('POST','GET'));
+                       $cat_id = get_var('cat_id',array('POST','GET'));
+                       $permission     = 
get_var('permission',array('POST','GET'));
+                       $module = get_var('module',array('POST','GET'));
+                       $granting_group = 
get_var('granting_group',array('POST','GET'));
+                       $allrows        = 
get_var('allrows',array('POST','GET'));
+
+                       if ($start)
+                       {
+                               $this->start=$start;
+                       }
+                       else
+                       {
+                               $this->start=0;
+                       }
+
+                       if($acl_app)
+                       {
+                               $this->acl_app = $acl_app;
+                       }
+                       else
+                       {
+                               $this->acl_app = $this->currentapp;
+                       }
+                       if(isset($query))
+                       {
+                               $this->query = $query;
+                       }
+                       if(isset($filter))
+                       {
+                               $this->filter = $filter;
+                       }
+                       if(isset($sort))
+                       {
+                               $this->sort = $sort;
+                       }
+                       if(isset($order))
+                       {
+                               $this->order = $order;
+                       }
+                       if(isset($cat_id))
+                       {
+                               $this->cat_id = $cat_id;
+                       }
+                       if(isset($module))
+                       {
+                               $this->location = $module;
+                       }
+                       if(isset($granting_group))
+                       {
+                               $this->granting_group = $granting_group;
+                       }
+                       if(isset($allrows))
+                       {
+                               $this->allrows = $allrows;
+                       }
+               }
+
+
+               function read_sessiondata()
+               {
+                       $data = 
$GLOBALS['phpgw']->session->appsession('session_data','fm_admin');
+
+                       $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->location         = $data['location'];
+                       $this->granting_group   = $data['granting_group'];
+                       $this->allrows  = $data['allrows'];
+               }
+
+               function save_sessiondata($data)
+               {
+                       if ($this->use_session)
+                       {
+                               
$GLOBALS['phpgw']->session->appsession('session_data','fm_admin',$data);
+                       }
+               }
+
+               function select_location($format='',$selected='',$grant='')
+               {
+
+                       switch($format)
+                       {
+                               case 'select':
+                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('select_location'));
+                                       break;
+                               case 'filter':
+                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('filter_location'));
+                                       break;
+                       }
+
+//                     $locations= $this->so->select_location($grant);
+                       $i=0;
+                       $locations[$i]['id']                    = 'run';
+                       $locations[$i]['descr']         = 'Hrm-main';
+                       $i++;
+                       $locations[$i]['id']                    = 'user';
+                       $locations[$i]['descr']         = 'Hrm-user';
+                       $i++;
+                       $locations[$i]['id']                    = 'C-1';
+                       $locations[$i]['descr']         = 
lang('contact_information');
+                       $i++;
+                       $locations[$i]['id']                    = 'C-2';
+                       $locations[$i]['descr']         = lang('photo');
+                       $i++;
+
+
+                       $api_cats = $this->catbo->return_array('all', 0, True, 
False, False, 'cat_name', True);
+                       if ( is_array($api_cats) )
+                       {
+                               foreach ($api_cats as $cat)
+                               {
+                                       $locations[$i]['id']    = 'C' . 
$cat['id'];
+                                       $locations[$i]['descr'] = $cat['name'];
+                                       $i++;
+                               }
+                       }
+                       unset($api_cats);
+
+                       while (is_array($locations) && list(,$loc) = 
each($locations))
+                       {
+                               $sel_loc = '';
+                               if ($loc['id']==$selected)
+                               {
+                                       $sel_loc = 'selected';
+                               }
+
+                               $location_list[] = array
+                               (
+                                       'id'            => $loc['id'],
+                                       'descr'         => $loc['id'] . ' [' . 
$loc['descr'] . ']',
+                                       'selected'      => $sel_loc
+                               );
+                       }
+
+                       for ($i=0;$i<count($location_list);$i++)
+                       {
+                               if ($location_list[$i]['selected'] != 
'selected')
+                               {
+                                       unset($location_list[$i]['selected']);
+                               }
+                       }
+
+                       return $location_list;
+               }
+
+               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[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;
+               }
+
+
+               function set_permission2($values,$r_processed, $grantor = 
False, $type = False)
+               {
+                       @reset($values);
+                       $totalacl = array();
+                       while(list($rowinfo,$perm) = each($values))
+                       {
+                               list($user_id,$rights) = split('_',$rowinfo);
+                               $totalacl[$user_id] += $rights;
+                       }
+                       @reset($totalacl);
+                       while(list($user_id,$rights) = @each($totalacl))
+                       {
+                               $user_checked[]=$user_id;
+
+                               $this->acl->account_id=$user_id;
+                               $this->acl->read_repository();
+                               $this->acl->delete($appname = $this->acl_app, 
$this->location,$grantor,$type);
+                               $this->acl->add($appname = $this->acl_app, 
$this->location, $rights,$grantor,$type);
+                               $this->acl->save_repository();
+                       }
+
+                       if(is_array($r_processed) && is_array($user_checked))
+                       {
+                               $user_delete    = array_diff($r_processed, 
$user_checked);
+                       }
+                       else
+                       {
+                               $user_delete    = $r_processed;
+                       }
+                       if(is_array($user_delete) && count($user_delete)>0)
+                       {
+                               while(list(,$user_id) = each($user_delete))
+                               {
+                                       $this->acl->account_id=$user_id;
+                                       $this->acl->read_repository();
+                                       $this->acl->delete($appname = 
$this->acl_app, $this->location,$grantor,$type);
+                                       $this->acl->save_repository();
+                               }
+                       }
+               }
+
+               function set_permission($values,$r_processed,$set_grant = '')
+               {
+
+                       $r_processed=explode("_",$r_processed);
+
+                       if(!$values['right'])
+                       {
+                               $values['right'] = array();
+                       }
+                       if(!$values['mask'])
+                       {
+                               $values['mask'] = array();
+                       }
+
+                       if($set_grant)
+                       {
+                               if($this->granting_group)
+                               {
+                                       $grantor = $this->granting_group;
+                               }
+                               else
+                               {
+                                       $grantor = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                               }
+                       }
+
+                       
$this->set_permission2($values['right'],$r_processed,$grantor,0);
+                       
$this->set_permission2($values['mask'],$r_processed,$grantor,1);
+
+                       $receipt['message'][] = array('msg' => 
lang('permissions are updated!'));
+                       return $receipt;
+               }
+
+
+               function get_user_list($type='',$get_grants='')
+               {
+                       if($type == 'groups')
+                       {
+                               $check_account_type = array('accounts');
+                       }
+                       else
+                       {
+                               $check_account_type = 
array('groups','accounts');
+                       }
+
+                       if($get_grants)
+                       {
+                               if($this->granting_group)
+                               {
+                                       $grantor = $this->granting_group;
+                               }
+                               else
+                               {
+                                       $grantor = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                               }
+                       }
+
+                       $right=$this->right;
+
+                       if ($this->allrows)
+                       {
+                               $this->start = -1;
+                               $offset = -1;
+                       }
+
+                       $allusers = 
$GLOBALS['phpgw']->accounts->get_list($type, $this->start,$this->sort, 
$this->order, $this->query, $offset);
+
+                       if (isSet($allusers) AND is_array($allusers))
+                       {
+                               $j=0;
+                               foreach($allusers as $account)
+                               {
+                                       $user_list[$j]['account_id']            
= $account['account_id'];
+                                       $user_list[$j]['account_lid']           
= $account['account_lid'];
+                                       $user_list[$j]['account_firstname']     
= $account['account_firstname'];
+                                       $user_list[$j]['account_lastname']      
= $account['account_lastname'];
+
+                                       
$this->acl->account_id=$account['account_id'];
+
+                                       $this->acl->read_repository();
+
+                                       $count_right=count($right);
+                                       for ($i=0;$i<$count_right;$i++)
+                                       {
+                                               
if($this->acl->check_brutto($this->location, 
$right[$i],$this->acl_app,$grantor,0,$check_account_type))
+                                               {
+                                                       
if($this->acl->account_type == 'g')
+                                                       {
+                                                               
$user_list[$j]['right'][$right[$i]] = 'from_group';
+                                                       }
+                                                       else
+                                                       {
+                                                               
$user_list[$j]['right'][$right[$i]] = 'checked';
+                                                       }
+                                                       
$user_list[$j]['result'][$right[$i]] = 'checked';
+                                               }
+                                               
if($this->acl->check_brutto($this->location, 
$right[$i],$this->acl_app,$grantor,1,$check_account_type))
+                                               {
+                                                       
if($this->acl->account_type == 'g')
+                                                       {
+                                                               
$user_list[$j]['mask'][$right[$i]] = 'from_group';
+                                                       }
+                                                       else
+                                                       {
+                                                               
$user_list[$j]['mask'][$right[$i]] = 'checked';
+                                                       }
+                                                       
unset($user_list[$j]['result'][$right[$i]]);
+                                               }
+                                       }
+
+                                       $j++;
+                               }
+                       }
+
+                       $this->total_records = 
$GLOBALS['phpgw']->accounts->total;
+
+                       return $user_list;
+               }
+       }

====================================================
Index: hrm/inc/class.bocommon.inc.php
diff -u hrm/inc/class.bocommon.inc.php:1.5 hrm/inc/class.bocommon.inc.php:1.6
--- hrm/inc/class.bocommon.inc.php:1.5  Tue Nov 29 13:09:40 2005
+++ hrm/inc/class.bocommon.inc.php      Wed Nov 30 17:07:22 2005
@@ -1,659 +1,657 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage core
-       * @version $Id$
-       */
-
-       /**
-        * Description
-        * @package hrm
-        */
-
-       class bocommon
-       {
-               var $start;
-               var $query;
-               var $filter;
-               var $sort;
-               var $order;
-               var $cat_id;
-               var $district_id;
-
-
-               var $public_functions = array
-               (
-                       'select_part_of_town'   => True,
-                       'menu'  => True,
-               );
-
-               var $soap_functions = array(
-                       'list' => array(
-                               'in'  => 
array('int','int','struct','string','int'),
-                               'out' => array('array')
-                       ),
-                       'read' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array('array')
-                       ),
-                       'save' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array()
-                       ),
-                       'delete' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array()
-                       )
-               );
-
-               function bocommon()
-               {
-//                     $GLOBALS['phpgw_info']['flags']['currentapp']   =       
'hrm';
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->socommon                 = 
CreateObject($this->currentapp.'.socommon');
-                       $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
-
-                       if (!is_object($GLOBALS['phpgw']->asyncservice))
-                       {
-                               $GLOBALS['phpgw']->asyncservice = 
CreateObject('phpgwapi.asyncservice');
-                       }
-                       $this->async = &$GLOBALS['phpgw']->asyncservice;
-
-                       $this->join                     = $this->socommon->join;
-                       $this->left_join        = $this->socommon->left_join;
-                       $this->like                     = $this->socommon->like;
-
-                       switch($GLOBALS['phpgw_info']['server']['db_type'])
-                       {
-                               case 'mssql':
-                                       $this->dateformat               = "M d 
Y";
-                                       $this->datetimeformat   = "M d Y g:iA";
-                                       break;
-                               case 'mysql':
-                                       $this->dateformat               = 
"Y-m-d";
-                                       $this->datetimeformat   = "Y-m-d G:i:s";
-                                       break;
-                               case 'pgsql':
-                                       $this->dateformat               = 
"Y-m-d";
-                                       $this->datetimeformat   = "Y-m-d G:i:s";
-//                                     $this->dateformat               = "F j, 
Y";
-//                                     $this->datetimeformat   = "F j, Y g:iA";
-                                       break;
-                       }
-
-       /*              if 
($GLOBALS['phpgw_info']['server']['db_type']=='mssql')
-                       {
-                               $this->dateformat               = "M d Y";
-                               $this->datetimeformat   = "M d Y g:iA";
-                       }
-                       else
-                       {
-                               $this->dateformat               = "Y-m-d";
-                               $this->datetimeformat   = "Y-m-d G:i:s";
-                       }
-
-
-                       if(!$GLOBALS['phpgw_info']['flags']['css'])
-                       {
-                               $GLOBALS['phpgw_info']['flags']['css'] .= 
"-->\n</style>\n"
-                                       . '<link rel="stylesheet" 
type="text/css" media="all" href="'
-                                       . 
$GLOBALS['phpgw_info']['server']['webserver_url'].'/' . $this->currentapp . 
'/templates/'
-                                       . 
$GLOBALS['phpgw_info']['server']['template_set']
-                                       . 
'/css/'.$GLOBALS['phpgw_info']['server']['template_set'].'.css" 
title="'.$GLOBALS['phpgw_info']['server']['template_set'].'" />'
-                                       . "\n<style type=\"text/css\">\n<!--\n";
-                       }
-*/
-               }
-
-
-               function check_perms($rights, $required)
-               {
-       //              return (!!($rights & $required) == True);
-                       return ($rights & $required);
-               }
-
-               function create_preferences($app='',$user_id='')
-               {
-                       return 
$this->socommon->create_preferences($app,$user_id);
-               }
-
-               function msgbox_data($receipt)
-               {
-                       $msgbox_data_error=array();
-                       if (isSet($receipt['error']) AND 
is_array($receipt['error']))
-                       {
-                               foreach($receipt['error'] as $errors)
-                               {
-                                       $msgbox_data_error += 
array($errors['msg']=> False);
-                               }
-                       }
-
-                       $msgbox_data_message=array();
-
-                       if (isSet($receipt['message']) AND 
is_array($receipt['message']))
-                       {
-                               foreach($receipt['message'] as $messages)
-                               {
-                                       $msgbox_data_message += 
array($messages['msg']=> True);
-                               }
-                       }
-
-                       $msgbox_data = $msgbox_data_error + 
$msgbox_data_message;
-
-                       return $msgbox_data;
-               }
-
-               function moneyformat($amount)
-               {
-                       if 
($GLOBALS['phpgw_info']['server']['db_type']=='mssql')
-                       {
-                               $moneyformat    = 
"CONVERT(MONEY,"."'$amount'".",0)";
-                       }
-                       else
-                       {
-                               $moneyformat    = "'" . $amount . "'";
-                       }
-
-                       return $moneyformat;
-               }
-
-
-               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];
-
-                       return $date_array;
-               }
-
-               function date_to_timestamp($date)
-               {
-                       if($date)
-                       {
-                               $date_array     = $this->date_array($date);
-                               $date   = mktime 
(8,0,0,$date_array['month'],$date_array['day'],$date_array['year']);
-                       }
-                       return $date;
-               }
-
-
-               function select_multi_list($selected='',$input_list)
-               {
-                       $j=0;
-                       if (isset($input_list) AND is_array($input_list))
-                       {
-                               foreach($input_list as $entry)
-                               {
-                                       $output_list[$j]['id'] = $entry['id'];
-                                       $output_list[$j]['name'] = 
$entry['name'];
-
-                                       for ($i=0;$i<count($selected);$i++)
-                                       {
-                                               if($selected[$i] == 
$entry['id'])
-                                               {
-                                                       
$output_list[$j]['selected'] = 'selected';
-                                               }
-                                       }
-                                       $j++;
-                               }
-                       }
-
-                       for ($i=0;$i<count($output_list);$i++)
-                       {
-                               if ($output_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($output_list[$i]['selected']);
-                               }
-                       }
-
-                       return $output_list;
-               }
-
-
-               function select_list($selected='',$input_list='')
-               {
-                       if (isset($input_list) AND is_array($input_list))
-                       {
-                               foreach($input_list as $entry)
-                               {
-                                       $sel_entry = '';
-                                       if ($entry['id']==$selected)
-                                       {
-                                               $sel_entry = 'selected';
-                                       }
-                                       $entry_list[] = array
-                                       (
-                                               'id'            => $entry['id'],
-                                               'name'          => 
$entry['name'],
-                                               'selected'      => $sel_entry
-                                       );
-                               }
-                               for ($i=0;$i<count($entry_list);$i++)
-                               {
-                                       if ($entry_list[$i]['selected'] != 
'selected')
-                                       {
-                                               
unset($entry_list[$i]['selected']);
-                                       }
-                               }
-                       }
-                       return $entry_list;
-               }
-
-
-               function 
get_user_list($format='',$selected='',$extra='',$default='',$start='', 
$sort='', $order='', $query='',$offset='')
-               {
-                       switch($format)
-                       {
-                               case 'select':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_select'));
-                                       break;
-                               case 'filter':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_filter'));
-                                       break;
-                       }
-
-                       if(!$selected && $default)
-                       {
-                               $selected = $default;
-                       }
-
-                       if (is_array($extra))
-                       {
-                               foreach($extra as $extra_user)
-                               {
-                                       $users_extra[]=array
-                                       (
-                                               'account_id' => $extra_user,
-                                               'account_firstname' => 
lang($extra_user)
-                                       );
-                               }
-                       }
-
-                       $accounts       = CreateObject('phpgwapi.accounts');
-                       $users = $accounts->get_list('accounts', $start, $sort, 
$order, $query,$offset);
-                       unset($accounts);
-                       if (is_array($users_extra) && is_array($users))
-                       {
-                               $users = $users_extra + $users;
-                       }
-
-                       if (isSet($users) AND is_array($users))
-                       {
-                               foreach($users as $user)
-                               {
-                                       $sel_user = '';
-                                       if ($user['account_id']==$selected)
-                                       {
-                                               $sel_user = 'selected';
-                                       }
-
-                                       $user_list[] = array
-                                       (
-                                               'user_id'       => 
$user['account_id'],
-                                               'name'          => 
$user['account_lastname'].' '.$user['account_firstname'],
-                                               'selected'      => $sel_user
-                                       );
-                               }
-                       }
-
-                       $user_count= count($user_list);
-                       for ($i=0;$i<$user_count;$i++)
-                       {
-                               if ($user_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($user_list[$i]['selected']);
-                               }
-                       }
-
-//_debug_array($user_list);
-                       return $user_list;
-               }
-
-               function get_group_list($format='',$selected='',$start='', 
$sort='', $order='', $query='',$offset='')
-               {
-                       switch($format)
-                       {
-                               case 'select':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('group_select'));
-                                       break;
-                               case 'filter':
-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('group_filter'));
-                                       break;
-                       }
-
-                       $accounts       = CreateObject('phpgwapi.accounts');
-                       $users = $accounts->get_list('groups', $start, $sort, 
$order, $query,$offset);
-                       unset($accounts);
-                       if (isSet($users) AND is_array($users))
-                       {
-                               foreach($users as $user)
-                               {
-                                       $sel_user = '';
-                                       if ($user['account_id']==$selected)
-                                       {
-                                               $sel_user = 'selected';
-                                       }
-
-                                       $user_list[] = array
-                                       (
-                                               'id'    => $user['account_id'],
-                                               'name'          => 
$user['account_firstname'],
-                                               'selected'      => $sel_user
-                                       );
-                               }
-                       }
-
-                       $user_count= count($user_list);
-                       for ($i=0;$i<$user_count;$i++)
-                       {
-                               if ($user_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($user_list[$i]['selected']);
-                               }
-                       }
-
-//_debug_array($user_list);
-                       return $user_list;
-               }
-
-
-               function initiate_ui_alarm($data)
-               {
-                       $boalarm                = 
CreateObject($this->currentapp.'.boalarm');
-
-                       if($data['type']=='view')
-                       {
-                               
$GLOBALS['phpgw']->xslttpl->add_file(array('alarm_view'));
-                       }
-                       else
-                       {
-                               
$GLOBALS['phpgw']->xslttpl->add_file(array('alarm_form'));
-                       }
-
-                       $alarm['header'][] = array
-                       (
-                               'lang_time'             => lang('Time'),
-                               'lang_text'     => lang('Text'),
-                               'lang_user'                     => lang('User'),
-                               'lang_enabled'          => lang('Enabled'),
-                               'lang_select'           => lang('Select')
-                               );
-
-                       $alarm['values'] = 
$boalarm->read_alarms($data['alarm_type'],$data['id'],$data['text']);
-                       if(!count($alarm['values'])>0)
-                       {
-                               unset($alarm['values']);
-                       }
-
-                       if($data['type']=='form')
-                       {
-                               $alarm['alter_alarm'][] = array
-                               (
-                                       'lang_enable'           => 
lang('Enable'),
-                                       'lang_disable'          => 
lang('Disable'),
-                                       'lang_delete'           => 
lang('Delete')
-                                       );
-
-                               for ($i=1; $i<=31; $i++)
-                               {
-                                       
$alarm['add_alarm']['day_list'][($i-1)][id] = $i;
-                               }
-                               $alarm['add_alarm']['lang_day']                 
                = lang('Day');
-                               $alarm['add_alarm']['lang_day_statustext']      
        = lang('Day');
-
-                               for ($i=1; $i<=24; $i++)
-                               {
-                                       
$alarm['add_alarm']['hour_list'][($i-1)][id] = $i;
-                               }
-                               $alarm['add_alarm']['lang_hour']                
                        = lang('Hour');
-                               $alarm['add_alarm']['lang_hour_statustext']     
                = lang('Hour');
-
-                               for ($i=1; $i<=60; $i++)
-                               {
-                                       
$alarm['add_alarm']['minute_list'][($i-1)][id] = $i;
-                               }
-                               $alarm['add_alarm']['lang_minute']              
                        = lang('Minutes before the event');
-                               $alarm['add_alarm']['lang_minute_statustext']   
        = lang('Minutes before the event');
-
-                               $alarm['add_alarm']['user_list'] = 
$this->get_user_list_right2('select',4,False,$data['acl_location'],False,$default=$this->account);
-
-                               $alarm['add_alarm']['lang_user']                
                        = lang('User');
-                               $alarm['add_alarm']['lang_user_statustext']     
                = lang('Select the user the alarm belongs to.');
-                               $alarm['add_alarm']['lang_no_user']             
                        = lang('No user');
-                               $alarm['add_alarm']['lang_add']                 
                        = lang('Add');
-                               $alarm['add_alarm']['lang_add_alarm']           
                                = lang('Add alarm');
-                               $alarm['add_alarm']['lang_add_statustext']      
                = lang('Add alarm for selected user');
-
-                       }
-
-//_debug_array($alarm['values']);
-                       return $alarm;
-               }
-
-
-               function 
select_multi_list_2($selected='',$input_list,$input_type='')
-               {
-                       $j=0;
-                       if (isset($input_list) AND is_array($input_list))
-                       {
-                               foreach($input_list as $entry)
-                               {
-                                       $output_list[$j]['id'] = $entry['id'];
-                                       $output_list[$j]['value'] = 
$entry['value'];
-                                       $output_list[$j]['input_type'] = 
$input_type;
-
-                                       for ($i=0;$i<count($selected);$i++)
-                                       {
-                                               if($selected[$i] == 
$entry['id'])
-                                               {
-                                                       
$output_list[$j]['checked'] = 'checked';
-                                               }
-                                       }
-                                       $j++;
-                               }
-                       }
-
-                       for ($i=0;$i<count($output_list);$i++)
-                       {
-                               if ($output_list[$i]['checked'] != 'checked')
-                               {
-                                       unset($output_list[$i]['checked']);
-                               }
-                       }
-
-                       return $output_list;
-               }
-
-
-               function list_methods($_type='xmlrpc')
-               {
-                       /*
-                         This handles introspection or discovery by the logged 
in client,
-                         in which case the input might be an array.  The 
server always calls
-                         this function to fill the server dispatch map using a 
string.
-                       */
-                       if (is_array($_type))
-                       {
-                               $_type = $_type['type'] ? $_type['type'] : 
$_type[0];
-                       }
-                       switch($_type)
-                       {
-                               case 'xmlrpc':
-                                       $xml_functions = array(
-                                               'read' => array(
-                                                       'function'  => 'read',
-                                                       'signature' => 
array(array(xmlrpcInt,xmlrpcStruct)),
-                                                       'docstring' => 
lang('Read a single entry by passing the id and fieldlist.')
-                                               ),
-                                               'save' => array(
-                                                       'function'  => 'save',
-                                                       'signature' => 
array(array(xmlrpcStruct,xmlrpcStruct)),
-                                                       'docstring' => 
lang('Update a single entry by passing the fields.')
-                                               ),
-                                               'delete' => array(
-                                                       'function'  => 'delete',
-                                                       'signature' => 
array(array(xmlrpcBoolean,xmlrpcInt)),
-                                                       'docstring' => 
lang('Delete a single entry by passing the id.')
-                                               ),
-                                               'list' => array(
-                                                       'function'  => '_list',
-                                                       'signature' => 
array(array(xmlrpcStruct,xmlrpcStruct)),
-                                                       'docstring' => 
lang('Read a list of entries.')
-                                               ),
-                                               'list_methods' => array(
-                                                       'function'  => 
'list_methods',
-                                                       'signature' => 
array(array(xmlrpcStruct,xmlrpcString)),
-                                                       'docstring' => 
lang('Read this list of methods.')
-                                               )
-                                       );
-                                       return $xml_functions;
-                                       break;
-                               case 'soap':
-                                       return $this->soap_functions;
-                                       break;
-                               default:
-                                       return array();
-                                       break;
-                       }
-               }
-
-               function add_leading_zero($num)
-               {
-
-                       if ($id_type == "hex")
-                       {
-                               $num = hexdec($num);
-                               $num++;
-                               $num = dechex($num);
-                       }
-                       else
-                       {
-                               $num++;
-                       }
-
-                       if (strlen($num) == 4)
-                               $return = $num;
-                       if (strlen($num) == 3)
-                               $return = "0$num";
-                       if (strlen($num) == 2)
-                               $return = "00$num";
-                       if (strlen($num) == 1)
-                               $return = "000$num";
-                       if (strlen($num) == 0)
-                               $return = "0001";
-
-                       return strtoupper($return);
-               }
-
-
-               function validate_db_insert($values)
-               {
-                       foreach($values as $value)
-                       {
-                               if($value || $value === 0)
-                               {
-                                       $insert_value[] = "'".$value."'";
-                               }
-                               else
-                               {
-                                       $insert_value[] = 'NULL';
-                               }
-                       }
-
-                       $values = implode(",", $insert_value);
-                       return $values;
-               }
-
-               function validate_db_update($value_set)
-               {
-                       while (is_array($value_set) && list($field,$value) = 
each($value_set))
-                       {
-                               if($value || $value === 0)
-                               {
-                                       $value_entry[]= "$field='$value'";
-                               }
-                               else
-                               {
-                                       $value_entry[]= "$field=NULL";
-                               }
-                       }
-
-                       $value_set      = implode(",", $value_entry);
-                       return $value_set;
-               }
-
-               function fm_cache($name='',$value='')
-               {
-                       return $this->socommon->fm_cache($name,$value);
-               }
-
-               function next_id($table,$key='')
-               {
-                       return $this->socommon->next_id($table,$key);
-               }
-
-
-               function excel($list,$name,$descr,$input_type='')
-               {
-                       $GLOBALS['phpgw_info']['flags'][noheader] = True;
-                       $GLOBALS['phpgw_info']['flags'][nofooter] = True;
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = False;
-
-                       $filename= 
$GLOBALS['phpgw_info']['user']['account_lid'].'.xls';
-
-                       $workbook       = 
CreateObject($this->currentapp.'.excel',"-");
-                       $browser = CreateObject('phpgwapi.browser');
-                       
$browser->content_header($filename,'application/vnd.ms-excel');
-
-                       $count_uicols_name=count($name);
-
-                       $worksheet1 =& $workbook->add_worksheet('First One');
-
-                       $j=0;
-                       if (isset($list) AND is_array($list))
-                       {
-                               foreach($list as $entry)
-                               {
-                                       $m=0;
-                                       for ($k=0;$k<$count_uicols_name;$k++)
-                                       {
-                                               if($input_type[$k]!='hidden')
-                                               {
-                                                       $content[$j][$m]        
= str_replace("\r\n"," ",$entry[$name[$k]]);
-                                                       
$worksheet1->write_string(0, $m, $descr[$k]);
-                                                       $m++;
-                                               }
-                                       }
-                                       $j++;
-                               }
-
-                               foreach($content as $row)
-                               {
-                                       $line++;
-                                       for ($i=0; $i<count($row); $i++)
-                                       {
-                                               
$worksheet1->write($line,$i,$row[$i]);
-                                       }
-                               }
-                       }
-                       $workbook->close();
-
-               }
-
-       }
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage core
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package hrm
+        */
+
+       class bocommon
+       {
+               var $start;
+               var $query;
+               var $filter;
+               var $sort;
+               var $order;
+               var $cat_id;
+               var $district_id;
+
+
+               var $public_functions = array
+               (
+                       'select_part_of_town'   => True,
+                       'menu'  => True,
+               );
+
+               var $soap_functions = array(
+                       'list' => array(
+                               'in'  => 
array('int','int','struct','string','int'),
+                               'out' => array('array')
+                       ),
+                       'read' => array(
+                               'in'  => array('int','struct'),
+                               'out' => array('array')
+                       ),
+                       'save' => array(
+                               'in'  => array('int','struct'),
+                               'out' => array()
+                       ),
+                       'delete' => array(
+                               'in'  => array('int','struct'),
+                               'out' => array()
+                       )
+               );
+
+               function bocommon()
+               {
+//                     $GLOBALS['phpgw_info']['flags']['currentapp']   =       
'hrm';
+                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->socommon                 = 
CreateObject($this->currentapp.'.socommon');
+                       $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
+
+                       if (!is_object($GLOBALS['phpgw']->asyncservice))
+                       {
+                               $GLOBALS['phpgw']->asyncservice = 
CreateObject('phpgwapi.asyncservice');
+                       }
+                       $this->async = &$GLOBALS['phpgw']->asyncservice;
+
+                       $this->join                     = $this->socommon->join;
+                       $this->left_join        = $this->socommon->left_join;
+                       $this->like                     = $this->socommon->like;
+
+                       switch($GLOBALS['phpgw_info']['server']['db_type'])
+                       {
+                               case 'mssql':
+                                       $this->dateformat               = "M d 
Y";
+                                       $this->datetimeformat   = "M d Y g:iA";
+                                       break;
+                               case 'mysql':
+                                       $this->dateformat               = 
"Y-m-d";
+                                       $this->datetimeformat   = "Y-m-d G:i:s";
+                                       break;
+                               case 'pgsql':
+                                       $this->dateformat               = 
"Y-m-d";
+                                       $this->datetimeformat   = "Y-m-d G:i:s";
+//                                     $this->dateformat               = "F j, 
Y";
+//                                     $this->datetimeformat   = "F j, Y g:iA";
+                                       break;
+                       }
+
+       /*              if 
($GLOBALS['phpgw_info']['server']['db_type']=='mssql')
+                       {
+                               $this->dateformat               = "M d Y";
+                               $this->datetimeformat   = "M d Y g:iA";
+                       }
+                       else
+                       {
+                               $this->dateformat               = "Y-m-d";
+                               $this->datetimeformat   = "Y-m-d G:i:s";
+                       }
+
+
+                       if(!$GLOBALS['phpgw_info']['flags']['css'])
+                       {
+                               $GLOBALS['phpgw_info']['flags']['css'] .= 
"-->\n</style>\n"
+                                       . '<link rel="stylesheet" 
type="text/css" media="all" href="'
+                                       . 
$GLOBALS['phpgw_info']['server']['webserver_url'].'/' . $this->currentapp . 
'/templates/'
+                                       . 
$GLOBALS['phpgw_info']['server']['template_set']
+                                       . 
'/css/'.$GLOBALS['phpgw_info']['server']['template_set'].'.css" 
title="'.$GLOBALS['phpgw_info']['server']['template_set'].'" />'
+                                       . "\n<style type=\"text/css\">\n<!--\n";
+                       }
+*/
+               }
+
+
+               function check_perms($rights, $required)
+               {
+       //              return (!!($rights & $required) == True);
+                       return ($rights & $required);
+               }
+
+               function create_preferences($app='',$user_id='')
+               {
+                       return 
$this->socommon->create_preferences($app,$user_id);
+               }
+
+               function msgbox_data($receipt)
+               {
+                       $msgbox_data_error=array();
+                       if (isSet($receipt['error']) AND 
is_array($receipt['error']))
+                       {
+                               foreach($receipt['error'] as $errors)
+                               {
+                                       $msgbox_data_error += 
array($errors['msg']=> False);
+                               }
+                       }
+
+                       $msgbox_data_message=array();
+
+                       if (isSet($receipt['message']) AND 
is_array($receipt['message']))
+                       {
+                               foreach($receipt['message'] as $messages)
+                               {
+                                       $msgbox_data_message += 
array($messages['msg']=> True);
+                               }
+                       }
+
+                       $msgbox_data = $msgbox_data_error + 
$msgbox_data_message;
+
+                       return $msgbox_data;
+               }
+
+               function moneyformat($amount)
+               {
+                       if 
($GLOBALS['phpgw_info']['server']['db_type']=='mssql')
+                       {
+                               $moneyformat    = 
"CONVERT(MONEY,"."'$amount'".",0)";
+                       }
+                       else
+                       {
+                               $moneyformat    = "'" . $amount . "'";
+                       }
+
+                       return $moneyformat;
+               }
+
+
+               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];
+
+                       return $date_array;
+               }
+
+               function date_to_timestamp($date)
+               {
+                       if($date)
+                       {
+                               $date_array     = $this->date_array($date);
+                               $date   = mktime 
(8,0,0,$date_array['month'],$date_array['day'],$date_array['year']);
+                       }
+                       return $date;
+               }
+
+
+               function select_multi_list($selected='',$input_list)
+               {
+                       $j=0;
+                       if (isset($input_list) AND is_array($input_list))
+                       {
+                               foreach($input_list as $entry)
+                               {
+                                       $output_list[$j]['id'] = $entry['id'];
+                                       $output_list[$j]['name'] = 
$entry['name'];
+
+                                       for ($i=0;$i<count($selected);$i++)
+                                       {
+                                               if($selected[$i] == 
$entry['id'])
+                                               {
+                                                       
$output_list[$j]['selected'] = 'selected';
+                                               }
+                                       }
+                                       $j++;
+                               }
+                       }
+
+                       for ($i=0;$i<count($output_list);$i++)
+                       {
+                               if ($output_list[$i]['selected'] != 'selected')
+                               {
+                                       unset($output_list[$i]['selected']);
+                               }
+                       }
+
+                       return $output_list;
+               }
+
+
+               function select_list($selected='',$input_list='')
+               {
+                       if (isset($input_list) AND is_array($input_list))
+                       {
+                               foreach($input_list as $entry)
+                               {
+                                       $sel_entry = '';
+                                       if ($entry['id']==$selected)
+                                       {
+                                               $sel_entry = 'selected';
+                                       }
+                                       $entry_list[] = array
+                                       (
+                                               'id'            => $entry['id'],
+                                               'name'          => 
$entry['name'],
+                                               'selected'      => $sel_entry
+                                       );
+                               }
+                               for ($i=0;$i<count($entry_list);$i++)
+                               {
+                                       if ($entry_list[$i]['selected'] != 
'selected')
+                                       {
+                                               
unset($entry_list[$i]['selected']);
+                                       }
+                               }
+                       }
+                       return $entry_list;
+               }
+
+
+               function 
get_user_list($format='',$selected='',$extra='',$default='',$start='', 
$sort='', $order='', $query='',$offset='')
+               {
+                       switch($format)
+                       {
+                               case 'select':
+                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_select'));
+                                       break;
+                               case 'filter':
+                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_filter'));
+                                       break;
+                       }
+
+                       if(!$selected && $default)
+                       {
+                               $selected = $default;
+                       }
+
+                       if (is_array($extra))
+                       {
+                               foreach($extra as $extra_user)
+                               {
+                                       $users_extra[]=array
+                                       (
+                                               'account_id' => $extra_user,
+                                               'account_firstname' => 
lang($extra_user)
+                                       );
+                               }
+                       }
+
+                       $accounts       = CreateObject('phpgwapi.accounts');
+                       $users = $accounts->get_list('accounts', $start, $sort, 
$order, $query,$offset);
+                       unset($accounts);
+                       if (is_array($users_extra) && is_array($users))
+                       {
+                               $users = $users_extra + $users;
+                       }
+
+                       if (isSet($users) AND is_array($users))
+                       {
+                               foreach($users as $user)
+                               {
+                                       $sel_user = '';
+                                       if ($user['account_id']==$selected)
+                                       {
+                                               $sel_user = 'selected';
+                                       }
+
+                                       $user_list[] = array
+                                       (
+                                               'user_id'       => 
$user['account_id'],
+                                               'name'          => 
$user['account_lastname'].' '.$user['account_firstname'],
+                                               'selected'      => $sel_user
+                                       );
+                               }
+                       }
+
+                       $user_count= count($user_list);
+                       for ($i=0;$i<$user_count;$i++)
+                       {
+                               if ($user_list[$i]['selected'] != 'selected')
+                               {
+                                       unset($user_list[$i]['selected']);
+                               }
+                       }
+
+//_debug_array($user_list);
+                       return $user_list;
+               }
+
+               function get_group_list($format='',$selected='',$start='', 
$sort='', $order='', $query='',$offset='')
+               {
+                       switch($format)
+                       {
+                               case 'select':
+                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('group_select'));
+                                       break;
+                               case 'filter':
+                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('group_filter'));
+                                       break;
+                       }
+
+                       $accounts       = CreateObject('phpgwapi.accounts');
+                       $users = $accounts->get_list('groups', $start, $sort, 
$order, $query,$offset);
+                       unset($accounts);
+                       if (isSet($users) AND is_array($users))
+                       {
+                               foreach($users as $user)
+                               {
+                                       $sel_user = '';
+                                       if ($user['account_id']==$selected)
+                                       {
+                                               $sel_user = 'selected';
+                                       }
+
+                                       $user_list[] = array
+                                       (
+                                               'id'    => $user['account_id'],
+                                               'name'          => 
$user['account_firstname'],
+                                               'selected'      => $sel_user
+                                       );
+                               }
+                       }
+
+                       $user_count= count($user_list);
+                       for ($i=0;$i<$user_count;$i++)
+                       {
+                               if ($user_list[$i]['selected'] != 'selected')
+                               {
+                                       unset($user_list[$i]['selected']);
+                               }
+                       }
+
+//_debug_array($user_list);
+                       return $user_list;
+               }
+
+
+               function initiate_ui_alarm($data)
+               {
+                       $boalarm                = 
CreateObject($this->currentapp.'.boalarm');
+
+                       if($data['type']=='view')
+                       {
+                               
$GLOBALS['phpgw']->xslttpl->add_file(array('alarm_view'));
+                       }
+                       else
+                       {
+                               
$GLOBALS['phpgw']->xslttpl->add_file(array('alarm_form'));
+                       }
+
+                       $alarm['header'][] = array
+                       (
+                               'lang_time'             => lang('Time'),
+                               'lang_text'     => lang('Text'),
+                               'lang_user'                     => lang('User'),
+                               'lang_enabled'          => lang('Enabled'),
+                               'lang_select'           => lang('Select')
+                               );
+
+                       $alarm['values'] = 
$boalarm->read_alarms($data['alarm_type'],$data['id'],$data['text']);
+                       if(!count($alarm['values'])>0)
+                       {
+                               unset($alarm['values']);
+                       }
+
+                       if($data['type']=='form')
+                       {
+                               $alarm['alter_alarm'][] = array
+                               (
+                                       'lang_enable'           => 
lang('Enable'),
+                                       'lang_disable'          => 
lang('Disable'),
+                                       'lang_delete'           => 
lang('Delete')
+                                       );
+
+                               for ($i=1; $i<=31; $i++)
+                               {
+                                       
$alarm['add_alarm']['day_list'][($i-1)][id] = $i;
+                               }
+                               $alarm['add_alarm']['lang_day']                 
                = lang('Day');
+                               $alarm['add_alarm']['lang_day_statustext']      
        = lang('Day');
+
+                               for ($i=1; $i<=24; $i++)
+                               {
+                                       
$alarm['add_alarm']['hour_list'][($i-1)][id] = $i;
+                               }
+                               $alarm['add_alarm']['lang_hour']                
                        = lang('Hour');
+                               $alarm['add_alarm']['lang_hour_statustext']     
                = lang('Hour');
+
+                               for ($i=1; $i<=60; $i++)
+                               {
+                                       
$alarm['add_alarm']['minute_list'][($i-1)][id] = $i;
+                               }
+                               $alarm['add_alarm']['lang_minute']              
                        = lang('Minutes before the event');
+                               $alarm['add_alarm']['lang_minute_statustext']   
        = lang('Minutes before the event');
+
+                               $alarm['add_alarm']['user_list'] = 
$this->get_user_list_right2('select',4,False,$data['acl_location'],False,$default=$this->account);
+
+                               $alarm['add_alarm']['lang_user']                
                        = lang('User');
+                               $alarm['add_alarm']['lang_user_statustext']     
                = lang('Select the user the alarm belongs to.');
+                               $alarm['add_alarm']['lang_no_user']             
                        = lang('No user');
+                               $alarm['add_alarm']['lang_add']                 
                        = lang('Add');
+                               $alarm['add_alarm']['lang_add_alarm']           
                                = lang('Add alarm');
+                               $alarm['add_alarm']['lang_add_statustext']      
                = lang('Add alarm for selected user');
+
+                       }
+
+//_debug_array($alarm['values']);
+                       return $alarm;
+               }
+
+
+               function 
select_multi_list_2($selected='',$input_list,$input_type='')
+               {
+                       $j=0;
+                       if (isset($input_list) AND is_array($input_list))
+                       {
+                               foreach($input_list as $entry)
+                               {
+                                       $output_list[$j]['id'] = $entry['id'];
+                                       $output_list[$j]['value'] = 
$entry['value'];
+                                       $output_list[$j]['input_type'] = 
$input_type;
+
+                                       for ($i=0;$i<count($selected);$i++)
+                                       {
+                                               if($selected[$i] == 
$entry['id'])
+                                               {
+                                                       
$output_list[$j]['checked'] = 'checked';
+                                               }
+                                       }
+                                       $j++;
+                               }
+                       }
+
+                       for ($i=0;$i<count($output_list);$i++)
+                       {
+                               if ($output_list[$i]['checked'] != 'checked')
+                               {
+                                       unset($output_list[$i]['checked']);
+                               }
+                       }
+
+                       return $output_list;
+               }
+
+
+               function list_methods($_type='xmlrpc')
+               {
+                       /*
+                         This handles introspection or discovery by the logged 
in client,
+                         in which case the input might be an array.  The 
server always calls
+                         this function to fill the server dispatch map using a 
string.
+                       */
+                       if (is_array($_type))
+                       {
+                               $_type = $_type['type'] ? $_type['type'] : 
$_type[0];
+                       }
+                       switch($_type)
+                       {
+                               case 'xmlrpc':
+                                       $xml_functions = array(
+                                               'read' => array(
+                                                       'function'  => 'read',
+                                                       'signature' => 
array(array(xmlrpcInt,xmlrpcStruct)),
+                                                       'docstring' => 
lang('Read a single entry by passing the id and fieldlist.')
+                                               ),
+                                               'save' => array(
+                                                       'function'  => 'save',
+                                                       'signature' => 
array(array(xmlrpcStruct,xmlrpcStruct)),
+                                                       'docstring' => 
lang('Update a single entry by passing the fields.')
+                                               ),
+                                               'delete' => array(
+                                                       'function'  => 'delete',
+                                                       'signature' => 
array(array(xmlrpcBoolean,xmlrpcInt)),
+                                                       'docstring' => 
lang('Delete a single entry by passing the id.')
+                                               ),
+                                               'list' => array(
+                                                       'function'  => '_list',
+                                                       'signature' => 
array(array(xmlrpcStruct,xmlrpcStruct)),
+                                                       'docstring' => 
lang('Read a list of entries.')
+                                               ),
+                                               'list_methods' => array(
+                                                       'function'  => 
'list_methods',
+                                                       'signature' => 
array(array(xmlrpcStruct,xmlrpcString)),
+                                                       'docstring' => 
lang('Read this list of methods.')
+                                               )
+                                       );
+                                       return $xml_functions;
+                                       break;
+                               case 'soap':
+                                       return $this->soap_functions;
+                                       break;
+                               default:
+                                       return array();
+                                       break;
+                       }
+               }
+
+               function add_leading_zero($num)
+               {
+
+                       if ($id_type == "hex")
+                       {
+                               $num = hexdec($num);
+                               $num++;
+                               $num = dechex($num);
+                       }
+                       else
+                       {
+                               $num++;
+                       }
+
+                       if (strlen($num) == 4)
+                               $return = $num;
+                       if (strlen($num) == 3)
+                               $return = "0$num";
+                       if (strlen($num) == 2)
+                               $return = "00$num";
+                       if (strlen($num) == 1)
+                               $return = "000$num";
+                       if (strlen($num) == 0)
+                               $return = "0001";
+
+                       return strtoupper($return);
+               }
+
+
+               function validate_db_insert($values)
+               {
+                       foreach($values as $value)
+                       {
+                               if($value || $value === 0)
+                               {
+                                       $insert_value[] = "'".$value."'";
+                               }
+                               else
+                               {
+                                       $insert_value[] = 'NULL';
+                               }
+                       }
+
+                       $values = implode(",", $insert_value);
+                       return $values;
+               }
+
+               function validate_db_update($value_set)
+               {
+                       while (is_array($value_set) && list($field,$value) = 
each($value_set))
+                       {
+                               if($value || $value === 0)
+                               {
+                                       $value_entry[]= "$field='$value'";
+                               }
+                               else
+                               {
+                                       $value_entry[]= "$field=NULL";
+                               }
+                       }
+
+                       $value_set      = implode(",", $value_entry);
+                       return $value_set;
+               }
+
+               function fm_cache($name='',$value='')
+               {
+                       return $this->socommon->fm_cache($name,$value);
+               }
+
+               function next_id($table,$key='')
+               {
+                       return $this->socommon->next_id($table,$key);
+               }
+
+
+               function excel($list,$name,$descr,$input_type='')
+               {
+                       $GLOBALS['phpgw_info']['flags'][noheader] = True;
+                       $GLOBALS['phpgw_info']['flags'][nofooter] = True;
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = False;
+
+                       $filename= 
$GLOBALS['phpgw_info']['user']['account_lid'].'.xls';
+
+                       $workbook       = 
CreateObject($this->currentapp.'.excel',"-");
+                       $browser = CreateObject('phpgwapi.browser');
+                       
$browser->content_header($filename,'application/vnd.ms-excel');
+
+                       $count_uicols_name=count($name);
+
+                       $worksheet1 =& $workbook->add_worksheet('First One');
+
+                       $j=0;
+                       if (isset($list) AND is_array($list))
+                       {
+                               foreach($list as $entry)
+                               {
+                                       $m=0;
+                                       for ($k=0;$k<$count_uicols_name;$k++)
+                                       {
+                                               if($input_type[$k]!='hidden')
+                                               {
+                                                       $content[$j][$m]        
= str_replace("\r\n"," ",$entry[$name[$k]]);
+                                                       
$worksheet1->write_string(0, $m, $descr[$k]);
+                                                       $m++;
+                                               }
+                                       }
+                                       $j++;
+                               }
+
+                               foreach($content as $row)
+                               {
+                                       $line++;
+                                       for ($i=0; $i<count($row); $i++)
+                                       {
+                                               
$worksheet1->write($line,$i,$row[$i]);
+                                       }
+                               }
+                       }
+                       $workbook->close();
+               }
+       }

====================================================
Index: hrm/inc/class.bojob.inc.php
diff -u hrm/inc/class.bojob.inc.php:1.7 hrm/inc/class.bojob.inc.php:1.8
--- hrm/inc/class.bojob.inc.php:1.7     Tue Nov 29 15:07:58 2005
+++ hrm/inc/class.bojob.inc.php Wed Nov 30 17:07:22 2005
@@ -1,263 +1,257 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage user
-       * @version $Id$
-       */
-
-       /**
-        * Description
-        * @package hrm
-        */
-
-       class bojob
-       {
-               var $start;
-               var $query;
-               var $filter;
-               var $sort;
-               var $order;
-               var $cat_id;
-
-               var $public_functions = array
-               (
-                       'read'                  => True,
-                       'read_single'           => True,
-                       'save'                  => True,
-                       'delete'                => True,
-                       'check_perms'           => True
-               );
-
-               var $soap_functions = array(
-                       'list' => array(
-                               'in'  => 
array('int','int','struct','string','int'),
-                               'out' => array('array')
-                       ),
-                       'read' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array('array')
-                       ),
-                       'save' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array()
-                       ),
-                       'delete' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array()
-                       )
-               );
-
-               function bojob($session=False)
-               {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->so               = 
CreateObject($this->currentapp.'.sojob');
-                       $this->socommon = 
CreateObject($this->currentapp.'.socommon');
-
-                       if ($session)
-                       {
-                               $this->read_sessiondata();
-                               $this->use_session = True;
-                       }
-
-                       $start  = get_var('start',array('POST','GET'));
-                       $query  = get_var('query',array('POST','GET'));
-                       $sort   = get_var('sort',array('POST','GET'));
-                       $order  = get_var('order',array('POST','GET'));
-                       $filter = get_var('filter',array('POST','GET'));
-                       $cat_id = get_var('cat_id',array('POST','GET'));
-                       $allrows= get_var('allrows',array('POST','GET'));
-
-                       if ($start)
-                       {
-                               $this->start=$start;
-                       }
-                       else
-                       {
-                               $this->start=0;
-                       }
-
-                       if(array_key_exists('query',$_POST) || 
array_key_exists('query',$_GET))
-                       {
-                               $this->query = $query;
-                       }
-                       if(array_key_exists('filter',$_POST) || 
array_key_exists('filter',$_GET))
-                       {
-                               $this->filter = $filter;
-                       }
-                       if(array_key_exists('sort',$_POST) || 
array_key_exists('sort',$_GET))
-                       {
-                               $this->sort = $sort;
-                       }
-                       if(array_key_exists('order',$_POST) || 
array_key_exists('order',$_GET))
-                       {
-                               $this->order = $order;
-                       }
-                       if(array_key_exists('cat_id',$_POST) || 
array_key_exists('cat_id',$_GET))
-                       {
-                               $this->cat_id = $cat_id;
-                       }
-                       if ($allrows)
-                       {
-                               $this->allrows = $allrows;
-                       }
-               }
-
-
-               function save_sessiondata($data)
-               {
-                       if ($this->use_session)
-                       {
-                               
$GLOBALS['phpgw']->session->appsession('session_data','hrm_job',$data);
-                       }
-               }
-
-               function read_sessiondata()
-               {
-                       $data = 
$GLOBALS['phpgw']->session->appsession('session_data','hrm_job');
-
-                       $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'];
-               }
-
-
-               function read()
-               {
-                       $account_info = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-                                                                               
        'allrows'=>$this->allrows));
-                       $this->total_records = $this->so->total_records;
-                       return $account_info;
-               }
-
-               function read_single_job($id)
-               {
-                       return $this->so->read_single_job($id);
-               }
-
-               function read_task($job_id)
-               {
-                       $values = $this->so->read_task($job_id);
-                       return $values;
-               }
-
-               function read_single_task($id)
-               {
-                       $values =$this->so->read_single_task($id);
-                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-
-                       if($values['entry_date'])
-                       {
-                               $values['entry_date']   = 
$GLOBALS['phpgw']->common->show_date($values['entry_date'],$dateformat);
-                       }
-
-                       return $values;
-               }
-
-
-               function save_job($values,$action='')
-               {
-                       if ($action=='edit')
-                       {
-                               if ($values['id'] != '')
-                               {
-
-                                       $receipt = $this->so->edit_job($values);
-                               }
-                               else
-                               {
-                                       
$receipt['error'][]=array('msg'=>lang('Error'));
-                               }
-                       }
-                       else
-                       {
-                               $receipt = $this->so->add_job($values);
-                       }
-
-                       return $receipt;
-               }
-
-               function save_task($values,$action='')
-               {
-                       if ($action=='edit')
-                       {
-                               if ($values['task_id'] != '')
-                               {
-
-                                       $receipt = 
$this->so->edit_task($values);
-                               }
-                               else
-                               {
-                                       
$receipt['error'][]=array('msg'=>lang('Error'));
-                               }
-                       }
-                       else
-                       {
-                               $receipt = $this->so->add_task($values);
-                       }
-
-                       return $receipt;
-               }
-
-               function delete_task($job_id,$id)
-               {
-                       $this->so->delete_task($job_id,$id);
-               }
-
-               function delete_job($id)
-               {
-                       $this->so->delete_job($id);
-               }
-
-               function reset_job_type_hierarchy()
-               {
-                       $this->so->reset_job_type_hierarchy();
-               }
-
-               function select_job_list($selected='')
-               {
-                       $jobs= $this->so->select_job_list();
-
-                       while (is_array($jobs) && list(,$job) = each($jobs))
-                       {
-
-                               if ($job['level'] > 0)
-                               {
-                                       $space = '--';
-                                       $spaceset = 
str_repeat($space,$job['level']);
-                                       $job['name'] = $spaceset . $job['name'];
-                               }
-
-                               $sel_job = '';
-                               if ($job['id']==$selected)
-                               {
-                                       $sel_job = 'selected';
-                               }
-
-                               $job_list[] = array
-                               (
-                                       'id'            => $job['id'],
-                                       'name'          => $job['name'],
-                                       'selected'      => $sel_job
-                               );
-                       }
-
-                       for ($i=0;$i<count($job_list);$i++)
-                       {
-                               if ($job_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($job_list[$i]['selected']);
-                               }
-                       }
-
-                       return $job_list;
-               }
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage user
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package hrm
+        */
+
+       class bojob
+       {
+               var $start;
+               var $query;
+               var $filter;
+               var $sort;
+               var $order;
+               var $cat_id;
+
+               var $public_functions = array
+               (
+                       'read'                  => True,
+                       'read_single'           => True,
+                       'save'                  => True,
+                       'delete'                => True,
+                       'check_perms'           => True
+               );
+
+               var $soap_functions = array(
+                       'list' => array(
+                               'in'  => 
array('int','int','struct','string','int'),
+                               'out' => array('array')
+                       ),
+                       'read' => array(
+                               'in'  => array('int','struct'),
+                               'out' => array('array')
+                       ),
+                       'save' => array(
+                               'in'  => array('int','struct'),
+                               'out' => array()
+                       ),
+                       'delete' => array(
+                               'in'  => array('int','struct'),
+                               'out' => array()
+                       )
+               );
+
+               function bojob($session=False)
+               {
+                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->so               = 
CreateObject($this->currentapp.'.sojob');
+                       $this->socommon = 
CreateObject($this->currentapp.'.socommon');
+
+                       if ($session)
+                       {
+                               $this->read_sessiondata();
+                               $this->use_session = True;
+                       }
+
+                       $start  = get_var('start',array('POST','GET'));
+                       $query  = get_var('query',array('POST','GET'));
+                       $sort   = get_var('sort',array('POST','GET'));
+                       $order  = get_var('order',array('POST','GET'));
+                       $filter = get_var('filter',array('POST','GET'));
+                       $cat_id = get_var('cat_id',array('POST','GET'));
+                       $allrows= get_var('allrows',array('POST','GET'));
+
+                       if ($start)
+                       {
+                               $this->start=$start;
+                       }
+                       else
+                       {
+                               $this->start=0;
+                       }
+
+                       if(array_key_exists('query',$_POST) || 
array_key_exists('query',$_GET))
+                       {
+                               $this->query = $query;
+                       }
+                       if(array_key_exists('filter',$_POST) || 
array_key_exists('filter',$_GET))
+                       {
+                               $this->filter = $filter;
+                       }
+                       if(array_key_exists('sort',$_POST) || 
array_key_exists('sort',$_GET))
+                       {
+                               $this->sort = $sort;
+                       }
+                       if(array_key_exists('order',$_POST) || 
array_key_exists('order',$_GET))
+                       {
+                               $this->order = $order;
+                       }
+                       if(array_key_exists('cat_id',$_POST) || 
array_key_exists('cat_id',$_GET))
+                       {
+                               $this->cat_id = $cat_id;
+                       }
+                       if ($allrows)
+                       {
+                               $this->allrows = $allrows;
+                       }
+               }
+
+
+               function save_sessiondata($data)
+               {
+                       if ($this->use_session)
+                       {
+                               
$GLOBALS['phpgw']->session->appsession('session_data','hrm_job',$data);
+                       }
+               }
+
+               function read_sessiondata()
+               {
+                       $data = 
$GLOBALS['phpgw']->session->appsession('session_data','hrm_job');
+
+                       $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'];
+               }
+
+
+               function read()
+               {
+                       $account_info = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
+                                                                               
        'allrows'=>$this->allrows));
+                       $this->total_records = $this->so->total_records;
+                       return $account_info;
+               }
+
+               function read_single_job($id)
+               {
+                       return $this->so->read_single_job($id);
+               }
+
+               function read_task($job_id)
+               {
+                       $values = $this->so->read_task($job_id);
+                       return $values;
+               }
+
+               function read_single_task($id)
+               {
+                       $values =$this->so->read_single_task($id);
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
+                       if($values['entry_date'])
+                       {
+                               $values['entry_date']   = 
$GLOBALS['phpgw']->common->show_date($values['entry_date'],$dateformat);
+                       }
+                       return $values;
+               }
+
+               function save_job($values,$action='')
+               {
+                       if ($action=='edit')
+                       {
+                               if ($values['id'] != '')
+                               {
+                                       $receipt = $this->so->edit_job($values);
+                               }
+                               else
+                               {
+                                       
$receipt['error'][]=array('msg'=>lang('Error'));
+                               }
+                       }
+                       else
+                       {
+                               $receipt = $this->so->add_job($values);
+                       }
+                       return $receipt;
+               }
+
+               function save_task($values,$action='')
+               {
+                       if ($action=='edit')
+                       {
+                               if ($values['task_id'] != '')
+                               {
+                                       $receipt = 
$this->so->edit_task($values);
+                               }
+                               else
+                               {
+                                       
$receipt['error'][]=array('msg'=>lang('Error'));
+                               }
+                       }
+                       else
+                       {
+                               $receipt = $this->so->add_task($values);
+                       }
+
+                       return $receipt;
+               }
+
+               function delete_task($job_id,$id)
+               {
+                       $this->so->delete_task($job_id,$id);
+               }
+
+               function delete_job($id)
+               {
+                       $this->so->delete_job($id);
+               }
+
+               function reset_job_type_hierarchy()
+               {
+                       $this->so->reset_job_type_hierarchy();
+               }
+
+               function select_job_list($selected='')
+               {
+                       $jobs= $this->so->select_job_list();
+                       while (is_array($jobs) && list(,$job) = each($jobs))
+                       {
+                               if ($job['level'] > 0)
+                               {
+                                       $space = '--';
+                                       $spaceset = 
str_repeat($space,$job['level']);
+                                       $job['name'] = $spaceset . $job['name'];
+                               }
+
+                               $sel_job = '';
+
+                               if ($job['id']==$selected)
+                               {
+                                       $sel_job = 'selected';
+                               }
+
+                               $job_list[] = array
+                               (
+                                       'id'            => $job['id'],
+                                       'name'          => $job['name'],
+                                       'selected'      => $sel_job
+                               );
+                       }
+
+                       for ($i=0;$i<count($job_list);$i++)
+                       {
+                               if ($job_list[$i]['selected'] != 'selected')
+                               {
+                                       unset($job_list[$i]['selected']);
+                               }
+                       }
+
+                       return $job_list;
+               }
        }

====================================================
Index: hrm/inc/class.boplace.inc.php
diff -u hrm/inc/class.boplace.inc.php:1.3 hrm/inc/class.boplace.inc.php:1.4
--- hrm/inc/class.boplace.inc.php:1.3   Mon Nov 28 15:06:48 2005
+++ hrm/inc/class.boplace.inc.php       Wed Nov 30 17:07:22 2005
@@ -1,231 +1,231 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage place
-       * @version $Id$
-       */
-
-       /**
-        * Description
-        * @package hrm
-        */
-
-       class boplace
-       {
-               var $start;
-               var $query;
-               var $filter;
-               var $sort;
-               var $order;
-               var $cat_id;
-
-               var $public_functions = array
-               (
-                       'read'                  => True,
-                       'read_single'           => True,
-                       'save'                  => True,
-                       'delete'                => True,
-                       'check_perms'           => True
-               );
-
-               var $soap_functions = array(
-                       'list' => array(
-                               'in'  => 
array('int','int','struct','string','int'),
-                               'out' => array('array')
-                       ),
-                       'read' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array('array')
-                       ),
-                       'save' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array()
-                       ),
-                       'delete' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array()
-                       )
-               );
-
-               function boplace($session=False)
-               {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->so               = 
CreateObject($this->currentapp.'.soplace');
-                       $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
-
-                       if ($session)
-                       {
-                               $this->read_sessiondata();
-                               $this->use_session = True;
-                       }
-
-                       $start  = get_var('start',array('POST','GET'));
-                       $query  = get_var('query',array('POST','GET'));
-                       $sort   = get_var('sort',array('POST','GET'));
-                       $order  = get_var('order',array('POST','GET'));
-                       $filter = get_var('filter',array('POST','GET'));
-                       $cat_id = get_var('cat_id',array('POST','GET'));
-                       $allrows= get_var('allrows',array('POST','GET'));
-
-                       if ($start)
-                       {
-                               $this->start=$start;
-                       }
-                       else
-                       {
-                               $this->start=0;
-                       }
-
-                       if(array_key_exists('query',$_POST) || 
array_key_exists('query',$_GET))
-                       {
-                               $this->query = $query;
-                       }
-                       if(array_key_exists('filter',$_POST) || 
array_key_exists('filter',$_GET))
-                       {
-                               $this->filter = $filter;
-                       }
-                       if(array_key_exists('sort',$_POST) || 
array_key_exists('sort',$_GET))
-                       {
-                               $this->sort = $sort;
-                       }
-                       if(array_key_exists('order',$_POST) || 
array_key_exists('order',$_GET))
-                       {
-                               $this->order = $order;
-                       }
-                       if(array_key_exists('cat_id',$_POST) || 
array_key_exists('cat_id',$_GET))
-                       {
-                               $this->cat_id = $cat_id;
-                       }
-                       if ($allrows)
-                       {
-                               $this->allrows = $allrows;
-                       }
-               }
-
-
-               function save_sessiondata($data)
-               {
-                       if ($this->use_session)
-                       {
-                               
$GLOBALS['phpgw']->session->appsession('session_data','hr_place',$data);
-                       }
-               }
-
-               function read_sessiondata()
-               {
-                       $data = 
$GLOBALS['phpgw']->session->appsession('session_data','hr_place');
-
-                       $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'];
-               }
-
-
-               function read()
-               {
-                       $place_info = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-                                                                               
        'allrows'=>$this->allrows));
-                       $this->total_records = $this->so->total_records;
-                       return $place_info;
-               }
-
-               function read_single($id)
-               {
-                       $values =$this->so->read_single($id);
-                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-                       if($values['entry_date'])
-                       {
-                               $values['entry_date']   = 
$GLOBALS['phpgw']->common->show_date($values['entry_date'],$dateformat);
-                       }
-
-                       return $values;
-               }
-
-
-               function save($values,$action='')
-               {
-
-                       if ($action=='edit')
-                       {
-                               if ($values['place_id'] != '')
-                               {
-
-                                       $receipt = $this->so->edit($values);
-                               }
-                               else
-                               {
-                                       
$receipt['error'][]=array('msg'=>lang('Error'));
-                               }
-                       }
-                       else
-                       {
-                               $receipt = $this->so->add($values);
-                       }
-
-                       return $receipt;
-               }
-
-               function delete($id)
-               {
-                       $this->so->delete($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 select_place_list($selected='')
-               {
-                       $places= $this->so->select_place_list();
-                       $place_list = 
$this->bocommon->select_list($selected,$places);
-                       return $place_list;
-               }
-       }
\ No newline at end of file
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage place
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package hrm
+        */
+
+       class boplace
+       {
+               var $start;
+               var $query;
+               var $filter;
+               var $sort;
+               var $order;
+               var $cat_id;
+
+               var $public_functions = array
+               (
+                       'read'                  => True,
+                       'read_single'           => True,
+                       'save'                  => True,
+                       'delete'                => True,
+                       'check_perms'           => True
+               );
+
+               var $soap_functions = array(
+                       'list' => array(
+                               'in'  => 
array('int','int','struct','string','int'),
+                               'out' => array('array')
+                       ),
+                       'read' => array(
+                               'in'  => array('int','struct'),
+                               'out' => array('array')
+                       ),
+                       'save' => array(
+                               'in'  => array('int','struct'),
+                               'out' => array()
+                       ),
+                       'delete' => array(
+                               'in'  => array('int','struct'),
+                               'out' => array()
+                       )
+               );
+
+               function boplace($session=False)
+               {
+                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->so               = 
CreateObject($this->currentapp.'.soplace');
+                       $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
+
+                       if ($session)
+                       {
+                               $this->read_sessiondata();
+                               $this->use_session = True;
+                       }
+
+                       $start  = get_var('start',array('POST','GET'));
+                       $query  = get_var('query',array('POST','GET'));
+                       $sort   = get_var('sort',array('POST','GET'));
+                       $order  = get_var('order',array('POST','GET'));
+                       $filter = get_var('filter',array('POST','GET'));
+                       $cat_id = get_var('cat_id',array('POST','GET'));
+                       $allrows= get_var('allrows',array('POST','GET'));
+
+                       if ($start)
+                       {
+                               $this->start=$start;
+                       }
+                       else
+                       {
+                               $this->start=0;
+                       }
+
+                       if(array_key_exists('query',$_POST) || 
array_key_exists('query',$_GET))
+                       {
+                               $this->query = $query;
+                       }
+                       if(array_key_exists('filter',$_POST) || 
array_key_exists('filter',$_GET))
+                       {
+                               $this->filter = $filter;
+                       }
+                       if(array_key_exists('sort',$_POST) || 
array_key_exists('sort',$_GET))
+                       {
+                               $this->sort = $sort;
+                       }
+                       if(array_key_exists('order',$_POST) || 
array_key_exists('order',$_GET))
+                       {
+                               $this->order = $order;
+                       }
+                       if(array_key_exists('cat_id',$_POST) || 
array_key_exists('cat_id',$_GET))
+                       {
+                               $this->cat_id = $cat_id;
+                       }
+                       if ($allrows)
+                       {
+                               $this->allrows = $allrows;
+                       }
+               }
+
+
+               function save_sessiondata($data)
+               {
+                       if ($this->use_session)
+                       {
+                               
$GLOBALS['phpgw']->session->appsession('session_data','hr_place',$data);
+                       }
+               }
+
+               function read_sessiondata()
+               {
+                       $data = 
$GLOBALS['phpgw']->session->appsession('session_data','hr_place');
+
+                       $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'];
+               }
+
+
+               function read()
+               {
+                       $place_info = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
+                                                                               
        'allrows'=>$this->allrows));
+                       $this->total_records = $this->so->total_records;
+                       return $place_info;
+               }
+
+               function read_single($id)
+               {
+                       $values =$this->so->read_single($id);
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       if($values['entry_date'])
+                       {
+                               $values['entry_date']   = 
$GLOBALS['phpgw']->common->show_date($values['entry_date'],$dateformat);
+                       }
+
+                       return $values;
+               }
+
+
+               function save($values,$action='')
+               {
+
+                       if ($action=='edit')
+                       {
+                               if ($values['place_id'] != '')
+                               {
+
+                                       $receipt = $this->so->edit($values);
+                               }
+                               else
+                               {
+                                       
$receipt['error'][]=array('msg'=>lang('Error'));
+                               }
+                       }
+                       else
+                       {
+                               $receipt = $this->so->add($values);
+                       }
+
+                       return $receipt;
+               }
+
+               function delete($id)
+               {
+                       $this->so->delete($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 select_place_list($selected='')
+               {
+                       $places= $this->so->select_place_list();
+                       $place_list = 
$this->bocommon->select_list($selected,$places);
+                       return $place_list;
+               }
+       }

====================================================
Index: hrm/inc/class.uiadmin.inc.php
diff -u hrm/inc/class.uiadmin.inc.php:1.4 hrm/inc/class.uiadmin.inc.php:1.5
--- hrm/inc/class.uiadmin.inc.php:1.4   Fri Nov 25 12:07:56 2005
+++ hrm/inc/class.uiadmin.inc.php       Wed Nov 30 17:07:22 2005
@@ -1,599 +1,598 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage admin
-       * @version $Id$
-       */
-
-       /**
-        * Description
-        * @package hrm
-        */
-
-       class uiadmin
-       {
-               var $grants;
-               var $cat_id;
-               var $start;
-               var $query;
-               var $sort;
-               var $order;
-               var $filter;
-               var $submodule_id;
-               var $permission;
-               var $sub;
-               var $currentapp;
-
-               var $public_functions = array
-               (
-                       'list_acl'              => True,
-                       'aclprefs'              => True,
-                       'edit_id'               => True,
-                       'contact_info'  => True
-               );
-
-               function uiadmin()
-               {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
-                       $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
-
-                       $this->bo                                       = 
CreateObject($this->currentapp.'.boadmin',true);
-                       $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
-
-                       $this->acl_app                          = 
$this->bo->acl_app;
-                       $this->start                            = 
$this->bo->start;
-                       $this->query                            = 
$this->bo->query;
-                       $this->sort                                     = 
$this->bo->sort;
-                       $this->order                            = 
$this->bo->order;
-                       $this->filter                           = 
$this->bo->filter;
-                       $this->cat_id                           = 
$this->bo->cat_id;
-                       $this->location                         = 
$this->bo->location;
-                       $this->granting_group           = 
$this->bo->granting_group;
-                       $this->allrows                          = 
$this->bo->allrows;
-               }
-
-               function save_sessiondata()
-               {
-                       $data = array
-                       (
-                               'start'                 => $this->start,
-                               'query'                 => $this->query,
-                               'sort'                  => $this->sort,
-                               'order'                 => $this->order,
-                               'filter'                => $this->filter,
-                               'cat_id'                => $this->cat_id,
-                               'location'              => $this->location,
-                               'granting_group'                => 
$this->granting_group,
-                               'allrows'       => $this->allrows
-                       );
-
-                       $this->bo->save_sessiondata($data);
-               }
-
-               function aclprefs()
-               {
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('admin','nextmatchs',
-                                                                               
'search_field'));
-
-                       $values         = get_var('values',array('POST'));
-                       $r_processed    = get_var('processed',array('POST'));
-                       $set_permission = 
get_var('set_permission',array('POST'));
-
-                       if($set_permission)
-                       {
-                               $receipt        = 
$this->bo->set_permission($values,$r_processed,true);
-                       }
-
-                       if ($this->location)
-                       {
-                               if($this->cat_id=='accounts')
-                               {
-                                       $user_list = 
$this->bo->get_user_list('accounts',true);
-                               }
-
-                               while (is_array($user_list) && list(,$user) = 
each($user_list))
-                               {
-                                       $processed[] = $user['account_id'];
-                                       $users[] = array
-                                       (
-                                               'account_id'                    
=> $user['account_id'],
-                                               'lid'                           
        => $user['account_lid'],
-                                               'name'                          
        => $user['account_firstname'] . ' ' . $user['account_lastname'],
-                                               'read_right'                    
        => $user['right'][1],
-                                               'add_right'                     
        => $user['right'][2],
-                                               'edit_right'                    
        => $user['right'][4],
-                                               'delete_right'                  
        => $user['right'][8],
-                                               'read_mask'                     
        => $user['mask'][1],
-                                               'add_mask'                      
        => $user['mask'][2],
-                                               'edit_mask'                     
        => $user['mask'][4],
-                                               'delete_mask'                   
        => $user['mask'][8],
-                                               'read_result'                   
        => $user['result'][1],
-                                               'add_result'                    
        => $user['result'][2],
-                                               'edit_result'                   
        => $user['result'][4],
-                                               'delete_result'                 
        => $user['result'][8],
-                                               'lang_right'                    
        => lang('right'),
-                                               'lang_mask'                     
        => lang('mask'),
-                                               'lang_result'                   
        => lang('result'),
-                                               'lang_read'                     
        => lang('Read'),                                //1
-                                               'lang_add'                      
        => lang('Add'),                                 //2
-                                               'lang_edit'                     
        => lang('Edit'),                                //4
-                                               'lang_delete'                   
        => lang('Delete'),                              //8
-                                               'type'                          
        => 'users'
-                                       );
-                               }
-
-                               if($this->cat_id=='groups')
-                               {
-                                       $group_list = 
$this->bo->get_user_list('groups',true);
-                               }
-
-
-                               while (is_array($group_list) && list(,$group) = 
each($group_list))
-                               {
-                                       $processed[] = $group['account_id'];
-                                       $groups[] = array
-                                       (
-                                               'account_id'                    
=> $group['account_id'],
-                                               'lid'                           
        => $group['account_lid'],
-                                               'name'                          
        => $group['account_firstname'],
-                                               'read_right'                    
        => $group['right'][1],
-                                               'add_right'                     
        => $group['right'][2],
-                                               'edit_right'                    
        => $group['right'][4],
-                                               'delete_right'                  
        => $group['right'][8],
-                                               'read_mask'                     
        => $group['mask'][1],
-                                               'add_mask'                      
        => $group['mask'][2],
-                                               'edit_mask'                     
        => $group['mask'][4],
-                                               'delete_mask'                   
        => $group['mask'][8],
-                                               'read_result'                   
        => $group['result'][1],
-                                               'add_result'                    
        => $group['result'][2],
-                                               'edit_result'                   
        => $group['result'][4],
-                                               'delete_result'                 
        => $group['result'][8],
-                                               'lang_right'                    
        => lang('right'),
-                                               'lang_mask'                     
        => lang('mask'),
-                                               'lang_result'                   
        => lang('result'),
-                                               'lang_read'                     
        => lang('Read'),                                //1
-                                               'lang_add'                      
        => lang('Add'),                                 //2
-                                               'lang_edit'                     
        => lang('Edit'),                                //4
-                                               'lang_delete'                   
        => lang('Delete'),                              //8
-                                               'type'                          
        => 'groups'
-                                       );
-                               }
-//_debug_array($groups);
-
-                               address@hidden("_", $processed);
-                       }
-
-
-                       $table_header[] = array
-                       (
-                               'lang_read'                             => 
lang('Read'),                                //1
-                               'lang_add'                              => 
lang('Add'),                                 //2
-                               'lang_edit'                             => 
lang('Edit'),                                //4
-                               'lang_delete'                           => 
lang('Delete'),                              //8
-                               'lang_manager'                          => 
lang('Manager')                              //16
-                       );
-
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin.aclprefs',
-                                               'sort'                          
=>$this->sort,
-                                               'order'                         
=>$this->order,
-                                               'cat_id'                        
=>$this->cat_id,
-                                               'filter'                        
=>$this->filter,
-                                               'query'                         
=>$this->query,
-                                               'module'                        
=> $this->location,
-                                               'granting_group'        => 
$this->granting_group,
-                                               'acl_app'                       
=> $this->acl_app
-                       );
-
-                       if(!$this->location)
-                       {
-                               $receipt['error'][] = array('msg' => 
lang('select a location!'));
-                       }
-
-                       $num_records = count($user_list) + count($group_list);
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $data = array
-                       (
-                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/preferences/index.php'),
-                               'lang_save'                                     
        => lang('save'),
-                               'lang_done'                                     
        => lang('done'),
-                               'processed'                                     
        => $processed,
-                               'location'                                      
        => $this->location,
-                               'links'                                         
        => $links,
-                               'allow_allrows'                                 
=> false,
-                               'start_record'                                  
=> $this->start,
-                               'record_limit'                                  
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
-                               'num_records'                                   
=> $num_records,
-                               'all_records'                                   
=> $this->bo->total_records,
-                               'link_url'                                      
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiadmin.aclprefs'),
-                               'img_path'                                      
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
-
-                               'lang_groups'                                   
=> lang('groups'),
-                               'lang_users'                                    
=> lang('users'),
-                               '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),
-                               'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'cat_id'                                        
        => $this->cat_id,
-                               'permission'                                    
=> False,
-                               'grant'                                         
        => 1,
-
-                               'lang_searchfield_statustext'   => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
-                               'lang_searchbutton_statustext'  => lang('Submit 
the search string'),
-                               'query'                                         
        => $this->query,
-                               'lang_search'                                   
=> lang('search'),
-                               'table_header_permission'               => 
$table_header,
-                               'values_groups'                                 
=> $groups,
-                               'values_users'                                  
=> $users,
-                               'lang_no_location'                              
=> lang('No location'),
-                               'lang_location_statustext'              => 
lang('Select submodule'),
-                               'select_name_location'                  => 
'module',
-                               'location_list'                                 
=> $this->bo->select_location('filter',$this->location,True),
-
-                               'is_admin'                                      
        => $GLOBALS['phpgw_info']['user']['apps']['admin'],
-                               'lang_group_statustext'                 => 
lang('Select the granting group. To do not use a granting group select NO 
GRANTING GROUP'),
-                               'select_group_name'                             
=> 'granting_group',
-                               'lang_no_group'                                 
=> lang('No granting group'),
-                               'group_list'                                    
=> 
$this->bocommon->get_group_list('filter',$this->granting_group,$start=-1,$sort='ASC',$order='account_firstname',$query='',$offset=-1),
-                       );
-
-                       $appname                                                
= lang('preferences');
-                       $function_msg                                   = 
lang('set grants');
-                       $owner_name = 
$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->accounts->account_id);  
          // get owner name for title
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg . ': ' . 
$owner_name;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_permission' => $data));
-                       $this->save_sessiondata();
-               }
-
-               function list_acl()
-               {
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('admin','nextmatchs',
-                                                                               
'search_field'));
-
-                       $values                 = 
get_var('values',array('POST'));
-                       $r_processed    = get_var('processed',array('POST'));
-
-                       $set_permission = 
get_var('set_permission',array('POST'));
-
-                       if($set_permission)
-                       {
-                               $receipt        = 
$this->bo->set_permission($values,$r_processed);
-                       }
-
-                       if ($this->location)
-                       {
-                               if($this->cat_id=='accounts')
-                               {
-                                       $user_list = 
$this->bo->get_user_list('accounts');
-                               }
-
-                               if (isSet($user_list) AND is_array($user_list))
-                               {
-                                       foreach($user_list as $user)
-                                       {
-                                               $processed[] = 
$user['account_id'];
-                                               $users[] = array
-                                               (
-                                                       'account_id'            
                => $user['account_id'],
-                                                       'lid'                   
                => $user['account_lid'],
-                                                       'name'                  
                => $user['account_firstname'] . ' ' . $user['account_lastname'] 
. ' [' . $user['account_lid'] . ']',
-                                                       'read_right'            
                => $user['right'][1],
-                                                       'add_right'             
                => $user['right'][2],
-                                                       'edit_right'            
                => $user['right'][4],
-                                                       'delete_right'          
                => $user['right'][8],
-                                                       'manage_right'          
                => $user['right'][16],
-                                                       'read_mask'             
                => $user['mask'][1],
-                                                       'add_mask'              
                => $user['mask'][2],
-                                                       'edit_mask'             
                => $user['mask'][4],
-                                                       'delete_mask'           
                => $user['mask'][8],
-                                                       'manage_mask'           
                => $user['mask'][16],
-                                                       'read_result'           
                => $user['result'][1],
-                                                       'add_result'            
                => $user['result'][2],
-                                                       'edit_result'           
                => $user['result'][4],
-                                                       'delete_result'         
                => $user['result'][8],
-                                                       'manage_result'         
                => $user['result'][16],
-                                                       'lang_right'            
                => lang('right'),
-                                                       'lang_mask'             
                => lang('mask'),
-                                                       'lang_result'           
                => lang('result'),
-                                                       'lang_read'             
                => lang('Read'),                                //1
-                                                       'lang_add'              
                => lang('Add'),                                 //2
-                                                       'lang_edit'             
                => lang('Edit'),                                //4
-                                                       'lang_delete'           
                => lang('Delete'),                              //8
-                                                       'lang_manage'           
                => lang('Manage'),                              //16
-                                                       'type'                  
                => 'users'
-                                               );
-                                       }
-                               }
-
-                               if($this->cat_id=='groups')
-                               {
-                                       $group_list = 
$this->bo->get_user_list('groups');
-                               }
-
-                               if (isSet($group_list) AND 
is_array($group_list))
-                               {
-                                       foreach($group_list as $group)
-                                       {
-                                               $processed[] = 
$group['account_id'];
-                                               $groups[] = array
-                                               (
-                                                       'account_id'            
                => $group['account_id'],
-                                                       'lid'                   
                => $group['account_lid'],
-                                                       'name'                  
                => $group['account_firstname'],
-                                                       'read_right'            
                => $group['right'][1],
-                                                       'add_right'             
                => $group['right'][2],
-                                                       'edit_right'            
                => $group['right'][4],
-                                                       'delete_right'          
                => $group['right'][8],
-                                                       'manage_right'          
                => $group['right'][16],
-                                                       'read_mask'             
                => $group['mask'][1],
-                                                       'add_mask'              
                => $group['mask'][2],
-                                                       'edit_mask'             
                => $group['mask'][4],
-                                                       'delete_mask'           
                => $group['mask'][8],
-                                                       'manage_mask'           
                => $group['mask'][16],
-                                                       'read_result'           
                => $group['result'][1],
-                                                       'add_result'            
                => $group['result'][2],
-                                                       'edit_result'           
                => $group['result'][4],
-                                                       'delete_result'         
                => $group['result'][8],
-                                                       'manage_result'         
                => $group['result'][16],
-                                                       'lang_right'            
                => lang('right'),
-                                                       'lang_mask'             
                => lang('mask'),
-                                                       'lang_result'           
                => lang('result'),
-                                                       'lang_read'             
                => lang('Read'),                                //1
-                                                       'lang_add'              
                => lang('Add'),                                 //2
-                                                       'lang_edit'             
                => lang('Edit'),                                //4
-                                                       'lang_delete'           
                => lang('Delete'),                              //8
-                                                       'lang_manage'           
                => lang('Manage'),                              //16
-                                                       'type'                  
                => 'groups'
-                                               );
-                                       }
-                               }
-
-
-                               address@hidden("_", $processed);
-                       }
-
-
-                       $table_header[] = array
-                       (
-                               'sort_lid'      => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   =>      'account_lid',
-                                                                               
        'order' =>      $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin.list_acl',
-                                                                               
                                                        'cat_id'        
=>$this->cat_id,
-                                                                               
                                                        'query'         
=>$this->query,
-                                                                               
                                                        'module'                
=> $this->location,
-                                                                               
                                                        'submodule_id'  
=>$this->submodule_id)
-                                                                               
)),
-                               'sort_lastname' => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  =>      $this->sort,
-                                                                               
        'var'   =>      'account_lastname',
-                                                                               
        'order' =>      $this->order,
-                                                                               
        'extra' =>      array('menuaction'      => 
$this->currentapp.'.uiadmin.list_acl',
-                                                                               
                                                        'cat_id'        
=>$this->cat_id,
-                                                                               
                                                        'query'         
=>$this->query,
-                                                                               
                                                        'module'                
=> $this->location,
-                                                                               
                                                        'submodule_id'  
=>$this->submodule_id)
-                                                                               
)),
-                               'sort_firstname'        => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  =>      $this->sort,
-                                                                               
        'var'   =>      'account_firstname',
-                                                                               
        'order' =>      $this->order,
-                                                                               
        'extra' =>      array('menuaction'      => 
$this->currentapp.'.uiadmin.list_acl',
-                                                                               
                                                        'cat_id'        
=>$this->cat_id,
-                                                                               
                                                        'query'         
=>$this->query,
-                                                                               
                                                        'module'                
=> $this->location,
-                                                                               
                                                        'submodule_id'  
=>$this->submodule_id)
-                                                                               
)),
-
-
-                               'lang_values'                           => 
lang('values'),
-                               'lang_read'                                     
=> lang('Read'),                                //1
-                               'lang_add'                                      
=> lang('Add'),                                 //2
-                               'lang_edit'                                     
=> lang('Edit'),                                //4
-                               'lang_delete'                           => 
lang('Delete'),                              //8
-                               'lang_manager'                          => 
lang('Manager'),                             //16
-                       );
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin.list_acl',
-                                               'sort'                  
=>$this->sort,
-                                               'order'                 
=>$this->order,
-                                               'cat_id'                
=>$this->cat_id,
-                                               'filter'                
=>$this->filter,
-                                               'query'                 
=>$this->query,
-                                               'module'                => 
$this->location
-
-                       );
-
-                       if(!$this->location)
-                       {
-                               $receipt['error'][] = array('msg' => 
lang('select a location!'));
-                       }
-
-                       if(!$this->allrows)
-                       {
-                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
-                       }
-                       else
-                       {
-                               $record_limit   = $this->bo->total_records;
-                       }
-
-                               $num_records = count($user_list) + 
count($group_list);
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $data = array
-                       (
-                               'allrows'                                       
        => $this->allrows,
-                               'allow_allrows'                                 
=> true,
-                               'start_record'                                  
=> $this->start,
-                               'record_limit'                                  
=> $record_limit,
-
-                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/admin/index.php'),
-                               'lang_save'                                     
        => lang('save'),
-                               'lang_done'                                     
        => lang('done'),
-                               'processed'                                     
        => $processed,
-                               'location'                                      
        => $this->location,
-                               'links'                                         
        => $links,
-
-                               'num_records'                                   
=> $num_records,
-                               'all_records'                                   
=> $this->bo->total_records,
-                               '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 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),
-                               'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'cat_id'                                        
        => $this->cat_id,
-                               'permission'                                    
=> 1,
-
-                               'lang_searchfield_statustext'   => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
-                               'lang_searchbutton_statustext'  => lang('Submit 
the search string'),
-                               'query'                                         
        => $this->query,
-                               'lang_search'                                   
=> lang('search'),
-                               'table_header_permission'               => 
$table_header,
-                               'values_groups'                                 
=> $groups,
-                               'values_users'                                  
=> $users,
-                               'lang_groups'                                   
=> lang('groups'),
-                               'lang_users'                                    
=> lang('users'),
-
-                               'lang_no_location'                              
=> lang('No location'),
-                               'lang_location_statustext'              => 
lang('Select submodule'),
-                               'select_name_location'                  => 
'module',
-                               'location_list'                                 
=> $this->bo->select_location('filter',$this->location,False)
-                       );
-
-                       $appname                                                
= lang('permission');
-                       $function_msg                                   = 
lang('set permission');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_permission' => $data));
-                       $this->save_sessiondata();
-               }
-
-               function contact_info()
-               {
-                       $GLOBALS['phpgw']->xslttpl->add_file(array('admin'));
-
-                       $values         = get_var('values',array('POST'));
-
-                       if ($values['save'])
-                       {
-                               
$GLOBALS['phpgw']->preferences->account_id=$this->filter;
-                               
$GLOBALS['phpgw']->preferences->read_repository();
-
-                               if ($values['old_email'] != $values['email'])
-                               {
-                                       
$GLOBALS['phpgw']->preferences->add($this->currentapp,"email",$values['email'],'user');
-                                       $receipt['message'][] = array('msg' => 
lang('Users email is updated'));
-                               }
-                               if ($values['old_phone'] != $values['phone'])
-                               {
-                                       
$GLOBALS['phpgw']->preferences->add($this->currentapp,"cellphone",$values['phone'],'user');
-                                       $receipt['message'][] = array('msg' => 
lang('Users phone is updated'));
-                               }
-                               if ($values['old_approval_from'] != 
$values['approval_from'])
-                               {
-                                       
$GLOBALS['phpgw']->preferences->add($this->currentapp,"approval_from",$values['approval_from'],'user');
-                                       $receipt['message'][] = array('msg' => 
lang('Approval from is updated'));
-                               }
-                               if ($values['old_default_vendor_category'] != 
$values['default_vendor_category'])
-                               {
-                                       
$GLOBALS['phpgw']->preferences->add($this->currentapp,"default_vendor_category",$values['default_vendor_category'],'user');
-                                       $receipt['message'][] = array('msg' => 
lang('default vendor category is updated'));
-                               }
-                               
$GLOBALS['phpgw']->preferences->save_repository();
-                       }
-
-                       if($this->filter)
-                       {
-                               $prefs = 
$this->bocommon->create_preferences($this->currentapp,$this->filter);
-                       }
-
-                       $cats           = CreateObject('phpgwapi.categories');
-                       $cats->app_name = 'fm_vendor';
-
-                       $cat_data       = 
$cats->formatted_xslt_list(array('selected' => 
$prefs['default_vendor_category'],'globals' => True, 'link_data' =>array()));
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $data = array
-                       (
-                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'form_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiadmin.contact_info'),
-                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/admin/index.php'),
-                               'lang_submit'                                   
=> lang('submit'),
-                               'lang_save'                                     
        => lang('Edit'),
-                               'lang_add_statustext'                   => 
lang('Edit ID'),
-                               'lang_done'                                     
        => lang('done'),
-                               'lang_done_statustext'                  => 
lang('Back to Admin'),
-
-                               'lang_email_statustext'                 => 
lang('Enter the email-address for this user'),
-
-                               'lang_user'                                     
        => lang('User'),
-                               'lang_email'                                    
=> lang('Email'),
-                               'value_old_email'                               
=> $prefs['email'],
-                               'value_email'                                   
=> $prefs['email'],
-
-                               'lang_phone'                                    
=> lang('Phone'),
-                               'value_old_phone'                               
=> $prefs['cellphone'],
-                               'value_phone'                                   
=> $prefs['cellphone'],
-
-                               'lang_approval_from'                    => 
lang('Approval from'),
-                               'value_old_approval_from'               => 
$prefs['approval_from'],
-                               'approval_from'                                 
=> 
$this->bocommon->get_user_list('select',$prefs['approval_from'],$extra=False,$default=False,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1),
-
-                               'select_user_name'                              
=> 'approval_from',
-                               'lang_approval_from_statustext' => lang('Select 
the users supervisor'),
-
-                               'lang_default_vendor_category'          => 
lang('default vendor category'),
-                               'value_old_default_vendor_category'     => 
$prefs['default_vendor_category'],
-                               'vendor_category'                               
        => $cat_data['cat_list'],
-                               'select_user_name'                              
        => 'approval_from',
-                               'lang_default_vendor_category_statustext'       
=> lang('Select default vendor category'),
-                               'lang_no_cat'                                   
        => lang('No category'),
-
-
-                               'lang_user_statustext'                  => 
lang('Select the user to edit email'),
-                               'select_user_name'                              
=> 'filter',
-                               'lang_no_user'                                  
=> lang('No user'),
-                               'value_user_id'                                 
=> $this->filter,
-                               'user_list'                                     
        => 
$this->bocommon->get_user_list('filter',$this->filter,$extra=False,$default=False,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1),
-                       );
-
-                       $appname                                                
        = lang('User contact info');
-                       $function_msg                                           
= lang('edit info');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('contact_info' => $data));
-                       $this->save_sessiondata();
-               }
-       }
\ No newline at end of file
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package hrm
+        */
+
+       class uiadmin
+       {
+               var $grants;
+               var $cat_id;
+               var $start;
+               var $query;
+               var $sort;
+               var $order;
+               var $filter;
+               var $submodule_id;
+               var $permission;
+               var $sub;
+               var $currentapp;
+
+               var $public_functions = array
+               (
+                       'list_acl'              => True,
+                       'aclprefs'              => True,
+                       'edit_id'               => True,
+                       'contact_info'  => True
+               );
+
+               function uiadmin()
+               {
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
+                       $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
+
+                       $this->bo                                       = 
CreateObject($this->currentapp.'.boadmin',true);
+                       $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
+
+                       $this->acl_app                          = 
$this->bo->acl_app;
+                       $this->start                            = 
$this->bo->start;
+                       $this->query                            = 
$this->bo->query;
+                       $this->sort                                     = 
$this->bo->sort;
+                       $this->order                            = 
$this->bo->order;
+                       $this->filter                           = 
$this->bo->filter;
+                       $this->cat_id                           = 
$this->bo->cat_id;
+                       $this->location                         = 
$this->bo->location;
+                       $this->granting_group           = 
$this->bo->granting_group;
+                       $this->allrows                          = 
$this->bo->allrows;
+               }
+
+               function save_sessiondata()
+               {
+                       $data = array
+                       (
+                               'start'                 => $this->start,
+                               'query'                 => $this->query,
+                               'sort'                  => $this->sort,
+                               'order'                 => $this->order,
+                               'filter'                => $this->filter,
+                               'cat_id'                => $this->cat_id,
+                               'location'              => $this->location,
+                               'granting_group'                => 
$this->granting_group,
+                               'allrows'       => $this->allrows
+                       );
+
+                       $this->bo->save_sessiondata($data);
+               }
+
+               function aclprefs()
+               {
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('admin','nextmatchs',
+                                                                               
'search_field'));
+
+                       $values         = get_var('values',array('POST'));
+                       $r_processed    = get_var('processed',array('POST'));
+                       $set_permission = 
get_var('set_permission',array('POST'));
+
+                       if($set_permission)
+                       {
+                               $receipt        = 
$this->bo->set_permission($values,$r_processed,true);
+                       }
+
+                       if ($this->location)
+                       {
+                               if($this->cat_id=='accounts')
+                               {
+                                       $user_list = 
$this->bo->get_user_list('accounts',true);
+                               }
+
+                               while (is_array($user_list) && list(,$user) = 
each($user_list))
+                               {
+                                       $processed[] = $user['account_id'];
+                                       $users[] = array
+                                       (
+                                               'account_id'                    
=> $user['account_id'],
+                                               'lid'                           
        => $user['account_lid'],
+                                               'name'                          
        => $user['account_firstname'] . ' ' . $user['account_lastname'],
+                                               'read_right'                    
        => $user['right'][1],
+                                               'add_right'                     
        => $user['right'][2],
+                                               'edit_right'                    
        => $user['right'][4],
+                                               'delete_right'                  
        => $user['right'][8],
+                                               'read_mask'                     
        => $user['mask'][1],
+                                               'add_mask'                      
        => $user['mask'][2],
+                                               'edit_mask'                     
        => $user['mask'][4],
+                                               'delete_mask'                   
        => $user['mask'][8],
+                                               'read_result'                   
        => $user['result'][1],
+                                               'add_result'                    
        => $user['result'][2],
+                                               'edit_result'                   
        => $user['result'][4],
+                                               'delete_result'                 
        => $user['result'][8],
+                                               'lang_right'                    
        => lang('right'),
+                                               'lang_mask'                     
        => lang('mask'),
+                                               'lang_result'                   
        => lang('result'),
+                                               'lang_read'                     
        => lang('Read'),                                //1
+                                               'lang_add'                      
        => lang('Add'),                                 //2
+                                               'lang_edit'                     
        => lang('Edit'),                                //4
+                                               'lang_delete'                   
        => lang('Delete'),                              //8
+                                               'type'                          
        => 'users'
+                                       );
+                               }
+
+                               if($this->cat_id=='groups')
+                               {
+                                       $group_list = 
$this->bo->get_user_list('groups',true);
+                               }
+
+
+                               while (is_array($group_list) && list(,$group) = 
each($group_list))
+                               {
+                                       $processed[] = $group['account_id'];
+                                       $groups[] = array
+                                       (
+                                               'account_id'                    
=> $group['account_id'],
+                                               'lid'                           
        => $group['account_lid'],
+                                               'name'                          
        => $group['account_firstname'],
+                                               'read_right'                    
        => $group['right'][1],
+                                               'add_right'                     
        => $group['right'][2],
+                                               'edit_right'                    
        => $group['right'][4],
+                                               'delete_right'                  
        => $group['right'][8],
+                                               'read_mask'                     
        => $group['mask'][1],
+                                               'add_mask'                      
        => $group['mask'][2],
+                                               'edit_mask'                     
        => $group['mask'][4],
+                                               'delete_mask'                   
        => $group['mask'][8],
+                                               'read_result'                   
        => $group['result'][1],
+                                               'add_result'                    
        => $group['result'][2],
+                                               'edit_result'                   
        => $group['result'][4],
+                                               'delete_result'                 
        => $group['result'][8],
+                                               'lang_right'                    
        => lang('right'),
+                                               'lang_mask'                     
        => lang('mask'),
+                                               'lang_result'                   
        => lang('result'),
+                                               'lang_read'                     
        => lang('Read'),                                //1
+                                               'lang_add'                      
        => lang('Add'),                                 //2
+                                               'lang_edit'                     
        => lang('Edit'),                                //4
+                                               'lang_delete'                   
        => lang('Delete'),                              //8
+                                               'type'                          
        => 'groups'
+                                       );
+                               }
+//_debug_array($groups);
+
+                               address@hidden("_", $processed);
+                       }
+
+
+                       $table_header[] = array
+                       (
+                               'lang_read'                             => 
lang('Read'),                                //1
+                               'lang_add'                              => 
lang('Add'),                                 //2
+                               'lang_edit'                             => 
lang('Edit'),                                //4
+                               'lang_delete'                           => 
lang('Delete'),                              //8
+                               'lang_manager'                          => 
lang('Manager')                              //16
+                       );
+
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uiadmin.aclprefs',
+                                               'sort'                          
=>$this->sort,
+                                               'order'                         
=>$this->order,
+                                               'cat_id'                        
=>$this->cat_id,
+                                               'filter'                        
=>$this->filter,
+                                               'query'                         
=>$this->query,
+                                               'module'                        
=> $this->location,
+                                               'granting_group'        => 
$this->granting_group,
+                                               'acl_app'                       
=> $this->acl_app
+                       );
+
+                       if(!$this->location)
+                       {
+                               $receipt['error'][] = array('msg' => 
lang('select a location!'));
+                       }
+
+                       $num_records = count($user_list) + count($group_list);
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/preferences/index.php'),
+                               'lang_save'                                     
        => lang('save'),
+                               'lang_done'                                     
        => lang('done'),
+                               'processed'                                     
        => $processed,
+                               'location'                                      
        => $this->location,
+                               'links'                                         
        => $links,
+                               'allow_allrows'                                 
=> false,
+                               'start_record'                                  
=> $this->start,
+                               'record_limit'                                  
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
+                               'num_records'                                   
=> $num_records,
+                               'all_records'                                   
=> $this->bo->total_records,
+                               'link_url'                                      
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiadmin.aclprefs'),
+                               'img_path'                                      
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
+
+                               'lang_groups'                                   
=> lang('groups'),
+                               'lang_users'                                    
=> lang('users'),
+                               '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),
+                               'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'cat_id'                                        
        => $this->cat_id,
+                               'permission'                                    
=> False,
+                               'grant'                                         
        => 1,
+
+                               'lang_searchfield_statustext'   => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
+                               'lang_searchbutton_statustext'  => lang('Submit 
the search string'),
+                               'query'                                         
        => $this->query,
+                               'lang_search'                                   
=> lang('search'),
+                               'table_header_permission'               => 
$table_header,
+                               'values_groups'                                 
=> $groups,
+                               'values_users'                                  
=> $users,
+                               'lang_no_location'                              
=> lang('No location'),
+                               'lang_location_statustext'              => 
lang('Select submodule'),
+                               'select_name_location'                  => 
'module',
+                               'location_list'                                 
=> $this->bo->select_location('filter',$this->location,True),
+
+                               'is_admin'                                      
        => $GLOBALS['phpgw_info']['user']['apps']['admin'],
+                               'lang_group_statustext'                 => 
lang('Select the granting group. To do not use a granting group select NO 
GRANTING GROUP'),
+                               'select_group_name'                             
=> 'granting_group',
+                               'lang_no_group'                                 
=> lang('No granting group'),
+                               'group_list'                                    
=> 
$this->bocommon->get_group_list('filter',$this->granting_group,$start=-1,$sort='ASC',$order='account_firstname',$query='',$offset=-1),
+                       );
+
+                       $appname                                                
= lang('preferences');
+                       $function_msg                                   = 
lang('set grants');
+                       $owner_name = 
$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->accounts->account_id);  
          // get owner name for title
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg . ': ' . 
$owner_name;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_permission' => $data));
+                       $this->save_sessiondata();
+               }
+
+               function list_acl()
+               {
+
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('admin','nextmatchs',
+                                                                               
'search_field'));
+
+                       $values                 = 
get_var('values',array('POST'));
+                       $r_processed    = get_var('processed',array('POST'));
+
+                       $set_permission = 
get_var('set_permission',array('POST'));
+
+                       if($set_permission)
+                       {
+                               $receipt        = 
$this->bo->set_permission($values,$r_processed);
+                       }
+
+                       if ($this->location)
+                       {
+                               if($this->cat_id=='accounts')
+                               {
+                                       $user_list = 
$this->bo->get_user_list('accounts');
+                               }
+
+                               if (isSet($user_list) AND is_array($user_list))
+                               {
+                                       foreach($user_list as $user)
+                                       {
+                                               $processed[] = 
$user['account_id'];
+                                               $users[] = array
+                                               (
+                                                       'account_id'            
                => $user['account_id'],
+                                                       'lid'                   
                => $user['account_lid'],
+                                                       'name'                  
                => $user['account_firstname'] . ' ' . $user['account_lastname'] 
. ' [' . $user['account_lid'] . ']',
+                                                       'read_right'            
                => $user['right'][1],
+                                                       'add_right'             
                => $user['right'][2],
+                                                       'edit_right'            
                => $user['right'][4],
+                                                       'delete_right'          
                => $user['right'][8],
+                                                       'manage_right'          
                => $user['right'][16],
+                                                       'read_mask'             
                => $user['mask'][1],
+                                                       'add_mask'              
                => $user['mask'][2],
+                                                       'edit_mask'             
                => $user['mask'][4],
+                                                       'delete_mask'           
                => $user['mask'][8],
+                                                       'manage_mask'           
                => $user['mask'][16],
+                                                       'read_result'           
                => $user['result'][1],
+                                                       'add_result'            
                => $user['result'][2],
+                                                       'edit_result'           
                => $user['result'][4],
+                                                       'delete_result'         
                => $user['result'][8],
+                                                       'manage_result'         
                => $user['result'][16],
+                                                       'lang_right'            
                => lang('right'),
+                                                       'lang_mask'             
                => lang('mask'),
+                                                       'lang_result'           
                => lang('result'),
+                                                       'lang_read'             
                => lang('Read'),                                //1
+                                                       'lang_add'              
                => lang('Add'),                                 //2
+                                                       'lang_edit'             
                => lang('Edit'),                                //4
+                                                       'lang_delete'           
                => lang('Delete'),                              //8
+                                                       'lang_manage'           
                => lang('Manage'),                              //16
+                                                       'type'                  
                => 'users'
+                                               );
+                                       }
+                               }
+
+                               if($this->cat_id=='groups')
+                               {
+                                       $group_list = 
$this->bo->get_user_list('groups');
+                               }
+
+                               if (isSet($group_list) AND 
is_array($group_list))
+                               {
+                                       foreach($group_list as $group)
+                                       {
+                                               $processed[] = 
$group['account_id'];
+                                               $groups[] = array
+                                               (
+                                                       'account_id'            
                => $group['account_id'],
+                                                       'lid'                   
                => $group['account_lid'],
+                                                       'name'                  
                => $group['account_firstname'],
+                                                       'read_right'            
                => $group['right'][1],
+                                                       'add_right'             
                => $group['right'][2],
+                                                       'edit_right'            
                => $group['right'][4],
+                                                       'delete_right'          
                => $group['right'][8],
+                                                       'manage_right'          
                => $group['right'][16],
+                                                       'read_mask'             
                => $group['mask'][1],
+                                                       'add_mask'              
                => $group['mask'][2],
+                                                       'edit_mask'             
                => $group['mask'][4],
+                                                       'delete_mask'           
                => $group['mask'][8],
+                                                       'manage_mask'           
                => $group['mask'][16],
+                                                       'read_result'           
                => $group['result'][1],
+                                                       'add_result'            
                => $group['result'][2],
+                                                       'edit_result'           
                => $group['result'][4],
+                                                       'delete_result'         
                => $group['result'][8],
+                                                       'manage_result'         
                => $group['result'][16],
+                                                       'lang_right'            
                => lang('right'),
+                                                       'lang_mask'             
                => lang('mask'),
+                                                       'lang_result'           
                => lang('result'),
+                                                       'lang_read'             
                => lang('Read'),                                //1
+                                                       'lang_add'              
                => lang('Add'),                                 //2
+                                                       'lang_edit'             
                => lang('Edit'),                                //4
+                                                       'lang_delete'           
                => lang('Delete'),                              //8
+                                                       'lang_manage'           
                => lang('Manage'),                              //16
+                                                       'type'                  
                => 'groups'
+                                               );
+                                       }
+                               }
+
+
+                               address@hidden("_", $processed);
+                       }
+
+
+                       $table_header[] = array
+                       (
+                               'sort_lid'      => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'account_lid',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin.list_acl',
+                                                                               
                                                        'cat_id'        
=>$this->cat_id,
+                                                                               
                                                        'query'         
=>$this->query,
+                                                                               
                                                        'module'                
=> $this->location,
+                                                                               
                                                        'submodule_id'  
=>$this->submodule_id)
+                                                                               
)),
+                               'sort_lastname' => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  =>      $this->sort,
+                                                                               
        'var'   =>      'account_lastname',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra' =>      array('menuaction'      => 
$this->currentapp.'.uiadmin.list_acl',
+                                                                               
                                                        'cat_id'        
=>$this->cat_id,
+                                                                               
                                                        'query'         
=>$this->query,
+                                                                               
                                                        'module'                
=> $this->location,
+                                                                               
                                                        'submodule_id'  
=>$this->submodule_id)
+                                                                               
)),
+                               'sort_firstname'        => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  =>      $this->sort,
+                                                                               
        'var'   =>      'account_firstname',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra' =>      array('menuaction'      => 
$this->currentapp.'.uiadmin.list_acl',
+                                                                               
                                                        'cat_id'        
=>$this->cat_id,
+                                                                               
                                                        'query'         
=>$this->query,
+                                                                               
                                                        'module'                
=> $this->location,
+                                                                               
                                                        'submodule_id'  
=>$this->submodule_id)
+                                                                               
)),
+
+
+                               'lang_values'                           => 
lang('values'),
+                               'lang_read'                                     
=> lang('Read'),                                //1
+                               'lang_add'                                      
=> lang('Add'),                                 //2
+                               'lang_edit'                                     
=> lang('Edit'),                                //4
+                               'lang_delete'                           => 
lang('Delete'),                              //8
+                               'lang_manager'                          => 
lang('Manager'),                             //16
+                       );
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uiadmin.list_acl',
+                                               'sort'                  
=>$this->sort,
+                                               'order'                 
=>$this->order,
+                                               'cat_id'                
=>$this->cat_id,
+                                               'filter'                
=>$this->filter,
+                                               'query'                 
=>$this->query,
+                                               'module'                => 
$this->location
+
+                       );
+
+                       if(!$this->location)
+                       {
+                               $receipt['error'][] = array('msg' => 
lang('select a location!'));
+                       }
+
+                       if(!$this->allrows)
+                       {
+                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                       }
+                       else
+                       {
+                               $record_limit   = $this->bo->total_records;
+                       }
+
+                               $num_records = count($user_list) + 
count($group_list);
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'allrows'                                       
        => $this->allrows,
+                               'allow_allrows'                                 
=> true,
+                               'start_record'                                  
=> $this->start,
+                               'record_limit'                                  
=> $record_limit,
+
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/admin/index.php'),
+                               'lang_save'                                     
        => lang('save'),
+                               'lang_done'                                     
        => lang('done'),
+                               'processed'                                     
        => $processed,
+                               'location'                                      
        => $this->location,
+                               'links'                                         
        => $links,
+
+                               'num_records'                                   
=> $num_records,
+                               'all_records'                                   
=> $this->bo->total_records,
+                               '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 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),
+                               'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'cat_id'                                        
        => $this->cat_id,
+                               'permission'                                    
=> 1,
+
+                               'lang_searchfield_statustext'   => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
+                               'lang_searchbutton_statustext'  => lang('Submit 
the search string'),
+                               'query'                                         
        => $this->query,
+                               'lang_search'                                   
=> lang('search'),
+                               'table_header_permission'               => 
$table_header,
+                               'values_groups'                                 
=> $groups,
+                               'values_users'                                  
=> $users,
+                               'lang_groups'                                   
=> lang('groups'),
+                               'lang_users'                                    
=> lang('users'),
+
+                               'lang_no_location'                              
=> lang('No location'),
+                               'lang_location_statustext'              => 
lang('Select submodule'),
+                               'select_name_location'                  => 
'module',
+                               'location_list'                                 
=> $this->bo->select_location('filter',$this->location,False)
+                       );
+
+                       $appname                                                
= lang('permission');
+                       $function_msg                                   = 
lang('set permission');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_permission' => $data));
+                       $this->save_sessiondata();
+               }
+
+               function contact_info()
+               {
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('admin'));
+
+                       $values         = get_var('values',array('POST'));
+
+                       if ($values['save'])
+                       {
+                               
$GLOBALS['phpgw']->preferences->account_id=$this->filter;
+                               
$GLOBALS['phpgw']->preferences->read_repository();
+
+                               if ($values['old_email'] != $values['email'])
+                               {
+                                       
$GLOBALS['phpgw']->preferences->add($this->currentapp,"email",$values['email'],'user');
+                                       $receipt['message'][] = array('msg' => 
lang('Users email is updated'));
+                               }
+                               if ($values['old_phone'] != $values['phone'])
+                               {
+                                       
$GLOBALS['phpgw']->preferences->add($this->currentapp,"cellphone",$values['phone'],'user');
+                                       $receipt['message'][] = array('msg' => 
lang('Users phone is updated'));
+                               }
+                               if ($values['old_approval_from'] != 
$values['approval_from'])
+                               {
+                                       
$GLOBALS['phpgw']->preferences->add($this->currentapp,"approval_from",$values['approval_from'],'user');
+                                       $receipt['message'][] = array('msg' => 
lang('Approval from is updated'));
+                               }
+                               if ($values['old_default_vendor_category'] != 
$values['default_vendor_category'])
+                               {
+                                       
$GLOBALS['phpgw']->preferences->add($this->currentapp,"default_vendor_category",$values['default_vendor_category'],'user');
+                                       $receipt['message'][] = array('msg' => 
lang('default vendor category is updated'));
+                               }
+                               
$GLOBALS['phpgw']->preferences->save_repository();
+                       }
+
+                       if($this->filter)
+                       {
+                               $prefs = 
$this->bocommon->create_preferences($this->currentapp,$this->filter);
+                       }
+
+                       $cats           = CreateObject('phpgwapi.categories');
+                       $cats->app_name = 'fm_vendor';
+
+                       $cat_data       = 
$cats->formatted_xslt_list(array('selected' => 
$prefs['default_vendor_category'],'globals' => True, 'link_data' =>array()));
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiadmin.contact_info'),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/admin/index.php'),
+                               'lang_submit'                                   
=> lang('submit'),
+                               'lang_save'                                     
        => lang('Edit'),
+                               'lang_add_statustext'                   => 
lang('Edit ID'),
+                               'lang_done'                                     
        => lang('done'),
+                               'lang_done_statustext'                  => 
lang('Back to Admin'),
+
+                               'lang_email_statustext'                 => 
lang('Enter the email-address for this user'),
+
+                               'lang_user'                                     
        => lang('User'),
+                               'lang_email'                                    
=> lang('Email'),
+                               'value_old_email'                               
=> $prefs['email'],
+                               'value_email'                                   
=> $prefs['email'],
+
+                               'lang_phone'                                    
=> lang('Phone'),
+                               'value_old_phone'                               
=> $prefs['cellphone'],
+                               'value_phone'                                   
=> $prefs['cellphone'],
+
+                               'lang_approval_from'                    => 
lang('Approval from'),
+                               'value_old_approval_from'               => 
$prefs['approval_from'],
+                               'approval_from'                                 
=> 
$this->bocommon->get_user_list('select',$prefs['approval_from'],$extra=False,$default=False,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1),
+
+                               'select_user_name'                              
=> 'approval_from',
+                               'lang_approval_from_statustext' => lang('Select 
the users supervisor'),
+
+                               'lang_default_vendor_category'          => 
lang('default vendor category'),
+                               'value_old_default_vendor_category'     => 
$prefs['default_vendor_category'],
+                               'vendor_category'                               
        => $cat_data['cat_list'],
+                               'select_user_name'                              
        => 'approval_from',
+                               'lang_default_vendor_category_statustext'       
=> lang('Select default vendor category'),
+                               'lang_no_cat'                                   
        => lang('No category'),
+
+
+                               'lang_user_statustext'                  => 
lang('Select the user to edit email'),
+                               'select_user_name'                              
=> 'filter',
+                               'lang_no_user'                                  
=> lang('No user'),
+                               'value_user_id'                                 
=> $this->filter,
+                               'user_list'                                     
        => 
$this->bocommon->get_user_list('filter',$this->filter,$extra=False,$default=False,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1),
+                       );
+
+                       $appname                                                
        = lang('User contact info');
+                       $function_msg                                           
= lang('edit info');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('contact_info' => $data));
+                       $this->save_sessiondata();
+               }
+       }

====================================================
Index: hrm/inc/class.uicategory.inc.php
diff -u hrm/inc/class.uicategory.inc.php:1.2 
hrm/inc/class.uicategory.inc.php:1.3
--- hrm/inc/class.uicategory.inc.php:1.2        Mon Nov 21 20:25:33 2005
+++ hrm/inc/class.uicategory.inc.php    Wed Nov 30 17:07:22 2005
@@ -1,289 +1,289 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage admin
-       * @version $Id$
-       */
-
-       /**
-        * Description
-        * @package hrm
-        */
-
-       class uicategory
-       {
-               var $grants;
-               var $start;
-               var $query;
-               var $sort;
-               var $order;
-               var $sub;
-               var $currentapp;
-
-               var $public_functions = array
-               (
-                       'index'  => True,
-                       'view'   => True,
-                       'edit'   => True,
-                       'delete' => True
-               );
-
-               function uicategory()
-               {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
-                       $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->bo                                       = 
CreateObject($this->currentapp.'.bocategory',true);
-                       $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
-
-                       $this->start                            = 
$this->bo->start;
-                       $this->query                            = 
$this->bo->query;
-                       $this->sort                                     = 
$this->bo->sort;
-                       $this->order                            = 
$this->bo->order;
-                       $this->allrows                          = 
$this->bo->allrows;
-               }
-
-               function save_sessiondata()
-               {
-                       $data = array
-                       (
-                               'start'         => $this->start,
-                               'query'         => $this->query,
-                               'sort'          => $this->sort,
-                               'order'         => $this->order,
-                               'allrows'       => $this->allrows
-                       );
-                       $this->bo->save_sessiondata($data);
-               }
-
-               function index()
-               {
-                       $type   = get_var('type',array('POST','GET'));
-                       $type_id        = 
get_var('type_id',array('POST','GET'));
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('category','nextmatchs',
-                                                                               
'search_field'));
-
-                       $category_list = $this->bo->read($type,$type_id);
-
-                       while (is_array($category_list) && list(,$category) = 
each($category_list))
-                       {
-                               $words = split(' ',$category['descr']);
-                               $first = "$words[0] $words[1] $words[2] 
$words[3]";
-
-                               $content[] = array
-                               (
-                                       'id'                                    
=> $category['id'],
-                                       'first'                                 
        => $first,
-                                       'link_edit'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.edit&id='
 . $category['id'].'&type='.$type . '&type_id=' . $type_id),
-                                       'link_delete'                           
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.delete&id='
 . $category['id'].'&type='.$type . '&type_id=' . $type_id),
-                                       'lang_view_categorytext'        => 
lang('view the category'),
-                                       'lang_edit_categorytext'        => 
lang('edit the category'),
-                                       'lang_delete_categorytext'      => 
lang('delete the category'),
-                                       'text_view'                             
        => lang('view'),
-                                       'text_edit'                             
        => lang('edit'),
-                                       'text_delete'                           
=> lang('delete')
-                               );
-                       }
-
-//_debug_array($content);
-
-                       $table_header[] = array
-                       (
-
-                               'lang_descr'            => lang('Descr'),
-                               'lang_edit'                     => lang('edit'),
-                               'lang_delete'           => lang('delete'),
-                               'sort_id'       => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   =>      'id',
-                                                                               
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uicategory.index',
-                                                                               
                                                        'type'  =>$type,
-                                                                               
                                                        'type_id' => $type_id)
-                                                                               
)),
-                               'lang_id'       => lang('category id'),
-                       );
-
-                       $table_add[] = array
-                       (
-                               'lang_add'                              => 
lang('add'),
-                               'lang_add_categorytext' => lang('add a 
category'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.edit&type='.$type
 . '&type_id=' . $type_id),
-                               'lang_done'                             => 
lang('done'),
-                               'lang_done_categorytext'        => lang('back 
to admin'),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php')
-                       );
-
-                       if(!$this->allrows)
-                       {
-                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
-                       }
-                       else
-                       {
-                               $record_limit   = $this->bo->total_records;
-                       }
-
-
-                       $data = array
-                       (
-                               'allow_allrows'                                 
=> True,
-                               'allrows'                                       
        => $this->allrows,
-                               'start_record'                                  
=> $this->start,
-                               'record_limit'                                  
=> $record_limit,
-                               'num_records'                                   
=> count($category_list),
-                               'all_records'                                   
=> $this->bo->total_records,
-                               'link_url'                                      
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.index&type='.$type
 . '&type_id=' . $type_id),
-                               'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
-                               'lang_searchfield_categorytext' => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
-                               'lang_searchbutton_categorytext'        => 
lang('Submit the search string'),
-                               'query'                                         
        => $this->query,
-                               'lang_search'                                   
=> lang('search'),
-                               'table_header'                                  
=> $table_header,
-                               'values'                                        
        => $content,
-                               'table_add'                                     
        => $table_add
-                       );
-
-                       $appname                                                
= lang($type). ' ' . $type_id;
-;
-                       $function_msg                                   = 
lang('list %1 category',$type);
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
-                       $this->save_sessiondata();
-               }
-
-               function edit()
-               {
-                       $type   = get_var('type',array('POST','GET'));
-                       $type_id        = 
get_var('type_id',array('POST','GET'));
-                       $id     = get_var('id',array('POST','GET'));
-                       $values                 = 
get_var('values',array('POST'));
-
-
-                       $GLOBALS['phpgw']->xslttpl->add_file(array('category'));
-
-                       if ($values['save'])
-                       {
-                               if(!$id && !ctype_digit($values['id']))
-                               {
-                                       
$receipt['error'][]=array('msg'=>lang('Please enter an integer !'));
-                                       unset($values['id']);
-                               }
-
-                               if($id)
-                               {
-                                       $values['id']=$id;
-                                       $action='edit';
-                               }
-                               else
-                               {
-                                       $id =   $values['id'];
-                               }
-
-                               if(!$receipt['error'])
-                               {
-                                       $receipt = 
$this->bo->save($values,$action,$type,$type_id);
-                               }
-                       }
-
-                       if ($id)
-                       {
-                               $category = 
$this->bo->read_single($id,$type,$type_id);
-                               $function_msg = lang('edit category');
-                               $action='edit';
-                       }
-                       else
-                       {
-                               $function_msg = lang('add category');
-                               $action='add';
-                       }
-
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uicategory.edit',
-                               'id'    => $id,
-                               'type' => $type,
-                               'type_id' => $type_id
-                       );
-//_debug_array($link_data);
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $data = array
-                       (
-                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.index&type='.$type
 . '&type_id=' . $type_id),
-                               'lang_id'                               => 
lang('category ID'),
-                               'lang_descr'                                    
=> lang('Descr'),
-                               'lang_save'                                     
        => lang('save'),
-                               'lang_done'                                     
        => lang('done'),
-                               'value_id'                              => $id,
-                               'lang_id_categorytext'  => lang('Enter the 
category ID'),
-                               'lang_descr_categorytext'                       
=> lang('Enter a description the category'),
-                               'lang_done_categorytext'                        
=> lang('Back to the list'),
-                               'lang_save_categorytext'                        
=> lang('Save the category'),
-                               'type_id'                               => 
$category['type_id'],
-                               'value_descr'                                   
=> $category['descr']
-                       );
-
-                       $appname                                                
= lang($type). ' ' . $type_id;
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
-               }
-
-               function delete()
-               {
-                       $type   = get_var('type',array('POST','GET'));
-                       $type_id        = 
get_var('type_id',array('POST','GET'));
-                       $id             = get_var('id',array('POST','GET'));
-                       $confirm                = 
get_var('confirm',array('POST'));
-
-                       $link_data = array
-                       (
-                               'menuaction' => 
$this->currentapp.'.uicategory.index',
-                               'type' => $type,
-                               'type_id' => $type_id
-                       );
-
-                       if (get_var('confirm',array('POST')))
-                       {
-                               $this->bo->delete($id,$type,$type_id);
-                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
-                       }
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
-
-                       $data = array
-                       (
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.delete&id='
 . $id.'&type='.$type . '&type_id=' . $type_id),
-                               'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
-                               'lang_yes'                              => 
lang('yes'),
-                               'lang_yes_categorytext' => lang('Delete the 
entry'),
-                               'lang_no_categorytext'  => lang('Back to the 
list'),
-                               'lang_no'                               => 
lang('no')
-                       );
-
-                       $appname                                                
= lang($type). ' ' . $type_id;
-                       $function_msg                                   = 
lang('delete '.$type.' category');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
-               }
-
-       }
\ No newline at end of file
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage admin
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package hrm
+        */
+
+       class uicategory
+       {
+               var $grants;
+               var $start;
+               var $query;
+               var $sort;
+               var $order;
+               var $sub;
+               var $currentapp;
+
+               var $public_functions = array
+               (
+                       'index'  => True,
+                       'view'   => True,
+                       'edit'   => True,
+                       'delete' => True
+               );
+
+               function uicategory()
+               {
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
+                       $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       $this->bo                                       = 
CreateObject($this->currentapp.'.bocategory',true);
+                       $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
+
+                       $this->start                            = 
$this->bo->start;
+                       $this->query                            = 
$this->bo->query;
+                       $this->sort                                     = 
$this->bo->sort;
+                       $this->order                            = 
$this->bo->order;
+                       $this->allrows                          = 
$this->bo->allrows;
+               }
+
+               function save_sessiondata()
+               {
+                       $data = array
+                       (
+                               'start'         => $this->start,
+                               'query'         => $this->query,
+                               'sort'          => $this->sort,
+                               'order'         => $this->order,
+                               'allrows'       => $this->allrows
+                       );
+                       $this->bo->save_sessiondata($data);
+               }
+
+               function index()
+               {
+                       $type   = get_var('type',array('POST','GET'));
+                       $type_id        = 
get_var('type_id',array('POST','GET'));
+
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('category','nextmatchs',
+                                                                               
'search_field'));
+
+                       $category_list = $this->bo->read($type,$type_id);
+
+                       while (is_array($category_list) && list(,$category) = 
each($category_list))
+                       {
+                               $words = split(' ',$category['descr']);
+                               $first = "$words[0] $words[1] $words[2] 
$words[3]";
+
+                               $content[] = array
+                               (
+                                       'id'                                    
=> $category['id'],
+                                       'first'                                 
        => $first,
+                                       'link_edit'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.edit&id='
 . $category['id'].'&type='.$type . '&type_id=' . $type_id),
+                                       'link_delete'                           
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.delete&id='
 . $category['id'].'&type='.$type . '&type_id=' . $type_id),
+                                       'lang_view_categorytext'        => 
lang('view the category'),
+                                       'lang_edit_categorytext'        => 
lang('edit the category'),
+                                       'lang_delete_categorytext'      => 
lang('delete the category'),
+                                       'text_view'                             
        => lang('view'),
+                                       'text_edit'                             
        => lang('edit'),
+                                       'text_delete'                           
=> lang('delete')
+                               );
+                       }
+
+//_debug_array($content);
+
+                       $table_header[] = array
+                       (
+
+                               'lang_descr'            => lang('Descr'),
+                               'lang_edit'                     => lang('edit'),
+                               'lang_delete'           => lang('delete'),
+                               'sort_id'       => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'id',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uicategory.index',
+                                                                               
                                                        'type'  =>$type,
+                                                                               
                                                        'type_id' => $type_id)
+                                                                               
)),
+                               'lang_id'       => lang('category id'),
+                       );
+
+                       $table_add[] = array
+                       (
+                               'lang_add'                              => 
lang('add'),
+                               'lang_add_categorytext' => lang('add a 
category'),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.edit&type='.$type
 . '&type_id=' . $type_id),
+                               'lang_done'                             => 
lang('done'),
+                               'lang_done_categorytext'        => lang('back 
to admin'),
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php')
+                       );
+
+                       if(!$this->allrows)
+                       {
+                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                       }
+                       else
+                       {
+                               $record_limit   = $this->bo->total_records;
+                       }
+
+
+                       $data = array
+                       (
+                               'allow_allrows'                                 
=> True,
+                               'allrows'                                       
        => $this->allrows,
+                               'start_record'                                  
=> $this->start,
+                               'record_limit'                                  
=> $record_limit,
+                               'num_records'                                   
=> count($category_list),
+                               'all_records'                                   
=> $this->bo->total_records,
+                               'link_url'                                      
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.index&type='.$type
 . '&type_id=' . $type_id),
+                               'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
+                               'lang_searchfield_categorytext' => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
+                               'lang_searchbutton_categorytext'        => 
lang('Submit the search string'),
+                               'query'                                         
        => $this->query,
+                               'lang_search'                                   
=> lang('search'),
+                               'table_header'                                  
=> $table_header,
+                               'values'                                        
        => $content,
+                               'table_add'                                     
        => $table_add
+                       );
+
+                       $appname                                                
= lang($type). ' ' . $type_id;
+;
+                       $function_msg                                   = 
lang('list %1 category',$type);
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
+               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       $this->save_sessiondata();
+               }
+
+               function edit()
+               {
+                       $type   = get_var('type',array('POST','GET'));
+                       $type_id        = 
get_var('type_id',array('POST','GET'));
+                       $id     = get_var('id',array('POST','GET'));
+                       $values                 = 
get_var('values',array('POST'));
+
+
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('category'));
+
+                       if ($values['save'])
+                       {
+                               if(!$id && !ctype_digit($values['id']))
+                               {
+                                       
$receipt['error'][]=array('msg'=>lang('Please enter an integer !'));
+                                       unset($values['id']);
+                               }
+
+                               if($id)
+                               {
+                                       $values['id']=$id;
+                                       $action='edit';
+                               }
+                               else
+                               {
+                                       $id =   $values['id'];
+                               }
+
+                               if(!$receipt['error'])
+                               {
+                                       $receipt = 
$this->bo->save($values,$action,$type,$type_id);
+                               }
+                       }
+
+                       if ($id)
+                       {
+                               $category = 
$this->bo->read_single($id,$type,$type_id);
+                               $function_msg = lang('edit category');
+                               $action='edit';
+                       }
+                       else
+                       {
+                               $function_msg = lang('add category');
+                               $action='add';
+                       }
+
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uicategory.edit',
+                               'id'    => $id,
+                               'type' => $type,
+                               'type_id' => $type_id
+                       );
+//_debug_array($link_data);
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.index&type='.$type
 . '&type_id=' . $type_id),
+                               'lang_id'                               => 
lang('category ID'),
+                               'lang_descr'                                    
=> lang('Descr'),
+                               'lang_save'                                     
        => lang('save'),
+                               'lang_done'                                     
        => lang('done'),
+                               'value_id'                              => $id,
+                               'lang_id_categorytext'  => lang('Enter the 
category ID'),
+                               'lang_descr_categorytext'                       
=> lang('Enter a description the category'),
+                               'lang_done_categorytext'                        
=> lang('Back to the list'),
+                               'lang_save_categorytext'                        
=> lang('Save the category'),
+                               'type_id'                               => 
$category['type_id'],
+                               'value_descr'                                   
=> $category['descr']
+                       );
+
+                       $appname                                                
= lang($type). ' ' . $type_id;
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
+               //      $GLOBALS['phpgw']->xslttpl->pp();
+               }
+
+               function delete()
+               {
+                       $type   = get_var('type',array('POST','GET'));
+                       $type_id        = 
get_var('type_id',array('POST','GET'));
+                       $id             = get_var('id',array('POST','GET'));
+                       $confirm                = 
get_var('confirm',array('POST'));
+
+                       $link_data = array
+                       (
+                               'menuaction' => 
$this->currentapp.'.uicategory.index',
+                               'type' => $type,
+                               'type_id' => $type_id
+                       );
+
+                       if (get_var('confirm',array('POST')))
+                       {
+                               $this->bo->delete($id,$type,$type_id);
+                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
+                       }
+
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
+
+                       $data = array
+                       (
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.delete&id='
 . $id.'&type='.$type . '&type_id=' . $type_id),
+                               'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
+                               'lang_yes'                              => 
lang('yes'),
+                               'lang_yes_categorytext' => lang('Delete the 
entry'),
+                               'lang_no_categorytext'  => lang('Back to the 
list'),
+                               'lang_no'                               => 
lang('no')
+                       );
+
+                       $appname                                                
= lang($type). ' ' . $type_id;
+                       $function_msg                                   = 
lang('delete '.$type.' category');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
+               //      $GLOBALS['phpgw']->xslttpl->pp();
+               }
+
+       }

====================================================
Index: hrm/inc/hook_settings.inc.php
diff -u hrm/inc/hook_settings.inc.php:1.1 hrm/inc/hook_settings.inc.php:1.2
--- hrm/inc/hook_settings.inc.php:1.1   Mon Nov 21 12:01:20 2005
+++ hrm/inc/hook_settings.inc.php       Wed Nov 30 17:07:22 2005
@@ -1,170 +1,170 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage core
-       * @version $Id$
-       */
-
-       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-
-       $yes_and_no = array(
-               'True' => 'Yes',
-               ''     => 'No'
-       );
-       create_select_box('show new/updated tickets on main 
screen','mainscreen_show_new_updated',$yes_and_no,'Dont think this is working - 
yet');
-
-       create_select_box('Group filters in single 
query','group_filters',$yes_and_no,'Group filters - means that one has to hit 
the search button to apply the filter');
-
-       $tts_status = array(
-               ''              => lang('Open'),
-               'closed'        => lang('Closed'),
-               'all'           => lang('All')
-       );
-
-       create_select_box('Default ticket status','tts_status',$tts_status,'The 
default status when entering the helpdesk');
-
-       $acc = CreateObject('phpgwapi.accounts');
-       $group_list = $acc->get_list('groups');
-       while (list($key,$entry) = each($group_list))
-       {
-               $_groups[$entry['account_id']] = $entry['account_lid'];
-       }
-       create_select_box('Default group TTS','groupdefault',$_groups,'The 
default group to assign a ticket in Helpdesk-submodule');
-
-       $account_list = $acc->get_list('accounts');
-       while (list($key,$entry) = each($account_list))
-       {
-               $_accounts[$entry['account_id']] = $entry['account_lid'];
-       }
-       create_select_box('Default assign to 
TTS','assigntodefault',$_accounts,'The default user to assign a ticket in 
Helpdesk-submodule');
-
-       // Choose the correct priority to display
-       $priority_comment[1]  = ' - ' . lang('Lowest');
-       $priority_comment[5]  = ' - ' . lang('Medium');
-       $priority_comment[10] = ' - ' . lang('Highest');
-       for ($i=1; $i<=10; $i++)
-       {
-               $priority[$i] = $i . $priority_comment[$i];
-       }
-
-
-       // Choose the correct degree to display
-               $degree_comment[0]=' - '.lang('None');
-               $degree_comment[1]=' - '.lang('Minor');
-               $degree_comment[2]=' - '.lang('Medium');
-               $degree_comment[3]=' - '.lang('Serious');
-       for ($i=0; $i<=3; $i++)
-       {
-               $degree[$i] = $i . $degree_comment[$i];
-       }
-       create_select_box('Default Priority 
TTS','prioritydefault',$priority,'The default priority for tickets in the 
Helpdesk-submodule');
-
-
-       $sotts= CreateObject($this->currentapp.'.sotts');
-       $category_tts= $sotts->select_category_list();
-       if ($category_tts)
-       {
-               while (list($key,$entry) = each($category_tts))
-               {
-                       $_categories_tts[$entry['id']] = $entry['name'];
-               }
-       }
-
-       unset($sotts);
-       create_select_box('Default TTS 
categories','tts_category',$_categories_tts,'The default category for TTS');
-
-       $yes_and_no = array(
-               '1' => 'Yes',
-               '2' => 'No'
-       );
-
-       create_select_box('Send e-mail from 
TTS','tts_user_mailnotification',$yes_and_no,'Send e-mail from TTS as default');
-       create_input_box('Refresh TTS every (seconds)','refreshinterval','The 
intervall for Helpdesk refresh - cheking for new tickets');
-
-       create_select_box('Default Degree Request 
safety','default_safety',$degree,'The degree of seriousness');
-       create_select_box('Default Degree Request 
aesthetics','default_aesthetics',$degree);
-       create_select_box('Default Degree Request indoor 
climate','default_climate',$degree);
-       create_select_box('Default Degree Request consequential 
damage','default_consequential_damage',$degree);
-       create_select_box('Default Degree Request user 
gratification','default_gratification',$degree);
-       create_select_box('Default Degree Request residential 
environment','default_environment',$degree);
-
-       create_select_box('Send order receipt as email 
','order_email_rcpt',$yes_and_no,'Send the order as BCC to the user');
-
-       $default_start_page = array(
-               'location'   => lang('Location'),
-               'project' => lang('Project'),
-               'tts' => lang('Ticket'),
-               'invoice' => lang('Invoice'),
-               'document'=> lang(Document)
-               );
-       create_select_box('Default start 
page','default_start_page',$default_start_page,'Select your start-submodule');
-
-       $soworkorder= CreateObject($this->currentapp.'.soworkorder');
-       $socommon= CreateObject($this->currentapp.'.socommon');
-
-       $status_list= $soworkorder->select_status_list();
-       $category_list= $soworkorder->select_category_workorder_list();
-       $district_list= $socommon->select_district_list();
-
-       if ($status_list)
-       {
-               while (list($key,$entry) = each($status_list))
-               {
-                       $_status[$entry['id']] = $entry['name'];
-               }
-       }
-       if ($category_list)
-       {
-               while (list($key,$entry) = each($category_list))
-               {
-                       $_categories[$entry['id']] = $entry['name'];
-               }
-       }
-       if ($district_list)
-       {
-               while (list($key,$entry) = each($district_list))
-               {
-                       $_districts[$entry['id']] = $entry['name'];
-               }
-       }
-
-       unset($soworkorder);
-       unset($socommon);
-       create_select_box('Default project 
status','project_status',$_status,'The default status for your projects and 
workorders');
-       create_select_box('Default project 
categories','project_category',$_categories,'The default category for your 
projects and workorders');
-       create_select_box('Default 
district-filter','default_district',$_districts,'Your default district-filter 
');
-
-       create_input_box('Your Cellphone','cellphone');
-
-       create_select_box('Workorder Approval 
From','approval_from',$_accounts,'If you need approval from your supervisor for 
projects/workorders');
-
-       if(!$email_org)
-       {
-               create_input_box('Your Email','email','Insert your email 
address');
-       }
-
-       
$email_property=$GLOBALS['phpgw_info']['user']['preferences']['hrm']['email'];
-       $GLOBALS['phpgw']->preferences->add("email","address",$email_property);
-       $GLOBALS['phpgw']->preferences->save_repository();
-
-       $cats           = CreateObject('phpgwapi.categories');
-       $cats->app_name = 'fm_vendor';
-       $cat_data       = $cats->formatted_xslt_list(array('globals' => True, 
'link_data' =>array()));
-       $cat_list = $cat_data['cat_list'];
-
-       if (is_array($cat_list))
-       {
-               while (list($key,$entry) = each($cat_list))
-               {
-                       $_categories_vendor[$entry['cat_id']] = $entry['name'];
-               }
-       }
-
-       create_select_box('Default vendor 
type','default_vendor_category',$_categories_vendor,'which agreement');
-
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage core
+       * @version $Id$
+       */
+
+       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+
+       $yes_and_no = array(
+               'True' => 'Yes',
+               ''     => 'No'
+       );
+       create_select_box('show new/updated tickets on main 
screen','mainscreen_show_new_updated',$yes_and_no,'Dont think this is working - 
yet');
+
+       create_select_box('Group filters in single 
query','group_filters',$yes_and_no,'Group filters - means that one has to hit 
the search button to apply the filter');
+
+       $tts_status = array(
+               ''              => lang('Open'),
+               'closed'        => lang('Closed'),
+               'all'           => lang('All')
+       );
+
+       create_select_box('Default ticket status','tts_status',$tts_status,'The 
default status when entering the helpdesk');
+
+       $acc = CreateObject('phpgwapi.accounts');
+       $group_list = $acc->get_list('groups');
+       while (list($key,$entry) = each($group_list))
+       {
+               $_groups[$entry['account_id']] = $entry['account_lid'];
+       }
+       create_select_box('Default group TTS','groupdefault',$_groups,'The 
default group to assign a ticket in Helpdesk-submodule');
+
+       $account_list = $acc->get_list('accounts');
+       while (list($key,$entry) = each($account_list))
+       {
+               $_accounts[$entry['account_id']] = $entry['account_lid'];
+       }
+       create_select_box('Default assign to 
TTS','assigntodefault',$_accounts,'The default user to assign a ticket in 
Helpdesk-submodule');
+
+       // Choose the correct priority to display
+       $priority_comment[1]  = ' - ' . lang('Lowest');
+       $priority_comment[5]  = ' - ' . lang('Medium');
+       $priority_comment[10] = ' - ' . lang('Highest');
+       for ($i=1; $i<=10; $i++)
+       {
+               $priority[$i] = $i . $priority_comment[$i];
+       }
+
+
+       // Choose the correct degree to display
+               $degree_comment[0]=' - '.lang('None');
+               $degree_comment[1]=' - '.lang('Minor');
+               $degree_comment[2]=' - '.lang('Medium');
+               $degree_comment[3]=' - '.lang('Serious');
+       for ($i=0; $i<=3; $i++)
+       {
+               $degree[$i] = $i . $degree_comment[$i];
+       }
+       create_select_box('Default Priority 
TTS','prioritydefault',$priority,'The default priority for tickets in the 
Helpdesk-submodule');
+
+
+       $sotts= CreateObject($this->currentapp.'.sotts');
+       $category_tts= $sotts->select_category_list();
+       if ($category_tts)
+       {
+               while (list($key,$entry) = each($category_tts))
+               {
+                       $_categories_tts[$entry['id']] = $entry['name'];
+               }
+       }
+
+       unset($sotts);
+       create_select_box('Default TTS 
categories','tts_category',$_categories_tts,'The default category for TTS');
+
+       $yes_and_no = array(
+               '1' => 'Yes',
+               '2' => 'No'
+       );
+
+       create_select_box('Send e-mail from 
TTS','tts_user_mailnotification',$yes_and_no,'Send e-mail from TTS as default');
+       create_input_box('Refresh TTS every (seconds)','refreshinterval','The 
intervall for Helpdesk refresh - cheking for new tickets');
+
+       create_select_box('Default Degree Request 
safety','default_safety',$degree,'The degree of seriousness');
+       create_select_box('Default Degree Request 
aesthetics','default_aesthetics',$degree);
+       create_select_box('Default Degree Request indoor 
climate','default_climate',$degree);
+       create_select_box('Default Degree Request consequential 
damage','default_consequential_damage',$degree);
+       create_select_box('Default Degree Request user 
gratification','default_gratification',$degree);
+       create_select_box('Default Degree Request residential 
environment','default_environment',$degree);
+
+       create_select_box('Send order receipt as email 
','order_email_rcpt',$yes_and_no,'Send the order as BCC to the user');
+
+       $default_start_page = array(
+               'location'   => lang('Location'),
+               'project' => lang('Project'),
+               'tts' => lang('Ticket'),
+               'invoice' => lang('Invoice'),
+               'document'=> lang(Document)
+               );
+       create_select_box('Default start 
page','default_start_page',$default_start_page,'Select your start-submodule');
+
+       $soworkorder= CreateObject($this->currentapp.'.soworkorder');
+       $socommon= CreateObject($this->currentapp.'.socommon');
+
+       $status_list= $soworkorder->select_status_list();
+       $category_list= $soworkorder->select_category_workorder_list();
+       $district_list= $socommon->select_district_list();
+
+       if ($status_list)
+       {
+               while (list($key,$entry) = each($status_list))
+               {
+                       $_status[$entry['id']] = $entry['name'];
+               }
+       }
+       if ($category_list)
+       {
+               while (list($key,$entry) = each($category_list))
+               {
+                       $_categories[$entry['id']] = $entry['name'];
+               }
+       }
+       if ($district_list)
+       {
+               while (list($key,$entry) = each($district_list))
+               {
+                       $_districts[$entry['id']] = $entry['name'];
+               }
+       }
+
+       unset($soworkorder);
+       unset($socommon);
+       create_select_box('Default project 
status','project_status',$_status,'The default status for your projects and 
workorders');
+       create_select_box('Default project 
categories','project_category',$_categories,'The default category for your 
projects and workorders');
+       create_select_box('Default 
district-filter','default_district',$_districts,'Your default district-filter 
');
+
+       create_input_box('Your Cellphone','cellphone');
+
+       create_select_box('Workorder Approval 
From','approval_from',$_accounts,'If you need approval from your supervisor for 
projects/workorders');
+
+       if(!$email_org)
+       {
+               create_input_box('Your Email','email','Insert your email 
address');
+       }
+
+       
$email_property=$GLOBALS['phpgw_info']['user']['preferences']['hrm']['email'];
+       $GLOBALS['phpgw']->preferences->add("email","address",$email_property);
+       $GLOBALS['phpgw']->preferences->save_repository();
+
+       $cats           = CreateObject('phpgwapi.categories');
+       $cats->app_name = 'fm_vendor';
+       $cat_data       = $cats->formatted_xslt_list(array('globals' => True, 
'link_data' =>array()));
+       $cat_list = $cat_data['cat_list'];
+
+       if (is_array($cat_list))
+       {
+               while (list($key,$entry) = each($cat_list))
+               {
+                       $_categories_vendor[$entry['cat_id']] = $entry['name'];
+               }
+       }
+
+       create_select_box('Default vendor 
type','default_vendor_category',$_categories_vendor,'which agreement');
+

====================================================
Index: hrm/inc/hook_preferences.inc.php
diff -u hrm/inc/hook_preferences.inc.php:1.2 
hrm/inc/hook_preferences.inc.php:1.3
--- hrm/inc/hook_preferences.inc.php:1.2        Mon Nov 21 20:25:33 2005
+++ hrm/inc/hook_preferences.inc.php    Wed Nov 30 17:07:22 2005
@@ -1,20 +1,20 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage core
-       * @version $Id$
-       */
-
-       $title = $appname;
-       $file = Array(
-               'Preferences'           => 
$GLOBALS['phpgw']->link('/preferences/preferences.php','appname='.$appname . 
'&type=user'),
-               'Grant Access'  => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiadmin.aclprefs&acl_app='.$appname)
-       );
-       display_section($appname,$file);
-
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage core
+       * @version $Id$
+       */
+
+       $title = $appname;
+       $file = Array(
+               'Preferences'           => 
$GLOBALS['phpgw']->link('/preferences/preferences.php','appname='.$appname . 
'&type=user'),
+               'Grant Access'  => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiadmin.aclprefs&acl_app='.$appname)
+       );
+       display_section($appname,$file);
+

====================================================
Index: hrm/inc/hook_manual.inc.php
diff -u hrm/inc/hook_manual.inc.php:1.3 hrm/inc/hook_manual.inc.php:1.4
--- hrm/inc/hook_manual.inc.php:1.3     Wed Nov 23 13:11:53 2005
+++ hrm/inc/hook_manual.inc.php Wed Nov 30 17:07:22 2005
@@ -1,21 +1,21 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage core
-       * @version $Id$
-       */
-
-       // Only Modify the $file variable.....
-       $file = Array(
-               'User'                                  =>      'user.php',
-               'Job'                                   =>      'job.php',
-       );
-//Do not modify below this line
-       display_manual_section($appname,$file);
-
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage core
+       * @version $Id$
+       */
+
+       // Only Modify the $file variable.....
+       $file = Array(
+               'User'                                  =>      'user.php',
+               'Job'                                   =>      'job.php',
+       );
+//Do not modify below this line
+       display_manual_section($appname,$file);
+

====================================================
Index: hrm/inc/class.uiplace.inc.php
diff -u hrm/inc/class.uiplace.inc.php:1.3 hrm/inc/class.uiplace.inc.php:1.4
--- hrm/inc/class.uiplace.inc.php:1.3   Wed Nov 23 10:55:40 2005
+++ hrm/inc/class.uiplace.inc.php       Wed Nov 30 17:07:22 2005
@@ -1,370 +1,370 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage place
-       * @version $Id$
-       */
-
-       /**
-        * Description
-        * @package hrm
-        */
-
-       class uiplace
-       {
-               var $grants;
-               var $start;
-               var $query;
-               var $sort;
-               var $order;
-               var $sub;
-               var $currentapp;
-
-               var $public_functions = array
-               (
-                       'index'  => True,
-                       'view'   => True,
-                       'training'=> True,
-                       'edit'   => True,
-                       'delete' => True
-               );
-
-               function uiplace()
-               {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
-                       $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->bo                               = 
CreateObject($this->currentapp.'.boplace',true);
-                       $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
-                       $this->menu                             = 
CreateObject($this->currentapp.'.menu');
-                       $this->menu->sub                        ='place';
-
-                       $this->start                            = 
$this->bo->start;
-                       $this->query                            = 
$this->bo->query;
-                       $this->sort                             = 
$this->bo->sort;
-                       $this->order                            = 
$this->bo->order;
-                       $this->allrows                          = 
$this->bo->allrows;
-               }
-
-               function save_sessiondata()
-               {
-                       $data = array
-                       (
-                               'start'         => $this->start,
-                               'query'         => $this->query,
-                               'sort'          => $this->sort,
-                               'order'         => $this->order,
-                       );
-                       $this->bo->save_sessiondata($data);
-               }
-
-               function index()
-               {
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('place','nextmatchs','menu',
-                                                                               
'search_field'));
-
-                       $links = $this->menu->links();
-
-                       $place_info = $this->bo->read();
-
-                       while (is_array($place_info) && list(,$entry) = 
each($place_info))
-                       {
-
-                               $content[] = array
-                               (
-                                       'name'                                  
=> $entry['name'],
-                                       'link_edit'                             
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiplace.edit&place_id='
 . $entry['id']),
-                                       'link_delete'                           
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiplace.delete&place_id='
 . $entry['id']),
-                                       'link_view'                             
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiplace.view&place_id='
 . $entry['id']),
-                                       'lang_view_place_text'                  
=> lang('view the place'),
-                                       'lang_edit_place_text'                  
=> lang('edit the place'),
-                                       'text_view'                             
=> lang('view'),
-                                       'text_edit'                             
=> lang('edit'),
-                                       'text_delete'                           
=> lang('delete'),
-                                       'lang_delete_place_text'                
=> lang('delete the place'),
-                               );
-                       }
-
-//_debug_array($content);
-
-                       $table_header[] = array
-                       (
-
-                               'sort_name'     => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   =>      'name',
-                                                                               
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uiplace.index',
-                                                                               
                                'query'         =>$this->query,
-                                                                               
                                'cat_id'        =>$this->cat_id,
-                                                                               
                                'allrows' => $this->allrows)
-                                                                               
)),
-                               'lang_delete'   => lang('delete'),
-                               'lang_edit'     => lang('edit'),
-                               'lang_view'     => lang('view'),
-                       );
-
-                       if(!$this->allrows)
-                       {
-                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
-                       }
-                       else
-                       {
-                               $record_limit   = $this->bo->total_records;
-                       }
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uiplace.index',
-                                               'sort'                  
=>$this->sort,
-                                               'order'                 
=>$this->order,
-                                               'cat_id'                
=>$this->cat_id,
-                                               'filter'                
=>$this->filter,
-                                               'query'                 
=>$this->query
-                       );
-
-                       $table_add[] = array
-                       (
-                               'lang_add'                              => 
lang('add'),
-                               'lang_add_statustext'   => lang('add a place'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiplace.edit'),
-                       );
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $data = array
-                       (
-                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                         
=> $links,
-                               'allow_allrows'                                 
=> True,
-                               'allrows'                                       
=> $this->allrows,
-                               'start_record'                                  
=> $this->start,
-                               'record_limit'                                  
=> $record_limit,
-                               'num_records'                                   
=> count($place_info),
-                               'all_records'                                   
=> $this->bo->total_records,
-                               'link_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
-                               '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,
-                               'table_add'                                     
=> $table_add,
-                               'values'                                        
        => $content
-                       );
-
-                       $appname                                        = 
lang('place');
-;
-                       $function_msg                                   = 
lang('list place');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-                       $this->save_sessiondata();
-               }
-
-
-               function edit()
-               {
-                       $place_id       = 
get_var('place_id',array('POST','GET'));
-                       $values         = get_var('values',array('POST'));
-
-                       $GLOBALS['phpgw']->xslttpl->add_file(array('place'));
-
-                       if (is_array($values))
-                       {
-                               if ($values['save'] || $values['apply'])
-                               {
-
-                                       if(!$values['name'])
-                                       {
-                                               
$receipt['error'][]=array('msg'=>lang('Please enter a name !'));
-                                       }
-                                       if(!$values['address'])
-                                       {
-                                               
$receipt['error'][]=array('msg'=>lang('Please enter an address !'));
-                                       }
-                                       if(!$values['zip'])
-                                       {
-                                               
$receipt['error'][]=array('msg'=>lang('Please enter a zip code !'));
-                                       }
-                                       if(!$values['town'])
-                                       {
-                                               
$receipt['error'][]=array('msg'=>lang('Please enter a town !'));
-                                       }
-
-                                       if($place_id)
-                                       {
-                                               $values['place_id']=$place_id;
-                                               $action='edit';
-                                       }
-
-                                       if(!$receipt['error'])
-                                       {
-                                               $receipt = 
$this->bo->save($values,$action);
-                                               $place_id = 
$receipt['place_id'];
-
-                                               if ($values['save'])
-                                               {
-                                                       
$GLOBALS['phpgw']->session->appsession('session_data','hrm_training_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uiplace.index&place_id='
 . $place_id);
-                                               }
-                                       }
-                               }
-                               else
-                               {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uiplace.index&place_id='
 . $place_id);
-                               }
-                       }
-
-
-                       if ($place_id)
-                       {
-                               if(!$receipt['error'])
-                               {
-                                       $values = 
$this->bo->read_single($place_id);
-                               }
-                               $function_msg = lang('edit place');
-                               $action='edit';
-                       }
-                       else
-                       {
-                               $function_msg = lang('add place');
-                               $action='add';
-                       }
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uiplace.edit',
-                               'place_id'      => $place_id
-                       );
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-
-                       $data = array
-                       (
-                               'value_title'                   => 
$values['title'],
-                               'value_entry_date'              => 
$values['entry_date'],
-                               'value_name'                    => 
$values['name'],
-                               'value_address'                 => 
$values['address'],
-                               'value_zip'                     => 
$values['zip'],
-                               'value_town'                    => 
$values['town'],
-                               'value_remark'                  => 
$values['remark'],
-
-                               'lang_entry_date'               => lang('Entry 
date'),
-                               'lang_name'                     => lang('name'),
-                               'lang_address'                  => 
lang('address'),
-                               'lang_zip'                      => lang('zip'),
-                               'lang_town'                     => lang('town'),
-                               'lang_remark'                   => 
lang('remark'),
-
-                               'msgbox_data'                   => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'form_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'lang_id'                       => 
lang('training ID'),
-                               'lang_save'                     => lang('save'),
-                               'lang_cancel'                   => 
lang('cancel'),
-                               'value_id'                      => $place_id,
-                               'lang_done_status_text'         => lang('Back 
to the list'),
-                               'lang_save_status_text'         => lang('Save 
the training'),
-                               'lang_apply'                    => 
lang('apply'),
-                               'lang_apply_status_text'        => lang('Apply 
the values'),
-                       );
-
-                       $appname                                        = 
lang('Place');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               }
-
-               function view()
-               {
-                       $place_id       = 
get_var('place_id',array('POST','GET'));
-                       $values         = get_var('values',array('POST'));
-
-                       $GLOBALS['phpgw']->xslttpl->add_file(array('place'));
-
-                       if ($place_id)
-                       {
-                               $values = $this->bo->read_single($place_id);
-                               $function_msg = lang('view place');
-                       }
-                       else
-                       {
-                               return;
-                       }
-
-
-                       $data = array
-                       (
-                               'value_title'                   => 
$values['title'],
-                               'value_entry_date'              => 
$values['entry_date'],
-                               'value_name'                    => 
$values['name'],
-                               'value_address'                 => 
$values['address'],
-                               'value_zip'                     => 
$values['zip'],
-                               'value_town'                    => 
$values['town'],
-                               'value_remark'                  => 
$values['remark'],
-                               'lang_id'                       => lang('Place 
ID'),
-                               'lang_entry_date'               => lang('Entry 
date'),
-                               'lang_name'                     => lang('name'),
-                               'lang_address'                  => 
lang('address'),
-                               'lang_zip'                      => lang('zip'),
-                               'lang_town'                     => lang('town'),
-                               'lang_remark'                   => 
lang('remark'),
-
-                               'form_action'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiplace.index'),
-                               'lang_cancel'                   => 
lang('cancel'),
-                               'value_id'                      => $place_id,
-                       );
-
-                       $appname                                        = 
lang('Place');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               }
-
-               function delete()
-               {
-                       $place_id       = 
get_var('place_id',array('POST','GET'));
-                       $confirm                = 
get_var('confirm',array('POST'));
-
-                       $link_data = array
-                       (
-                               'menuaction' => 
$this->currentapp.'.uiplace.index',
-                               'place_id' => $place_id
-                       );
-
-                       if (get_var('confirm',array('POST')))
-                       {
-                               $this->bo->delete($place_id);
-                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
-                       }
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
-
-                       $data = array
-                       (
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiplace.delete&place_id='
 . $place_id),
-                               'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
-                               'lang_yes'                              => 
lang('yes'),
-                               'lang_yes_statustext'   => lang('Delete the 
entry'),
-                               'lang_no_statustext'    => lang('Back to the 
list'),
-                               'lang_no'                               => 
lang('no')
-                       );
-
-                       $appname                                        = 
lang('Place');
-                       $function_msg                                   = 
lang('delete');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               }
-
-       }
\ No newline at end of file
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage place
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package hrm
+        */
+
+       class uiplace
+       {
+               var $grants;
+               var $start;
+               var $query;
+               var $sort;
+               var $order;
+               var $sub;
+               var $currentapp;
+
+               var $public_functions = array
+               (
+                       'index'  => True,
+                       'view'   => True,
+                       'training'=> True,
+                       'edit'   => True,
+                       'delete' => True
+               );
+
+               function uiplace()
+               {
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
+                       $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       $this->bo                               = 
CreateObject($this->currentapp.'.boplace',true);
+                       $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
+                       $this->menu                             = 
CreateObject($this->currentapp.'.menu');
+                       $this->menu->sub                        ='place';
+
+                       $this->start                            = 
$this->bo->start;
+                       $this->query                            = 
$this->bo->query;
+                       $this->sort                             = 
$this->bo->sort;
+                       $this->order                            = 
$this->bo->order;
+                       $this->allrows                          = 
$this->bo->allrows;
+               }
+
+               function save_sessiondata()
+               {
+                       $data = array
+                       (
+                               'start'         => $this->start,
+                               'query'         => $this->query,
+                               'sort'          => $this->sort,
+                               'order'         => $this->order,
+                       );
+                       $this->bo->save_sessiondata($data);
+               }
+
+               function index()
+               {
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('place','nextmatchs','menu',
+                                                                               
'search_field'));
+
+                       $links = $this->menu->links();
+
+                       $place_info = $this->bo->read();
+
+                       while (is_array($place_info) && list(,$entry) = 
each($place_info))
+                       {
+
+                               $content[] = array
+                               (
+                                       'name'                                  
=> $entry['name'],
+                                       'link_edit'                             
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiplace.edit&place_id='
 . $entry['id']),
+                                       'link_delete'                           
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiplace.delete&place_id='
 . $entry['id']),
+                                       'link_view'                             
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiplace.view&place_id='
 . $entry['id']),
+                                       'lang_view_place_text'                  
=> lang('view the place'),
+                                       'lang_edit_place_text'                  
=> lang('edit the place'),
+                                       'text_view'                             
=> lang('view'),
+                                       'text_edit'                             
=> lang('edit'),
+                                       'text_delete'                           
=> lang('delete'),
+                                       'lang_delete_place_text'                
=> lang('delete the place'),
+                               );
+                       }
+
+//_debug_array($content);
+
+                       $table_header[] = array
+                       (
+
+                               'sort_name'     => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'name',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uiplace.index',
+                                                                               
                                'query'         =>$this->query,
+                                                                               
                                'cat_id'        =>$this->cat_id,
+                                                                               
                                'allrows' => $this->allrows)
+                                                                               
)),
+                               'lang_delete'   => lang('delete'),
+                               'lang_edit'     => lang('edit'),
+                               'lang_view'     => lang('view'),
+                       );
+
+                       if(!$this->allrows)
+                       {
+                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                       }
+                       else
+                       {
+                               $record_limit   = $this->bo->total_records;
+                       }
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uiplace.index',
+                                               'sort'                  
=>$this->sort,
+                                               'order'                 
=>$this->order,
+                                               'cat_id'                
=>$this->cat_id,
+                                               'filter'                
=>$this->filter,
+                                               'query'                 
=>$this->query
+                       );
+
+                       $table_add[] = array
+                       (
+                               'lang_add'                              => 
lang('add'),
+                               'lang_add_statustext'   => lang('add a place'),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiplace.edit'),
+                       );
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'links'                                         
=> $links,
+                               'allow_allrows'                                 
=> True,
+                               'allrows'                                       
=> $this->allrows,
+                               'start_record'                                  
=> $this->start,
+                               'record_limit'                                  
=> $record_limit,
+                               'num_records'                                   
=> count($place_info),
+                               'all_records'                                   
=> $this->bo->total_records,
+                               'link_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
+                               '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,
+                               'table_add'                                     
=> $table_add,
+                               'values'                                        
        => $content
+                       );
+
+                       $appname                                        = 
lang('place');
+;
+                       $function_msg                                   = 
lang('list place');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
+                       $this->save_sessiondata();
+               }
+
+
+               function edit()
+               {
+                       $place_id       = 
get_var('place_id',array('POST','GET'));
+                       $values         = get_var('values',array('POST'));
+
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('place'));
+
+                       if (is_array($values))
+                       {
+                               if ($values['save'] || $values['apply'])
+                               {
+
+                                       if(!$values['name'])
+                                       {
+                                               
$receipt['error'][]=array('msg'=>lang('Please enter a name !'));
+                                       }
+                                       if(!$values['address'])
+                                       {
+                                               
$receipt['error'][]=array('msg'=>lang('Please enter an address !'));
+                                       }
+                                       if(!$values['zip'])
+                                       {
+                                               
$receipt['error'][]=array('msg'=>lang('Please enter a zip code !'));
+                                       }
+                                       if(!$values['town'])
+                                       {
+                                               
$receipt['error'][]=array('msg'=>lang('Please enter a town !'));
+                                       }
+
+                                       if($place_id)
+                                       {
+                                               $values['place_id']=$place_id;
+                                               $action='edit';
+                                       }
+
+                                       if(!$receipt['error'])
+                                       {
+                                               $receipt = 
$this->bo->save($values,$action);
+                                               $place_id = 
$receipt['place_id'];
+
+                                               if ($values['save'])
+                                               {
+                                                       
$GLOBALS['phpgw']->session->appsession('session_data','hrm_training_receipt',$receipt);
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uiplace.index&place_id='
 . $place_id);
+                                               }
+                                       }
+                               }
+                               else
+                               {
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uiplace.index&place_id='
 . $place_id);
+                               }
+                       }
+
+
+                       if ($place_id)
+                       {
+                               if(!$receipt['error'])
+                               {
+                                       $values = 
$this->bo->read_single($place_id);
+                               }
+                               $function_msg = lang('edit place');
+                               $action='edit';
+                       }
+                       else
+                       {
+                               $function_msg = lang('add place');
+                               $action='add';
+                       }
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uiplace.edit',
+                               'place_id'      => $place_id
+                       );
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+
+                       $data = array
+                       (
+                               'value_title'                   => 
$values['title'],
+                               'value_entry_date'              => 
$values['entry_date'],
+                               'value_name'                    => 
$values['name'],
+                               'value_address'                 => 
$values['address'],
+                               'value_zip'                     => 
$values['zip'],
+                               'value_town'                    => 
$values['town'],
+                               'value_remark'                  => 
$values['remark'],
+
+                               'lang_entry_date'               => lang('Entry 
date'),
+                               'lang_name'                     => lang('name'),
+                               'lang_address'                  => 
lang('address'),
+                               'lang_zip'                      => lang('zip'),
+                               'lang_town'                     => lang('town'),
+                               'lang_remark'                   => 
lang('remark'),
+
+                               'msgbox_data'                   => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'lang_id'                       => 
lang('training ID'),
+                               'lang_save'                     => lang('save'),
+                               'lang_cancel'                   => 
lang('cancel'),
+                               'value_id'                      => $place_id,
+                               'lang_done_status_text'         => lang('Back 
to the list'),
+                               'lang_save_status_text'         => lang('Save 
the training'),
+                               'lang_apply'                    => 
lang('apply'),
+                               'lang_apply_status_text'        => lang('Apply 
the values'),
+                       );
+
+                       $appname                                        = 
lang('Place');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
+               }
+
+               function view()
+               {
+                       $place_id       = 
get_var('place_id',array('POST','GET'));
+                       $values         = get_var('values',array('POST'));
+
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('place'));
+
+                       if ($place_id)
+                       {
+                               $values = $this->bo->read_single($place_id);
+                               $function_msg = lang('view place');
+                       }
+                       else
+                       {
+                               return;
+                       }
+
+
+                       $data = array
+                       (
+                               'value_title'                   => 
$values['title'],
+                               'value_entry_date'              => 
$values['entry_date'],
+                               'value_name'                    => 
$values['name'],
+                               'value_address'                 => 
$values['address'],
+                               'value_zip'                     => 
$values['zip'],
+                               'value_town'                    => 
$values['town'],
+                               'value_remark'                  => 
$values['remark'],
+                               'lang_id'                       => lang('Place 
ID'),
+                               'lang_entry_date'               => lang('Entry 
date'),
+                               'lang_name'                     => lang('name'),
+                               'lang_address'                  => 
lang('address'),
+                               'lang_zip'                      => lang('zip'),
+                               'lang_town'                     => lang('town'),
+                               'lang_remark'                   => 
lang('remark'),
+
+                               'form_action'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiplace.index'),
+                               'lang_cancel'                   => 
lang('cancel'),
+                               'value_id'                      => $place_id,
+                       );
+
+                       $appname                                        = 
lang('Place');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
+               }
+
+               function delete()
+               {
+                       $place_id       = 
get_var('place_id',array('POST','GET'));
+                       $confirm                = 
get_var('confirm',array('POST'));
+
+                       $link_data = array
+                       (
+                               'menuaction' => 
$this->currentapp.'.uiplace.index',
+                               'place_id' => $place_id
+                       );
+
+                       if (get_var('confirm',array('POST')))
+                       {
+                               $this->bo->delete($place_id);
+                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
+                       }
+
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
+
+                       $data = array
+                       (
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiplace.delete&place_id='
 . $place_id),
+                               'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
+                               'lang_yes'                              => 
lang('yes'),
+                               'lang_yes_statustext'   => lang('Delete the 
entry'),
+                               'lang_no_statustext'    => lang('Back to the 
list'),
+                               'lang_no'                               => 
lang('no')
+                       );
+
+                       $appname                                        = 
lang('Place');
+                       $function_msg                                   = 
lang('delete');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
+               }
+
+       }

====================================================
Index: hrm/inc/class.uijob.inc.php
diff -u hrm/inc/class.uijob.inc.php:1.7 hrm/inc/class.uijob.inc.php:1.8
--- hrm/inc/class.uijob.inc.php:1.7     Tue Nov 29 15:07:58 2005
+++ hrm/inc/class.uijob.inc.php Wed Nov 30 17:07:22 2005
@@ -1,811 +1,963 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage job
-       * @version $Id$
-       */
-
-       /**
-        * Description
-        * @package hrm
-        */
-
-       class uijob
-       {
-               var $grants;
-               var $start;
-               var $query;
-               var $sort;
-               var $order;
-               var $sub;
-               var $currentapp;
-
-               var $public_functions = array
-               (
-                       'index'                         => True,
-                       'view_task'                     => True,
-                       'view_job'                      => True,
-                       'edit_job'                      => True,
-                       'edit_task'                     => True,
-                       'delete_task'                   => True,
-                       'task'                          => True,
-                       'delete_job'                    => True,
-                       'reset_job_type_hierarchy'      => True
-               );
-
-               function uijob()
-               {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
-                       $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->bo                               = 
CreateObject($this->currentapp.'.bojob',true);
-                       $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
-                       $this->bocategory                       = 
CreateObject($this->currentapp.'.bocategory');
-                       $this->menu                             = 
CreateObject($this->currentapp.'.menu');
-                       $this->menu->sub                        ='job';
-
-                       $this->start                            = 
$this->bo->start;
-                       $this->query                            = 
$this->bo->query;
-                       $this->sort                             = 
$this->bo->sort;
-                       $this->order                            = 
$this->bo->order;
-                       $this->allrows                          = 
$this->bo->allrows;
-               }
-
-               function save_sessiondata()
-               {
-                       $data = array
-                       (
-                               'start'         => $this->start,
-                               'query'         => $this->query,
-                               'sort'          => $this->sort,
-                               'order'         => $this->order
-                       );
-                       $this->bo->save_sessiondata($data);
-               }
-
-               function index()
-               {
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('job','nextmatchs','menu',
-                                                                               
'search_field'));
-
-                       $links = $this->menu->links('job_type');
-
-                       $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','hrm_job_receipt');
-                       
$GLOBALS['phpgw']->session->appsession('session_data','hrm_job_receipt','');
-
-                       $job_info = $this->bo->read();
-
-                       while (is_array($job_info) && list(,$entry) = 
each($job_info))
-                       {
-
-                               if ($entry['level'] > 0)
-                               {
-                                       $space = '--';
-                                       $spaceset = 
str_repeat($space,$entry['level']);
-                                       $entry['name'] = $spaceset . 
$entry['name'];
-                               }
-
-
-                               $content[] = array
-                               (
-                                       'name'                          => 
$entry['name'],
-                                       'descr'                         => 
$entry['descr'],
-                                       'link_add_sub'                  => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.edit_job&parent_id='
 . $entry['id']),
-                                       'link_edit'                     => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.edit_job&id='
 . $entry['id']),
-                                       'link_delete'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.delete_job&job_id='
 . $entry['id']),
-                                       'link_view'                     => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.view_job&id='
 . $entry['id']),
-                                       'link_task'                     => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.task&job_id='
 . $entry['id']),
-                                       'lang_task_job_text'            => 
lang('Tasks for this job'),
-                                       'lang_view_job_text'            => 
lang('view the job'),
-                                       'lang_edit_job_text'            => 
lang('edit the job'),
-                                       'lang_delete_job_text'          => 
lang('delete the job'),
-                                       'lang_add_sub_text'             => 
lang('Add a new sub-job'),
-                                       'text_task'                     => 
lang('task'),
-                                       'text_view'                     => 
lang('view'),
-                                       'text_edit'                     => 
lang('edit'),
-                                       'text_delete'                   => 
lang('delete'),
-                                       'text_add_sub'                  => 
lang('Add sub'),
-                               );
-                       }
-
-//_debug_array($content);
-
-                       $table_header[] = array
-                       (
-                               'sort_name'     => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   =>      'name',
-                                                                               
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uijob.index',
-                                                                               
                                'query'         =>$this->query,
-                                                                               
                                'cat_id'        =>$this->cat_id,
-                                                                               
                                'allrows' => $this->allrows)
-                                                                               
)),
-                               'lang_add_sub'  => lang('Add sub'),
-                               'lang_name'     => lang('name'),
-                               'lang_descr'    => lang('descr'),
-                               'lang_edit'     => lang('edit'),
-                               'lang_delete'   => lang('delete'),
-                               'lang_view'     => lang('view'),
-                               'lang_task'     => lang('task'),
-                       );
-
-                       $table_add[] = array
-                       (
-                               'lang_add'                              => 
lang('add'),
-                               'lang_add_statustext'   => lang('add a 
category'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.edit_job'),
-                               'lang_reset'            => lang('reset 
hierarchy'),
-                               'lang_reset_statustext' => lang('Reset the 
hierarchy'),
-                               'reset_action'          => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.reset_job_type_hierarchy')
-                       );
-
-                       $table_reset_job_type[] = array
-                       (
-                       );
-
-                       if(!$this->allrows)
-                       {
-                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
-                       }
-                       else
-                       {
-                               $record_limit   = $this->bo->total_records;
-                       }
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uijob.index',
-                                               'sort'                  
=>$this->sort,
-                                               'order'                 
=>$this->order,
-                                               'cat_id'                
=>$this->cat_id,
-                                               'filter'                
=>$this->filter,
-                                               'query'                 
=>$this->query
-                       );
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $data = array
-                       (
-                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                         
=> $links,
-                               'allow_allrows'                                 
=> True,
-                               'allrows'                                       
=> $this->allrows,
-                               'start_record'                                  
=> $this->start,
-                               'record_limit'                                  
=> $record_limit,
-                               'num_records'                                   
=> count($job_info),
-                               'all_records'                                   
=> $this->bo->total_records,
-                               'link_url'                                      
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'img_path'                                      
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
-                               '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_job'                                 
=> $table_add
-                       );
-
-                       $appname                                        = 
lang('job');
-;
-                       $function_msg                                   = 
lang('list job');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-                       $this->save_sessiondata();
-               }
-
-
-               function task()
-               {
-                       $job_id = get_var('job_id',array('POST','GET'));
-
-                       $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','hrm_task_receipt');
-                       
$GLOBALS['phpgw']->session->appsession('session_data','hrm_task_receipt','');
-
-                       $GLOBALS['phpgw']->xslttpl->add_file(array('job'));
-
-                       if ($job_id)
-                       {
-                               $job_info = $this->bo->read_single_job($job_id);
-                               $task = $this->bo->read_task($job_id);
-                       }
-
-                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-
-                       while (is_array($task) && list(,$entry) = each($task))
-                       {
-
-                               if($entry['start_date'])
-                               {
-                                       $entry['start_date']    = 
$GLOBALS['phpgw']->common->show_date($entry['start_date'],$dateformat);
-                               }
-                               if($entry['end_date'])
-                               {
-                                       $entry['end_date']      = 
$GLOBALS['phpgw']->common->show_date($entry['end_date'],$dateformat);
-                               }
-
-                               $content[] = array
-                               (
-                                       'name'                  => 
$entry['name'],
-                                       'place'                 => 
$entry['place'],
-                                       'start_date'            => 
$entry['start_date'],
-                                       'end_date'              => 
$entry['end_date'],
-                                       'link_edit'             => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.edit_task&job_id=$job_id&task_id="
 . $entry['task_id']),
-                                       'link_view'             => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.view_task&job_id=$job_id&task_id="
 . $entry['task_id']),
-                                       'link_delete'           => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.delete_task&job_id=$job_id&task_id="
 . $entry['task_id']),
-                                       'lang_view_text'        => lang('view 
task item'),
-                                       'lang_edit_text'        => lang('edit 
task item'),
-                                       'lang_delete_text'      => lang('delete 
task item'),
-                                       'text_view'             => lang('view'),
-                                       'text_edit'             => lang('edit'),
-                                       'text_delete'           => 
lang('delete')
-                               );
-                       }
-
-
-                       $table_header[] = array
-                       (
-
-                               'sort_place'    => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   =>      'hrm_task_place.name',
-                                                                               
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uijob.task',
-                                                                               
                                'job_id'        =>$job_id,
-                                                                               
                                'query'         =>$this->query,
-                                                                               
                                'cat_id'        =>$this->cat_id,
-                                                                               
                                'allrows'       => $this->allrows)
-                                                                               
)),
-                               'lang_place'    => lang('place'),
-                               'sort_name'     => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   =>      'hrm_task.name',
-                                                                               
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uijob.task',
-                                                                               
                                'job_id'        =>$job_id,
-                                                                               
                                'query'         =>$this->query,
-                                                                               
                                'cat_id'        =>$this->cat_id,
-                                                                               
                                'allrows' => $this->allrows)
-                                                                               
)),
-                               'lang_name'     => lang('name'),
-                               'lang_start_date'=> lang('start date'),
-                               'lang_end_date' => lang('end date'),
-                               'lang_view'     => lang('view'),
-                               'lang_edit'     => lang('edit'),
-                               'lang_delete'   => lang('delete'),
-                       );
-
-
-
-                       $function_msg = lang('list task');
-
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uijob.edit_task',
-                               'job_id'        => $job_id
-                       );
-
-                       $table_add[] = array
-                       (
-                               'lang_add'                      => lang('add'),
-                               'lang_add_task_text'    => lang('add a task 
item'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.edit_task&job_id='.$job_id),
-                               'lang_done'                     => lang('done'),
-                               'lang_done_task_text'   => lang('back to user 
list'),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.index')
-                       );
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $data = array
-                       (
-                               'lang_job_name'                         => 
lang('Job name'),
-                               'value_job_name'                        => 
$job_info['name'],
-                               'table_header_task'                     => 
$table_header,
-                               'values_task'                           => 
$content,
-                               'table_add'                             => 
$table_add,
-                               'user_values'                           => 
$user_values,
-                               'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.index'),
-                               'lang_id'                               => 
lang('task ID'),
-                               'lang_descr'                            => 
lang('Descr'),
-                               'lang_save'                             => 
lang('save'),
-                               'lang_cancel'                           => 
lang('cancel'),
-                               'value_id'                              => 
$job_id,
-                               'lang_id_status_text'                   => 
lang('Enter the task ID'),
-                               'lang_descr_status_text'                => 
lang('Enter a description the task'),
-                               'lang_done_status_text'                 => 
lang('Back to the list'),
-                               'lang_save_status_text'                 => 
lang('Save the task'),
-                               'type_id'                               => 
$task['type_id'],
-                               'value_descr'                           => 
$task['descr'],
-                               'lang_apply'                            => 
lang('apply'),
-                               'lang_apply_status_text'                => 
lang('Apply the values'),
-                       );
-
-                       $appname                                        = 
lang('task');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('task' => $data));
-               }
-
-               function edit_job()
-               {
-                       $id             = get_var('id',array('POST','GET'));
-                       $parent_id      = 
get_var('parent_id',array('POST','GET'));
-                       $values         = get_var('values',array('POST'));
-
-                       $GLOBALS['phpgw']->xslttpl->add_file(array('job'));
-
-                       if (is_array($values))
-                       {
-                               if ($values['save'] || $values['apply'])
-                               {
-                                       if(!$values['name'])
-                                       {
-                                               
$receipt['error'][]=array('msg'=>lang('Please enter a name !'));
-                                       }
-
-
-                                       if($id)
-                                       {
-                                               $values['id']=$id;
-                                               $action='edit';
-                                       }
-
-                                       if(!$receipt['error'])
-                                       {
-                                               $receipt = 
$this->bo->save_job($values,$action);
-                                               $id = $receipt['id'];
-
-                                               if ($values['save'])
-                                               {
-                                                       
$GLOBALS['phpgw']->session->appsession('session_data','hrm_job_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uijob.index');
-                                               }
-                                       }
-                               }
-                               else
-                               {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uijob.index');
-                               }
-                       }
-
-                       if ($id)
-                       {
-                               $values = $this->bo->read_single_job($id);
-                               $function_msg = lang('edit job');
-                               $action='edit';
-                       }
-                       else
-                       {
-                               $function_msg = lang('add job');
-                               $action='add';
-                       }
-
-
-                       if($parent_id)
-                       {
-                               $values['parent_id'] = $parent_id;
-                       }
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uijob.edit_job',
-                               'id'    => $id
-                       );
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $data = array
-                       (
-                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.index&type='.$type
 . '&type_id=' . $type_id),
-                               'lang_id'                               => 
lang('category ID'),
-                               'lang_descr'                                    
=> lang('Descr'),
-                               'lang_save'                                     
=> lang('save'),
-                               'value_id'                              => $id,
-
-                               'parent_list'                           => 
$this->bo->select_job_list($values['parent_id']),
-                               'lang_parent'                           => 
lang('parent'),
-                               'lang_parent_status_text'               => 
lang('Select this jobs parent'),
-                               'lang_no_parent'                        => 
lang('select a parent'),
-
-                               'lang_name'                             => 
lang('name'),
-                               'lang_name_status_text'                 => 
lang('name of the job-type'),
-
-
-                               'lang_id_statustext'    => lang('Enter the 
category ID'),
-                               'lang_descr_statustext'                 => 
lang('Enter a description the job'),
-                               'lang_done_statustext'                  => 
lang('Back to the list'),
-                               'lang_save_statustext'                  => 
lang('Save the job'),
-                               'type_id'                               => 
$values['type_id'],
-                               'value_descr'                                   
=> $values['descr'],
-                               'value_name'                                    
=> $values['name'],
-
-                               'lang_cancel'                           => 
lang('cancel'),
-                               'lang_apply'                            => 
lang('apply'),
-                               'lang_apply_status_text'                => 
lang('Apply the values'),
-                       );
-
-                       $appname                                        = 
lang('job');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_job' => $data));
-               }
-
-               function view_job()
-               {
-                       $id             = get_var('id',array('POST','GET'));
-                       $parent_id      = 
get_var('parent_id',array('POST','GET'));
-                       $values         = get_var('values',array('POST'));
-
-                       $GLOBALS['phpgw']->xslttpl->add_file(array('job'));
-
-
-                       if ($id)
-                       {
-                               $values = $this->bo->read_single_job($id);
-                               $function_msg = lang('view job');
-                       }
-
-                       if($parent_id)
-                       {
-                               $values['parent_id'] = $parent_id;
-                       }
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uijob.edit_job',
-                               'id'    => $id
-                       );
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $data = array
-                       (
-                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.index&type='.$type
 . '&type_id=' . $type_id),
-                               'lang_id'                               => 
lang('category ID'),
-                               'lang_descr'                                    
=> lang('Descr'),
-                               'lang_save'                                     
=> lang('save'),
-                               'value_id'                              => $id,
-
-                               'parent_list'                           => 
$this->bo->select_job_list($values['parent_id']),
-                               'lang_parent'                           => 
lang('parent'),
-                               'lang_parent_status_text'               => 
lang('Select this jobs parent'),
-                               'lang_no_parent'                        => 
lang('select a parent'),
-
-                               'lang_name'                             => 
lang('name'),
-                               'lang_name_status_text'                 => 
lang('name of the job-type'),
-
-
-                               'lang_id_statustext'    => lang('Enter the 
category ID'),
-                               'lang_descr_statustext'                 => 
lang('Enter a description the job'),
-                               'lang_done_statustext'                  => 
lang('Back to the list'),
-                               'lang_save_statustext'                  => 
lang('Save the job'),
-                               'type_id'                               => 
$values['type_id'],
-                               'value_descr'                                   
=> $values['descr'],
-                               'value_name'                                    
=> $values['name'],
-
-                               'lang_cancel'                           => 
lang('cancel'),
-                               'lang_apply'                            => 
lang('apply'),
-                               'lang_apply_status_text'                => 
lang('Apply the values'),
-                       );
-
-                       $appname                                        = 
lang('job');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view_job' => $data));
-               }
-
-               function edit_task()
-               {
-                       $task_id        = 
get_var('task_id',array('POST','GET'));
-                       $job_id = get_var('job_id',array('POST','GET'));
-                       $values         = get_var('values',array('POST'));
-
-                       $GLOBALS['phpgw']->xslttpl->add_file(array('job'));
-
-                       if (is_array($values))
-                       {
-                               $values['job_id']= $job_id;
-
-                               if ($values['save'] || $values['apply'])
-                               {
-                                       if(!$values['cat_id'])
-                                       {
-                                               
$receipt['error'][]=array('msg'=>lang('Please select a category !'));
-                                       }
-                                       if(!$values['name'])
-                                       {
-                                               
$receipt['error'][]=array('msg'=>lang('Please enter a name !'));
-                                       }
-
-                                       if($task_id)
-                                       {
-                                               $values['task_id']=$task_id;
-                                               $action='edit';
-                                       }
-
-                                       if(!$receipt['error'])
-                                       {
-                                               $receipt = 
$this->bo->save_task($values,$action);
-                                               $task_id = $receipt['task_id'];
-
-                                               if ($values['save'])
-                                               {
-                                                       
$GLOBALS['phpgw']->session->appsession('session_data','hrm_task_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uijob.task&job_id='
 . $job_id);
-                                               }
-                                       }
-                               }
-                               else
-                               {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uijob.task&job_id='
 . $job_id);
-                               }
-                       }
-
-
-                       if ($task_id)
-                       {
-                               if(!$receipt['error'])
-                               {
-                                       $values = 
$this->bo->read_single_task($task_id);
-                               }
-                               $function_msg = lang('edit task');
-                               $action='edit';
-                       }
-                       else
-                       {
-                               $function_msg = lang('add task');
-                               $action='add';
-                       }
-
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uijob.edit_task',
-                               'task_id'       => $task_id,
-                               'job_id' => $job_id
-                       );
-//_debug_array($link_data);
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $data = array
-                       (
-                               'value_descr'                           => 
$values['descr'],
-                               'value_name'                            => 
$values['name'],
-                               'value_entry_date'                      => 
$values['entry_date'],
-                               'lang_entry_date'                       => 
lang('Entry date'),
-
-                               'lang_name'                             => 
lang('name'),
-                               'lang_name_status_text'                 => 
lang('name of the task item'),
-                               'lang_skill'                            => 
lang('Skill level'),
-                               'lang_skill_status_text'                => 
lang('Select your skill'),
-                               'skill_list'                            => 
$this->bocategory->select_category_list('skill_level',$values['skill_id']),
-                               'lang_no_skill'                         => 
lang('select a level'),
-
-                               'experience_list'                       => 
$this->bocategory->select_category_list('experience',$values['experience_id']),
-                               'lang_experience'                       => 
lang('experience'),
-                               'lang_experience_status_text'           => 
lang('Select a experience level'),
-                               'lang_no_experience'                    => 
lang('select experience'),
-
-                               'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'lang_id'                               => 
lang('task ID'),
-                               'lang_descr'                            => 
lang('Descr'),
-                               'lang_save'                             => 
lang('save'),
-                               'lang_cancel'                           => 
lang('cancel'),
-                               'value_id'                              => 
$task_id,
-
-                               'lang_descr_status_text'                => 
lang('Enter a description the task'),
-                               'lang_done_status_text'                 => 
lang('Back to the list'),
-                               'lang_save_status_text'                 => 
lang('Save the task'),
-                               'lang_apply'                            => 
lang('apply'),
-                               'lang_apply_status_text'                => 
lang('Apply the values'),
-
-                               'lang_category'                         => 
lang('category'),
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage job
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package hrm
+        */
+
+       class uijob
+       {
+               var $grants;
+               var $start;
+               var $query;
+               var $sort;
+               var $order;
+               var $sub;
+               var $currentapp;
+
+               var $public_functions = array
+               (
+                       'index'                         => True,
+                       'view_task'                     => True,
+                       'view_job'                      => True,
+                       'edit_job'                      => True,
+                       'edit_task'                     => True,
+                       'delete_task'                   => True,
+                       'task'                          => True,
+                       'delete_job'                    => True,
+                       'reset_job_type_hierarchy'      => True,
+                       'lookup_task'                   => True
+               );
+
+               function uijob()
+               {
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
+                       $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       $this->bo                               = 
CreateObject($this->currentapp.'.bojob',true);
+                       $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
+                       $this->bocategory                       = 
CreateObject($this->currentapp.'.bocategory');
+                       $this->menu                             = 
CreateObject($this->currentapp.'.menu');
+                       $this->menu->sub                        ='job';
+
+                       $this->start                            = 
$this->bo->start;
+                       $this->query                            = 
$this->bo->query;
+                       $this->sort                             = 
$this->bo->sort;
+                       $this->order                            = 
$this->bo->order;
+                       $this->allrows                          = 
$this->bo->allrows;
+               }
+
+               function save_sessiondata()
+               {
+                       $data = array
+                       (
+                               'start'         => $this->start,
+                               'query'         => $this->query,
+                               'sort'          => $this->sort,
+                               'order'         => $this->order
+                       );
+                       $this->bo->save_sessiondata($data);
+               }
+
+               function index()
+               {
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('job','nextmatchs','menu',
+                                                                               
'search_field'));
+
+                       $links = $this->menu->links('job_type');
+
+                       $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','hrm_job_receipt');
+                       
$GLOBALS['phpgw']->session->appsession('session_data','hrm_job_receipt','');
+
+                       $job_info = $this->bo->read();
+
+                       while (is_array($job_info) && list(,$entry) = 
each($job_info))
+                       {
+
+                               if ($entry['level'] > 0)
+                               {
+                                       $space = '--';
+                                       $spaceset = 
str_repeat($space,$entry['level']);
+                                       $entry['name'] = $spaceset . 
$entry['name'];
+                               }
+
+
+                               $content[] = array
+                               (
+                                       'name'                          => 
$entry['name'],
+                                       'descr'                         => 
$entry['descr'],
+                                       'link_add_sub'                  => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.edit_job&parent_id='
 . $entry['id']),
+                                       'link_edit'                     => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.edit_job&id='
 . $entry['id']),
+                                       'link_delete'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.delete_job&job_id='
 . $entry['id']),
+                                       'link_view'                     => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.view_job&id='
 . $entry['id']),
+                                       'link_task'                     => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.task&job_id='
 . $entry['id']),
+                                       'lang_task_job_text'            => 
lang('Tasks for this job'),
+                                       'lang_view_job_text'            => 
lang('view the job'),
+                                       'lang_edit_job_text'            => 
lang('edit the job'),
+                                       'lang_delete_job_text'          => 
lang('delete the job'),
+                                       'lang_add_sub_text'             => 
lang('Add a new sub-job'),
+                                       'text_task'                     => 
lang('task'),
+                                       'text_view'                     => 
lang('view'),
+                                       'text_edit'                     => 
lang('edit'),
+                                       'text_delete'                   => 
lang('delete'),
+                                       'text_add_sub'                  => 
lang('Add sub'),
+                               );
+                       }
+
+//_debug_array($content);
+
+                       $table_header[] = array
+                       (
+                               'sort_name'     => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'name',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uijob.index',
+                                                                               
                                'query'         =>$this->query,
+                                                                               
                                'cat_id'        =>$this->cat_id,
+                                                                               
                                'allrows' => $this->allrows)
+                                                                               
)),
+                               'lang_add_sub'  => lang('Add sub'),
+                               'lang_name'     => lang('name'),
+                               'lang_descr'    => lang('descr'),
+                               'lang_edit'     => lang('edit'),
+                               'lang_delete'   => lang('delete'),
+                               'lang_view'     => lang('view'),
+                               'lang_task'     => lang('task'),
+                       );
+
+                       $table_add[] = array
+                       (
+                               'lang_add'                              => 
lang('add'),
+                               'lang_add_statustext'   => lang('add a 
category'),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.edit_job'),
+                               'lang_reset'            => lang('reset 
hierarchy'),
+                               'lang_reset_statustext' => lang('Reset the 
hierarchy'),
+                               'reset_action'          => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.reset_job_type_hierarchy')
+                       );
+
+                       $table_reset_job_type[] = array
+                       (
+                       );
+
+                       if(!$this->allrows)
+                       {
+                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                       }
+                       else
+                       {
+                               $record_limit   = $this->bo->total_records;
+                       }
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uijob.index',
+                                               'sort'                  
=>$this->sort,
+                                               'order'                 
=>$this->order,
+                                               'cat_id'                
=>$this->cat_id,
+                                               'filter'                
=>$this->filter,
+                                               'query'                 
=>$this->query
+                       );
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'links'                                         
=> $links,
+                               'allow_allrows'                                 
=> True,
+                               'allrows'                                       
=> $this->allrows,
+                               'start_record'                                  
=> $this->start,
+                               'record_limit'                                  
=> $record_limit,
+                               'num_records'                                   
=> count($job_info),
+                               'all_records'                                   
=> $this->bo->total_records,
+                               'link_url'                                      
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'img_path'                                      
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
+                               '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_job'                                 
=> $table_add
+                       );
+
+                       $appname                                        = 
lang('job');
+;
+                       $function_msg                                   = 
lang('list job');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
+                       $this->save_sessiondata();
+               }
+
+
+               function task()
+               {
+                       $job_id = get_var('job_id',array('POST','GET'));
+
+                       $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','hrm_task_receipt');
+                       
$GLOBALS['phpgw']->session->appsession('session_data','hrm_task_receipt','');
+
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('job'));
+
+                       if ($job_id)
+                       {
+                               $job_info = $this->bo->read_single_job($job_id);
+                               $task = $this->bo->read_task($job_id);
+                       }
+
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
+                       while (is_array($task) && list(,$entry) = each($task))
+                       {
+
+                               if($entry['start_date'])
+                               {
+                                       $entry['start_date']    = 
$GLOBALS['phpgw']->common->show_date($entry['start_date'],$dateformat);
+                               }
+                               if($entry['end_date'])
+                               {
+                                       $entry['end_date']      = 
$GLOBALS['phpgw']->common->show_date($entry['end_date'],$dateformat);
+                               }
+
+                               $content[] = array
+                               (
+                                       'name'                  => 
$entry['name'],
+                                       'place'                 => 
$entry['place'],
+                                       'start_date'            => 
$entry['start_date'],
+                                       'end_date'              => 
$entry['end_date'],
+                                       'link_edit'             => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.edit_task&job_id=$job_id&task_id="
 . $entry['task_id']),
+                                       'link_view'             => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.view_task&job_id=$job_id&task_id="
 . $entry['task_id']),
+                                       'link_delete'           => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.delete_task&job_id=$job_id&task_id="
 . $entry['task_id']),
+                                       'lang_view_text'        => lang('view 
task item'),
+                                       'lang_edit_text'        => lang('edit 
task item'),
+                                       'lang_delete_text'      => lang('delete 
task item'),
+                                       'text_view'             => lang('view'),
+                                       'text_edit'             => lang('edit'),
+                                       'text_delete'           => 
lang('delete')
+                               );
+                       }
+
+
+                       $table_header[] = array
+                       (
+
+                               'sort_place'    => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'hrm_task_place.name',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uijob.task',
+                                                                               
                                'job_id'        =>$job_id,
+                                                                               
                                'query'         =>$this->query,
+                                                                               
                                'cat_id'        =>$this->cat_id,
+                                                                               
                                'allrows'       => $this->allrows)
+                                                                               
)),
+                               'lang_place'    => lang('place'),
+                               'sort_name'     => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'hrm_task.name',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uijob.task',
+                                                                               
                                'job_id'        =>$job_id,
+                                                                               
                                'query'         =>$this->query,
+                                                                               
                                'cat_id'        =>$this->cat_id,
+                                                                               
                                'allrows' => $this->allrows)
+                                                                               
)),
+                               'lang_name'     => lang('name'),
+                               'lang_start_date'=> lang('start date'),
+                               'lang_end_date' => lang('end date'),
+                               'lang_view'     => lang('view'),
+                               'lang_edit'     => lang('edit'),
+                               'lang_delete'   => lang('delete'),
+                       );
+
+
+
+                       $function_msg = lang('list task');
+
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uijob.edit_task',
+                               'job_id'        => $job_id
+                       );
+
+                       $table_add[] = array
+                       (
+                               'lang_add'                      => lang('add'),
+                               'lang_add_task_text'    => lang('add a task 
item'),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.edit_task&job_id='.$job_id),
+                               'lang_done'                     => lang('done'),
+                               'lang_done_task_text'   => lang('back to user 
list'),
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.index')
+                       );
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'lang_job_name'                         => 
lang('Job name'),
+                               'value_job_name'                        => 
$job_info['name'],
+                               'table_header_task'                     => 
$table_header,
+                               'values_task'                           => 
$content,
+                               'table_add'                             => 
$table_add,
+                               'user_values'                           => 
$user_values,
+                               'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.index'),
+                               'lang_id'                               => 
lang('task ID'),
+                               'lang_descr'                            => 
lang('Descr'),
+                               'lang_save'                             => 
lang('save'),
+                               'lang_cancel'                           => 
lang('cancel'),
+                               'value_id'                              => 
$job_id,
+                               'lang_id_status_text'                   => 
lang('Enter the task ID'),
+                               'lang_descr_status_text'                => 
lang('Enter a description the task'),
+                               'lang_done_status_text'                 => 
lang('Back to the list'),
+                               'lang_save_status_text'                 => 
lang('Save the task'),
+                               'type_id'                               => 
$task['type_id'],
+                               'value_descr'                           => 
$task['descr'],
+                               'lang_apply'                            => 
lang('apply'),
+                               'lang_apply_status_text'                => 
lang('Apply the values'),
+                       );
+
+                       $appname                                        = 
lang('task');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('task' => $data));
+               }
+
+               function lookup_task()
+               {
+                       $job_id = get_var('job_id',array('POST','GET'));
+
+                       $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','hrm_task_receipt');
+                       
$GLOBALS['phpgw']->session->appsession('session_data','hrm_task_receipt','');
+
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('job'));
+
+                       if ($job_id)
+                       {
+                               $job_info = $this->bo->read_single_job($job_id);
+                               $task = $this->bo->read_task($job_id);
+                       }
+
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
+                       while (is_array($task) && list(,$entry) = each($task))
+                       {
+
+                               if($entry['start_date'])
+                               {
+                                       $entry['start_date']    = 
$GLOBALS['phpgw']->common->show_date($entry['start_date'],$dateformat);
+                               }
+                               if($entry['end_date'])
+                               {
+                                       $entry['end_date']      = 
$GLOBALS['phpgw']->common->show_date($entry['end_date'],$dateformat);
+                               }
+
+                               $content[] = array
+                               (
+                                       'id'                    => 
$entry['task_id'],
+                                       'name'                  => 
$entry['name'],
+                                       'descr'                 => 
$entry['descr'],
+                                       'link_edit'             => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.edit_task&job_id=$job_id&task_id="
 . $entry['task_id']),
+                                       'link_view'             => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.view_task&job_id=$job_id&task_id="
 . $entry['task_id']),
+                                       'link_delete'           => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.delete_task&job_id=$job_id&task_id="
 . $entry['task_id']),
+                                       'lang_select'           => 
lang('select'),
+                                       'text_delete'           => 
lang('delete')
+                               );
+                       }
+
+
+                       $table_header[] = array
+                       (
+
+                               'sort_place'    => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'hrm_task_place.name',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uijob.task',
+                                                                               
                                'job_id'        =>$job_id,
+                                                                               
                                'query'         =>$this->query,
+                                                                               
                                'cat_id'        =>$this->cat_id,
+                                                                               
                                'allrows'       => $this->allrows)
+                                                                               
)),
+                               'lang_place'    => lang('place'),
+                               'sort_name'     => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'hrm_task.name',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uijob.task',
+                                                                               
                                'job_id'        =>$job_id,
+                                                                               
                                'query'         =>$this->query,
+                                                                               
                                'cat_id'        =>$this->cat_id,
+                                                                               
                                'allrows' => $this->allrows)
+                                                                               
)),
+                               'lang_name'     => lang('name'),
+                               'lang_descr'=> lang('descr'),
+                               'lang_select'   => lang('select'),
+                               'lang_view'     => lang('view'),
+                               'lang_edit'     => lang('edit'),
+                               'lang_delete'   => lang('delete'),
+                       );
+
+
+
+                       $function_msg = lang('list task');
+
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uijob.edit_task',
+                               'job_id'        => $job_id
+                       );
+
+                       $table_add[] = array
+                       (
+                               'lang_add'                      => lang('add'),
+                               'lang_add_task_text'    => lang('add a task 
item'),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.edit_task&job_id='.$job_id),
+                               'lang_done'                     => lang('done'),
+                               'lang_done_task_text'   => lang('back to user 
list'),
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.index')
+                       );
+
+
+
+                       $GLOBALS['phpgw_info']['flags']['java_script'] .= "\n"
+                               . '<script language="JavaScript">' ."\n"
+                               . 'var userSelectBox = 
opener.document.forms["app_form"].elements[' . "'alternative_task[]'];" ."\n"
+                               . "\n"
+                               . 'function ExchangeTaskSelect(thisform)' ."\n"
+                               . '{' ."\n"
+                                       . 'NewEntry = new 
Option(thisform.elements[1].value,thisform.elements[0].value,false,true);' ."\n"
+                                       . 
'userSelectBox.options[userSelectBox.length] = NewEntry;' ."\n"
+                               . '}' ."\n"
+                               . "</script>\n";
+
+
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'lang_job_name'                         => 
lang('Job name'),
+                               'value_job_name'                        => 
$job_info['name'],
+                               'table_header_lookup_task'                      
=> $table_header,
+                               'values_lookup_task'                            
=> $content,
+                               'table_add'                             => 
$table_add,
+                               'user_values'                           => 
$user_values,
+                               'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.index'),
+                               'lang_id'                               => 
lang('task ID'),
+                               'lang_descr'                            => 
lang('Descr'),
+                               'lang_save'                             => 
lang('save'),
+                               'lang_cancel'                           => 
lang('cancel'),
+                               'value_id'                              => 
$job_id,
+                               'lang_id_status_text'                   => 
lang('Enter the task ID'),
+                               'lang_descr_status_text'                => 
lang('Enter a description the task'),
+                               'lang_done_status_text'                 => 
lang('Back to the list'),
+                               'lang_save_status_text'                 => 
lang('Save the task'),
+                               'type_id'                               => 
$task['type_id'],
+                               'value_descr'                           => 
$task['descr'],
+                               'lang_apply'                            => 
lang('apply'),
+                               'lang_apply_status_text'                => 
lang('Apply the values'),
+                       );
+
+                       $appname                                        = 
lang('task');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('lookup_task' => $data));
+               }
+
+               function edit_job()
+               {
+                       $id             = get_var('id',array('POST','GET'));
+                       $parent_id      = 
get_var('parent_id',array('POST','GET'));
+                       $values         = get_var('values',array('POST'));
+
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('job'));
+
+                       if (is_array($values))
+                       {
+                               if ($values['save'] || $values['apply'])
+                               {
+                                       if(!$values['name'])
+                                       {
+                                               
$receipt['error'][]=array('msg'=>lang('Please enter a name !'));
+                                       }
+
+
+                                       if($id)
+                                       {
+                                               $values['id']=$id;
+                                               $action='edit';
+                                       }
+
+                                       if(!$receipt['error'])
+                                       {
+                                               $receipt = 
$this->bo->save_job($values,$action);
+                                               $id = $receipt['id'];
+
+                                               if ($values['save'])
+                                               {
+                                                       
$GLOBALS['phpgw']->session->appsession('session_data','hrm_job_receipt',$receipt);
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uijob.index');
+                                               }
+                                       }
+                               }
+                               else
+                               {
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uijob.index');
+                               }
+                       }
+
+                       if ($id)
+                       {
+                               $values = $this->bo->read_single_job($id);
+                               $function_msg = lang('edit job');
+                               $action='edit';
+                       }
+                       else
+                       {
+                               $function_msg = lang('add job');
+                               $action='add';
+                       }
+
+
+                       if($parent_id)
+                       {
+                               $values['parent_id'] = $parent_id;
+                       }
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uijob.edit_job',
+                               'id'    => $id
+                       );
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.index&type='.$type
 . '&type_id=' . $type_id),
+                               'lang_id'                               => 
lang('category ID'),
+                               'lang_descr'                                    
=> lang('Descr'),
+                               'lang_save'                                     
=> lang('save'),
+                               'value_id'                              => $id,
+
+                               'parent_list'                           => 
$this->bo->select_job_list($values['parent_id']),
+                               'lang_parent'                           => 
lang('parent'),
+                               'lang_parent_status_text'               => 
lang('Select this jobs parent'),
+                               'lang_no_parent'                        => 
lang('select a parent'),
+
+                               'lang_name'                             => 
lang('name'),
+                               'lang_name_status_text'                 => 
lang('name of the job-type'),
+
+
+                               'lang_id_statustext'    => lang('Enter the 
category ID'),
+                               'lang_descr_statustext'                 => 
lang('Enter a description the job'),
+                               'lang_done_statustext'                  => 
lang('Back to the list'),
+                               'lang_save_statustext'                  => 
lang('Save the job'),
+                               'type_id'                               => 
$values['type_id'],
+                               'value_descr'                                   
=> $values['descr'],
+                               'value_name'                                    
=> $values['name'],
+
+                               'lang_cancel'                           => 
lang('cancel'),
+                               'lang_apply'                            => 
lang('apply'),
+                               'lang_apply_status_text'                => 
lang('Apply the values'),
+                       );
+
+                       $appname                                        = 
lang('job');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_job' => $data));
+               }
+
+               function view_job()
+               {
+                       $id             = get_var('id',array('POST','GET'));
+                       $parent_id      = 
get_var('parent_id',array('POST','GET'));
+                       $values         = get_var('values',array('POST'));
+
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('job'));
+
+
+                       if ($id)
+                       {
+                               $values = $this->bo->read_single_job($id);
+                               $function_msg = lang('view job');
+                       }
+
+                       if($parent_id)
+                       {
+                               $values['parent_id'] = $parent_id;
+                       }
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uijob.edit_job',
+                               'id'    => $id
+                       );
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.index&type='.$type
 . '&type_id=' . $type_id),
+                               'lang_id'                               => 
lang('category ID'),
+                               'lang_descr'                                    
=> lang('Descr'),
+                               'lang_save'                                     
=> lang('save'),
+                               'value_id'                              => $id,
+
+                               'parent_list'                           => 
$this->bo->select_job_list($values['parent_id']),
+                               'lang_parent'                           => 
lang('parent'),
+                               'lang_parent_status_text'               => 
lang('Select this jobs parent'),
+                               'lang_no_parent'                        => 
lang('select a parent'),
+
+                               'lang_name'                             => 
lang('name'),
+                               'lang_name_status_text'                 => 
lang('name of the job-type'),
+
+                               'lang_id_statustext'    => lang('Enter the 
category ID'),
+                               'lang_descr_statustext'                 => 
lang('Enter a description the job'),
+                               'lang_done_statustext'                  => 
lang('Back to the list'),
+                               'lang_save_statustext'                  => 
lang('Save the job'),
+                               'type_id'                               => 
$values['type_id'],
+                               'value_descr'                                   
=> $values['descr'],
+                               'value_name'                                    
=> $values['name'],
+
+                               'lang_cancel'                           => 
lang('cancel'),
+                               'lang_apply'                            => 
lang('apply'),
+                               'lang_apply_status_text'                => 
lang('Apply the values'),
+                       );
+
+                       $appname                                        = 
lang('job');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view_job' => $data));
+               }
+
+               function edit_task()
+               {
+                       $task_id        = 
get_var('task_id',array('POST','GET'));
+                       $job_id = get_var('job_id',array('POST','GET'));
+                       $values         = get_var('values',array('POST'));
+
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('job'));
+
+                       if (is_array($values))
+                       {
+                               $values['job_id']= $job_id;
+
+                               if ($values['save'] || $values['apply'])
+                               {
+                                       if(!$values['cat_id'])
+                                       {
+                                               
$receipt['error'][]=array('msg'=>lang('Please select a category !'));
+                                       }
+                                       if(!$values['name'])
+                                       {
+                                               
$receipt['error'][]=array('msg'=>lang('Please enter a name !'));
+                                       }
+
+                                       if($task_id)
+                                       {
+                                               $values['task_id']=$task_id;
+                                               $action='edit';
+                                       }
+
+                                       if(!$receipt['error'])
+                                       {
+                                               $receipt = 
$this->bo->save_task($values,$action);
+                                               $task_id = $receipt['task_id'];
+
+                                               if ($values['save'])
+                                               {
+                                                       
$GLOBALS['phpgw']->session->appsession('session_data','hrm_task_receipt',$receipt);
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uijob.task&job_id='
 . $job_id);
+                                               }
+                                       }
+                               }
+                               else
+                               {
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uijob.task&job_id='
 . $job_id);
+                               }
+                       }
+
+
+                       if ($task_id)
+                       {
+                               if(!$receipt['error'])
+                               {
+                                       $values = 
$this->bo->read_single_task($task_id);
+                               }
+                               $function_msg = lang('edit task');
+                               $action='edit';
+                       }
+                       else
+                       {
+                               $function_msg = lang('add task');
+                               $action='add';
+                       }
+
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uijob.edit_task',
+                               'task_id'       => $task_id,
+                               'job_id' => $job_id
+                       );
+//_debug_array($link_data);
+
+                       $link_data_lookup = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uijob.lookup_task',
+                               'task_id'       => $task_id,
+                               'job_id' => $job_id
+                       );
+
+                       $GLOBALS['phpgw_info']['flags']['java_script'] .= "\n"
+                               . '<script language="JavaScript">' ."\n"
+                                       . 'self.name="first_Window";' ."\n"
+                                       . 'function tasks_popup()' ."\n"
+                                       . '{' ."\n"
+                                               . 'Window1=window.open("' . 
$GLOBALS['phpgw']->link('/index.php',$link_data_lookup) . 
'","Search","width=800,height=600,toolbar=no,scrollbars=yes,resizable=yes");' 
."\n"
+                                       . '}' ."\n"
+                               . "</script>\n";
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'value_descr'                           => 
$values['descr'],
+                               'value_name'                            => 
$values['name'],
+                               'value_entry_date'                      => 
$values['entry_date'],
+                               'lang_entry_date'                       => 
lang('Entry date'),
+                               'lang_name'                             => 
lang('name'),
+                               'lang_name_status_text'                 => 
lang('name of the task item'),
+                               'lang_skill'                            => 
lang('Skill level'),
+                               'lang_skill_status_text'                => 
lang('Select your skill'),
+                               'skill_list'                            => 
$this->bocategory->select_category_list('skill_level',$values['skill_id']),
+                               'lang_no_skill'                         => 
lang('select a level'),
+                               'experience_list'                       => 
$this->bocategory->select_category_list('experience',$values['experience_id']),
+                               'lang_experience'                       => 
lang('experience'),
+                               'lang_experience_status_text'           => 
lang('Select a experience level'),
+                               'lang_no_experience'                    => 
lang('select experience'),
+                               'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'lang_id'                               => 
lang('task ID'),
+                               'lang_descr'                            => 
lang('Descr'),
+                               'lang_save'                             => 
lang('save'),
+                               'lang_cancel'                           => 
lang('cancel'),
+                               'value_id'                              => 
$task_id,
+                               'lang_descr_status_text'                => 
lang('Enter a description the task'),
+                               'lang_done_status_text'                 => 
lang('Back to the list'),
+                               'lang_save_status_text'                 => 
lang('Save the task'),
+                               'lang_apply'                            => 
lang('apply'),
+                               'lang_apply_status_text'                => 
lang('Apply the values'),
+                               'lang_category'                         => 
lang('category'),
                                'cat_list'                              => 
$this->bocategory->select_category_list('task',$values['cat_id']),
-                               'lang_no_cat'                           => 
lang('no category'),
-                               'lang_cat_status_text'                  => 
lang('Select the category the task belongs to. To do not use a category select 
NO CATEGORY'),
-                       );
-
-                       $job_info = $this->bo->read_single_job($job_id);
-
-                       $appname                                        = 
lang('task') .' ' . $job_info['name'];
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_task' => $data));
-               }
-
-               function view_task()
-               {
-                       $task_id        = 
get_var('task_id',array('POST','GET'));
-                       $job_id = get_var('job_id',array('POST','GET'));
-                       $values         = get_var('values',array('POST'));
-
-                       $GLOBALS['phpgw']->xslttpl->add_file(array('job'));
-
-                       $values = $this->bo->read_single_task($task_id);
-                       $function_msg = lang('view task');
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uijob.task',
-                               'job_id' => $job_id
-                       );
-
-                       $data = array
-                       (
                                'value_descr'                           => 
$values['descr'],
-                               'value_name'                            => 
$values['name'],
-                               'value_entry_date'                      => 
$values['entry_date'],
-                               'lang_entry_date'                       => 
lang('Entry date'),
-
-                               'lang_name'                             => 
lang('name'),
-                               'lang_name_status_text'                 => 
lang('name of the task item'),
-                               'lang_skill'                            => 
lang('Skill level'),
-                               'lang_skill_status_text'                => 
lang('Select your skill'),
-                               'skill_list'                            => 
$this->bocategory->select_category_list('skill_level',$values['skill_id']),
-                               'lang_no_skill'                         => 
lang('select a level'),
-
-                               'experience_list'                       => 
$this->bocategory->select_category_list('experience',$values['experience_id']),
-                               'lang_experience'                       => 
lang('experience'),
-                               'lang_experience_status_text'           => 
lang('Select a experience level'),
-                               'lang_no_experience'                    => 
lang('select experience'),
-
-                               'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'lang_id'                               => 
lang('task ID'),
-                               'lang_descr'                            => 
lang('Descr'),
-                               'lang_save'                             => 
lang('save'),
-                               'lang_cancel'                           => 
lang('cancel'),
-                               'value_id'                              => 
$task_id,
-
-                               'lang_descr_status_text'                => 
lang('Enter a description the task'),
-                               'lang_done_status_text'                 => 
lang('Back to the list'),
-                               'lang_save_status_text'                 => 
lang('Save the task'),
-                               'lang_apply'                            => 
lang('apply'),
-                               'lang_apply_status_text'                => 
lang('Apply the values'),
-
-                               'lang_category'                         => 
lang('category'),
+                               'lang_no_cat'                           => 
lang('no category'),
+                               'lang_cat_status_text'                  => 
lang('Select the category the task belongs to. To do not use a category select 
NO CATEGORY'),
+                               'lang_alternative'                      => 
lang('alternative'),
+                               'lang_open_popup'                       => 
lang('open popup window'),
+                               'lang_no_alternative'                   => 
lang('select alternative'),
+
+                       );
+
+                       $job_info = $this->bo->read_single_job($job_id);
+
+                       $appname                                        = 
lang('task') .' ' . $job_info['name'];
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_task' => $data));
+               }
+
+               function view_task()
+               {
+                       $task_id        = 
get_var('task_id',array('POST','GET'));
+                       $job_id = get_var('job_id',array('POST','GET'));
+                       $values         = get_var('values',array('POST'));
+
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('job'));
+
+                       $values = $this->bo->read_single_task($task_id);
+                       $function_msg = lang('view task');
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uijob.task',
+                               'job_id' => $job_id
+                       );
+
+                       $data = array
+                       (
+                               'value_descr'                           => 
$values['descr'],
+                               'value_name'                            => 
$values['name'],
+                               'value_entry_date'                      => 
$values['entry_date'],
+                               'lang_entry_date'                       => 
lang('Entry date'),
+                               'lang_name'                             => 
lang('name'),
+                               'lang_name_status_text'                 => 
lang('name of the task item'),
+                               'lang_skill'                            => 
lang('Skill level'),
+                               'lang_skill_status_text'                => 
lang('Select your skill'),
+                               'skill_list'                            => 
$this->bocategory->select_category_list('skill_level',$values['skill_id']),
+                               'lang_no_skill'                         => 
lang('select a level'),
+                               'experience_list'                       => 
$this->bocategory->select_category_list('experience',$values['experience_id']),
+                               'lang_experience'                       => 
lang('experience'),
+                               'lang_experience_status_text'           => 
lang('Select a experience level'),
+                               'lang_no_experience'                    => 
lang('select experience'),
+
+                               'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'lang_id'                               => 
lang('task ID'),
+                               'lang_descr'                            => 
lang('Descr'),
+                               'lang_save'                             => 
lang('save'),
+                               'lang_cancel'                           => 
lang('cancel'),
+                               'value_id'                              => 
$task_id,
+
+                               'lang_descr_status_text'                => 
lang('Enter a description the task'),
+                               'lang_done_status_text'                 => 
lang('Back to the list'),
+                               'lang_save_status_text'                 => 
lang('Save the task'),
+                               'lang_apply'                            => 
lang('apply'),
+                               'lang_apply_status_text'                => 
lang('Apply the values'),
+
+                               'lang_category'                         => 
lang('category'),
                                'cat_list'                              => 
$this->bocategory->select_category_list('task',$values['cat_id']),
-                               'lang_no_cat'                           => 
lang('no category'),
-                               'lang_cat_status_text'                  => 
lang('Select the category the task belongs to. To do not use a category select 
NO CATEGORY'),
+                               'lang_no_cat'                           => 
lang('no category'),
+                               'lang_cat_status_text'                  => 
lang('Select the category the task belongs to. To do not use a category select 
NO CATEGORY'),
+                       );
+
+                       $job_info = $this->bo->read_single_job($job_id);
+                       $appname                                        = 
lang('task') .' ' . $job_info['name'];
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view_task' => $data));
+               }
+
+               function delete_job()
+               {
+                       $job_id = get_var('job_id',array('POST','GET'));
+                       $confirm                = 
get_var('confirm',array('POST'));
+                       $link_data = array
+                       (
+                               'menuaction' => 
$this->currentapp.'.uijob.index',
+                               'job_id' => $job_id
+                       );
+
+                       if (get_var('confirm',array('POST')))
+                       {
+                               $this->bo->delete_job($job_id);
+                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
+                       }
+
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
+                       $data = array
+                       (
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.delete_job&job_id='
 . $job_id),
+                               'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
+                               'lang_yes'                              => 
lang('yes'),
+                               'lang_yes_statustext'   => lang('Delete the 
entry'),
+                               'lang_no_statustext'    => lang('Back to the 
list'),
+                               'lang_no'                               => 
lang('no')
+                       );
+
+                       $appname                                        = 
lang('job');
+                       $function_msg                                   = 
lang('delete');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
+               }
+
+               function delete_task()
+               {
+                       $task_id                = 
get_var('task_id',array('POST','GET'));
+                       $job_id = get_var('job_id',array('POST','GET'));
+                       $confirm                = 
get_var('confirm',array('POST'));
+
+                       $link_data = array
+                       (
+                               'menuaction' => $this->currentapp.'.uijob.task',
+                               'job_id' => $job_id
+                       );
+
+                       if (get_var('confirm',array('POST')))
+                       {
+                               $this->bo->delete_task($job_id,$task_id);
+                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
+                       }
+
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
+
+                       $data = array
+                       (
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.delete_task&job_id='
 . $job_id .'&task_id='. $task_id),
+                               'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
+                               'lang_yes'                              => 
lang('yes'),
+                               'lang_yes_categorytext' => lang('Delete the 
entry'),
+                               'lang_no_categorytext'  => lang('Back to the 
list'),
+                               'lang_no'                               => 
lang('no')
+                       );
+
+                       $appname                                        = 
lang('task');
+                       $function_msg                                   = 
lang('delete');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
+               }
+
+               function reset_job_type_hierarchy()
+               {
+                       $confirm                = 
get_var('confirm',array('POST'));
+                       $link_data = array
+                       (
+                               'menuaction' => $this->currentapp.'.uijob.index'
+                       );
+
+                       if (get_var('confirm',array('POST')))
+                       {
+                               $this->bo->reset_job_type_hierarchy();
+                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
+                       }
+
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
+
+                       $data = array
+                       (
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.reset_job_type_hierarchy'),
+                               'lang_confirm_msg'              => lang('do you 
really want to reset the hierarchy'),
+                               'lang_yes'                              => 
lang('yes'),
+                               'lang_yes_statustext'   => lang('Reset the 
hierarchy'),
+                               'lang_no_statustext'    => lang('Back to the 
list'),
+                               'lang_no'                               => 
lang('no')
+                       );

-                       );
-
-                       $job_info = $this->bo->read_single_job($job_id);
-
-                       $appname                                        = 
lang('task') .' ' . $job_info['name'];
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view_task' => $data));
-               }
-
-
-               function delete_job()
-               {
-                       $job_id = get_var('job_id',array('POST','GET'));
-                       $confirm                = 
get_var('confirm',array('POST'));
-
-                       $link_data = array
-                       (
-                               'menuaction' => 
$this->currentapp.'.uijob.index',
-                               'job_id' => $job_id
-                       );
-
-                       if (get_var('confirm',array('POST')))
-                       {
-                               $this->bo->delete_job($job_id);
-                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
-                       }
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
-
-                       $data = array
-                       (
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.delete_job&job_id='
 . $job_id),
-                               'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
-                               'lang_yes'                              => 
lang('yes'),
-                               'lang_yes_statustext'   => lang('Delete the 
entry'),
-                               'lang_no_statustext'    => lang('Back to the 
list'),
-                               'lang_no'                               => 
lang('no')
-                       );
-
-                       $appname                                        = 
lang('job');
-                       $function_msg                                   = 
lang('delete');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               }
-
-               function delete_task()
-               {
-                       $task_id                = 
get_var('task_id',array('POST','GET'));
-                       $job_id = get_var('job_id',array('POST','GET'));
-                       $confirm                = 
get_var('confirm',array('POST'));
-
-                       $link_data = array
-                       (
-                               'menuaction' => $this->currentapp.'.uijob.task',
-                               'job_id' => $job_id
-                       );
-
-                       if (get_var('confirm',array('POST')))
-                       {
-                               $this->bo->delete_task($job_id,$task_id);
-                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
-                       }
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
-
-                       $data = array
-                       (
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.delete_task&job_id='
 . $job_id .'&task_id='. $task_id),
-                               'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
-                               'lang_yes'                              => 
lang('yes'),
-                               'lang_yes_categorytext' => lang('Delete the 
entry'),
-                               'lang_no_categorytext'  => lang('Back to the 
list'),
-                               'lang_no'                               => 
lang('no')
-                       );
-
-                       $appname                                        = 
lang('task');
-                       $function_msg                                   = 
lang('delete');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               }
-
-               function reset_job_type_hierarchy()
-               {
-                       $confirm                = 
get_var('confirm',array('POST'));
-
-                       $link_data = array
-                       (
-                               'menuaction' => $this->currentapp.'.uijob.index'
-                       );
-
-                       if (get_var('confirm',array('POST')))
-                       {
-                               $this->bo->reset_job_type_hierarchy();
-                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
-                       }
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
-
-                       $data = array
-                       (
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.reset_job_type_hierarchy'),
-                               'lang_confirm_msg'              => lang('do you 
really want to reset the hierarchy'),
-                               'lang_yes'                              => 
lang('yes'),
-                               'lang_yes_statustext'   => lang('Reset the 
hierarchy'),
-                               'lang_no_statustext'    => lang('Back to the 
list'),
-                               'lang_no'                               => 
lang('no')
-                       );
-
-                       $appname                                        = 
lang('job');
-                       $function_msg                                   = 
lang('delete');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               }
-
-       }
+                       $appname                                        = 
lang('job');
+                       $function_msg                                   = 
lang('delete');
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
+               }
+       }

====================================================
Index: hrm/inc/class.uiuser.inc.php
diff -u hrm/inc/class.uiuser.inc.php:1.7 hrm/inc/class.uiuser.inc.php:1.8
--- hrm/inc/class.uiuser.inc.php:1.7    Tue Nov 29 15:07:58 2005
+++ hrm/inc/class.uiuser.inc.php        Wed Nov 30 17:07:22 2005
@@ -1,83 +1,83 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage user
-       * @version $Id$
-       */
-
-       /**
-        * Description
-        * @package hrm
-        */
-
-       class uiuser
-       {
-               var $grants;
-               var $start;
-               var $query;
-               var $sort;
-               var $order;
-               var $sub;
-               var $currentapp;
-
-               var $public_functions = array
-               (
-                       'index'  => True,
-                       'view'   => True,
-                       'training'=> True,
-                       'edit'   => True,
-                       'delete' => True
-               );
-
-               function uiuser()
-               {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
-                       $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->bo                               = 
CreateObject($this->currentapp.'.bouser',False);
-                       $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
-                       $this->bocategory                       = 
CreateObject($this->currentapp.'.bocategory');
-                       $this->menu                             = 
CreateObject($this->currentapp.'.menu');
-                       $this->menu->sub                        ='user';
-
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage user
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package hrm
+        */
+
+       class uiuser
+       {
+               var $grants;
+               var $start;
+               var $query;
+               var $sort;
+               var $order;
+               var $sub;
+               var $currentapp;
+
+               var $public_functions = array
+               (
+                       'index'  => True,
+                       'view'   => True,
+                       'training'=> True,
+                       'edit'   => True,
+                       'delete' => True
+               );
+
+               function uiuser()
+               {
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
+                       $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       $this->bo                               = 
CreateObject($this->currentapp.'.bouser',False);
+                       $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
+                       $this->bocategory                       = 
CreateObject($this->currentapp.'.bocategory');
+                       $this->menu                             = 
CreateObject($this->currentapp.'.menu');
+                       $this->menu->sub                        ='user';
                        $this->grants                           = 
$this->bo->grants;
-                       $this->start                            = 
$this->bo->start;
-                       $this->query                            = 
$this->bo->query;
-                       $this->sort                             = 
$this->bo->sort;
-                       $this->order                            = 
$this->bo->order;
-                       $this->allrows                          = 
$this->bo->allrows;
-               }
-
-               function save_sessiondata()
-               {
-                       $data = array
-                       (
-                               'start'         => $this->start,
-                               'query'         => $this->query,
-                               'sort'          => $this->sort,
-                               'order'         => $this->order,
-                       );
-                       $this->bo->save_sessiondata($data);
-               }
-
-               function index()
-               {
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('user','nextmatchs','menu',
-                                                                               
'search_field'));
-
-                       $links = $this->menu->links();
-
-                       $account_info = $this->bo->read();
-
-                       while (is_array($account_info) && list(,$entry) = 
each($account_info))
-                       {
+                       $this->start                            = 
$this->bo->start;
+                       $this->query                            = 
$this->bo->query;
+                       $this->sort                             = 
$this->bo->sort;
+                       $this->order                            = 
$this->bo->order;
+                       $this->allrows                          = 
$this->bo->allrows;
+               }
+
+               function save_sessiondata()
+               {
+                       $data = array
+                       (
+                               'start'         => $this->start,
+                               'query'         => $this->query,
+                               'sort'          => $this->sort,
+                               'order'         => $this->order,
+                       );
+
+                       $this->bo->save_sessiondata($data);
+               }
+
+               function index()
+               {
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('user','nextmatchs','menu',
+                                                                               
'search_field'));
+
+                       $links = $this->menu->links();
+
+                       $account_info = $this->bo->read();
+
+                       while (is_array($account_info) && list(,$entry) = 
each($account_info))
+                       {
                                if($entry['grants'])
                                {
                                        $link_training          = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiuser.training&user_id='
 . $entry['account_id']);
@@ -85,233 +85,226 @@
                                        $lang_training_user_text = 
lang('Training profile');
                                }

-                               $content[] = array
-                               (
-                                       'first_name'                            
=> $entry['account_firstname'],
-                                       'last_name'                             
=> $entry['account_lastname'],
-//                                     'link_edit'                             
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiuser.training&user_id='
 . $entry['account_id']),
-                                       'link_training'                         
=> $link_training,
-                                       'link_view'                             
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiuser.view&user_id='
 . $entry['account_id']),
-                                       'lang_view_user_text'                   
=> lang('view the user'),
-                                       'lang_training_user_text'               
=> $lang_training_user_text,
-                                       'lang_edit_user_text'                   
=> lang('edit the user'),
-                                       'text_view'                             
=> lang('view'),
-                                       'text_edit'                             
=> lang('edit'),
-                                       'text_training'                         
=> $text_training
+                               $content[] = array
+                               (
+                                       'first_name'                            
=> $entry['account_firstname'],
+                                       'last_name'                             
=> $entry['account_lastname'],
+//                                     'link_edit'                             
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiuser.training&user_id='
 . $entry['account_id']),
+                                       'link_training'                         
=> $link_training,
+                                       'link_view'                             
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiuser.view&user_id='
 . $entry['account_id']),
+                                       'lang_view_user_text'                   
=> lang('view the user'),
+                                       'lang_training_user_text'               
=> $lang_training_user_text,
+                                       'lang_edit_user_text'                   
=> lang('edit the user'),
+                                       'text_view'                             
=> lang('view'),
+                                       'text_edit'                             
=> lang('edit'),
+                                       'text_training'                         
=> $text_training
                                );
-                               unset ($link_training);
+                               unset ($link_training);
                                unset ($text_training);
                                unset ($lang_training_user_text);
-                       }
-
-//_debug_array($content);
-
-                       $table_header[] = array
-                       (
-
-                               'sort_last_name'        => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   =>      'account_lastname',
-                                                                               
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uiuser.index',
-                                                                               
                                'query'         =>$this->query,
-                                                                               
                                'district_id'   => $this->district_id,
-                                                                               
                                'entity_id'             =>$this->entity_id,
-                                                                               
                                'cat_id'        =>$this->cat_id,
-                                                                               
                                'allrows' => $this->allrows)
-                                                                               
)),
-                               'lang_last_name'        => lang('Last name'),
-                               'sort_first_name'       => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   =>      'account_firstname',
-                                                                               
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uiuser.index',
-                                                                               
                                'query'         =>$this->query,
-                                                                               
                                'district_id'   => $this->district_id,
-                                                                               
                                'entity_id'             =>$this->entity_id,
-                                                                               
                                'cat_id'        =>$this->cat_id,
-                                                                               
                                'allrows' => $this->allrows)
-                                                                               
)),
-                               'lang_first_name'       => lang('First name'),
-                               'lang_training' => lang('training'),
-                               'lang_edit'     => lang('edit'),
-                               'lang_view'     => lang('view'),
-                       );
-
-                       if(!$this->allrows)
-                       {
-                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
-                       }
-                       else
-                       {
-                               $record_limit   = $this->bo->total_records;
-                       }
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uiuser.index',
-                                               'sort'                  
=>$this->sort,
-                                               'order'                 
=>$this->order,
-                                               'cat_id'                
=>$this->cat_id,
-                                               'filter'                
=>$this->filter,
-                                               'query'                 
=>$this->query
-                       );
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $data = array
-                       (
-                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                         
=> $links,
-                               'allow_allrows'                                 
=> True,
-                               'allrows'                                       
=> $this->allrows,
-                               'start_record'                                  
=> $this->start,
-                               'record_limit'                                  
=> $record_limit,
-                               'num_records'                                   
=> count($account_info),
-                               'all_records'                                   
=> $this->bo->total_records,
-                               'link_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
-                               'lang_searchfield_categorytext' => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
-                               'lang_searchbutton_categorytext'        => 
lang('Submit the search string'),
-                               'query'                                         
        => $this->query,
-                               'lang_search'                                   
=> lang('search'),
-                               'table_header'                                  
=> $table_header,
-                               'values'                                        
        => $content
-                       );
-
-                       $appname                                        = 
lang('user');
-;
-                       $function_msg                                   = 
lang('list user');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-                       $this->save_sessiondata();
-               }
-
-               function training()
-               {
-                       $user_id        = 
get_var('user_id',array('POST','GET'));
-
+                       }
+
+//_debug_array($content);
+
+                       $table_header[] = array
+                       (
+                               'sort_last_name'        => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'account_lastname',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uiuser.index',
+                                                                               
                                'query'         =>$this->query,
+                                                                               
                                'district_id'   => $this->district_id,
+                                                                               
                                'entity_id'             =>$this->entity_id,
+                                                                               
                                'cat_id'        =>$this->cat_id,
+                                                                               
                                'allrows' => $this->allrows)
+                                                                               
)),
+                               'lang_last_name'        => lang('Last name'),
+                               'sort_first_name'       => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'account_firstname',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uiuser.index',
+                                                                               
                                'query'         =>$this->query,
+                                                                               
                                'district_id'   => $this->district_id,
+                                                                               
                                'entity_id'             =>$this->entity_id,
+                                                                               
                                'cat_id'        =>$this->cat_id,
+                                                                               
                                'allrows' => $this->allrows)
+                                                                               
)),
+                               'lang_first_name'       => lang('First name'),
+                               'lang_training' => lang('training'),
+                               'lang_edit'     => lang('edit'),
+                               'lang_view'     => lang('view'),
+                       );
+
+                       if(!$this->allrows)
+                       {
+                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                       }
+                       else
+                       {
+                               $record_limit   = $this->bo->total_records;
+                       }
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uiuser.index',
+                                               'sort'                  
=>$this->sort,
+                                               'order'                 
=>$this->order,
+                                               'cat_id'                
=>$this->cat_id,
+                                               'filter'                
=>$this->filter,
+                                               'query'                 
=>$this->query
+                       );
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'links'                                         
=> $links,
+                               'allow_allrows'                                 
=> True,
+                               'allrows'                                       
=> $this->allrows,
+                               'start_record'                                  
=> $this->start,
+                               'record_limit'                                  
=> $record_limit,
+                               'num_records'                                   
=> count($account_info),
+                               'all_records'                                   
=> $this->bo->total_records,
+                               'link_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
+                               'lang_searchfield_categorytext' => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
+                               'lang_searchbutton_categorytext'        => 
lang('Submit the search string'),
+                               'query'                                         
        => $this->query,
+                               'lang_search'                                   
=> lang('search'),
+                               'table_header'                                  
=> $table_header,
+                               'values'                                        
        => $content
+                       );
+
+                       $appname                                        = 
lang('user');
+                       $function_msg                                   = 
lang('list user');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
+                       $this->save_sessiondata();
+               }
+
+               function training()
+               {
+                       $user_id        = 
get_var('user_id',array('POST','GET'));
+
                        if (!$this->grants[$user_id])
                        {
                                return;
                        }

-                       $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','hrm_training_receipt');
-                       
$GLOBALS['phpgw']->session->appsession('session_data','hrm_training_receipt','');
-
-                       $GLOBALS['phpgw']->xslttpl->add_file(array('user'));
-
-
-                       $account = 
CreateObject('phpgwapi.accounts',$user_id,'u');
-                       $account_info = $account->read_repository();
-                       $membership = $account->membership($user_id);
-                       $contacts = CreateObject('phpgwapi.contacts');
-
-                       $qcols = array(
-                               'n_given'    => 'n_given',
-                               'n_family'   => 'n_family',
-                               'tel_work'   => 'tel_work',
-                               'tel_home'   => 'tel_home',
-                               'tel_cell'   => 'tel_cell',
-                               'title'      => 'title',
-                               'email'      => 'email',
-                               'email_home' => 'email_home',
-                       );
-
-                       $fields = 
$contacts->are_users($account_info['person_id'], $qcols);
-
-
-                       if(!$account_info['person_id'])
-                       {
-                               $sfields = rawurlencode(serialize($fields[0]));
-                               $contact_link   = 
$GLOBALS['phpgw']->link('/index.php',
-                                       array
-                                       (
-                                               'menuaction'    => 
'addressbook.uiaddressbook.add_person',
-                                               'entry'         => $sfields,
-                                       )
-                               );
-                       }
-                       else
-                       {
-                               $contact_link   = 
$GLOBALS['phpgw']->link('/index.php',
-                                       array
-                                       (
-                                               'menuaction'    => 
'addressbook.uiaddressbook.view_person',
-                                               'ab_id'         => 
$fields[0]['contact_id']
-                                       )
-                               );
-                       }
-
-                       $prefs_user = 
$this->bocommon->create_preferences('email',$user_id);
-
-                       if($fields[0]['email'] || $prefs_user['address'])
-                       {
-                               if($prefs_user['address'])
-                               {
-                                       $email_work = $prefs_user['address'];
-                               }
-                               else
-                               {
-                                       $email_work = $fields[0]['email'];
-                               }
-                       }
-
-                       if($fields[0]['email_home'])
-                       {
-                               $email_home = $fields[0]['email_home'];
-                       }
-
-
-                       $qcols_extra = array(
-                               array('name' =>lang('first name'), 'type' => 
'link', 'link_value' =>$contact_link),
-                               array('name' =>lang('last name'), 'type' => 
'text'),
-                               array('name' =>lang('work phone'), 'type' => 
'text'),
-                               array('name' =>lang('home phone'), 'type' => 
'text'),
-                               array('name' =>lang('cellular phone'), 'type' 
=> 'text'),
-                               array('name' =>lang('title'), 'type' => 'text'),
-                               array('name' =>lang('work email'), 'type' => 
'mail', 'link_value' =>$email_work),
-                               array('name' =>lang('home email'), 'type' => 
'mail', 'link_value' =>$email_home),
-                       );
-
-
-                       if(is_array($fields))
-                       {
-                               $j=0;
-                               for ($i=0;$i<count($qcols);$i++)
-                               {
-                                       $user_values[$j]['value'] = 
$fields[0][$i];
-                                       $user_values[$j]['name'] = 
$qcols_extra[$i]['name'];
-                                       $user_values[$j]['type'] = 
$qcols_extra[$i]['type'];
-                                       $user_values[$j]['link_value'] = 
$qcols_extra[$i]['link_value'];
-                                       $j++;
-                               }
-                       }
-
-
-
-                       if ($user_id)
-                       {
-                               $training = $this->bo->read_training($user_id);
-                       }
-//_debug_array($training);
-                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-
-                       while (is_array($training) && list(,$entry) = 
each($training))
-                       {
-
-                               if($entry['start_date'])
-                               {
-                                       $entry['start_date']    = 
$GLOBALS['phpgw']->common->show_date($entry['start_date'],$dateformat);
-                               }
-                               if($entry['end_date'])
-                               {
-                                       $entry['end_date']      = 
$GLOBALS['phpgw']->common->show_date($entry['end_date'],$dateformat);
-                               }
-
+                       $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','hrm_training_receipt');
+
+                       
$GLOBALS['phpgw']->session->appsession('session_data','hrm_training_receipt','');
+
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('user'));
+
+                       $account = 
CreateObject('phpgwapi.accounts',$user_id,'u');
+                       $account_info = $account->read_repository();
+                       $membership = $account->membership($user_id);
+                       $contacts = CreateObject('phpgwapi.contacts');
+
+                       $qcols = array(
+                               'n_given'    => 'n_given',
+                               'n_family'   => 'n_family',
+                               'tel_work'   => 'tel_work',
+                               'tel_home'   => 'tel_home',
+                               'tel_cell'   => 'tel_cell',
+                               'title'      => 'title',
+                               'email'      => 'email',
+                               'email_home' => 'email_home',
+                       );
+
+                       $fields = 
$contacts->are_users($account_info['person_id'], $qcols);
+
+                       if(!$account_info['person_id'])
+                       {
+                               $sfields = rawurlencode(serialize($fields[0]));
+                               $contact_link   = 
$GLOBALS['phpgw']->link('/index.php',
+                                       array
+                                       (
+                                               'menuaction'    => 
'addressbook.uiaddressbook.add_person',
+                                               'entry'         => $sfields,
+                                       )
+                               );
+                       }
+                       else
+                       {
+                               $contact_link   = 
$GLOBALS['phpgw']->link('/index.php',
+                                       array
+                                       (
+                                               'menuaction'    => 
'addressbook.uiaddressbook.view_person',
+                                               'ab_id'         => 
$fields[0]['contact_id']
+                                       )
+                               );
+                       }
+
+                       $prefs_user = 
$this->bocommon->create_preferences('email',$user_id);
+
+                       if($fields[0]['email'] || $prefs_user['address'])
+                       {
+                               if($prefs_user['address'])
+                               {
+                                       $email_work = $prefs_user['address'];
+                               }
+                               else
+                               {
+                                       $email_work = $fields[0]['email'];
+                               }
+                       }
+
+                       if($fields[0]['email_home'])
+                       {
+                               $email_home = $fields[0]['email_home'];
+                       }
+
+                       $qcols_extra = array(
+                               array('name' =>lang('first name'), 'type' => 
'link', 'link_value' =>$contact_link),
+                               array('name' =>lang('last name'), 'type' => 
'text'),
+                               array('name' =>lang('work phone'), 'type' => 
'text'),
+                               array('name' =>lang('home phone'), 'type' => 
'text'),
+                               array('name' =>lang('cellular phone'), 'type' 
=> 'text'),
+                               array('name' =>lang('title'), 'type' => 'text'),
+                               array('name' =>lang('work email'), 'type' => 
'mail', 'link_value' =>$email_work),
+                               array('name' =>lang('home email'), 'type' => 
'mail', 'link_value' =>$email_home),
+                       );
+
+                       if(is_array($fields))
+                       {
+                               $j=0;
+                               for ($i=0;$i<count($qcols);$i++)
+                               {
+                                       $user_values[$j]['value'] = 
$fields[0][$i];
+                                       $user_values[$j]['name'] = 
$qcols_extra[$i]['name'];
+                                       $user_values[$j]['type'] = 
$qcols_extra[$i]['type'];
+                                       $user_values[$j]['link_value'] = 
$qcols_extra[$i]['link_value'];
+                                       $j++;
+                               }
+                       }
+
+                       if ($user_id)
+                       {
+                               $training = $this->bo->read_training($user_id);
+                       }
+//_debug_array($training);
+
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
+                       while (is_array($training) && list(,$entry) = 
each($training))
+                       {
+                               if($entry['start_date'])
+                               {
+                                       $entry['start_date']    = 
$GLOBALS['phpgw']->common->show_date($entry['start_date'],$dateformat);
+                               }
+                               if($entry['end_date'])
+                               {
+                                       $entry['end_date']      = 
$GLOBALS['phpgw']->common->show_date($entry['end_date'],$dateformat);
+                               }
+
                                
if($this->bocommon->check_perms($this->grants[$user_id], PHPGW_ACL_EDIT))
                                {
                                        $link_edit      = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uiuser.edit&user_id=$user_id&training_id="
 . $entry['training_id']);
@@ -325,450 +318,437 @@
                                        $lang_delete_text       = lang('delete 
training item');
                                }

-                               $content[] = array
-                               (
-                                       'title'                 => 
$entry['title'],
-                                       'place'                 => 
$entry['place'],
-                                       'start_date'            => 
$entry['start_date'],
-                                       'end_date'              => 
$entry['end_date'],
-                                       'link_edit'             => $link_edit,
-                                       'link_view'             => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uiuser.view&user_id=$user_id&training_id="
 . $entry['training_id']),
-                                       'link_delete'           => $link_delete,
-                                       'lang_view_text'        => lang('view 
training item'),
-                                       'lang_edit_text'        => 
$lang_edit_text,
-                                       'lang_delete_text'      => 
$lang_delete_text,
-                                       'text_view'             => lang('view'),
-                                       'text_edit'             => $text_edit,
-                                       'text_delete'           => $text_delete
+                               $content[] = array
+                               (
+                                       'title'                 => 
$entry['title'],
+                                       'place'                 => 
$entry['place'],
+                                       'start_date'            => 
$entry['start_date'],
+                                       'end_date'              => 
$entry['end_date'],
+                                       'link_edit'             => $link_edit,
+                                       'link_view'             => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uiuser.view&user_id=$user_id&training_id="
 . $entry['training_id']),
+                                       'link_delete'           => $link_delete,
+                                       'lang_view_text'        => lang('view 
training item'),
+                                       'lang_edit_text'        => 
$lang_edit_text,
+                                       'lang_delete_text'      => 
$lang_delete_text,
+                                       'text_view'             => lang('view'),
+                                       'text_edit'             => $text_edit,
+                                       'text_delete'           => $text_delete
                                );

-                               unset ($link_edit);
+                               unset ($link_edit);
                                unset ($text_edit);
                                unset ($lang_edit_edit);
                                unset ($link_delete);
                                unset ($text_delete);
                                unset ($lang_delete_text);
-                       }
-
-
-                       $table_header[] = array
-                       (
-
-                               'sort_place'    => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   =>      'hrm_training_place.name',
-                                                                               
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uiuser.training',
-                                                                               
                                'user_id'       =>$user_id,
-                                                                               
                                'query'         =>$this->query,
-                                                                               
                                'cat_id'        =>$this->cat_id,
-                                                                               
                                'allrows'       => $this->allrows)
-                                                                               
)),
-                               'lang_place'    => lang('place'),
-                               'sort_title'    => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   =>      'hrm_training.title',
-                                                                               
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uiuser.training',
-                                                                               
                                'user_id'       =>$user_id,
-                                                                               
                                'query'         =>$this->query,
-                                                                               
                                'cat_id'        =>$this->cat_id,
-                                                                               
                                'allrows' => $this->allrows)
-                                                                               
)),
-                               'lang_title'    => lang('title'),
-                               'lang_start_date'=> lang('start date'),
-                               'lang_end_date' => lang('end date'),
-                               'lang_view'     => lang('view'),
-                               'lang_edit'     => lang('edit'),
-                               'lang_delete'   => lang('delete'),
-                       );
-
-                       $function_msg = lang('list training');
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uiuser.edit',
-                               'user_id'       => $user_id
-                       );
-
+                       }
+
+                       $table_header[] = array
+                       (
+                               'sort_place'    => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'hrm_training_place.name',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uiuser.training',
+                                                                               
                                'user_id'       =>$user_id,
+                                                                               
                                'query'         =>$this->query,
+                                                                               
                                'cat_id'        =>$this->cat_id,
+                                                                               
                                'allrows'       => $this->allrows)
+                                                                               
)),
+                               'lang_place'    => lang('place'),
+                               'sort_title'    => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'hrm_training.title',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uiuser.training',
+                                                                               
                                'user_id'       =>$user_id,
+                                                                               
                                'query'         =>$this->query,
+                                                                               
                                'cat_id'        =>$this->cat_id,
+                                                                               
                                'allrows' => $this->allrows)
+                                                                               
)),
+                               'lang_title'    => lang('title'),
+                               'lang_start_date'=> lang('start date'),
+                               'lang_end_date' => lang('end date'),
+                               'lang_view'     => lang('view'),
+                               'lang_edit'     => lang('edit'),
+                               'lang_delete'   => lang('delete'),
+                       );
+
+                       $function_msg = lang('list training');
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uiuser.edit',
+                               'user_id'       => $user_id
+                       );
+
                        
if($this->bocommon->check_perms($this->grants[$user_id], PHPGW_ACL_ADD))
                        {
                                $add_action     = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiuser.edit&user_id='.$user_id);
                                $lang_add       = lang('add');
                        }
-

-                       $table_add[] = array
-                       (
-                               'lang_add'                      => $lang_add,
-                               'lang_add_training_text'        => lang('add a 
training item'),
-                               'add_action'                    => $add_action,
-                               'lang_done'                     => lang('done'),
-                               'lang_done_training_text'       => lang('back 
to user list'),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiuser.index')
-                       );
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $data = array
-                       (
-                               'table_header_training'                 => 
$table_header,
-                               'values_training'                       => 
$content,
-                               'table_add'                             => 
$table_add,
-                               'user_values'                           => 
$user_values,
-                               'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiuser.index'),
-                               'lang_id'                               => 
lang('training ID'),
-                               'lang_descr'                            => 
lang('Descr'),
-                               'lang_save'                             => 
lang('save'),
-                               'lang_cancel'                           => 
lang('cancel'),
-                               'value_id'                              => 
$user_id,
-                               'lang_id_status_text'                   => 
lang('Enter the training ID'),
-                               'lang_descr_status_text'                => 
lang('Enter a description the training'),
-                               'lang_done_status_text'                 => 
lang('Back to the list'),
-                               'lang_save_status_text'                 => 
lang('Save the training'),
-                               'type_id'                               => 
$training['type_id'],
-                               'value_descr'                           => 
$training['descr'],
-                               'lang_apply'                            => 
lang('apply'),
-                               'lang_apply_status_text'                => 
lang('Apply the values'),
-                       );
-
-                       $appname                                        = 
lang('Training');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('training' => $data));
-               }
-
-               function edit()
-               {
-                       $training_id    = 
get_var('training_id',array('POST','GET'));
-                       $user_id        = 
get_var('user_id',array('POST','GET'));
-                       $values         = get_var('values',array('POST'));
+                       $table_add[] = array
+                       (
+                               'lang_add'                      => $lang_add,
+                               'lang_add_training_text'        => lang('add a 
training item'),
+                               'add_action'                    => $add_action,
+                               'lang_done'                     => lang('done'),
+                               'lang_done_training_text'       => lang('back 
to user list'),
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiuser.index')
+                       );
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'table_header_training'                 => 
$table_header,
+                               'values_training'                       => 
$content,
+                               'table_add'                             => 
$table_add,
+                               'user_values'                           => 
$user_values,
+                               'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiuser.index'),
+                               'lang_id'                               => 
lang('training ID'),
+                               'lang_descr'                            => 
lang('Descr'),
+                               'lang_save'                             => 
lang('save'),
+                               'lang_cancel'                           => 
lang('cancel'),
+                               'value_id'                              => 
$user_id,
+                               'lang_id_status_text'                   => 
lang('Enter the training ID'),
+                               'lang_descr_status_text'                => 
lang('Enter a description the training'),
+                               'lang_done_status_text'                 => 
lang('Back to the list'),
+                               'lang_save_status_text'                 => 
lang('Save the training'),
+                               'type_id'                               => 
$training['type_id'],
+                               'value_descr'                           => 
$training['descr'],
+                               'lang_apply'                            => 
lang('apply'),
+                               'lang_apply_status_text'                => 
lang('Apply the values'),
+                       );
+
+                       $appname                                        = 
lang('Training');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('training' => $data));
+               }
+
+               function edit()
+               {
+                       $training_id    = 
get_var('training_id',array('POST','GET'));
+                       $user_id        = 
get_var('user_id',array('POST','GET'));
+                       $values         = get_var('values',array('POST'));
+
+                       if(!$training_id)                       {
+                               
if(!$this->bcommon->check_perms($this->grants[$user_id], PHPGW_ACL_ADD))
+                               {                                       return;
+                               }                       }
+                       else                    {
+                               
if(!$this->bcommon->check_perms($this->grants[$user_id], PHPGW_ACL_EDIT))
+                               {                                       return;
+                               }
+                       }
+                       $GLOBALS['phpgw']->xlttpl->add_file(array('user'));
+
+                       if (is_array($values))
+                       {
+                               $values['place_id']= 
get_var('place_id',array('POST'));
+                               $values['user_id']= $user_id;
+
+                               if ($values['save'] || $values['apply'])
+                               {
+                                       if(!$values['cat_id'])
+                                       {
+                                               
$receipt['error'][]=array('msg'=>lang('Please select a category !'));
+                                       }
+
+                                       if(!$values['start_date'])
+                                       {
+                                               
$receipt['error'][]=array('msg'=>lang('Please select a start date !'));
+                                       }

-                       if(!$training_id)
+                                       if(!$values['place_id'] && 
!$values['new_place_name'])
+                                       {
+                                                       
$receipt['error'][]=array('msg'=>lang('Please select a place or enter a new 
place !'));
+                                       }
+                                       if($values['place_id']=='new_place')
+                                       {
+                                               
if(!$values['new_place_address'])
+                                               {
+                                                       
$receipt['error'][]=array('msg'=>lang('Please enter an address !'));
+                                               }
+                                               if(!$values['new_place_zip'])
+                                               {
+                                                       
$receipt['error'][]=array('msg'=>lang('Please enter a zip code !'));
+                                               }
+                                               if(!$values['new_place_town'])
+                                               {
+                                                       
$receipt['error'][]=array('msg'=>lang('Please enter a town !'));
+                                               }
+                                       }
+
+                                       if($training_id)
+                                       {
+                                               
$values['training_id']=$training_id;
+                                               $action='edit';
+                                       }
+
+                                       if(!$receipt['error'])
+                                       {
+                                               $receipt = 
$this->bo->save($values,$action);
+                                               $training_id = 
$receipt['training_id'];
+
+                                               if ($values['save'])
+                                               {
+                                                       
$GLOBALS['phpgw']->session->appsession('session_data','hrm_training_receipt',$receipt);
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uiuser.training&user_id='
 . $user_id);
+                                               }
+                                       }
+                               }
+                               else
+                               {
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uiuser.training&user_id='
 . $user_id);
+                               }
+                       }
+
+
+                       if ($training_id)
                        {
-                               
if(!$this->bocommon->check_perms($this->grants[$user_id], PHPGW_ACL_ADD))
+                               if(!$receipt['error'])
                                {
-                                       return;
+                                       $values = 
$this->bo->read_single_training($training_id);
                                }
+                               $function_msg = lang('edit training');
+                               $action='edit';
                        }
                        else
                        {
-                               
if(!$this->bocommon->check_perms($this->grants[$user_id], PHPGW_ACL_EDIT))
-                               {
-                                       return;
-                               }
+                               $function_msg = lang('add training');
+                               $action='add';
                        }

-                       $GLOBALS['phpgw']->xslttpl->add_file(array('user'));
-
-                       if (is_array($values))
-                       {
-                               $values['place_id']= 
get_var('place_id',array('POST'));
-                               $values['user_id']= $user_id;
-
-                               if ($values['save'] || $values['apply'])
-                               {
-                                       if(!$values['cat_id'])
-                                       {
-                                               
$receipt['error'][]=array('msg'=>lang('Please select a category !'));
-                                       }
-
-                                       if(!$values['start_date'])
-                                       {
-                                               
$receipt['error'][]=array('msg'=>lang('Please select a start date !'));
-                                       }
-
-                                       if(!$values['place_id'] && 
!$values['new_place_name'])
-                                       {
-                                                       
$receipt['error'][]=array('msg'=>lang('Please select a place or enter a new 
place !'));
-                                       }
-                                       if($values['place_id']=='new_place')
-                                       {
-                                               
if(!$values['new_place_address'])
-                                               {
-                                                       
$receipt['error'][]=array('msg'=>lang('Please enter an address !'));
-                                               }
-                                               if(!$values['new_place_zip'])
-                                               {
-                                                       
$receipt['error'][]=array('msg'=>lang('Please enter a zip code !'));
-                                               }
-                                               if(!$values['new_place_town'])
-                                               {
-                                                       
$receipt['error'][]=array('msg'=>lang('Please enter a town !'));
-                                               }
-                                       }
-
-                                       if($training_id)
-                                       {
-                                               
$values['training_id']=$training_id;
-                                               $action='edit';
-                                       }
-
-                                       if(!$receipt['error'])
-                                       {
-                                               $receipt = 
$this->bo->save($values,$action);
-                                               $training_id = 
$receipt['training_id'];
-
-                                               if ($values['save'])
-                                               {
-                                                       
$GLOBALS['phpgw']->session->appsession('session_data','hrm_training_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uiuser.training&user_id='
 . $user_id);
-                                               }
-                                       }
-                               }
-                               else
-                               {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uiuser.training&user_id='
 . $user_id);
-                               }
-                       }
-
-
-                       if ($training_id)
-                       {
-                               if(!$receipt['error'])
-                               {
-                                       $values = 
$this->bo->read_single_training($training_id);
-                               }
-                               $function_msg = lang('edit training');
-                               $action='edit';
-                       }
-                       else
-                       {
-                               $function_msg = lang('add training');
-                               $action='add';
-                       }
-
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uiuser.edit',
-                               'training_id'   => $training_id,
-                               'user_id' => $user_id
-                       );
-//_debug_array($link_data);
-
-                       $jscal = CreateObject('phpgwapi.jscalendar');   // 
before phpgw_header() !!!
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $GLOBALS['phpgw_info']['flags']['java_script'] .= "\n"
-                               . '<script language ="javascript">' ."\n"
-                               . 'function modplace(form){' ."\n"
-                               . 'var val = form.place_id.value' ."\n"
-                               . 'if(val == "new_place"){' ."\n"
-                                       . 'document.all.div1.style.display = 
"block"' ."\n"
-                               . '}' ."\n"
-                               . 'else{' ."\n"
-                                       . 'document.all.div1.style.display = 
"none"' ."\n"
-                               . '}' ."\n"
-                               . '}' ."\n"
-                               . "</script>\n";
-
-                       $data = array
-                       (
-                               'value_descr'                           => 
$values['descr'],
-                               'value_title'                           => 
$values['title'],
-                               'value_start_date'                      => 
$values['start_date'],
-                               'value_end_date'                        => 
$values['end_date'],
-                               'value_entry_date'                      => 
$values['entry_date'],
-                               'value_reference'                       => 
$values['reference'],
-                               'value_new_place_name'                  => 
$values['new_place_name'],
-                               'value_new_place_address'               => 
$values['new_place_address'],
-                               'value_new_place_zip'                   => 
$values['new_place_zip'],
-                               'value_new_place_town'                  => 
$values['new_place_town'],
-                               'value_new_place_remark'                => 
$values['new_place_remark'],
-
-                               'date_img'                              => 
$GLOBALS['phpgw']->common->image('phpgwapi','cal'),
-                               'lang_start_date'                       => 
lang('start date'),
-                               'lang_end_date'                         => 
lang('end date'),
-                               'lang_start_date_title'                 => 
lang('select start date'),
-                               'lang_end_date_title'                   => 
lang('select end date'),
-                               'lang_start_date_status_text'           => 
lang('Select the start date for your training'),
-                               'lang_end_date_status_text'             => 
lang('Select the end date for your training'),
-                               'calendar_setup_start'                  => 
"Calendar.setup({inputField  : 'values[start_date]',button : 
'values[start_date]-trigger'});",
-                               'calendar_setup_end'                    => 
"Calendar.setup({inputField  : 'values[end_date]',button : 
'values[end_date]-trigger'});",
-                               'lang_reference'                        => 
lang('reference'),
-
-                               'lang_entry_date'                       => 
lang('Entry date'),
-                               'lang_title'                            => 
lang('Title'),
-                               'lang_title_status_text'                => 
lang('Title of the training item'),
-                               'lang_skill'                            => 
lang('Skill'),
-                               'lang_skill_status_text'                => 
lang('Select your skill'),
-                               'skill_list'                            => 
$this->bocategory->select_category_list('skill_level',$values['skill']),
-                               'lang_no_skill'                         => 
lang('select a skill'),
-
-                               'place_list'                            => 
$this->bo->select_place_list($values['place_id']),
-                               'lang_place'                            => 
lang('place'),
-                               'lang_new_place'                        => 
lang('new place'),
-                               'lang_place_status_text'                => 
lang('Select a place'),
-                               'lang_new_place_status_text'            => 
lang('Enter a new place'),
-                               'lang_no_place'                                 
=> lang('select a place'),
-
-                               'lang_new_place_name'                   => 
lang('name'),
-                               'lang_new_place_address'                => 
lang('address'),
-                               'lang_new_place_zip'                    => 
lang('zip'),
-                               'lang_new_place_town'                   => 
lang('town'),
-                               'lang_new_place_remark'                 => 
lang('remark'),
-
-                               'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'lang_id'                               => 
lang('training ID'),
-                               'lang_descr'                            => 
lang('Descr'),
-                               'lang_save'                             => 
lang('save'),
-                               'lang_cancel'                           => 
lang('cancel'),
-                               'value_id'                              => 
$training_id,
-                               'lang_id_status_text'                   => 
lang('Enter the training ID'),
-                               'lang_descr_status_text'                => 
lang('Enter a description the training'),
-                               'lang_done_status_text'                 => 
lang('Back to the list'),
-                               'lang_save_status_text'                 => 
lang('Save the training'),
-                               'lang_apply'                            => 
lang('apply'),
-                               'lang_apply_status_text'                => 
lang('Apply the values'),
-
-                               'lang_category'                         => 
lang('category'),
-//                             'cat_list'                              => 
$this->bo->select_category_list('select',$values['cat_id']),
-                               'cat_list'                              => 
$this->bocategory->select_category_list('training',$values['cat_id']),
-                               'lang_no_cat'                           => 
lang('no category'),
-                               'lang_cat_status_text'                  => 
lang('Select the category the building belongs to. To do not use a category 
select NO CATEGORY'),
-                               'select_name'                           => 
'values[cat_id]',
-                       );
-
-                       $appname                                        = 
lang('Training');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               }
-
-               function view()
-               {
-                       $training_id            = 
get_var('training_id',array('POST','GET'));
-                       $user_id        = 
get_var('user_id',array('POST','GET'));
-
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uiuser.edit',
+                               'training_id'   => $training_id,
+                               'user_id' => $user_id
+                       );
+//_debug_array($link_data);
+
+                       $jscal = CreateObject('phpgwapi.jscalendar');   // 
before phpgw_header() !!!
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $GLOBALS['phpgw_info']['flags']['java_script'] .= "\n"
+                               . '<script language ="javascript">' ."\n"
+                               . 'function modplace(form){' ."\n"
+                               . 'var val = form.place_id.value' ."\n"
+                               . 'if(val == "new_place"){' ."\n"
+                                       . 'document.all.div1.style.display = 
"block"' ."\n"
+                               . '}' ."\n"
+                               . 'else{' ."\n"
+                                       . 'document.all.div1.style.display = 
"none"' ."\n"
+                               . '}' ."\n"
+                               . '}' ."\n"
+                               . "</script>\n";
+
+                       $data = array
+                       (
+                               'value_descr'                           => 
$values['descr'],
+                               'value_title'                           => 
$values['title'],
+                               'value_start_date'                      => 
$values['start_date'],
+                               'value_end_date'                        => 
$values['end_date'],
+                               'value_entry_date'                      => 
$values['entry_date'],
+                               'value_reference'                       => 
$values['reference'],
+                               'value_new_place_name'                  => 
$values['new_place_name'],
+                               'value_new_place_address'               => 
$values['new_place_address'],
+                               'value_new_place_zip'                   => 
$values['new_place_zip'],
+                               'value_new_place_town'                  => 
$values['new_place_town'],
+                               'value_new_place_remark'                => 
$values['new_place_remark'],
+
+                               'date_img'                              => 
$GLOBALS['phpgw']->common->image('phpgwapi','cal'),
+                               'lang_start_date'                       => 
lang('start date'),
+                               'lang_end_date'                         => 
lang('end date'),
+                               'lang_start_date_title'                 => 
lang('select start date'),
+                               'lang_end_date_title'                   => 
lang('select end date'),
+                               'lang_start_date_status_text'           => 
lang('Select the start date for your training'),
+                               'lang_end_date_status_text'             => 
lang('Select the end date for your training'),
+                               'calendar_setup_start'                  => 
"Calendar.setup({inputField  : 'values[start_date]',button : 
'values[start_date]-trigger'});",
+                               'calendar_setup_end'                    => 
"Calendar.setup({inputField  : 'values[end_date]',button : 
'values[end_date]-trigger'});",
+                               'lang_reference'                        => 
lang('reference'),
+
+                               'lang_entry_date'                       => 
lang('Entry date'),
+                               'lang_title'                            => 
lang('Title'),
+                               'lang_title_status_text'                => 
lang('Title of the training item'),
+                               'lang_skill'                            => 
lang('Skill'),
+                               'lang_skill_status_text'                => 
lang('Select your skill'),
+                               'skill_list'                            => 
$this->bocategory->select_category_list('skill_level',$values['skill']),
+                               'lang_no_skill'                         => 
lang('select a skill'),
+
+                               'place_list'                            => 
$this->bo->select_place_list($values['place_id']),
+                               'lang_place'                            => 
lang('place'),
+                               'lang_new_place'                        => 
lang('new place'),
+                               'lang_place_status_text'                => 
lang('Select a place'),
+                               'lang_new_place_status_text'            => 
lang('Enter a new place'),
+                               'lang_no_place'                                 
=> lang('select a place'),
+
+                               'lang_new_place_name'                   => 
lang('name'),
+                               'lang_new_place_address'                => 
lang('address'),
+                               'lang_new_place_zip'                    => 
lang('zip'),
+                               'lang_new_place_town'                   => 
lang('town'),
+                               'lang_new_place_remark'                 => 
lang('remark'),
+
+                               'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'lang_id'                               => 
lang('training ID'),
+                               'lang_descr'                            => 
lang('Descr'),
+                               'lang_save'                             => 
lang('save'),
+                               'lang_cancel'                           => 
lang('cancel'),
+                               'value_id'                              => 
$training_id,
+                               'lang_id_status_text'                   => 
lang('Enter the training ID'),
+                               'lang_descr_status_text'                => 
lang('Enter a description the training'),
+                               'lang_done_status_text'                 => 
lang('Back to the list'),
+                               'lang_save_status_text'                 => 
lang('Save the training'),
+                               'lang_apply'                            => 
lang('apply'),
+                               'lang_apply_status_text'                => 
lang('Apply the values'),
+
+                               'lang_category'                         => 
lang('category'),
+//                             'cat_list'                              => 
$this->bo->select_category_list('select',$values['cat_id']),
+                               'cat_list'                              => 
$this->bocategory->select_category_list('training',$values['cat_id']),
+                               'lang_no_cat'                           => 
lang('no category'),
+                               'lang_cat_status_text'                  => 
lang('Select the category the building belongs to. To do not use a category 
select NO CATEGORY'),
+                               'select_name'                           => 
'values[cat_id]',
+                       );
+
+                       $appname                                        = 
lang('Training');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
+               }
+
+               function view()
+               {
+                       $training_id            = 
get_var('training_id',array('POST','GET'));
+                       $user_id        = 
get_var('user_id',array('POST','GET'));
+
                        
if(!$this->bocommon->check_perms($this->grants[$user_id], PHPGW_ACL_READ))
+                       {                               unset($training_id);
+                       }
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('user'));
+
+                       if ($training_id)
+                       {
+                               $values = 
$this->bo->read_single_training($training_id);
+                               $function_msg = lang('view training');
+                       }
+                       else
                        {
-                               unset($training_id);
+                               return;
                        }
-
-                       $GLOBALS['phpgw']->xslttpl->add_file(array('user'));
-
-                       if ($training_id)
-                       {
-                               $values = 
$this->bo->read_single_training($training_id);
-                               $function_msg = lang('view training');
-                       }
-                       else
-                       {
-                               return;
-                       }
-
-
-                       $data = array
-                       (
-                               'value_descr'                   => 
$values['descr'],
-                               'value_title'                   => 
$values['title'],
-                               'value_start_date'              => 
$values['start_date'],
-                               'value_end_date'                => 
$values['end_date'],
-                               'value_entry_date'              => 
$values['entry_date'],
-                               'value_reference'               => 
$values['reference'],
-
-                               'lang_start_date'                       => 
lang('start date'),
-                               'lang_end_date'                 => lang('end 
date'),
-                               'lang_start_date_title'                 => 
lang('select start date'),
-                               'lang_end_date_title'                   => 
lang('select end date'),
-                               'lang_start_date_status_text'           => 
lang('Select the start date for your training'),
-                               'lang_end_date_status_text'             => 
lang('Select the end date for your training'),
-                               'calendar_setup_start'                  => 
"Calendar.setup({inputField  : 'values[start_date]',button : 
'values[start_date]-trigger'});",
-                               'calendar_setup_end'                    => 
"Calendar.setup({inputField  : 'values[end_date]',button : 
'values[end_date]-trigger'});",
-                               'lang_reference'                        => 
lang('reference'),
-
-                               'lang_entry_date'                               
=> lang('Entry date'),
-                               'lang_title'                                    
=> lang('Title'),
-                               'lang_title_status_text'                        
=> lang('Title of the training item'),
-                               'lang_skill'                                    
=> lang('Skill'),
-                               'lang_skill_status_text'                        
=> lang('Select your skill'),
-                               'skill_list'                                    
=> $this->bocategory->select_category_list('skill_level',$values['skill']),
-                               'lang_no_skill'                                 
=> lang('select a skill'),
-
-                               'place_list'                                    
=> $this->bo->select_place_list($values['place_id']),
-                               'lang_place'                                    
=> lang('place'),
-                               'lang_new_place'                                
=> lang('new place'),
-                               'lang_place_status_text'                => 
lang('Select a place'),
-                               'lang_new_place_status_text'    => lang('Enter 
a new place'),
-                               'lang_no_place'                                 
=> lang('select a place'),
-
-                               'form_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiuser.training&user_id='
 . $user_id),
-                               'lang_id'                               => 
lang('training ID'),
-                               'lang_descr'                                    
=> lang('Descr'),
-                               'lang_save'                                     
        => lang('save'),
-                               'lang_cancel'                                   
=> lang('cancel'),
-                               'value_id'                              => 
$training_id,
-                               'lang_id_status_text'   => lang('Enter the 
training ID'),
-                               'lang_descr_status_text'                        
=> lang('Enter a description the training'),
-                               'lang_done_status_text'                 => 
lang('Back to the list'),
-                               'lang_save_status_text'                 => 
lang('Save the training'),
-                               'type_id'                               => 
$training['type_id'],
-                               'lang_apply'                                    
=> lang('apply'),
-                               'lang_apply_status_text'                        
=> lang('Apply the values'),
-
-                               'lang_category'                         => 
lang('category'),
-//                             'cat_list'                              => 
$this->bo->select_category_list('select',$values['cat_id']),
-                               'cat_list'                              => 
$this->bocategory->select_category_list('training',$values['cat_id']),
-                               'lang_no_cat'                           => 
lang('no category'),
-                               'lang_cat_status_text'                  => 
lang('Select the category the building belongs to. To do not use a category 
select NO CATEGORY'),
-                               'select_name'                           => 
'values[cat_id]',
-                       );
-
-                       $appname                                        = 
lang('Training');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               }
-
-               function delete()
-               {
-                       $training_id            = 
get_var('training_id',array('POST','GET'));
-                       $user_id        = 
get_var('user_id',array('POST','GET'));
-
+
+
+                       $data = array
+                       (
+                               'value_descr'                   => 
$values['descr'],
+                               'value_title'                   => 
$values['title'],
+                               'value_start_date'              => 
$values['start_date'],
+                               'value_end_date'                => 
$values['end_date'],
+                               'value_entry_date'              => 
$values['entry_date'],
+                               'value_reference'               => 
$values['reference'],
+
+                               'lang_start_date'                       => 
lang('start date'),
+                               'lang_end_date'                 => lang('end 
date'),
+                               'lang_start_date_title'                 => 
lang('select start date'),
+                               'lang_end_date_title'                   => 
lang('select end date'),
+                               'lang_start_date_status_text'           => 
lang('Select the start date for your training'),
+                               'lang_end_date_status_text'             => 
lang('Select the end date for your training'),
+                               'calendar_setup_start'                  => 
"Calendar.setup({inputField  : 'values[start_date]',button : 
'values[start_date]-trigger'});",
+                               'calendar_setup_end'                    => 
"Calendar.setup({inputField  : 'values[end_date]',button : 
'values[end_date]-trigger'});",
+                               'lang_reference'                        => 
lang('reference'),
+
+                               'lang_entry_date'                               
=> lang('Entry date'),
+                               'lang_title'                                    
=> lang('Title'),
+                               'lang_title_status_text'                        
=> lang('Title of the training item'),
+                               'lang_skill'                                    
=> lang('Skill'),
+                               'lang_skill_status_text'                        
=> lang('Select your skill'),
+                               'skill_list'                                    
=> $this->bocategory->select_category_list('skill_level',$values['skill']),
+                               'lang_no_skill'                                 
=> lang('select a skill'),
+
+                               'place_list'                                    
=> $this->bo->select_place_list($values['place_id']),
+                               'lang_place'                                    
=> lang('place'),
+                               'lang_new_place'                                
=> lang('new place'),
+                               'lang_place_status_text'                => 
lang('Select a place'),
+                               'lang_new_place_status_text'    => lang('Enter 
a new place'),
+                               'lang_no_place'                                 
=> lang('select a place'),
+
+                               'form_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiuser.training&user_id='
 . $user_id),
+                               'lang_id'                               => 
lang('training ID'),
+                               'lang_descr'                                    
=> lang('Descr'),
+                               'lang_save'                                     
        => lang('save'),
+                               'lang_cancel'                                   
=> lang('cancel'),
+                               'value_id'                              => 
$training_id,
+                               'lang_id_status_text'   => lang('Enter the 
training ID'),
+                               'lang_descr_status_text'                        
=> lang('Enter a description the training'),
+                               'lang_done_status_text'                 => 
lang('Back to the list'),
+                               'lang_save_status_text'                 => 
lang('Save the training'),
+                               'type_id'                               => 
$training['type_id'],
+                               'lang_apply'                                    
=> lang('apply'),
+                               'lang_apply_status_text'                        
=> lang('Apply the values'),
+
+                               'lang_category'                         => 
lang('category'),
+//                             'cat_list'                              => 
$this->bo->select_category_list('select',$values['cat_id']),
+                               'cat_list'                              => 
$this->bocategory->select_category_list('training',$values['cat_id']),
+                               'lang_no_cat'                           => 
lang('no category'),
+                               'lang_cat_status_text'                  => 
lang('Select the category the building belongs to. To do not use a category 
select NO CATEGORY'),
+                               'select_name'                           => 
'values[cat_id]',
+                       );
+
+                       $appname                                        = 
lang('Training');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
+               }
+
+               function delete()
+               {
+                       $training_id            = 
get_var('training_id',array('POST','GET'));
+                       $user_id        = 
get_var('user_id',array('POST','GET'));
+
                        
if(!$this->bocommon->check_perms($this->grants[$user_id], PHPGW_ACL_DELETE))
                        {
                                return;
                        }
+                       $confirm = get_var('confirm',array('POST'));
+
+                       $link_data = array
+                       (
+                               'menuaction' => 
$this->currentapp.'.uiuser.training',
+                               'user_id' => $user_id
+                       );
+
+                       if (get_var('confirm',array('POST')))
+                       {
+                               
$this->bo->delete_training($user_id,$training_id);
+                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
+                       }
+
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
+
+                       $data = array
+                       (
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiuser.delete&user_id='
 . $user_id .'&training_id='. $training_id),
+                               'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
+                               'lang_yes'                              => 
lang('yes'),
+                               'lang_yes_categorytext' => lang('Delete the 
entry'),
+                               'lang_no_categorytext'  => lang('Back to the 
list'),
+                               'lang_no'                               => 
lang('no')
+                       );
+
+                       $appname                                        = 
lang('Training');
+                       $function_msg                                   = 
lang('delete');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
+               }

-                       $confirm                = 
get_var('confirm',array('POST'));
-
-                       $link_data = array
-                       (
-                               'menuaction' => 
$this->currentapp.'.uiuser.training',
-                               'user_id' => $user_id
-                       );
-
-                       if (get_var('confirm',array('POST')))
-                       {
-                               
$this->bo->delete_training($user_id,$training_id);
-                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
-                       }
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
-
-                       $data = array
-                       (
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiuser.delete&user_id='
 . $user_id .'&training_id='. $training_id),
-                               'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
-                               'lang_yes'                              => 
lang('yes'),
-                               'lang_yes_categorytext' => lang('Delete the 
entry'),
-                               'lang_no_categorytext'  => lang('Back to the 
list'),
-                               'lang_no'                               => 
lang('no')
-                       );
-
-                       $appname                                        = 
lang('Training');
-                       $function_msg                                   = 
lang('delete');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               }
-
        }

====================================================
Index: hrm/inc/hook_admin.inc.php
diff -u hrm/inc/hook_admin.inc.php:1.4 hrm/inc/hook_admin.inc.php:1.5
--- hrm/inc/hook_admin.inc.php:1.4      Tue Nov 29 15:07:58 2005
+++ hrm/inc/hook_admin.inc.php  Wed Nov 30 17:07:22 2005
@@ -1,32 +1,32 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage admin
-       * @version $Id$
-       */
-
-               {
-                       $file = array
-                       (
-       //                      'Configuration' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' 
. $appname),
-                               'Global Categories'     => 
$GLOBALS['phpgw']->link('/index.php',
-                                                               array
-                                                               (
-                                                                       
'menuaction'    => 'admin.uicategories.index',
-                                                                       
'appname'       => 'hrm'
-                                                               ) ),
-
-                               'training category'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=training'),
-                               'skill level'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=skill_level'),
-                               'experience category'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=experience'),
-                               'task category'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=task'),
-                               'Configure Access Permissions'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiadmin.list_acl'),
-                       );
-                       display_section($appname,$appname,$file);
-               }
\ No newline at end of file
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage admin
+       * @version $Id$
+       */
+
+               {
+                       $file = array
+                       (
+       //                      'Configuration' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' 
. $appname),
+                               'Global Categories'     => 
$GLOBALS['phpgw']->link('/index.php',
+                                                               array
+                                                               (
+                                                                       
'menuaction'    => 'admin.uicategories.index',
+                                                                       
'appname'       => 'hrm'
+                                                               ) ),
+
+                               'training category'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=training'),
+                               'skill level'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=skill_level'),
+                               'experience category'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=experience'),
+                               'task category'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=task'),
+                               'Configure Access Permissions'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiadmin.list_acl'),
+                       );
+                       display_section($appname,$appname,$file);
+               }

====================================================
Index: hrm/inc/hook_help.inc.php
diff -u hrm/inc/hook_help.inc.php:1.2 hrm/inc/hook_help.inc.php:1.3
--- hrm/inc/hook_help.inc.php:1.2       Mon Nov 21 20:25:33 2005
+++ hrm/inc/hook_help.inc.php   Wed Nov 30 17:07:22 2005
@@ -1,46 +1,46 @@
-<?php
-       /**
-       * phpGroupWare - HRM: a  human resource competence management system.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package hrm
-       * @subpackage manual
-       * @version $Id$
-       */
-
-
-       /**
-        * Description
-        */
-
-       include(PHPGW_SERVER_ROOT.'/'.'hrm'.'/setup/setup.inc.php');
-
-       $GLOBALS['phpgw']->help->set_params(array('app_name' => 'hrm',
-                                                       'title' => lang('hrm'),
-                                                       'app_version'   => 
$setup_info['hrm']['version']));
-       $GLOBALS['phpgw']->help->data[] = array
-       (
-               'text'                                  => lang('overview'),
-               'link'                                  => 
$GLOBALS['phpgw']->help->check_help_file('overview.php'),
-               'lang_link_statustext'  => lang('overview')
-       );
-
-
-       $GLOBALS['phpgw']->help->data[] = array
-       (
-               'text'                                  => lang('hrm'),
-               'link'                                  => 
$GLOBALS['phpgw']->help->check_help_file('hrm.php'),
-               'lang_link_statustext'  => lang('hrm')
-       );
-
-       $GLOBALS['phpgw']->help->data[] = array
-       (
-               'text'                                  => lang('project'),
-               'link'                                  => 
$GLOBALS['phpgw']->help->check_help_file('project.php'),
-               'lang_link_statustext'  => lang('project')
-       );
-
-       $GLOBALS['phpgw']->help->draw();
+<?php
+       /**
+       * phpGroupWare - HRM: a  human resource competence management system.
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package hrm
+       * @subpackage manual
+       * @version $Id$
+       */
+
+
+       /**
+        * Description
+        */
+
+       include(PHPGW_SERVER_ROOT.'/'.'hrm'.'/setup/setup.inc.php');
+
+       $GLOBALS['phpgw']->help->set_params(array('app_name' => 'hrm',
+                                                       'title' => lang('hrm'),
+                                                       'app_version'   => 
$setup_info['hrm']['version']));
+       $GLOBALS['phpgw']->help->data[] = array
+       (
+               'text'                                  => lang('overview'),
+               'link'                                  => 
$GLOBALS['phpgw']->help->check_help_file('overview.php'),
+               'lang_link_statustext'  => lang('overview')
+       );
+
+
+       $GLOBALS['phpgw']->help->data[] = array
+       (
+               'text'                                  => lang('hrm'),
+               'link'                                  => 
$GLOBALS['phpgw']->help->check_help_file('hrm.php'),
+               'lang_link_statustext'  => lang('hrm')
+       );
+
+       $GLOBALS['phpgw']->help->data[] = array
+       (
+               'text'                                  => lang('project'),
+               'link'                                  => 
$GLOBALS['phpgw']->help->check_help_file('project.php'),
+               'lang_link_statustext'  => lang('project')
+       );
+
+       $GLOBALS['phpgw']->help->draw();

====================================================
Index: hrm/inc/class.acl2.inc.php
diff -u hrm/inc/class.acl2.inc.php:1.3 hrm/inc/class.acl2.inc.php:1.4
--- hrm/inc/class.acl2.inc.php:1.3      Tue Nov 29 20:22:03 2005
+++ hrm/inc/class.acl2.inc.php  Wed Nov 30 17:07:22 2005
@@ -844,4 +844,4 @@

                        return $grants;
                }
-       }
\ No newline at end of file
+       }






reply via email to

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