[20842] update hrm

Sigurd Nes <[email protected]>
Newsgroups gmane.comp.web.phpgroupware.cvs
Message-ID <[email protected]>
Revision: 20842
          http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=20842
Author:   sigurdne
Date:     2009-11-20 10:27:33 +0000 (Fri, 20 Nov 2009)
Log Message:
-----------
update hrm

Modified Paths:
--------------
    people/sigurdne/modules/hrm/trunk/inc/class.bocategory.inc.php
    people/sigurdne/modules/hrm/trunk/inc/class.bocommon.inc.php
    people/sigurdne/modules/hrm/trunk/inc/class.bojob.inc.php
    people/sigurdne/modules/hrm/trunk/inc/class.boplace.inc.php
    people/sigurdne/modules/hrm/trunk/inc/class.bouser.inc.php
    people/sigurdne/modules/hrm/trunk/inc/class.menu.inc.php
    people/sigurdne/modules/hrm/trunk/inc/class.socategory.inc.php
    people/sigurdne/modules/hrm/trunk/inc/class.socommon.inc.php
    people/sigurdne/modules/hrm/trunk/inc/class.sojob.inc.php
    people/sigurdne/modules/hrm/trunk/inc/class.soplace.inc.php
    people/sigurdne/modules/hrm/trunk/inc/class.souser.inc.php
    people/sigurdne/modules/hrm/trunk/inc/class.uicategory.inc.php
    people/sigurdne/modules/hrm/trunk/inc/class.uijob.inc.php
    people/sigurdne/modules/hrm/trunk/inc/class.uiplace.inc.php
    people/sigurdne/modules/hrm/trunk/inc/class.uiuser.inc.php
    people/sigurdne/modules/hrm/trunk/inc/hook_settings.inc.php
    people/sigurdne/modules/hrm/trunk/index.php
    people/sigurdne/modules/hrm/trunk/setup/default_records.inc.php
    people/sigurdne/modules/hrm/trunk/setup/setup.inc.php

Modified: people/sigurdne/modules/hrm/trunk/inc/class.bocategory.inc.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/inc/class.bocategory.inc.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/inc/class.bocategory.inc.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -27,11 +27,11 @@
 
 		var $public_functions = array
 		(
-			'read'				=> True,
-			'read_single'		=> True,
-			'save'				=> True,
-			'delete'			=> True,
-			'check_perms'		=> True
+			'read'				=> true,
+			'read_single'		=> true,
+			'save'				=> true,
+			'delete'			=> true,
+			'check_perms'		=> true
 		);
 
 		var $soap_functions = array(
@@ -53,7 +53,7 @@
 			)
 		);
 
-		function hrm_bocategory($session=False)
+		function hrm_bocategory($session=false)
 		{
 		//	$this->currentapp	= $GLOBALS['phpgw_info']['flags']['currentapp'];
 			$this->so 		= CreateObject('hrm.socategory');
@@ -62,7 +62,7 @@
 			if ($session)
 			{
 				$this->read_sessiondata();
-				$this->use_session = True;
+				$this->use_session = true;
 			}
 
 			$start	= phpgw::get_var('start', 'int', 'REQUEST', 0);

Modified: people/sigurdne/modules/hrm/trunk/inc/class.bocommon.inc.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/inc/class.bocommon.inc.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/inc/class.bocommon.inc.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -29,46 +29,16 @@
 
 		var $public_functions = array
 		(
-			'select_part_of_town'	=> True,
-			'menu'	=> True,
+			'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 hrm_bocommon()
 		{
-//			$GLOBALS['phpgw_info']['flags']['currentapp']	=	'hrm';
-		//	$this->currentapp		= $GLOBALS['phpgw_info']['flags']['currentapp'];
 			$this->socommon			= CreateObject('hrm.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':
@@ -113,7 +83,7 @@
 			{
 				foreach($receipt['error'] as $errors)
 				{
-					$msgbox_data_error += array($errors['msg']=> False);
+					$msgbox_data_error += array($errors['msg']=> false);
 				}
 			}
 
@@ -123,7 +93,7 @@
 			{
 				foreach($receipt['message'] as $messages)
 				{
-					$msgbox_data_message += array($messages['msg']=> True);
+					$msgbox_data_message += array($messages['msg']=> true);
 				}
 			}
 
@@ -179,7 +149,7 @@
 		{
 			if (!$date)
 			{
-				return False;
+				return false;
 			}
 
 			$date_array	= $this->date_array($date);
@@ -188,39 +158,6 @@
 			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))
@@ -250,406 +187,6 @@
 			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('hrm.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('hrm.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();
-		}
-
 		function no_access($links = '')
 		{
 			$GLOBALS['phpgw']->xslttpl->add_file(array('no_access','menu'));
@@ -669,14 +206,4 @@
 			$GLOBALS['phpgw_info']['flags']['app_header'] = lang('hrm') . ' - ' . $appname;
 			$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('no_access' => $data));
 		}
-
-		function new_db()
-		{
-			if ( isset($GLOBALS['phpgw']->db) && is_object($GLOBALS['phpgw']->db) )
-			{
-				return clone($GLOBALS['phpgw']->db);
-			}
-			return $this->socommon->new_db();
-		}
 	}
-?>

Modified: people/sigurdne/modules/hrm/trunk/inc/class.bojob.inc.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/inc/class.bojob.inc.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/inc/class.bojob.inc.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -32,11 +32,11 @@
 
 		var $public_functions = array
 		(
-			'read'			=> True,
-			'read_single'		=> True,
-			'save'			=> True,
-			'delete'		=> True,
-			'check_perms'		=> True
+			'read'			=> true,
+			'read_single'		=> true,
+			'save'			=> true,
+			'delete'		=> true,
+			'check_perms'		=> true
 		);
 
 		var $soap_functions = array(
@@ -58,7 +58,7 @@
 			)
 		);
 
-		public function __construct($session=False)
+		public function __construct($session=false)
 		{
 		//	$this->currentapp	= $GLOBALS['phpgw_info']['flags']['currentapp'];
 			$this->so 		= CreateObject('hrm.sojob');
@@ -67,7 +67,7 @@
 			if ($session)
 			{
 				$this->read_sessiondata();
-				$this->use_session = True;
+				$this->use_session = true;
 			}
 
 			$this->start	= phpgw::get_var('start', 'int');

Modified: people/sigurdne/modules/hrm/trunk/inc/class.boplace.inc.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/inc/class.boplace.inc.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/inc/class.boplace.inc.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -27,11 +27,11 @@
 
 		var $public_functions = array
 		(
-			'read'			=> True,
-			'read_single'		=> True,
-			'save'			=> True,
-			'delete'		=> True,
-			'check_perms'		=> True
+			'read'			=> true,
+			'read_single'		=> true,
+			'save'			=> true,
+			'delete'		=> true,
+			'check_perms'		=> true
 		);
 
 		var $soap_functions = array(
@@ -53,7 +53,7 @@
 			)
 		);
 
-		function hrm_boplace($session=False)
+		function hrm_boplace($session=false)
 		{
 		//	$this->currentapp	= $GLOBALS['phpgw_info']['flags']['currentapp'];
 			$this->so 		= CreateObject('hrm.soplace');
@@ -62,7 +62,7 @@
 			if ($session)
 			{
 				$this->read_sessiondata();
-				$this->use_session = True;
+				$this->use_session = true;
 			}
 
 			$start	= phpgw::get_var('start', 'int', 'REQUEST', 0);

Modified: people/sigurdne/modules/hrm/trunk/inc/class.bouser.inc.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/inc/class.bouser.inc.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/inc/class.bouser.inc.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -29,11 +29,11 @@
 
 		var $public_functions = array
 		(
-			'read'			=> True,
-			'read_single'		=> True,
-			'save'			=> True,
-			'delete'		=> True,
-			'check_perms'		=> True
+			'read'			=> true,
+			'read_single'		=> true,
+			'save'			=> true,
+			'delete'		=> true,
+			'check_perms'		=> true
 		);
 
 		var $soap_functions = array(
@@ -55,7 +55,7 @@
 			)
 		);
 
-		function hrm_bouser($session=False)
+		function hrm_bouser($session=false)
 		{
 		//	$this->currentapp	= $GLOBALS['phpgw_info']['flags']['currentapp'];
 			$this->so 		= CreateObject('hrm.souser');
@@ -65,7 +65,7 @@
 			if ($session)
 			{
 				$this->read_sessiondata();
-				$this->use_session = True;
+				$this->use_session = true;
 			}
 
 			$this->start	= phpgw::get_var('start', 'int', 'REQUEST', 0);
@@ -225,8 +225,9 @@
 
 		function get_user_data($user_id)
 		{
-			$account = CreateObject('phpgwapi.accounts',$user_id,'u');
-			$account_info = $account->read_repository();
+			$account =& $GLOBALS['phpgw']->accounts;
+			$account->set_account($user_id, 'u');
+			$account_info = $account->read();
 			$membership = $account->membership($user_id);
 			$contacts = CreateObject('phpgwapi.contacts');
 
@@ -242,7 +243,7 @@
 				'email_home' => 'email_home',
 			);
 
-			$fields = $contacts->are_users($account_info['person_id'], $qcols);
+			$fields = $contacts->are_users($account_info->person_id, $qcols);
 
 			$this->boaddressbook  = CreateObject('addressbook.boaddressbook');
 			$comms = $this->boaddressbook->get_comm_contact_data($fields[0]['contact_id']);
@@ -255,7 +256,7 @@
 				$fields[0]['email_home'] = $comms[$fields[0]['contact_id']]['home email'];
 			}
 		
-			if(!$account_info['person_id'])
+			if(!$account_info->person_id)
 			{
 				$sfields = rawurlencode(serialize($fields[0]));
 				$contact_link   = $GLOBALS['phpgw']->link('/index.php', 

Modified: people/sigurdne/modules/hrm/trunk/inc/class.menu.inc.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/inc/class.menu.inc.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/inc/class.menu.inc.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -22,7 +22,7 @@
 
 		var $public_functions = array
 		(
-			'links'	=> True,
+			'links'	=> true,
 		);
 
 		function hrm_menu($sub='')

Modified: people/sigurdne/modules/hrm/trunk/inc/class.socategory.inc.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/inc/class.socategory.inc.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/inc/class.socategory.inc.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -20,13 +20,10 @@
 	{
 		public function __construct()
 		{
-		//	$this->currentapp	= 'hrm';
 			$this->account		= $GLOBALS['phpgw_info']['user']['account_id'];
-			$this->bocommon		= CreateObject('hrm.bocommon');
-			$this->db			= $this->bocommon->new_db();
-
-			$this->join			=& $this->bocommon->join;
-			$this->like			=& $this->bocommon->like;
+			$this->db 			= & $GLOBALS['phpgw']->db;
+			$this->like 		= & $this->db->like;
+			$this->join 		= & $this->db->join;
 		}
 
 		function read($data)
@@ -67,8 +64,7 @@
 
 			if($query)
 			{
-				$query = preg_replace("/'/",'',$query);
-				$query = preg_replace('/"/','',$query);
+				$query = $this->db->db_addslashes($query);
 
 				$querymethod = " where id $this->like '%$query%' or descr $this->like '%$query%'";
 			}

Modified: people/sigurdne/modules/hrm/trunk/inc/class.socommon.inc.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/inc/class.socommon.inc.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/inc/class.socommon.inc.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -46,22 +46,6 @@
 			$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 );
@@ -70,37 +54,4 @@
 				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";
-		}
-
-		function new_db()
-		{
-			$db = CreateObject('phpgwapi.db');
-			$db->Host = $GLOBALS['phpgw_info']['server']['db_host'];
-			$db->Type = $GLOBALS['phpgw_info']['server']['db_type'];
-			$db->Database = $GLOBALS['phpgw_info']['server']['db_name'];
-			$db->User = $GLOBALS['phpgw_info']['server']['db_user'];
-			$db->Password = $GLOBALS['phpgw_info']['server']['db_pass'];
-			return $db;
-		}
-
 	}

Modified: people/sigurdne/modules/hrm/trunk/inc/class.sojob.inc.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/inc/class.sojob.inc.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/inc/class.sojob.inc.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -26,15 +26,11 @@
 
 		public function __construct()
 		{
-		//	$this->currentapp	= $GLOBALS['phpgw_info']['flags']['currentapp'];
 			$this->account	= $GLOBALS['phpgw_info']['user']['account_id'];
-			$this->bocommon		= CreateObject('hrm.bocommon');
-			$this->db           	= $this->bocommon->new_db();
-			$this->db2           	= $this->bocommon->new_db();
-
-			$this->left_join		= $this->bocommon->left_join;
-			$this->join			= $this->bocommon->join;
-			$this->like			= $this->bocommon->like;
+			$this->db 			= & $GLOBALS['phpgw']->db;
+			$this->like 		= & $this->db->like;
+			$this->join 		= & $this->db->join;
+			$this->left_join	= & $this->db->left_join;
 		}
 
 		function read($data)
@@ -434,8 +430,8 @@
 
 			$sql = "SELECT * FROM $table $filtermethod $querymethod";
 
-			$this->db2->query($sql,__LINE__,__FILE__);
-			$this->total_records = $this->db2->num_rows();
+			$this->db->query($sql,__LINE__,__FILE__);
+			$this->total_records = $this->db->num_rows();
 
 			if(!$allrows)
 			{
@@ -612,7 +608,7 @@
 				$this->account
 				);
 
-			$insert_values	= $this->bocommon->validate_db_insert($insert_values);
+			$insert_values	= $this->db->validate_insert($insert_values);
 
 
 			$this->db->query("INSERT INTO $table (name,descr,job_parent,job_level,entry_date,owner) "
@@ -672,7 +668,7 @@
 			$value_set['job_parent']		= intval($values['parent_id']);
 			$value_set['job_level']		= $level;
 
-			$value_set	= $this->bocommon->validate_db_update($value_set);
+			$value_set	= $this->db->validate_update($value_set);
 
 			$this->db->query("UPDATE $table set $value_set WHERE id=" . $values['id'],__LINE__,__FILE__);
 
@@ -850,7 +846,7 @@
 				$value_sort
 				);
 
-			$insert_values	= $this->bocommon->validate_db_insert($insert_values);
+			$insert_values	= $this->db->validate_insert($insert_values);
 
 
 			$this->db->query("INSERT INTO $table (job_id,name,descr,task_parent,task_level,entry_date,owner,value_sort) "
@@ -911,7 +907,7 @@
 			$value_set['task_parent']		= intval($values['parent_id']);
 			$value_set['task_level']		= $level;
 
-			$value_set	= $this->bocommon->validate_db_update($value_set);
+			$value_set	= $this->db->validate_update($value_set);
 
 			$this->db->query("UPDATE $table set $value_set WHERE id=" . $values['id'],__LINE__,__FILE__);
 
@@ -1035,7 +1031,7 @@
 			$values['descr'] = $this->db->db_addslashes($values['descr']);
 			$values['name'] = $this->db->db_addslashes($values['name']);
 
-			$values['quali_type_id'] = $this->bocommon->next_id('phpgw_hrm_quali_type');
+			$values['quali_type_id'] = $this->db->next_id('phpgw_hrm_quali_type');
 
 			$insert_values=array(
 				$values['quali_type_id'],
@@ -1045,7 +1041,7 @@
 				$this->account
 				);
 
-			$insert_values	= $this->bocommon->validate_db_insert($insert_values);
+			$insert_values	= $this->db->validate_insert($insert_values);
 			$this->db->query("INSERT INTO phpgw_hrm_quali_type (id,name,descr,entry_date,type_owner) "
 				. "VALUES ($insert_values)",__LINE__,__FILE__);
 
@@ -1063,7 +1059,7 @@
 			$value_set['descr'] = $this->db->db_addslashes($values['descr']);
 			$value_set['name'] = $this->db->db_addslashes($values['name']);
 
-			$value_set	= $this->bocommon->validate_db_update($value_set);
+			$value_set	= $this->db->validate_update($value_set);
 
 			$this->db->query("UPDATE phpgw_hrm_quali_type set $value_set WHERE id=" . $values['quali_type_id'],__LINE__,__FILE__);
 
@@ -1085,11 +1081,11 @@
 			 {
 			 	if ($values['name'] == stripslashes($this->db->f('name')) && $values['descr'] == stripslashes($this->db->f('descr')))
 			 	{
-			 		return True;
+			 		return true;
 			 	}
 			 }
 
-			 return False;
+			 return false;
 		}
 
 		function add_qualification($values)
@@ -1114,7 +1110,7 @@
 				$value_sort
 				);
 
-			$insert_values	= $this->bocommon->validate_db_insert($insert_values);
+			$insert_values	= $this->db->validate_insert($insert_values);
 
 			$this->db->query("INSERT INTO phpgw_hrm_quali (job_id,quali_type_id,category,skill_id,experience_id,entry_date,quali_owner,remark,value_sort) "
 				. "VALUES ($insert_values)",__LINE__,__FILE__);
@@ -1154,7 +1150,7 @@
 			$value_set['experience_id']		= $values['experience_id'];
 			$value_set['remark'] 			= $this->db->db_addslashes($values['remark']);
 
-			$value_set	= $this->bocommon->validate_db_update($value_set);
+			$value_set	= $this->db->validate_update($value_set);
 
 			$table='phpgw_hrm_quali';
 

Modified: people/sigurdne/modules/hrm/trunk/inc/class.soplace.inc.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/inc/class.soplace.inc.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/inc/class.soplace.inc.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -18,23 +18,16 @@
 
 	class hrm_soplace
 	{
-		var $grants;
 		var $db;
-		var $db2;
 		var $account;
 
 		function hrm_soplace()
 		{
-		//	$this->currentapp	= $GLOBALS['phpgw_info']['flags']['currentapp'];
 			$this->account	= $GLOBALS['phpgw_info']['user']['account_id'];
-			$this->bocommon		= CreateObject('hrm.bocommon');
-			$this->db           	= $this->bocommon->new_db();
-			$this->db2           	= $this->bocommon->new_db();
-
-			$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;
+			$this->db 			= & $GLOBALS['phpgw']->db;
+			$this->like 		= & $this->db->like;
+			$this->join 		= & $this->db->join;
+			$this->left_join	= & $this->db->left_join;
 		}
 
 		function read($data)
@@ -77,8 +70,8 @@
 
 			$sql = "SELECT * FROM $table $querymethod";
 
-			$this->db2->query($sql,__LINE__,__FILE__);
-			$this->total_records = $this->db2->num_rows();
+			$this->db->query($sql,__LINE__,__FILE__);
+			$this->total_records = $this->db->num_rows();
 
 			if(!$allrows)
 			{
@@ -152,7 +145,7 @@
 			$values['address'] = $this->db->db_addslashes($values['address']);
 			$values['town'] = $this->db->db_addslashes($values['town']);
 			$values['remark'] = $this->db->db_addslashes($values['remark']);
-			$values['place_id'] = $this->bocommon->next_id('phpgw_hrm_training_place');
+			$values['place_id'] = $this->db->next_id('phpgw_hrm_training_place');
 
 			$insert_values=array(
 				$values['place_id'],
@@ -163,7 +156,7 @@
 				$values['remark'],
 				);
 
-			$insert_values	= $this->bocommon->validate_db_insert($insert_values);
+			$insert_values	= $this->db->validate_insert($insert_values);
 			$this->db->query("INSERT INTO phpgw_hrm_training_place (id,name,address,zip,town, remark) "
 				. "VALUES ($insert_values)",__LINE__,__FILE__);
 
@@ -185,7 +178,7 @@
 			$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);
+			$value_set	= $this->db->validate_update($value_set);
 
 
 			$this->db->query("UPDATE phpgw_hrm_training_place set $value_set WHERE id=" . $values['place_id'],__LINE__,__FILE__);

Modified: people/sigurdne/modules/hrm/trunk/inc/class.souser.inc.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/inc/class.souser.inc.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/inc/class.souser.inc.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -24,16 +24,12 @@
 
 		public function __construct()
 		{
-		//	$this->currentapp	= $GLOBALS['phpgw_info']['flags']['currentapp'];
 			$this->account		= $GLOBALS['phpgw_info']['user']['account_id'];
-			$this->bocommon	= CreateObject('hrm.bocommon');
-			$this->db           	= $this->bocommon->new_db();
-
-			$this->acl		= CreateObject('phpgwapi.acl');
-			$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;
+			$this->db 			= & $GLOBALS['phpgw']->db;
+			$this->like 		= & $this->db->like;
+			$this->join 		= & $this->db->join;
+			$this->left_join	= & $this->db->left_join;
+			$this->grants		= $GLOBALS['phpgw']->acl->get_grants('hrm','.user');
 		}
 
 		function read($data)
@@ -47,20 +43,22 @@
 				$allrows	= isset($data['allrows']) && $data['allrows'] ? $data['allrows'] : false;
 			}
 
-			if ( !isset($GLOBALS['phpgw']->accounts) || !is_object($GLOBALS['phpgw']->accounts) )
-			{
-				$GLOBALS['phpgw']->accounts = createObject('phpgwapi.accounts');
-			}
 			$accounts =& $GLOBALS['phpgw']->accounts;
 			
-			$account_info = $accounts->get_list('accounts', $start, $sort, $order, $query);
+			$list = $accounts->get_list('accounts', $start, $sort, $order, $query);
 			$this->total_records = $accounts->total;
 
-			foreach ( $account_info as &$account )
+			$account_info = array();
+			foreach ( $list as $entry )
 			{
-				$account['grants'] = isset($this->grants[$account['account_id']]) ? $this->grants[$account['account_id']] : 0;
+				$account_info[] = array
+				(
+					'grants'			=> isset($this->grants[$entry->id]) ? $this->grants[$entry->id] : 0,
+					'account_firstname'	=> $entry->firstname,
+					'account_lastname'	=> $entry->lastname,
+					'account_id'		=> $entry->id
+				);
 			}
-
 			return $account_info;
 		}
 
@@ -155,7 +153,7 @@
 			$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('phpgw_hrm_training_place');
+			$values['place_id'] = $this->db->next_id('phpgw_hrm_training_place');
 
 			$insert_values=array(
 				$values['place_id'],
@@ -166,7 +164,7 @@
 				$values['new_place_remark'],
 				);
 
-			$insert_values	= $this->bocommon->validate_db_insert($insert_values);
+			$insert_values	= $this->db->validate_insert($insert_values);
 			$this->db->query("INSERT INTO phpgw_hrm_training_place (id,name,address,zip,town, remark) "
 				. "VALUES ($insert_values)",__LINE__,__FILE__);
 
@@ -185,7 +183,7 @@
 				$values['place_id'] = $this->add_place($values);
 			}
 
-			$training_id = $this->bocommon->next_id('phpgw_hrm_training');
+			$training_id = $this->db->next_id('phpgw_hrm_training');
 
 			$insert_values=array(
 				$training_id,
@@ -202,7 +200,7 @@
 				$this->account
 				);
 
-			$insert_values	= $this->bocommon->validate_db_insert($insert_values);
+			$insert_values	= $this->db->validate_insert($insert_values);
 
 			$this->db->query("INSERT INTO phpgw_hrm_training (id,user_id,category,title,start_date,end_date,reference,skill,place_id,descr,entry_date,owner) "
 				. "VALUES ($insert_values)",__LINE__,__FILE__);
@@ -233,7 +231,7 @@
 			$value_set['skill']			= $values['skill'];
 			$value_set['place_id']		= $values['place_id'];
 
-			$value_set	= $this->bocommon->validate_db_update($value_set);
+			$value_set	= $this->db->validate_update($value_set);
 
 			$table='phpgw_hrm_training';
 

Modified: people/sigurdne/modules/hrm/trunk/inc/class.uicategory.inc.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/inc/class.uicategory.inc.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/inc/class.uicategory.inc.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -28,15 +28,15 @@
 
 		var $public_functions = array
 		(
-			'index'  => True,
-			'view'   => True,
-			'edit'   => True,
-			'delete' => True
+			'index'  => true,
+			'view'   => true,
+			'edit'   => true,
+			'delete' => true
 		);
 
 		function hrm_uicategory()
 		{
-			$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+			$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'];
@@ -137,7 +137,7 @@
 
 			$data = array
 			(
-				'allow_allrows'					=> True,
+				'allow_allrows'					=> true,
 				'allrows'					=> $this->allrows,
 				'start_record'					=> $this->start,
 				'record_limit'					=> $record_limit,

Modified: people/sigurdne/modules/hrm/trunk/inc/class.uijob.inc.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/inc/class.uijob.inc.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/inc/class.uijob.inc.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -38,28 +38,28 @@
 
 		var $public_functions = array
 		(
-			'index'  			=> True,
-			'view_qualification'		=> True,
-			'view_job'   			=> True,
-			'edit_job'			=> True,
-			'delete_job'			=> True,
-			'reset_job_type_hierarchy'	=> True,
-			'edit_qualification'		=> True,
-			'delete_qualification'		=> True,
-			'qualification'			=> True,
-			'task'				=> True,
-			'edit_task'			=> True,
-			'view_task'			=> True,
-			'delete_task'			=> True,
-			'lookup_qualification'		=> True,
-			'edit_qualification_type'	=> True,
-			'hierarchy'			=> True,
-			'print_pdf'			=> True
+			'index'  			=> true,
+			'view_qualification'		=> true,
+			'view_job'   			=> true,
+			'edit_job'			=> true,
+			'delete_job'			=> true,
+			'reset_job_type_hierarchy'	=> true,
+			'edit_qualification'		=> true,
+			'delete_qualification'		=> true,
+			'qualification'			=> true,
+			'task'				=> true,
+			'edit_task'			=> true,
+			'view_task'			=> true,
+			'delete_task'			=> true,
+			'lookup_qualification'		=> true,
+			'edit_qualification_type'	=> true,
+			'hierarchy'			=> true,
+			'print_pdf'			=> true
 		);
 
 		public function __construct()
 		{
-			$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+			$GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
 		//	$this->currentapp			= 'hrm';
 			$this->nextmatchs			= CreateObject('phpgwapi.nextmatchs');
 			$this->account				= $GLOBALS['phpgw_info']['user']['account_id'];
@@ -93,7 +93,7 @@
 		function index()
 		{
 
-			if(!$this->acl->check('.job', PHPGW_ACL_READ))
+			if(!$this->acl->check('.job', PHPGW_ACL_READ, 'hrm'))
 			{
 				$this->bocommon->no_access();
 				return;
@@ -101,10 +101,6 @@
 
 			$GLOBALS['phpgw_info']['flags']['menu_selection'] .= '::job_type';
 
-			if ( !isset($GLOBALS['phpgw']->js) || !is_object($GLOBALS['phpgw']->js) )
-			{
-				$GLOBALS['phpgw']->js = createObject('phpgwapi.javascript');
-			}
 			$GLOBALS['phpgw']->js->validate_file('base', 'check', 'hrm');
 
 			$GLOBALS['phpgw']->xslttpl->add_file(array('job','nextmatchs','menu',
@@ -219,7 +215,7 @@
 			(
 				'msgbox_data'					=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
 				'menu'							=> execMethod('hrm.menu.links'),
-				'allow_allrows'					=> True,
+				'allow_allrows'					=> true,
 				'allrows'						=> $this->allrows,
 				'start_record'					=> $this->start,
 				'record_limit'					=> $record_limit,
@@ -250,14 +246,15 @@
 
 		function print_pdf()
 		{
-			if(!$this->acl->check('.job', PHPGW_ACL_READ))
+			if(!$this->acl->check('.job', PHPGW_ACL_READ, 'hrm'))
 			{
 				$this->bocommon->no_access();
 				return;
 			}
-			$GLOBALS['phpgw_info']['flags'][noheader] = True;
-			$GLOBALS['phpgw_info']['flags'][nofooter] = True;
-			$GLOBALS['phpgw_info']['flags']['xslt_app'] = False;
+
+			$GLOBALS['phpgw_info']['flags']['noheader'] = true;
+			$GLOBALS['phpgw_info']['flags']['nofooter'] = true;
+			$GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
 			
 			$pdf	= CreateObject('phpgwapi.pdf');
 			$dateformat = $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
@@ -350,7 +347,7 @@
 
 		function qualification()
 		{
-			if(!$this->acl->check('.job', PHPGW_ACL_READ))
+			if(!$this->acl->check('.job', PHPGW_ACL_READ, 'hrm'))
 			{
 				$this->bocommon->no_access();
 				return;
@@ -503,7 +500,7 @@
 
 		function task()
 		{
-			if(!$this->acl->check('.job', PHPGW_ACL_READ))
+			if(!$this->acl->check('.job', PHPGW_ACL_READ, 'hrm'))
 			{
 				$this->bocommon->no_access();
 				return;
@@ -658,7 +655,7 @@
 
 			if(!$id)
 			{
-				if(!$this->acl->check('.job', PHPGW_ACL_ADD))
+				if(!$this->acl->check('.job', PHPGW_ACL_ADD, 'hrm'))
 				{
 					$this->bocommon->no_access();
 					return;
@@ -666,7 +663,7 @@
 			}
 			else
 			{
-				if(!$this->acl->check('.job', PHPGW_ACL_EDIT))
+				if(!$this->acl->check('.job', PHPGW_ACL_EDIT, 'hrm'))
 				{
 					$this->bocommon->no_access();
 					return;
@@ -780,7 +777,7 @@
 			$job_id		= phpgw::get_var('job_id', 'int');
 			$parent_id	= phpgw::get_var('parent_id', 'int');
 
-			if(!$this->acl->check('.job', PHPGW_ACL_READ))
+			if(!$this->acl->check('.job', PHPGW_ACL_READ, 'hrm'))
 			{
 				$this->bocommon->no_access();
 				return;
@@ -843,7 +840,7 @@
 
 		function lookup_qualification()
 		{
-			if(!$this->acl->check('.job', PHPGW_ACL_ADD))
+			if(!$this->acl->check('.job', PHPGW_ACL_ADD, 'hrm'))
 			{
 				$this->bocommon->no_access();
 				return;
@@ -851,7 +848,7 @@
 
 			$GLOBALS['phpgw_info']['flags']['menu_selection'] .= '::job_type';
 
-			$GLOBALS['phpgw_info']['flags']['noframework'] = True;
+			$GLOBALS['phpgw_info']['flags']['noframework'] = true;
 			$GLOBALS['phpgw_info']['flags']['headonly']=true;
 
 			$receipt = $GLOBALS['phpgw']->session->appsession('session_data','hrm_quali_tp_receipt');
@@ -863,7 +860,7 @@
 
 			$dateformat = $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
 
-			if($this->acl->check('.job', PHPGW_ACL_EDIT))
+			if($this->acl->check('.job', PHPGW_ACL_EDIT, 'hrm'))
 			{
 				$allowed_edit = true;
 			}
@@ -966,7 +963,7 @@
 
 			$data = array
 			(
-				'allow_allrows'					=> True,
+				'allow_allrows'					=> true,
 				'allrows'					=> $this->allrows,
 				'start_record'					=> $this->start,
 				'record_limit'					=> $record_limit,
@@ -1017,7 +1014,7 @@
 
 		function edit_qualification_type()
 		{
-			$GLOBALS['phpgw_info']['flags']['noframework'] = True;
+			$GLOBALS['phpgw_info']['flags']['noframework'] = true;
 			$GLOBALS['phpgw_info']['flags']['headonly']=true;
 
 			$quali_type_id	= phpgw::get_var('quali_type_id', 'int');
@@ -1123,7 +1120,7 @@
 
 			if(!$id)
 			{
-				if(!$this->acl->check('.job', PHPGW_ACL_ADD))
+				if(!$this->acl->check('.job', PHPGW_ACL_ADD, 'hrm'))
 				{
 					$this->bocommon->no_access();
 					return;
@@ -1131,7 +1128,7 @@
 			}
 			else
 			{
-				if(!$this->acl->check('.job', PHPGW_ACL_EDIT))
+				if(!$this->acl->check('.job', PHPGW_ACL_EDIT, 'hrm'))
 				{
 					$this->bocommon->no_access();
 					return;
@@ -1248,7 +1245,7 @@
 			$id		= phpgw::get_var('id', 'int');
 			$parent_id	= phpgw::get_var('parent_id', 'int');
 
-			if(!$this->acl->check('.job', PHPGW_ACL_READ))
+			if(!$this->acl->check('.job', PHPGW_ACL_READ, 'hrm'))
 			{
 				$this->bocommon->no_access();
 				return;
@@ -1321,7 +1318,7 @@
 
 			if(!$quali_id)
 			{
-				if(!$this->acl->check('.job', PHPGW_ACL_ADD))
+				if(!$this->acl->check('.job', PHPGW_ACL_ADD, 'hrm'))
 				{
 					$this->bocommon->no_access();
 					return;
@@ -1329,7 +1326,7 @@
 			}
 			else
 			{
-				if(!$this->acl->check('.job', PHPGW_ACL_EDIT))
+				if(!$this->acl->check('.job', PHPGW_ACL_EDIT, 'hrm'))
 				{
 					$this->bocommon->no_access();
 					return;
@@ -1485,7 +1482,7 @@
 			$quali_id	= phpgw::get_var('quali_id', 'int');
 			$job_id	= phpgw::get_var('job_id', 'int');
 
-			if(!$this->acl->check('.job', PHPGW_ACL_READ))
+			if(!$this->acl->check('.job', PHPGW_ACL_READ, 'hrm'))
 			{
 				$this->bocommon->no_access();
 				return;
@@ -1556,7 +1553,7 @@
 
 		function delete_job()
 		{
-			if(!$this->acl->check('.job', PHPGW_ACL_DELETE))
+			if(!$this->acl->check('.job', PHPGW_ACL_DELETE, 'hrm'))
 			{
 				$this->bocommon->no_access();
 				return;
@@ -1599,7 +1596,7 @@
 
 		function delete_task()
 		{
-			if(!$this->acl->check('.job', PHPGW_ACL_DELETE))
+			if(!$this->acl->check('.job', PHPGW_ACL_DELETE, 'hrm'))
 			{
 				$this->bocommon->no_access();
 				return;
@@ -1645,7 +1642,7 @@
 
 		function delete_qualification()
 		{
-			if(!$this->acl->check('.job', PHPGW_ACL_DELETE))
+			if(!$this->acl->check('.job', PHPGW_ACL_DELETE, 'hrm'))
 			{
 				$this->bocommon->no_access();
 				return;
@@ -1691,7 +1688,7 @@
 
 		function reset_job_type_hierarchy()
 		{
-			if(!$this->acl->check('.job', PHPGW_ACL_DELETE))
+			if(!$this->acl->check('.job', PHPGW_ACL_DELETE, 'hrm'))
 			{
 				$this->bocommon->no_access();
 				return;

Modified: people/sigurdne/modules/hrm/trunk/inc/class.uiplace.inc.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/inc/class.uiplace.inc.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/inc/class.uiplace.inc.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -28,16 +28,16 @@
 
 		var $public_functions = array
 		(
-			'index'  => True,
-			'view'   => True,
-			'training'=> True,
-			'edit'   => True,
-			'delete' => True
+			'index'  => true,
+			'view'   => true,
+			'training'=> true,
+			'edit'   => true,
+			'delete' => true
 		);
 
 		function hrm_uiplace()
 		{
-			$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+			$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'];
@@ -141,7 +141,7 @@
 			(
 				'msgbox_data'					=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
 				'menu'							=> execMethod('hrm.menu.links'),
-				'allow_allrows'					=> True,
+				'allow_allrows'					=> true,
 				'allrows'					=> $this->allrows,
 				'start_record'					=> $this->start,
 				'record_limit'					=> $record_limit,

Modified: people/sigurdne/modules/hrm/trunk/inc/class.uiuser.inc.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/inc/class.uiuser.inc.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/inc/class.uiuser.inc.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -41,7 +41,7 @@
 			$GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
 			$this->nextmatchs			= CreateObject('phpgwapi.nextmatchs');
 			$this->account				= $GLOBALS['phpgw_info']['user']['account_id'];
-			$this->bo					= CreateObject('hrm.bouser',False);
+			$this->bo					= CreateObject('hrm.bouser',false);
 			$this->bocommon				= CreateObject('hrm.bocommon');
 			$this->bocategory			= CreateObject('hrm.bocategory');
 			$this->grants 				= $this->bo->grants;
@@ -154,7 +154,7 @@
 			$data = array
 			(
 				'menu'								=> execMethod('hrm.menu.links'),
-				'allow_allrows'						=> True,
+				'allow_allrows'						=> true,
 				'allrows'							=> $this->allrows,
 				'start_record'						=> $this->start,
 				'record_limit'						=> $record_limit,

Modified: people/sigurdne/modules/hrm/trunk/inc/hook_settings.inc.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/inc/hook_settings.inc.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/inc/hook_settings.inc.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -11,6 +11,4 @@
  	* @version $Id$
 	*/
 
-	$this->currentapp			= $GLOBALS['phpgw_info']['flags']['currentapp'];
-
 	create_select_box('show horisontal menues','horisontal_menus',array('no' => 'No','yes' => 'Yes'),'Horisontal menues are shown in top of page');

Modified: people/sigurdne/modules/hrm/trunk/index.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/index.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/index.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -21,8 +21,8 @@
 
 
 	$GLOBALS['phpgw_info']['flags'] = array(
-		'noheader'   	=> True,
-		'nonavbar'   	=> True,
+		'noheader'   	=> true,
+		'nonavbar'   	=> true,
 		'currentapp'	=> $currentapp
 		);
 
@@ -40,4 +40,4 @@
 	}
 
 	$GLOBALS['phpgw']->redirect_link('/index.php',$start_page);
-?>
+

Modified: people/sigurdne/modules/hrm/trunk/setup/default_records.inc.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/setup/default_records.inc.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/setup/default_records.inc.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -17,9 +17,14 @@
 	 * @package hrm
 	 */
 
-	$GLOBALS['phpgw_setup']->oProc->query("DELETE FROM phpgw_acl_location where appname = 'hrm'");
-	$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location (appname,id, descr) VALUES ('hrm', '.', 'Top')");
-	$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location (appname,id, descr, allow_grant) VALUES ('hrm', '.user', 'User',1)");
-	$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location (appname,id, descr) VALUES ('hrm', '.job', 'Job description')");
+//	$app_id = $GLOBALS['phpgw']->applications->name2id('hrm');
+	$GLOBALS['phpgw_setup']->oProc->query("SELECT app_id FROM phpgw_applications WHERE app_name = 'hrm'");
+	$GLOBALS['phpgw_setup']->oProc->next_record();
+	$app_id = $GLOBALS['phpgw_setup']->oProc->f('app_id');
 
+	$GLOBALS['phpgw_setup']->oProc->query("DELETE FROM phpgw_locations where app_id = {$app_id} AND name != 'run'");
+	$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_locations (app_id, name, descr) VALUES ({$app_id}, '.', 'Top')");
+	$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_locations (app_id, name, descr, allow_grant) VALUES ({$app_id}, '.user', 'User',1)");
+	$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_locations (app_id, name, descr) VALUES ({$app_id}, '.job', 'Job description')");
 
+

Modified: people/sigurdne/modules/hrm/trunk/setup/setup.inc.php
===================================================================
--- people/sigurdne/modules/hrm/trunk/setup/setup.inc.php	2009-11-20 10:27:27 UTC (rev 20841)
+++ people/sigurdne/modules/hrm/trunk/setup/setup.inc.php	2009-11-20 10:27:33 UTC (rev 20842)
@@ -12,14 +12,13 @@
 	*/
 
 	$setup_info['hrm']['name']      = 'hrm';
-	$setup_info['hrm']['title']     = 'Human resource management';
 	$setup_info['hrm']['version']   = '0.9.17.005';
 	$setup_info['hrm']['app_order'] = 20;
 	$setup_info['hrm']['enable']    = 1;
 	$setup_info['hrm']['globals_checked']    = True;
 	$setup_info['hrm']['app_group']	= 'office';
 
-	$setup_info['hrm']['author'][] = array
+	$setup_info['hrm']['author'] = array
 	(
 		'name'	=> 'Sigurd Nes',
 		'email'	=> '[email protected]'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.