[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] hrm inc/class.bojob.inc.php inc/class.socategor...
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] hrm inc/class.bojob.inc.php inc/class.socategor... |
Date: |
Fri, 21 Apr 2006 12:57:28 +0000 |
CVSROOT: /sources/phpgroupware
Module name: hrm
Branch:
Changes by: Sigurd Nes <address@hidden> 06/04/21 12:57:27
Modified files:
inc : class.bojob.inc.php class.socategory.inc.php
class.sojob.inc.php class.uijob.inc.php
hook_admin.inc.php
setup : phpgw_no.lang setup.inc.php
tables_current.inc.php tables_update.inc.php
templates/base : job.xsl
Removed files:
templates/default: admin.xsl app_data.xsl app_delete.xsl
cat_filter.xsl cat_select.xsl category.xsl
filter_filter.xsl filter_location.xsl
filter_select.xsl group_filter.xsl job.xsl
menu.xsl nextmatchs.xsl no_access.xsl
place.xsl search_field.xsl user.xsl
Log message:
splitting qualifications and tasks
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/hrm/inc/class.bojob.inc.php.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/hrm/inc/class.socategory.inc.php.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/hrm/inc/class.sojob.inc.php.diff?tr1=1.16&tr2=1.17&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/hrm/inc/class.uijob.inc.php.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/hrm/inc/hook_admin.inc.php.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/hrm/setup/phpgw_no.lang.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/hrm/setup/setup.inc.php.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/hrm/setup/tables_current.inc.php.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/hrm/setup/tables_update.inc.php.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/hrm/templates/base/job.xsl.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
Patches:
Index: hrm/inc/class.bojob.inc.php
diff -u hrm/inc/class.bojob.inc.php:1.13 hrm/inc/class.bojob.inc.php:1.14
--- hrm/inc/class.bojob.inc.php:1.13 Sat Apr 15 19:04:13 2006
+++ hrm/inc/class.bojob.inc.php Fri Apr 21 12:57:27 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package hrm
* @subpackage user
- * @version $Id: class.bojob.inc.php,v 1.13 2006/04/15 19:04:13 sigurdne
Exp $
+ * @version $Id: class.bojob.inc.php,v 1.14 2006/04/21 12:57:27 sigurdne
Exp $
*/
/**
@@ -143,32 +143,44 @@
return $this->so->read_single_job($id);
}
- function read_task($job_id)
+ function read_qualification($job_id)
{
- $task_list =
$this->so->read_task(array('job_id'=>$job_id,'start' => $this->start,'query' =>
$this->query,'sort' => $this->sort,'order' => $this->order,
+ $qualification_list =
$this->so->read_qualification(array('job_id'=>$job_id,'start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
'allrows'=>$this->allrows));
$this->total_records = $this->so->total_records;
- for ($i=0;$i<count($task_list);$i++)
+ for ($i=0;$i<count($qualification_list);$i++)
{
- if ($task_list[$i]['level'] > 0)
+ if ($qualification_list[$i]['level'] > 0)
{
$space = '--> ';
- $spaceset =
str_repeat($space,$task_list[$i]['level']);
- $task_list[$i]['name'] = $spaceset .
$task_list[$i]['name'];
+ $spaceset =
str_repeat($space,$qualification_list[$i]['level']);
+ $qualification_list[$i]['name'] =
$spaceset . $qualification_list[$i]['name'];
}
}
- return $task_list;
+ return $qualification_list;
}
- function read_task_type()
+ function read_qualification_type()
{
- $task_list = $this->so->read_task_type(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
+ $qualification_list =
$this->so->read_qualification_type(array('start' => $this->start,'query' =>
$this->query,'sort' => $this->sort,'order' => $this->order,
'allrows'=>$this->allrows));
$this->total_records = $this->so->total_records;
- return $task_list;
+ return $qualification_list;
+ }
+
+ function read_single_qualification($id)
+ {
+ $values =$this->so->read_single_qualification($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 read_single_task($id)
@@ -183,9 +195,9 @@
return $values;
}
- function read_single_task_type($id)
+ function read_single_qualification_type($id)
{
- $values =$this->so->read_single_task_type($id);
+ $values =$this->so->read_single_qualification_type($id);
$dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
if($values['entry_date'])
@@ -195,6 +207,28 @@
return $values;
}
+
+ function read_task($job_id)
+ {
+ $task_list =
$this->so->read_task(array('job_id'=>$job_id,'start' => $this->start,'query' =>
$this->query,'sort' => $this->sort,'order' => $this->order,
+
'allrows'=>$this->allrows));
+
+ $this->total_records = $this->so->total_records;
+
+ for ($i=0;$i<count($task_list);$i++)
+ {
+ if ($task_list[$i]['level'] > 0)
+ {
+ $space = '--> ';
+ $spaceset =
str_repeat($space,$task_list[$i]['level']);
+ $task_list[$i]['name'] = $spaceset .
$task_list[$i]['name'];
+ }
+ }
+
+ return $task_list;
+ }
+
+
function save_job($values,$action='')
{
if ($action=='edit')
@@ -219,7 +253,7 @@
{
if ($action=='edit')
{
- if ($values['task_id'] != '')
+ if ($values['id'] != '')
{
$receipt =
$this->so->edit_task($values);
}
@@ -232,17 +266,37 @@
{
$receipt = $this->so->add_task($values);
}
+ return $receipt;
+ }
+
+ function save_qualification($values,$action='')
+ {
+ if ($action=='edit')
+ {
+ if ($values['quali_id'] != '')
+ {
+ $receipt =
$this->so->edit_qualification($values);
+ }
+ else
+ {
+
$receipt['error'][]=array('msg'=>lang('Error'));
+ }
+ }
+ else
+ {
+ $receipt =
$this->so->add_qualification($values);
+ }
return $receipt;
}
- function save_task_type($values,$action='')
+ function save_qualification_type($values,$action='')
{
if ($action=='edit')
{
- if ($values['task_type_id'] != '')
+ if ($values['quali_type_id'] != '')
{
- $receipt =
$this->so->edit_task_type($values);
+ $receipt =
$this->so->edit_qualification_type($values);
}
else
{
@@ -251,15 +305,20 @@
}
else
{
- $receipt = $this->so->add_task_type($values);
+ $receipt =
$this->so->add_qualification_type($values);
}
return $receipt;
}
- function delete_task($job_id,$id)
+ function delete_task($id='')
{
- $this->so->delete_task($job_id,$id);
+ $this->so->delete_task($id);
+ }
+
+ function delete_qualification($job_id,$id)
+ {
+ $this->so->delete_qualification($job_id,$id);
}
function delete_job($id)
@@ -310,9 +369,47 @@
return $job_list;
}
- function select_task_list($job_id,$task_id='')
+ function select_task_list($selected='',$id='', $job_id='')
{
- $task_list =
$this->so->select_task_list($job_id,$task_id);
+ $tasks= $this->so->select_task_list($id,$job_id);
+ while (is_array($tasks) && list(,$task) = each($tasks))
+ {
+ if ($task['level'] > 0)
+ {
+ $space = '--';
+ $spaceset =
str_repeat($space,$task['level']);
+ $task['name'] = $spaceset .
$task['name'];
+ }
+
+ $sel_task = '';
+
+ if ($task['id']==$selected)
+ {
+ $sel_task = 'selected';
+ }
+
+ $task_list[] = array
+ (
+ 'id' => $task['id'],
+ 'name' => $task['name'],
+ 'selected' => $sel_task
+ );
+ }
+
+ for ($i=0;$i<count($task_list);$i++)
+ {
+ if ($task_list[$i]['selected'] != 'selected')
+ {
+ unset($task_list[$i]['selected']);
+ }
+ }
+
return $task_list;
}
+
+ function select_qualification_list($job_id,$quali_id='')
+ {
+ $qualification_list =
$this->so->select_qualification_list($job_id,$quali_id);
+ return $qualification_list;
+ }
}
Index: hrm/inc/class.socategory.inc.php
diff -u hrm/inc/class.socategory.inc.php:1.7
hrm/inc/class.socategory.inc.php:1.8
--- hrm/inc/class.socategory.inc.php:1.7 Sat Apr 15 19:04:13 2006
+++ hrm/inc/class.socategory.inc.php Fri Apr 21 12:57:27 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package hrm
* @subpackage admin
- * @version $Id: class.socategory.inc.php,v 1.7 2006/04/15 19:04:13
sigurdne Exp $
+ * @version $Id: class.socategory.inc.php,v 1.8 2006/04/21 12:57:27
sigurdne Exp $
*/
/**
@@ -116,8 +116,8 @@
case 'skill_level':
$table='phpgw_hrm_skill_level';
break;
- case 'task':
- $table='phpgw_hrm_task_category';
+ case 'qualification':
+ $table='phpgw_hrm_quali_category';
break;
}
Index: hrm/inc/class.sojob.inc.php
diff -u hrm/inc/class.sojob.inc.php:1.16 hrm/inc/class.sojob.inc.php:1.17
--- hrm/inc/class.sojob.inc.php:1.16 Sat Apr 15 19:04:13 2006
+++ hrm/inc/class.sojob.inc.php Fri Apr 21 12:57:27 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package hrm
* @subpackage job
- * @version $Id: class.sojob.inc.php,v 1.16 2006/04/15 19:04:13 sigurdne
Exp $
+ * @version $Id: class.sojob.inc.php,v 1.17 2006/04/21 12:57:27 sigurdne
Exp $
*/
/**
@@ -189,8 +189,29 @@
}
}
+ function read_single_task($id)
+ {
- function read_task($data)
+ $table = 'phpgw_hrm_task';
+
+ $sql = "SELECT * FROM $table where id='$id'";
+
+ $this->db->query($sql,__LINE__,__FILE__);
+
+ if ($this->db->next_record())
+ {
+ $task['id'] = $id;
+ $task['parent_id'] =
(int)$this->db->f('task_parent');
+ $task['entry_date'] =
$this->db->f('entry_date');
+ $task['name'] =
stripslashes($this->db->f('name'));
+ $task['descr'] =
stripslashes($this->db->f('descr'));
+
+ return $task;
+ }
+ }
+
+
+ function read_qualification($data)
{
if(is_array($data))
{
@@ -221,9 +242,9 @@
}
- $sql = "SELECT * , phpgw_hrm_task.id as task_id from
phpgw_hrm_task $this->join phpgw_hrm_task_type ON phpgw_hrm_task.task_type_id =
phpgw_hrm_task_type.id WHERE job_id=" . intval($job_id);
+ $sql = "SELECT * , phpgw_hrm_quali.id as quali_id from
phpgw_hrm_quali $this->join phpgw_hrm_quali_type ON
phpgw_hrm_quali.quali_type_id = phpgw_hrm_quali_type.id WHERE job_id=" .
intval($job_id);
- $parent_select = ' AND (is_parent =1 OR (is_parent != 1
AND task_parent IS NULL))';
+ $parent_select = ' AND (is_parent =1 OR (is_parent != 1
AND quali_parent IS NULL))';
if($query)
{
@@ -239,9 +260,9 @@
while ($this->db->next_record())
{
- $tasks[] = array
+ $qualifications[] = array
(
- 'task_id' =>
$this->db->f('task_id'),
+ 'quali_id' =>
$this->db->f('quali_id'),
'level' => 0,
'name' =>
stripslashes($this->db->f('name')),
'descr' =>
stripslashes($this->db->f('descr')),
@@ -249,65 +270,65 @@
);
}
- $num_tasks = count($tasks);
- for ($i=0;$i < $num_tasks;$i++)
+ $num_qualifications = count($qualifications);
+ for ($i=0;$i < $num_qualifications;$i++)
{
- $sub_select = ' AND task_parent=' .
$tasks[$i]['task_id'] . " AND is_parent != 1";
+ $sub_select = ' AND quali_parent=' .
$qualifications[$i]['quali_id'] . " AND is_parent != 1";
$this->db->query($sql . $querymethod .
$sub_select . $ordermethod,__LINE__,__FILE__);
$this->total_records += $this->db->num_rows();
- $subtasks = array();
+ $subqualifications = array();
$j = 0;
while ($this->db->next_record())
{
- $subtasks[$j]['task_id'] =
(int)$this->db->f('task_id');
- $subtasks[$j]['level'] = 1;
- $subtasks[$j]['parent'] =
(int)$this->db->f('task_parent');
- $subtasks[$j]['name'] =
$this->db->f('name');
- $subtasks[$j]['descr'] =
$this->db->f('descr');
+ $subqualifications[$j]['quali_id']
= (int)$this->db->f('quali_id');
+ $subqualifications[$j]['level'] =
1;
+ $subqualifications[$j]['parent'] =
(int)$this->db->f('quali_parent');
+ $subqualifications[$j]['name'] =
$this->db->f('name');
+ $subqualifications[$j]['descr'] =
$this->db->f('descr');
$j++;
}
- $num_subtasks = count($subtasks);
- if ($num_subtasks != 0)
+ $num_subqualifications =
count($subqualifications);
+ if ($num_subqualifications != 0)
{
- $newtasks = array();
+ $newqualifications = array();
for ($k = 0; $k <= $i; $k++)
{
- $newtasks[$k] = $tasks[$k];
+ $newqualifications[$k] =
$qualifications[$k];
}
- for ($k = 0; $k < $num_subtasks; $k++)
+ for ($k = 0; $k <
$num_subqualifications; $k++)
{
- $newtasks[$k+$i+1] =
$subtasks[$k];
+ $newqualifications[$k+$i+1] =
$subqualifications[$k];
}
- for ($k = $i+1; $k < $num_tasks; $k++)
+ for ($k = $i+1; $k <
$num_qualifications; $k++)
{
- $newtasks[$k+$num_subtasks] =
$tasks[$k];
+
$newqualifications[$k+$num_subqualifications] = $qualifications[$k];
}
- $tasks = $newtasks;
- $num_tasks = count($tasks);
+ $qualifications = $newqualifications;
+ $num_qualifications =
count($qualifications);
}
}
-//_debug_array($tasks);
+//_debug_array($qualifications);
- return $tasks;
+ return $qualifications;
}
- function read_single_task($id)
+ function read_single_qualification($id)
{
- $sql = "SELECT * , phpgw_hrm_task_type.id as
task_type_id FROM phpgw_hrm_task $this->join phpgw_hrm_task_type ON
phpgw_hrm_task.task_type_id = phpgw_hrm_task_type.id WHERE phpgw_hrm_task.id="
. intval($id);
+ $sql = "SELECT * , phpgw_hrm_quali_type.id as
quali_type_id FROM phpgw_hrm_quali $this->join phpgw_hrm_quali_type ON
phpgw_hrm_quali.quali_type_id = phpgw_hrm_quali_type.id WHERE
phpgw_hrm_quali.id=" . intval($id);
$this->db->query($sql,__LINE__,__FILE__);
if ($this->db->next_record())
{
$values['id'] = $id;
- $values['task_type_id'] =
$this->db->f('task_type_id');
+ $values['quali_type_id'] =
$this->db->f('quali_type_id');
$values['name'] =
stripslashes($this->db->f('name'));
$values['descr'] =
stripslashes($this->db->f('descr'));
$values['job_id'] =
$this->db->f('job_id');
@@ -320,15 +341,15 @@
return $values;
}
- function read_single_task_type($id)
+ function read_single_qualification_type($id)
{
- $sql = "SELECT * FROM phpgw_hrm_task_type WHERE id=" .
intval($id);
+ $sql = "SELECT * FROM phpgw_hrm_quali_type WHERE id="
. intval($id);
$this->db->query($sql,__LINE__,__FILE__);
if ($this->db->next_record())
{
- $values['task_type_id'] = $id;
+ $values['quali_type_id'] = $id;
$values['name'] =
stripslashes($this->db->f('name'));
$values['descr'] =
stripslashes($this->db->f('descr'));
$values['entry_date'] =
$this->db->f('entry_date');
@@ -337,7 +358,7 @@
return $values;
}
- function read_task_type($data)
+ function read_qualification_type($data)
{
if(is_array($data))
{
@@ -365,7 +386,7 @@
$ordermethod = ' order by name asc';
}
- $table = 'phpgw_hrm_task_type';
+ $table = 'phpgw_hrm_quali_type';
if($query)
{
@@ -391,17 +412,134 @@
while ($this->db->next_record())
{
- $task_type[] = array
+ $qualification_type[] = array
+ (
+ 'id' => $this->db->f('id'),
+ 'name' =>
stripslashes($this->db->f('name')),
+ 'descr' =>
stripslashes($this->db->f('descr')),
+ );
+ }
+
+ return $qualification_type;
+ }
+
+
+ function read_task($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']:'');
+ }
+
+ $job_id = $data['job_id'];
+ $filter_id = $data['filter_id'];
+
+ if ($order)
+ {
+ $ordermethod = " order by $order $sort";
+
+ }
+ else
+ {
+ $ordermethod = ' order by name asc';
+ }
+
+ $sql = "SELECT * from phpgw_hrm_task WHERE job_id=" .
intval($job_id);
+
+ $parent_select = ' AND task_level =0';
+
+ if($filter_id)
+ {
+ $querymethod = " AND id != $filter_id";
+ }
+
+ if($query)
+ {
+ $query = ereg_replace("'",'',$query);
+ $query = ereg_replace('"','',$query);
+
+ $querymethod .= " AND name $this->like
'%$query%'";
+ }
+
+
+ $this->db->query($sql . $parent_select . $querymethod .
$ordermethod,__LINE__,__FILE__);
+ $this->total_records = $this->db->num_rows();
+
+ while ($this->db->next_record())
+ {
+ $tasks[] = array
(
'id' => $this->db->f('id'),
+ 'level' => 0,
'name' =>
stripslashes($this->db->f('name')),
'descr' =>
stripslashes($this->db->f('descr')),
+ 'parent'=> 0
);
}
- return $task_type;
+ $num_tasks = count($tasks);
+ for ($i=0;$i < $num_tasks;$i++)
+ {
+ $sub_select = ' AND task_parent=' .
$tasks[$i]['id'] . " AND task_level=" . ($tasks[$i]['level']+1);
+
+ $this->db->query($sql . $querymethod .
$sub_select . $ordermethod,__LINE__,__FILE__);
+
+ $this->total_records += $this->db->num_rows();
+
+ $subtasks = array();
+ $j = 0;
+ while ($this->db->next_record())
+ {
+ $subtasks[$j]['id'] =
(int)$this->db->f('id');
+ $subtasks[$j]['level'] = 1;
+ $subtasks[$j]['parent'] =
(int)$this->db->f('task_parent');
+ $subtasks[$j]['name'] =
$this->db->f('name');
+ $subtasks[$j]['descr'] =
$this->db->f('descr');
+ $j++;
+ }
+
+ $num_subtasks = count($subtasks);
+ if ($num_subtasks != 0)
+ {
+ $newtasks = array();
+ for ($k = 0; $k <= $i; $k++)
+ {
+ $newtasks[$k] = $tasks[$k];
+ }
+ for ($k = 0; $k < $num_subtasks; $k++)
+ {
+ $newtasks[$k+$i+1] =
$subtasks[$k];
+ }
+ for ($k = $i+1; $k < $num_tasks; $k++)
+ {
+ $newtasks[$k+$num_subtasks] =
$tasks[$k];
+ }
+ $tasks = $newtasks;
+ $num_tasks = count($tasks);
+ }
+
+ }
+//_debug_array($tasks);
+
+ return $tasks;
}
+ function select_task_list($id='',$job_id='')
+ {
+ $task = $this->read_task(array('job_id' => $job_id,
'allrows'=>true, 'filter_id' => $id));
+ return $task;
+ }
function add_job($values)
@@ -622,15 +760,225 @@
$this->db->query($sql,__LINE__,__FILE__);
}
- function add_task_type($values)
+
+
+ function add_task($values)
+ {
+ $table = 'phpgw_hrm_task';
+
+ if($values['parent_id'])
+ {
+ $this->db->query("SELECT task_level FROM $table
where id=" . intval($values['parent_id']),__LINE__,__FILE__);
+ $this->db->next_record();
+ $level = (int)$this->db->f('task_level') +1;
+ }
+ else
+ {
+ $level = 0;
+ }
+
+ $values['name'] =
$this->db->db_addslashes($values['name']);
+ $values['descr'] =
$this->db->db_addslashes($values['descr']);
+
+ $insert_values=array(
+ $values['job_id'],
+ $values['name'],
+ $values['descr'],
+ intval($values['parent_id']),
+ $level,
+ time(),
+ $this->account
+ );
+
+ $insert_values =
$this->bocommon->validate_db_insert($insert_values);
+
+
+ $this->db->query("INSERT INTO $table
(job_id,name,descr,task_parent,task_level,entry_date,owner) "
+ . "VALUES ($insert_values)",__LINE__,__FILE__);
+
+ $receipt['message'][]=array('msg'=>lang('task has been
saved'));
+
+ $receipt['id'] =
$this->db->get_last_insert_id($table,'id');
+
+ $this->db->transaction_commit();
+ return $receipt;
+ }
+
+ function edit_task($values)
+ {
+ $this->db->transaction_begin();
+ $table = 'phpgw_hrm_task';
+
+ $this->db->query("SELECT task_level FROM $table where
id=" . intval($values['id']),__LINE__,__FILE__);
+ $this->db->next_record();
+ $old_level = (int)$this->db->f('task_level');
+
+ if($values['parent_id'])
+ {
+ $this->db->query("SELECT task_level FROM $table
where id=" . intval($values['parent_id']),__LINE__,__FILE__);
+ $this->db->next_record();
+ $level = (int)$this->db->f('task_level') +1;
+ }
+ else
+ {
+ $level = 0;
+ }
+
+ if($old_level !=$level)
+ {
+ $this->level = $level;
+ $this->parent_gap = 1;
+ $this->task_parent = $values['id'];
+ while ($this->task_parent)
+ {
+ $this->check_move_task_child();
+
+ }
+
+ if (is_array($this->move_task_child))
+ {
+ foreach ($this->move_task_child as
$child)
+ {
+ $new_level =
$child['new_level'];
+ $this->db->query("UPDATE $table
set task_level= $new_level WHERE id=" . intval($child['id']),__LINE__,__FILE__);
+ }
+ }
+
+ }
+
+ $value_set['descr'] =
$this->db->db_addslashes($values['descr']);
+ $value_set['name'] =
$this->db->db_addslashes($values['name']);
+ $value_set['task_parent'] =
intval($values['parent_id']);
+ $value_set['task_level'] = $level;
+
+ $value_set =
$this->bocommon->validate_db_update($value_set);
+
+ $this->db->query("UPDATE $table set $value_set WHERE
id=" . $values['id'],__LINE__,__FILE__);
+
+ $receipt['id'] = $values['id'];
+
+ $this->db->transaction_commit();
+
+ $receipt['message'][]=array('msg'=>lang('task has been
edited'));
+ return $receipt;
+ }
+
+ function check_move_task_child()
+ {
+ $continue = false;
+ $move_task_child = array();
+ $this->db->query("SELECT id FROM phpgw_hrm_task where
task_parent=" . intval($this->task_parent),__LINE__,__FILE__);
+ while ($this->db->next_record())
+ {
+ $this->move_task_child[] = array(
+ 'id'
=>(int)$this->db->f('id'),
+ 'task_parent'
=>(int)$this->task_parent,
+ 'new_level' => ($this->level +
$this->parent_gap)
+ );
+
+ $move_task_child[] = (int)$this->db->f('id');
+ $continue = true;
+ }
+ if($continue)
+ {
+ $this->parent_gap++;
+ foreach ($move_task_child as $parent_id)
+ {
+ $this->task_parent = $parent_id;
+ $this->check_move_task_child();
+ }
+
+ }
+ else
+ {
+ $this->task_parent = false;
+ }
+ }
+
+
+ function check_move_task_child_delete()
+ {
+ $continue = false;
+ $move_task_child = array();
+
+ $this->db->query("SELECT id FROM phpgw_hrm_task where
task_parent=" . intval($this->task_id),__LINE__,__FILE__);
+ while ($this->db->next_record())
+ {
+ $this->move_task_child[] = array(
+ 'id'
=>(int)$this->db->f('id'),
+ 'task_parent' =>$this->task_parent,
+ 'new_level' => ($this->level)
+ );
+
+ $move_task_child[] = (int)$this->db->f('id');
+ $continue = true;
+ }
+ unset ($this->task_parent);
+ if($continue)
+ {
+ $this->level++;
+ foreach ($move_task_child as $task_id)
+ {
+ $this->task_id = $task_id;
+ $this->check_move_task_child_delete();
+ }
+
+ }
+ else
+ {
+ $this->check_parent = false;
+ }
+ }
+
+
+ function delete_task($id)
+ {
+ $this->db->transaction_begin();
+
+ $this->db->query("SELECT task_parent,task_level FROM
phpgw_hrm_task where id=" . intval($id),__LINE__,__FILE__);
+ $this->db->next_record();
+ $this->level =
(int)$this->db->f('task_level');
+ $this->task_parent =
(int)$this->db->f('task_parent');
+
+ $this->check_parent = true;
+ $this->task_id = $id;
+ while ($this->check_parent)
+ {
+ $this->check_move_task_child_delete();
+ }
+
+ if (is_array($this->move_task_child))
+ {
+ foreach ($this->move_task_child as $child)
+ {
+ $new_level = $child['new_level'];
+ $child['task_parent'];
+ if($child['task_parent'] ||
$child['task_parent']===0)
+ {
+ $sql = "UPDATE phpgw_hrm_task
set task_level= $new_level,task_parent = " . intval($child['task_parent']) . "
WHERE id=" . intval($child['id']);
+ }
+ else
+ {
+ $sql = "UPDATE phpgw_hrm_task
set task_level= $new_level WHERE id=" . intval($child['id']);
+ }
+
$this->db->query($sql,__LINE__,__FILE__);
+ }
+ }
+
+ $this->db->query("DELETE FROM phpgw_hrm_task WHERE id="
. intval($id),__LINE__,__FILE__);
+ $this->db->transaction_commit();
+ }
+
+
+ function add_qualification_type($values)
{
$values['descr'] =
$this->db->db_addslashes($values['descr']);
$values['name'] =
$this->db->db_addslashes($values['name']);
- $values['task_type_id'] =
$this->bocommon->next_id('phpgw_hrm_task_type');
+ $values['quali_type_id'] =
$this->bocommon->next_id('phpgw_hrm_quali_type');
$insert_values=array(
- $values['task_type_id'],
+ $values['quali_type_id'],
$values['name'],
$values['descr'],
time(),
@@ -638,17 +986,17 @@
);
$insert_values =
$this->bocommon->validate_db_insert($insert_values);
- $this->db->query("INSERT INTO phpgw_hrm_task_type
(id,name,descr,entry_date,type_owner) "
+ $this->db->query("INSERT INTO phpgw_hrm_quali_type
(id,name,descr,entry_date,type_owner) "
. "VALUES ($insert_values)",__LINE__,__FILE__);
- $receipt['message'][]=array('msg'=>lang('task type item
has been saved'));
+ $receipt['message'][]=array('msg'=>lang('qualification
type item has been saved'));
- $receipt['task_type_id']= $values['task_type_id'];
+ $receipt['quali_type_id']= $values['quali_type_id'];
return $receipt;
}
- function edit_task_type($values)
+ function edit_qualification_type($values)
{
$this->db->transaction_begin();
@@ -657,20 +1005,20 @@
$value_set =
$this->bocommon->validate_db_update($value_set);
- $this->db->query("UPDATE phpgw_hrm_task_type set
$value_set WHERE id=" . $values['task_type_id'],__LINE__,__FILE__);
+ $this->db->query("UPDATE phpgw_hrm_quali_type set
$value_set WHERE id=" . $values['quali_type_id'],__LINE__,__FILE__);
$this->db->transaction_commit();
- $receipt['message'][]=array('msg'=>lang('task type item
has been edited'));
+ $receipt['message'][]=array('msg'=>lang('qualification
type item has been edited'));
- $receipt['task_type_id']= $values['task_type_id'];
+ $receipt['quali_type_id']= $values['quali_type_id'];
return $receipt;
}
- function check_task_type($values)
+ function check_qualification_type($values)
{
- $sql = "SELECT * FROM phpgw_hrm_task_type WHERE id=" .
intval($values['task_type_id']);
+ $sql = "SELECT * FROM phpgw_hrm_quali_type WHERE id="
. intval($values['quali_type_id']);
$this->db->query($sql,__LINE__,__FILE__);
if($this->db->next_record())
@@ -684,16 +1032,13 @@
return False;
}
- function add_task($values)
+ function add_qualification($values)
{
$this->db->transaction_begin();
- $task_id = $this->bocommon->next_id('phpgw_hrm_task');
-
$insert_values=array(
- $task_id,
$values['job_id'],
- $values['task_type_id'],
+ $values['quali_type_id'],
$values['cat_id'],
$values['skill_id'],
$values['experience_id'],
@@ -703,82 +1048,82 @@
$insert_values =
$this->bocommon->validate_db_insert($insert_values);
- $this->db->query("INSERT INTO phpgw_hrm_task
(id,job_id,task_type_id,category,skill_id,experience_id,entry_date,task_owner) "
+ $this->db->query("INSERT INTO phpgw_hrm_quali
(job_id,quali_type_id,category,skill_id,experience_id,entry_date,quali_owner) "
. "VALUES ($insert_values)",__LINE__,__FILE__);
- if(is_array($values['alternative_task']))
+ if(is_array($values['alternative_qualification']))
{
- $this->db->query("UPDATE phpgw_hrm_task set
is_parent = 1 WHERE id= $task_id",__LINE__,__FILE__);
+ $this->db->query("UPDATE phpgw_hrm_quali set
is_parent = 1 WHERE id= $quali_id",__LINE__,__FILE__);
- foreach($values['alternative_task'] as
$alternative_task)
+ foreach($values['alternative_qualification'] as
$alternative_qualification)
{
- $this->db->query("UPDATE phpgw_hrm_task
set task_parent = $task_id WHERE id= $alternative_task",__LINE__,__FILE__);
+ $this->db->query("UPDATE
phpgw_hrm_quali set quali_parent = $quali_id WHERE id=
$alternative_qualification",__LINE__,__FILE__);
}
}
else
{
- $this->db->query("UPDATE phpgw_hrm_task set
is_parent = 0 WHERE id=" . (int)$task_id,__LINE__,__FILE__);
+ $this->db->query("UPDATE phpgw_hrm_quali set
is_parent = 0 WHERE id=" . (int)$quali_id,__LINE__,__FILE__);
}
- $receipt['message'][]=array('msg'=>lang('task item has
been saved'));
+ $receipt['message'][]=array('msg'=>lang('qualification
item has been saved'));
- $receipt['task_id']= $task_id;
+ $receipt['quali_id'] =
$this->db->get_last_insert_id('phpgw_hrm_quali','id');
$this->db->transaction_commit();
return $receipt;
}
- function edit_task($values)
+ function edit_qualification($values)
{
$this->db->transaction_begin();
- $value_set['task_type_id'] =
$values['task_type_id'];
+ $value_set['quali_type_id'] =
$values['quali_type_id'];
$value_set['category'] =
$values['cat_id'];
$value_set['skill_id'] =
$values['skill_id'];
$value_set['experience_id'] =
$values['experience_id'];
$value_set =
$this->bocommon->validate_db_update($value_set);
- $table='phpgw_hrm_task';
+ $table='phpgw_hrm_quali';
- $this->db->query("UPDATE $table set $value_set WHERE
id=" . $values['task_id'],__LINE__,__FILE__);
- $this->db->query("UPDATE phpgw_hrm_task set task_parent
= NULL WHERE task_parent = " . $values['task_id'] ,__LINE__,__FILE__);
+ $this->db->query("UPDATE $table set $value_set WHERE
id=" . $values['quali_id'],__LINE__,__FILE__);
+ $this->db->query("UPDATE phpgw_hrm_quali set
quali_parent = NULL WHERE quali_parent = " . $values['quali_id']
,__LINE__,__FILE__);
- if(is_array($values['alternative_task']))
+ if(is_array($values['alternative_qualification']))
{
- $this->db->query("UPDATE phpgw_hrm_task set
is_parent = 1 WHERE id= " . $values['task_id'],__LINE__,__FILE__);
+ $this->db->query("UPDATE phpgw_hrm_quali set
is_parent = 1 WHERE id= " . $values['quali_id'],__LINE__,__FILE__);
- foreach($values['alternative_task'] as
$alternative_task)
+ foreach($values['alternative_qualification'] as
$alternative_qualification)
{
- $this->db->query("UPDATE phpgw_hrm_task
set task_parent = " . $values['task_id'] . " WHERE id=
$alternative_task",__LINE__,__FILE__);
+ $this->db->query("UPDATE
phpgw_hrm_quali set quali_parent = " . $values['quali_id'] . " WHERE id=
$alternative_qualification",__LINE__,__FILE__);
}
}
else
{
- $this->db->query("UPDATE phpgw_hrm_task set
is_parent = 0 WHERE id= " . $values['task_id'],__LINE__,__FILE__);
+ $this->db->query("UPDATE phpgw_hrm_quali set
is_parent = 0 WHERE id= " . $values['quali_id'],__LINE__,__FILE__);
}
$this->db->transaction_commit();
- $receipt['message'][]=array('msg'=>lang('task item has
been edited'));
+ $receipt['message'][]=array('msg'=>lang('qualification
item has been edited'));
- $receipt['task_id']= $values['task_id'];
+ $receipt['quali_id']= $values['quali_id'];
return $receipt;
}
- function select_task_list($job_id,$task_id='')
+ function select_qualification_list($job_id,$quali_id='')
{
- $sql = "SELECT * ,phpgw_hrm_task.id as task_id from
phpgw_hrm_task $this->join phpgw_hrm_task_type ON phpgw_hrm_task.task_type_id =
phpgw_hrm_task_type.id WHERE job_id=" . intval($job_id);
+ $sql = "SELECT * ,phpgw_hrm_quali.id as quali_id from
phpgw_hrm_quali $this->join phpgw_hrm_quali_type ON
phpgw_hrm_quali.quali_type_id = phpgw_hrm_quali_type.id WHERE job_id=" .
intval($job_id);
- if($task_id)
+ if($quali_id)
{
- $sql .= " AND phpgw_hrm_task.id != $task_id AND
(is_parent !=1 AND (task_parent is null or task_parent = $task_id ))";
+ $sql .= " AND phpgw_hrm_quali.id != $quali_id
AND (is_parent !=1 AND (quali_parent is null or quali_parent = $quali_id ))";
}
else
{
- $sql .= " AND (is_parent !=1 AND (task_parent
is null))";
+ $sql .= " AND (is_parent !=1 AND (quali_parent
is null))";
}
$this->db->query($sql,__LINE__,__FILE__);
@@ -786,23 +1131,23 @@
$i=0;
while ($this->db->next_record())
{
- $task_list[$i]['id'] =
$this->db->f('task_id');
- $task_list[$i]['name'] =
stripslashes($this->db->f('name'));
- if($this->db->f('task_parent'))
+ $qualification_list[$i]['id'] =
$this->db->f('quali_id');
+ $qualification_list[$i]['name'] =
stripslashes($this->db->f('name'));
+ if($this->db->f('quali_parent'))
{
- $task_list[$i]['selected'] = 'selected';
+ $qualification_list[$i]['selected'] =
'selected';
}
$i++;
}
- return $task_list;
+ return $qualification_list;
}
- function delete_task($job_id,$id)
+ function delete_qualification($job_id,$id)
{
$this->db->transaction_begin();
- $this->db->query('UPDATE phpgw_hrm_task set task_parent
= NULL WHERE task_parent = ' . intval($id) . ' AND job_id=' .
intval($job_id),__LINE__,__FILE__);
- $this->db->query('DELETE FROM phpgw_hrm_task WHERE id='
. intval($id) . ' AND job_id=' . intval($job_id),__LINE__,__FILE__);
+ $this->db->query('UPDATE phpgw_hrm_quali set
quali_parent = NULL WHERE quali_parent = ' . intval($id) . ' AND job_id=' .
intval($job_id),__LINE__,__FILE__);
+ $this->db->query('DELETE FROM phpgw_hrm_quali WHERE
id=' . intval($id) . ' AND job_id=' . intval($job_id),__LINE__,__FILE__);
$this->db->transaction_commit();
}
}
Index: hrm/inc/class.uijob.inc.php
diff -u hrm/inc/class.uijob.inc.php:1.18 hrm/inc/class.uijob.inc.php:1.19
--- hrm/inc/class.uijob.inc.php:1.18 Sat Apr 15 19:04:13 2006
+++ hrm/inc/class.uijob.inc.php Fri Apr 21 12:57:27 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package hrm
* @subpackage job
- * @version $Id: class.uijob.inc.php,v 1.18 2006/04/15 19:04:13 sigurdne
Exp $
+ * @version $Id: class.uijob.inc.php,v 1.19 2006/04/21 12:57:27 sigurdne
Exp $
*/
/**
@@ -28,18 +28,22 @@
var $public_functions = array
(
- 'index' => True,
- 'view_task' => True,
+ 'index' => True,
+ 'view_qualification' => True,
'view_job' => True,
- 'edit_job' => True,
- 'edit_task' => True,
- 'delete_task' => True,
- 'task' => True,
+ 'edit_job' => True,
'delete_job' => True,
'reset_job_type_hierarchy' => True,
- 'lookup_task' => True,
- 'edit_task_type' => True,
- '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
);
function uijob()
@@ -48,16 +52,16 @@
$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->bo =
CreateObject($this->currentapp.'.bojob',true);
$this->bocommon =
CreateObject($this->currentapp.'.bocommon');
$this->bocategory =
CreateObject($this->currentapp.'.bocategory');
- $this->acl =
CreateObject($this->currentapp.'.acl2');
- $this->menu =
CreateObject($this->currentapp.'.menu');
+ $this->acl =
CreateObject($this->currentapp.'.acl2');
+ $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->sort =
$this->bo->sort;
$this->order =
$this->bo->order;
$this->allrows =
$this->bo->allrows;
}
@@ -106,23 +110,26 @@
$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'),
+ '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_qualification' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.qualification&job_id='
. $entry['id']),
+ 'link_task'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.task&job_id='
. $entry['id']),
+ 'lang_qualification_job_text' =>
lang('qualifications for this job'),
+ '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'),
+ 'lang_add_sub_text'
=> lang('Add a new sub-job'),
+ 'text_qualification' =>
lang('qualification'),
+ 'text_task'
=> lang('task'),
+ 'text_view'
=> lang('view'),
+ 'text_edit'
=> lang('edit'),
+ 'text_delete'
=> lang('delete'),
+ 'text_add_sub'
=> lang('Add sub'),
);
}
@@ -146,6 +153,7 @@
'lang_edit' => lang('edit'),
'lang_delete' => lang('delete'),
'lang_view' => lang('view'),
+ 'lang_qualification' =>
lang('qualification'),
'lang_task' => lang('task'),
);
@@ -214,6 +222,135 @@
}
+ function qualification()
+ {
+ if(!$this->acl->check('.job', PHPGW_ACL_READ))
+ {
+ $this->bocommon->no_access($links);
+ return;
+ }
+
+ $job_id = get_var('job_id',array('POST','GET'));
+
+ $receipt =
$GLOBALS['phpgw']->session->appsession('session_data','hrm_quali_receipt');
+
$GLOBALS['phpgw']->session->appsession('session_data','hrm_quali_receipt','');
+
+ $GLOBALS['phpgw']->xslttpl->add_file(array('job'));
+
+ if ($job_id)
+ {
+ $job_info = $this->bo->read_single_job($job_id);
+ $qualification =
$this->bo->read_qualification($job_id);
+ }
+
+ $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
+ while (is_array($qualification) && list(,$entry) =
each($qualification))
+ {
+
+ 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['quali_id'],
+ 'name' =>
$entry['name'],
+ 'descr' =>
$entry['descr'],
+ 'link_edit' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.edit_qualification&job_id=$job_id&quali_id="
. $entry['quali_id']),
+ 'link_view' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.view_qualification&job_id=$job_id&quali_id="
. $entry['quali_id']),
+ 'link_delete' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.delete_qualification&job_id=$job_id&quali_id="
. $entry['quali_id']),
+ 'lang_view_text' => lang('view
qualification item'),
+ 'lang_edit_text' => lang('edit
qualification item'),
+ 'lang_delete_text' => lang('delete
qualification item'),
+ 'text_view' => lang('view'),
+ 'text_edit' => lang('edit'),
+ 'text_delete' =>
lang('delete')
+ );
+ }
+
+
+ $table_header[] = array
+ (
+
+ 'sort_name' =>
$this->nextmatchs->show_sort_order(array
+
(
+
'sort' => $this->sort,
+
'var' => 'phpgw_hrm_quali.name',
+
'order' => $this->order,
+
'extra' => array('menuaction' =>
$this->currentapp.'.uijob.qualification',
+
'job_id' =>$job_id,
+
'query' =>$this->query,
+
'cat_id' =>$this->cat_id,
+
'allrows' => $this->allrows)
+
)),
+ 'lang_name' => lang('name'),
+ 'lang_descr'=> lang('descr'),
+ 'lang_view' => lang('view'),
+ 'lang_edit' => lang('edit'),
+ 'lang_delete' => lang('delete'),
+ );
+
+
+
+ $function_msg = lang('list qualification');
+
+
+ $link_data = array
+ (
+ 'menuaction' =>
$this->currentapp.'.uijob.edit_qualification',
+ 'job_id' => $job_id
+ );
+
+ $table_add[] = array
+ (
+ 'lang_add' => lang('add'),
+ 'lang_add_qualification_text' => lang('add a
qualification item'),
+ 'add_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.edit_qualification&job_id='.$job_id),
+ 'lang_done' => lang('done'),
+ 'lang_done_qualification_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_qualification'
=> $table_header,
+ 'values_qualification'
=> $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('qualification ID'),
+ 'lang_descr' =>
lang('Descr'),
+ 'lang_save' =>
lang('save'),
+ 'lang_cancel' =>
lang('cancel'),
+ 'value_id' =>
$job_id,
+ 'lang_id_status_text' =>
lang('Enter the qualification ID'),
+ 'lang_descr_status_text' =>
lang('Enter a description the qualification'),
+ 'lang_done_status_text' =>
lang('Back to the list'),
+ 'lang_save_status_text' =>
lang('Save the qualification'),
+ 'type_id' =>
$qualification['type_id'],
+ 'value_descr' =>
$qualification['descr'],
+ 'lang_apply' =>
lang('apply'),
+ 'lang_apply_status_text' =>
lang('Apply the values'),
+ );
+
+ $appname =
lang('qualification');
+
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('qualification' => $data));
+ }
+
function task()
{
if(!$this->acl->check('.job', PHPGW_ACL_READ))
@@ -251,12 +388,12 @@
$content[] = array
(
- 'id' =>
$entry['task_id'],
+ 'id' => $entry['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']),
+ 'link_edit' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.edit_task&job_id=$job_id&id="
. $entry['id']),
+ 'link_view' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.view_task&job_id=$job_id&id="
. $entry['id']),
+ 'link_delete' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.delete_task&job_id=$job_id&id="
. $entry['id']),
'lang_view_text' => lang('view
task item'),
'lang_edit_text' => lang('edit
task item'),
'lang_delete_text' => lang('delete
task item'),
@@ -288,8 +425,6 @@
'lang_delete' => lang('delete'),
);
-
-
$function_msg = lang('list task');
@@ -317,24 +452,24 @@
'value_job_name' =>
$job_info['name'],
'table_header_task' =>
$table_header,
'values_task' =>
$content,
- 'table_add' =>
$table_add,
+ '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_id'
=> lang('task ID'),
'lang_descr' =>
lang('Descr'),
- 'lang_save' =>
lang('save'),
+ '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_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'),
+ 'lang_apply_status_text' => lang('Apply
the values'),
);
$appname =
lang('task');
@@ -343,7 +478,197 @@
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('task' => $data));
}
- function lookup_task()
+ function edit_task()
+ {
+ $id = get_var('id',array('POST','GET'));
+ $job_id = get_var('job_id',array('POST','GET'));
+ $parent_id =
get_var('parent_id',array('POST','GET'));
+ $values = get_var('values',array('POST'));
+
+ if(!$id)
+ {
+ if(!$this->acl->check('.job', PHPGW_ACL_ADD))
+ {
+ $this->bocommon->no_access($links);
+ return;
+ }
+ }
+ else
+ {
+ if(!$this->acl->check('.job', PHPGW_ACL_EDIT))
+ {
+ $this->bocommon->no_access($links);
+ return;
+ }
+ }
+
+
+ $GLOBALS['phpgw']->xslttpl->add_file(array('job'));
+
+ if (is_array($values))
+ {
+ $values['job_id']= $job_id;
+
+ 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_task($values,$action);
+ $id = $receipt['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 ($id)
+ {
+ $values = $this->bo->read_single_task($id);
+ $function_msg = lang('edit task');
+ $action='edit';
+ }
+ else
+ {
+ $function_msg = lang('add task');
+ $action='add';
+ }
+
+
+ if($parent_id)
+ {
+ $values['parent_id'] = $parent_id;
+ }
+
+ $link_data = array
+ (
+ 'menuaction' =>
$this->currentapp.'.uijob.edit_task',
+ 'id' => $id,
+ 'job_id' => $job_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),
+ 'lang_id'
=> lang('task ID'),
+ 'lang_descr'
=> lang('Descr'),
+ 'lang_save'
=> lang('save'),
+ 'value_id'
=> $id,
+
+ 'parent_list'
=> $this->bo->select_task_list($values['parent_id'],$id,$job_id),
+ 'lang_parent'
=> lang('parent'),
+ 'lang_parent_status_text' =>
lang('Select this tasks parent'),
+ 'lang_no_parent'
=> lang('select a parent'),
+
+ 'lang_name'
=> lang('name'),
+ 'lang_name_status_text' =>
lang('name of the task-type'),
+
+ 'lang_id_statustext' =>
lang('Enter the category ID'),
+ 'lang_descr_statustext' =>
lang('Enter a description the task'),
+ 'lang_done_statustext' =>
lang('Back to the list'),
+ 'lang_save_statustext' =>
lang('Save the task'),
+ '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('task');
+
+ $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()
+ {
+ $id = get_var('id',array('POST','GET'));
+ $job_id = get_var('job_id',array('POST','GET'));
+ $parent_id =
get_var('parent_id',array('POST','GET'));
+
+ if(!$this->acl->check('.job', PHPGW_ACL_READ))
+ {
+ $this->bocommon->no_access($links);
+ return;
+ }
+
+ $GLOBALS['phpgw']->xslttpl->add_file(array('job'));
+
+ if ($id)
+ {
+ $values = $this->bo->read_single_task($id);
+ $function_msg = lang('view task');
+ }
+
+ if($parent_id)
+ {
+ $values['parent_id'] = $parent_id;
+ }
+
+ $link_data = array
+ (
+ 'menuaction' =>
$this->currentapp.'.uijob.task',
+ 'id' => $id,
+ 'job_id'=> $job_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',$link_data),
+ 'lang_id'
=> lang('task ID'),
+ 'lang_descr'
=> lang('Descr'),
+ 'value_id' => $id,
+
+ 'parent_list' =>
$this->bo->select_task_list($values['parent_id'],$id,$job_id),
+ 'lang_parent' =>
lang('parent'),
+ 'lang_parent_status_text' => lang('Select
this tasks parent'),
+
+ 'lang_name' =>
lang('name'),
+ 'lang_name_status_text' =>
lang('name of the task-type'),
+
+ 'lang_done_statustext' =>
lang('Return to the list'),
+ 'type_id'
=> $values['type_id'],
+ 'value_descr'
=> $values['descr'],
+ 'value_name'
=> $values['name'],
+
+ 'lang_cancel' =>
lang('cancel'),
+ );
+
+ $appname =
lang('task');
+
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view_task' => $data));
+ }
+
+
+
+ function lookup_qualification()
{
if(!$this->acl->check('.job', PHPGW_ACL_ADD))
{
@@ -355,12 +680,12 @@
$GLOBALS['phpgw_info']['flags']['noframework'] = True;
$GLOBALS['phpgw_info']['flags']['headonly']=true;
- $receipt =
$GLOBALS['phpgw']->session->appsession('session_data','hrm_task_tp_receipt');
-
$GLOBALS['phpgw']->session->appsession('session_data','hrm_task_tp_receipt','');
+ $receipt =
$GLOBALS['phpgw']->session->appsession('session_data','hrm_quali_tp_receipt');
+
$GLOBALS['phpgw']->session->appsession('session_data','hrm_quali_tp_receipt','');
$GLOBALS['phpgw']->xslttpl->add_file(array('job','nextmatchs','search_field'));
- $task = $this->bo->read_task_type();
+ $qualification = $this->bo->read_qualification_type();
$dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
@@ -370,12 +695,12 @@
}
- while (is_array($task) && list(,$entry) = each($task))
+ while (is_array($qualification) && list(,$entry) =
each($qualification))
{
if ($allowed_edit)
{
- $link_edit =
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.edit_task_type&task_type_id="
. $entry['id']);
+ $link_edit =
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.edit_qualification_type&quali_type_id="
. $entry['id']);
$text_edit = lang('edit');
}
@@ -385,8 +710,8 @@
'name' =>
$entry['name'],
'descr' =>
$entry['descr'],
'link_edit' => $link_edit,
-// 'link_view' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.edit_task_type&task_type_id="
. $entry['id']),
-// 'link_delete' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.edit_task_type&task_type_id="
. $entry['id']),
+// 'link_view' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.edit_qualification_type&quali_type_id="
. $entry['id']),
+// 'link_delete' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.edit_qualification_type&quali_type_id="
. $entry['id']),
'lang_select' =>
lang('select'),
'text_delete' =>
lang('delete'),
'text_edit' => $text_edit,
@@ -404,7 +729,7 @@
'sort' => $this->sort,
'var' => 'name',
'order' => $this->order,
-
'extra' => array('menuaction' =>
$this->currentapp.'.uijob.lookup_task',
+
'extra' => array('menuaction' =>
$this->currentapp.'.uijob.lookup_qualification',
'query' =>$this->query,
'cat_id' =>$this->cat_id,
'allrows' => $this->allrows)
@@ -419,7 +744,7 @@
- $function_msg = lang('list task');
+ $function_msg = lang('list qualification');
if(!$this->allrows)
@@ -433,7 +758,7 @@
$link_data = array
(
- 'menuaction' =>
$this->currentapp.'.uijob.lookup_task',
+ 'menuaction' =>
$this->currentapp.'.uijob.lookup_qualification',
'sort'
=>$this->sort,
'order'
=>$this->order,
'cat_id'
=>$this->cat_id,
@@ -444,21 +769,21 @@
$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_type&job_id='.$job_id),
+ 'lang_add_qualification_text' => lang('add a
qualification item'),
+ 'add_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.edit_qualification_type&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.lookup_task')
+ 'lang_done_qualification_text' => lang('back
to user list'),
+ 'done_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.lookup_qualification')
);
$GLOBALS['phpgw_info']['flags']['java_script'] .= "\n"
. '<script language="JavaScript">' ."\n"
- . 'function ExchangeTask(thisform)' ."\n"
+ . 'function Exchangequalification(thisform)'
."\n"
. '{' ."\n"
- . 'opener.document.task_form.elements[' .
"'values[task_type_id]']" . '.value = thisform.elements[0].value;' ."\n"
- . 'opener.document.task_form.elements[' .
"'values[name]']" . '.value = thisform.elements[1].value;' ."\n"
- . 'opener.document.task_form.elements[' .
"'values[descr]']" . '.value = thisform.elements[2].value;' ."\n"
+ .
'opener.document.qualification_form.elements[' . "'values[quali_type_id]']" .
'.value = thisform.elements[0].value;' ."\n"
+ .
'opener.document.qualification_form.elements[' . "'values[name]']" . '.value =
thisform.elements[1].value;' ."\n"
+ .
'opener.document.qualification_form.elements[' . "'values[descr]']" . '.value =
thisform.elements[2].value;' ."\n"
. 'window.close()' ."\n"
. '}' ."\n"
. "</script>\n";
@@ -471,7 +796,7 @@
'allrows'
=> $this->allrows,
'start_record'
=> $this->start,
'record_limit'
=> $record_limit,
- 'num_records'
=> count($task),
+ 'num_records'
=> count($qualification),
'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'),
@@ -480,48 +805,48 @@
'query'
=> $this->query,
'lang_search'
=> lang('search'),
- 'lang_name_status_text' =>
lang('Enter the name of the task-type'),
+ 'lang_name_status_text' =>
lang('Enter the name of the qualification-type'),
- 'table_header_lookup_task' =>
$table_header,
- 'values_lookup_task' =>
$content,
+ 'table_header_lookup_qualification'
=> $table_header,
+ 'values_lookup_qualification'
=> $content,
// 'table_add' =>
$table_add,
'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_type'),
+ 'lang_add_qualification_text' => lang('add a
qualification item'),
+ 'add_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.edit_qualification_type'),
'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_id' =>
lang('qualification 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_id_status_text' =>
lang('Enter the qualification ID'),
+ 'lang_descr_status_text' =>
lang('Enter a description the qualification'),
'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_save_status_text' =>
lang('Save the qualification'),
+ 'type_id' =>
$qualification['type_id'],
+ 'value_descr' =>
$qualification['descr'],
'lang_apply' =>
lang('apply'),
'lang_apply_status_text' =>
lang('Apply the values'),
);
- $appname =
lang('task');
+ $appname =
lang('qualification');
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('lookup_task' => $data));
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('lookup_qualification' =>
$data));
}
- function edit_task_type()
+ function edit_qualification_type()
{
$GLOBALS['phpgw_info']['flags']['noframework'] = True;
$GLOBALS['phpgw_info']['flags']['headonly']=true;
- $task_type_id =
get_var('task_type_id',array('POST','GET'));
+ $quali_type_id =
get_var('quali_type_id',array('POST','GET'));
$values = get_var('values',array('POST'));
$GLOBALS['phpgw']->xslttpl->add_file(array('job'));
@@ -536,50 +861,50 @@
$receipt['error'][]=array('msg'=>lang('Please enter a name !'));
}
- if($task_type_id)
+ if($quali_type_id)
{
-
$values['task_type_id']=$task_type_id;
+
$values['quali_type_id']=$quali_type_id;
$action='edit';
}
if(!$receipt['error'])
{
- $receipt =
$this->bo->save_task_type($values,$action);
- $task_type_id =
$receipt['task_type_id'];
+ $receipt =
$this->bo->save_qualification_type($values,$action);
+ $quali_type_id =
$receipt['quali_type_id'];
if ($values['save'])
{
-
$GLOBALS['phpgw']->session->appsession('session_data','hrm_task_tp_receipt',$receipt);
-
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uijob.lookup_task&query='
. $values['name']);
+
$GLOBALS['phpgw']->session->appsession('session_data','hrm_quali_tp_receipt',$receipt);
+
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uijob.lookup_qualification&query='
. $values['name']);
}
}
}
else
{
-
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uijob.lookup_task');
+
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uijob.lookup_qualification');
}
}
- if ($task_type_id)
+ if ($quali_type_id)
{
if(!$receipt['error'])
{
- $values =
$this->bo->read_single_task_type($task_type_id);
+ $values =
$this->bo->read_single_qualification_type($quali_type_id);
}
- $function_msg = lang('edit task type');
+ $function_msg = lang('edit qualification type');
$action='edit';
}
else
{
- $function_msg = lang('add task type');
+ $function_msg = lang('add qualification type');
$action='add';
}
$link_data = array
(
- 'menuaction' =>
$this->currentapp.'.uijob.edit_task_type',
- 'task_type_id' => $task_type_id
+ 'menuaction' =>
$this->currentapp.'.uijob.edit_qualification_type',
+ 'quali_type_id' => $quali_type_id
);
$msgbox_data = $this->bocommon->msgbox_data($receipt);
@@ -598,10 +923,10 @@
'msgbox_data' =>
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
'form_action' =>
$GLOBALS['phpgw']->link('/index.php',$link_data),
- 'lang_id'
=> lang('task type ID'),
+ 'lang_id'
=> lang('qualification type ID'),
'lang_save'
=> lang('save'),
'lang_cancel' =>
lang('cancel'),
- 'value_id'
=> $task_type_id,
+ 'value_id'
=> $quali_type_id,
'lang_done_status_text' => lang('Back
to the list'),
'lang_save_status_text' => lang('Save
the training'),
'lang_apply' =>
lang('apply'),
@@ -611,7 +936,7 @@
$appname =
lang('Place');
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_task_type' => $data));
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_qualification_type' =>
$data));
}
function edit_job()
@@ -686,7 +1011,6 @@
$action='add';
}
-
if($parent_id)
{
$values['parent_id'] = $parent_id;
@@ -808,12 +1132,12 @@
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view_job' => $data));
}
- function edit_task()
+ function edit_qualification()
{
- $task_id =
get_var('task_id',array('POST','GET'));
+ $quali_id =
get_var('quali_id',array('POST','GET'));
$job_id = get_var('job_id',array('POST','GET'));
- if(!$task_id)
+ if(!$quali_id)
{
if(!$this->acl->check('.job', PHPGW_ACL_ADD))
{
@@ -838,7 +1162,7 @@
{
$values['job_id']= $job_id;
- $values['alternative_task'] =
get_var('alternative_task',array('POST'));
+ $values['alternative_qualification']
= get_var('alternative_qualification',array('POST'));
if ($values['save'] || $values['apply'])
{
@@ -851,66 +1175,66 @@
$receipt['error'][]=array('msg'=>lang('Please enter a name !'));
}
- if($task_id)
+ if($quali_id)
{
- $values['task_id']=$task_id;
+ $values['quali_id']=$quali_id;
$action='edit';
}
if(!$receipt['error'])
{
- $receipt =
$this->bo->save_task($values,$action);
- $task_id = $receipt['task_id'];
+ $receipt =
$this->bo->save_qualification($values,$action);
+ $quali_id =
$receipt['quali_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);
+
$GLOBALS['phpgw']->session->appsession('session_data','hrm_quali_receipt',$receipt);
+
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uijob.qualification&job_id='
. $job_id);
}
}
}
else
{
-
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uijob.task&job_id='
. $job_id);
+
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uijob.qualification&job_id='
. $job_id);
}
}
- if ($task_id)
+ if ($quali_id)
{
if(!$receipt['error'])
{
- $values =
$this->bo->read_single_task($task_id);
+ $values =
$this->bo->read_single_qualification($quali_id);
}
- $function_msg = lang('edit task');
+ $function_msg = lang('edit qualification');
$action='edit';
}
else
{
- $function_msg = lang('add task');
+ $function_msg = lang('add qualification');
$action='add';
}
$link_data = array
(
- 'menuaction' =>
$this->currentapp.'.uijob.edit_task',
- 'task_id' => $task_id,
+ 'menuaction' =>
$this->currentapp.'.uijob.edit_qualification',
+ 'quali_id' => $quali_id,
'job_id' => $job_id
);
//_debug_array($link_data);
$link_data_lookup = array
(
- 'menuaction' =>
$this->currentapp.'.uijob.lookup_task',
- 'task_id' => $task_id,
+ 'menuaction' =>
$this->currentapp.'.uijob.lookup_qualification',
+ 'quali_id' => $quali_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"
+ . 'function qualifications_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"
@@ -918,17 +1242,17 @@
$msgbox_data = $this->bocommon->msgbox_data($receipt);
- $task_list =
$this->bo->select_task_list($job_id,$task_id);
+ $qualification_list =
$this->bo->select_qualification_list($job_id,$quali_id);
$data = array
(
- 'value_task_type_id' =>
$values['task_type_id'],
+ 'value_quali_type_id' =>
$values['quali_type_id'],
'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_name_status_text' =>
lang('name of the qualification 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']),
@@ -939,39 +1263,39 @@
'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_id' =>
lang('qualification 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'),
+ 'value_id' =>
$quali_id,
+ 'lang_descr_status_text' =>
lang('Enter a description the qualification'),
'lang_done_status_text' =>
lang('Back to the list'),
- 'lang_save_status_text' =>
lang('Save the task'),
+ 'lang_save_status_text' =>
lang('Save the qualification'),
'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']),
+ 'cat_list' =>
$this->bocategory->select_category_list('qualification',$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_cat_status_text' =>
lang('Select the category the qualification 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'),
- 'task_list' =>
$task_list,
- 'task_list_size' =>
count($task_list)
+ 'qualification_list'
=> $qualification_list,
+ 'qualification_list_size'
=> count($qualification_list)
);
$job_info = $this->bo->read_single_job($job_id);
- $appname =
lang('task') .' ' . $job_info['name'];
+ $appname =
lang('qualification') .' ' . $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));
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_qualification' =>
$data));
}
- function view_task()
+ function view_qualification()
{
- $task_id =
get_var('task_id',array('POST','GET'));
+ $quali_id =
get_var('quali_id',array('POST','GET'));
$job_id = get_var('job_id',array('POST','GET'));
if(!$this->acl->check('.job', PHPGW_ACL_READ))
@@ -982,16 +1306,16 @@
$GLOBALS['phpgw']->xslttpl->add_file(array('job'));
- $values = $this->bo->read_single_task($task_id);
- $function_msg = lang('view task');
+ $values =
$this->bo->read_single_qualification($quali_id);
+ $function_msg = lang('view qualification');
$link_data = array
(
- 'menuaction' =>
$this->currentapp.'.uijob.task',
+ 'menuaction' =>
$this->currentapp.'.uijob.qualification',
'job_id' => $job_id
);
- $task_list =
$this->bo->select_task_list($job_id,$task_id);
+ $qualification_list =
$this->bo->select_qualification_list($job_id,$quali_id);
$data = array
(
'value_descr' =>
$values['descr'],
@@ -999,7 +1323,7 @@
'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_name_status_text' =>
lang('name of the qualification 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']),
@@ -1011,32 +1335,32 @@
'msgbox_data' =>
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
'form_action' =>
$GLOBALS['phpgw']->link('/index.php',$link_data),
- 'lang_id' =>
lang('task ID'),
+ 'lang_id' =>
lang('qualification ID'),
'lang_descr' =>
lang('Descr'),
'lang_save' =>
lang('save'),
'lang_cancel' =>
lang('cancel'),
- 'value_id' =>
$task_id,
+ 'value_id' =>
$quali_id,
- 'lang_descr_status_text' =>
lang('Enter a description the task'),
+ 'lang_descr_status_text' =>
lang('Enter a description the qualification'),
'lang_done_status_text' =>
lang('Back to the list'),
- 'lang_save_status_text' =>
lang('Save the task'),
+ 'lang_save_status_text' =>
lang('Save the qualification'),
'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']),
+ 'cat_list' =>
$this->bocategory->select_category_list('qualification',$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_cat_status_text' =>
lang('Select the category the qualification belongs to. To do not use a
category select NO CATEGORY'),
'lang_alternative' =>
lang('alternative'),
- 'task_list' =>
$task_list,
- 'task_list_size' =>
count($task_list)
+ 'qualification_list'
=> $qualification_list,
+ 'qualification_list_size'
=> count($qualification_list)
);
$job_info = $this->bo->read_single_job($job_id);
- $appname =
lang('task') .' ' . $job_info['name'];
+ $appname =
lang('qualification') .' ' . $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));
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view_qualification' =>
$data));
}
function delete_job()
@@ -1088,7 +1412,7 @@
return;
}
- $task_id =
get_var('task_id',array('POST','GET'));
+ $id = get_var('id',array('POST','GET'));
$job_id = get_var('job_id',array('POST','GET'));
$confirm =
get_var('confirm',array('POST'));
@@ -1100,7 +1424,7 @@
if (get_var('confirm',array('POST')))
{
- $this->bo->delete_task($job_id,$task_id);
+ $this->bo->delete_task($id);
Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php',$link_data));
}
@@ -1109,7 +1433,7 @@
$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),
+ 'delete_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.delete_task&job_id='
. $job_id .'&id='. $id),
'lang_confirm_msg' => lang('do you
really want to delete this entry'),
'lang_yes' =>
lang('yes'),
'lang_yes_categorytext' => lang('Delete the
entry'),
@@ -1124,6 +1448,50 @@
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
}
+ function delete_qualification()
+ {
+ if(!$this->acl->check('.job', PHPGW_ACL_DELETE))
+ {
+ $this->bocommon->no_access($links);
+ return;
+ }
+
+ $quali_id =
get_var('quali_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.qualification',
+ 'job_id' => $job_id
+ );
+
+ if (get_var('confirm',array('POST')))
+ {
+
$this->bo->delete_qualification($job_id,$quali_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_qualification&job_id='
. $job_id .'&quali_id='. $quali_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('qualification');
+ $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()
{
if(!$this->acl->check('.job', PHPGW_ACL_DELETE))
Index: hrm/inc/hook_admin.inc.php
diff -u hrm/inc/hook_admin.inc.php:1.6 hrm/inc/hook_admin.inc.php:1.7
--- hrm/inc/hook_admin.inc.php:1.6 Tue Mar 14 10:32:02 2006
+++ hrm/inc/hook_admin.inc.php Fri Apr 21 12:57:27 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package hrm
* @subpackage admin
- * @version $Id: hook_admin.inc.php,v 1.6 2006/03/14 10:32:02 sigurdne
Exp $
+ * @version $Id: hook_admin.inc.php,v 1.7 2006/04/21 12:57:27 sigurdne
Exp $
*/
{
@@ -25,7 +25,7 @@
'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'),
+ 'qualification category'=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uicategory.index&type=qualification'),
'Configure Access Permissions'=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiadmin.list_acl'),
'Configure Access Permissions(API version)'=>
$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiadmin_acl.list_acl&acl_app='.$appname),
);
Index: hrm/setup/phpgw_no.lang
diff -u hrm/setup/phpgw_no.lang:1.3 hrm/setup/phpgw_no.lang:1.4
--- hrm/setup/phpgw_no.lang:1.3 Fri Dec 2 09:31:43 2005
+++ hrm/setup/phpgw_no.lang Fri Apr 21 12:57:27 2006
@@ -23,6 +23,7 @@
select a place hrm no velg et sted
start date hrm no startdato
task hrm no oppgave
+qualification hrm no kvalifikasjon
title hrm no tittel
town hrm no poststed
training hrm no utdanning / erfaring
Index: hrm/setup/setup.inc.php
diff -u hrm/setup/setup.inc.php:1.8 hrm/setup/setup.inc.php:1.9
--- hrm/setup/setup.inc.php:1.8 Sat Apr 15 19:04:13 2006
+++ hrm/setup/setup.inc.php Fri Apr 21 12:57:27 2006
@@ -8,12 +8,12 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package hrm
* @subpackage setup
- * @version $Id: setup.inc.php,v 1.8 2006/04/15 19:04:13 sigurdne Exp $
+ * @version $Id: setup.inc.php,v 1.9 2006/04/21 12:57:27 sigurdne Exp $
*/
$setup_info['hrm']['name'] = 'hrm';
$setup_info['hrm']['title'] = 'Human resource management';
- $setup_info['hrm']['version'] = '0.9.17.002';
+ $setup_info['hrm']['version'] = '0.9.17.003';
$setup_info['hrm']['app_order'] = 20;
$setup_info['hrm']['enable'] = 1;
$setup_info['hrm']['globals_checked'] = True;
@@ -48,7 +48,7 @@
</div>';
$setup_info['hrm']['note'] =
- 'Training item is rated and linked to tasks with degree of
relevance. The task is rated for importance and grouped into job-descriptions
(job-type) - which is linked to an organization layout (hierarchy). <br>
+ 'Training item is rated and linked to qualifications with
degree of relevance. The qualification is rated for importance and grouped into
job-descriptions (job-type) - which is linked to an organization layout
(hierarchy). <br>
Training items is categorized as education, courses or work
experiences';
$setup_info['hrm']['tables'] = array(
@@ -57,15 +57,16 @@
'phpgw_hrm_org',
'phpgw_hrm_job',
'phpgw_hrm_task',
- 'phpgw_hrm_task_type',
- 'phpgw_hrm_task_job',
+ 'phpgw_hrm_quali',
+ 'phpgw_hrm_quali_type',
+ 'phpgw_hrm_quali_job',
'phpgw_hrm_training',
'phpgw_hrm_training_category',
'phpgw_hrm_training_place',
- 'phpgw_hrm_training_task',
+ 'phpgw_hrm_training_quali',
'phpgw_hrm_experience_category',
'phpgw_hrm_skill_level',
- 'phpgw_hrm_task_category'
+ 'phpgw_hrm_quali_category'
);
/* The hooks this app includes, needed for hooks registration */
Index: hrm/setup/tables_current.inc.php
diff -u hrm/setup/tables_current.inc.php:1.14
hrm/setup/tables_current.inc.php:1.15
--- hrm/setup/tables_current.inc.php:1.14 Sat Apr 15 19:04:13 2006
+++ hrm/setup/tables_current.inc.php Fri Apr 21 12:57:27 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package hrm
* @subpackage setup
- * @version $Id: tables_current.inc.php,v 1.14 2006/04/15 19:04:13
sigurdne Exp $
+ * @version $Id: tables_current.inc.php,v 1.15 2006/04/21 12:57:27
sigurdne Exp $
*/
$phpgw_baseline = array(
@@ -48,7 +48,26 @@
'uc' => array()
),
- 'phpgw_hrm_task_type' => array(
+ 'phpgw_hrm_task' => array(
+ 'fd' => array(
+ 'id' => array('type' => 'auto','precision' =>
'4','nullable' => False),
+ 'job_id' => array('type' => 'int','precision'
=> '4','nullable' => False),
+ 'task_parent' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'task_level' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'name' => array('type' => 'varchar','precision'
=> '64','nullable' => True),
+ 'descr' => array('type' => 'text','nullable' =>
True),
+ 'entry_date' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'owner' => array('type' => 'int','precision' =>
'4','nullable' => True),
+ 'access' => array('type' =>
'varchar','precision' => '7','nullable' => True),
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ ),
+
+
+ 'phpgw_hrm_quali_type' => array(
'fd' => array(
'id' => array('type' => 'int','precision' =>
'4','nullable' => False),
'name' => array('type' => 'varchar','precision'
=> '100','nullable' => True),
@@ -62,18 +81,18 @@
'uc' => array()
),
- 'phpgw_hrm_task' => array(
+ 'phpgw_hrm_quali' => array(
'fd' => array(
'id' => array('type' => 'auto','precision' =>
'4','nullable' => False),
'job_id' => array('type' => 'int','precision'
=> '4','nullable' => False),
- 'task_type_id' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'quali_type_id' => array('type' =>
'int','precision' => '4','nullable' => False),
'category' => array('type' => 'int','precision'
=> '4','nullable' => True),
'skill_id' => array('type' => 'int','precision'
=> '4','nullable' => True),
'experience_id' => array('type' =>
'int','precision' => '4','nullable' => True),
- 'task_parent' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'quali_parent' => array('type' =>
'int','precision' => '4','nullable' => True),
'is_parent' => array('type' =>
'int','precision' => '2','nullable' => True),
'entry_date' => array('type' =>
'int','precision' => '4','nullable' => True),
- 'task_owner' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'quali_owner' => array('type' =>
'int','precision' => '4','nullable' => True),
),
'pk' => array('id'),
'fk' => array(),
@@ -81,14 +100,14 @@
'uc' => array()
),
- 'phpgw_hrm_task_job' => array(
+ 'phpgw_hrm_quali_job' => array(
'fd' => array(
- 'task_id' => array('type' => 'int','precision'
=> '4','nullable' => False),
+ 'quali_id' => array('type' => 'int','precision'
=> '4','nullable' => False),
'job_id' => array('type' => 'int','precision'
=> '4','nullable' => False),
'importance' => array('type' =>
'int','precision' => '4','nullable' => True),
'required_skill' => array('type' =>
'int','precision' => '4','nullable' => True)
),
- 'pk' => array('task_id','job_id'),
+ 'pk' => array('quali_id','job_id'),
'fk' => array(),
'ix' => array(),
'uc' => array()
@@ -140,13 +159,13 @@
'ix' => array(),
'uc' => array()
),
- 'phpgw_hrm_training_task' => array(
+ 'phpgw_hrm_training_quali' => array(
'fd' => array(
'training_id' => array('type' =>
'int','precision' => '4','nullable' => False),
- 'task_id' => array('type' => 'int','precision'
=> '4','nullable' => False),
+ 'quali_id' => array('type' => 'int','precision'
=> '4','nullable' => False),
'relevance' => array('type' =>
'int','precision' => '4','nullable' => True),
),
- 'pk' => array('training_id','task_id'),
+ 'pk' => array('training_id','quali_id'),
'fk' => array(),
'ix' => array(),
'uc' => array()
@@ -197,7 +216,7 @@
'ix' => array(),
'uc' => array()
),
- 'phpgw_hrm_task_category' => array(
+ 'phpgw_hrm_quali_category' => array(
'fd' => array(
'id' => array('type' => 'int','precision' =>
'4','nullable' => False),
'descr' => array('type' =>
'varchar','precision' => '40','nullable' => True),
Index: hrm/setup/tables_update.inc.php
diff -u hrm/setup/tables_update.inc.php:1.3 hrm/setup/tables_update.inc.php:1.4
--- hrm/setup/tables_update.inc.php:1.3 Sat Apr 15 19:04:13 2006
+++ hrm/setup/tables_update.inc.php Fri Apr 21 12:57:27 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package hrm
* @subpackage setup
- * @version $Id: tables_update.inc.php,v 1.3 2006/04/15 19:04:13
sigurdne Exp $
+ * @version $Id: tables_update.inc.php,v 1.4 2006/04/21 12:57:27
sigurdne Exp $
*/
/**
@@ -72,3 +72,51 @@
$GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
return $GLOBALS['setup_info']['hrm']['currentver'];
}
+
+ /**
+ * Update hrm version from 0.9.17.002 to 0.9.17.003
+ */
+
+ $test[] = '0.9.17.002';
+ function hrm_upgrade0_9_17_002()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+
+
$GLOBALS['phpgw_setup']->oProc->RenameTable('phpgw_hrm_task','phpgw_hrm_quali');
+
$GLOBALS['phpgw_setup']->oProc->RenameTable('phpgw_hrm_task_type','phpgw_hrm_quali_type');
+
$GLOBALS['phpgw_setup']->oProc->RenameTable('phpgw_hrm_task_job','phpgw_hrm_quali_job');
+
$GLOBALS['phpgw_setup']->oProc->RenameTable('phpgw_hrm_training_task','phpgw_hrm_training_quali');
+
$GLOBALS['phpgw_setup']->oProc->RenameTable('phpgw_hrm_task_category','phpgw_hrm_quali_category');
+
+
$GLOBALS['phpgw_setup']->oProc->RenameColumn('phpgw_hrm_quali','task_type_id','quali_type_id');
+
$GLOBALS['phpgw_setup']->oProc->RenameColumn('phpgw_hrm_quali','task_parent','quali_parent');
+
$GLOBALS['phpgw_setup']->oProc->RenameColumn('phpgw_hrm_quali','task_owner','quali_owner');
+
$GLOBALS['phpgw_setup']->oProc->RenameColumn('phpgw_hrm_quali_job','task_id','quali_id');
+
$GLOBALS['phpgw_setup']->oProc->RenameColumn('phpgw_hrm_training_quali','task_id','quali_id');
+
+ $GLOBALS['phpgw_setup']->oProc->CreateTable(
+ 'phpgw_hrm_task', array(
+ 'fd' => array(
+ 'id' => array('type' =>
'auto','precision' => '4','nullable' => False),
+ 'job_id' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'task_parent' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'task_level' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'name' => array('type' =>
'varchar','precision' => '64','nullable' => True),
+ 'descr' => array('type' =>
'text','nullable' => True),
+ 'entry_date' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'owner' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'access' => array('type' =>
'varchar','precision' => '7','nullable' => True),
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ )
+ );
+
+ $GLOBALS['setup_info']['hrm']['currentver'] = '0.9.17.003';
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ return $GLOBALS['setup_info']['hrm']['currentver'];
+ }
+
Index: hrm/templates/base/job.xsl
diff -u hrm/templates/base/job.xsl:1.13 hrm/templates/base/job.xsl:1.14
--- hrm/templates/base/job.xsl:1.13 Sat Dec 3 21:35:01 2005
+++ hrm/templates/base/job.xsl Fri Apr 21 12:57:27 2006
@@ -1,4 +1,4 @@
-<!-- $Id: job.xsl,v 1.13 2005/12/03 21:35:01 sigurdne Exp $ -->
+<!-- $Id: job.xsl,v 1.14 2006/04/21 12:57:27 sigurdne Exp $ -->
<xsl:template name="app_data">
<xsl:choose>
@@ -8,20 +8,29 @@
<xsl:when test="edit_job">
<xsl:apply-templates select="view_job"/>
</xsl:when>
- <xsl:when test="edit_task">
- <xsl:apply-templates select="edit_task"/>
+ <xsl:when test="edit_qualification">
+ <xsl:apply-templates
select="edit_qualification"/>
</xsl:when>
- <xsl:when test="view_task">
- <xsl:apply-templates select="view_task"/>
+ <xsl:when test="view_qualification">
+ <xsl:apply-templates
select="view_qualification"/>
</xsl:when>
- <xsl:when test="lookup_task">
- <xsl:apply-templates select="lookup_task"/>
+ <xsl:when test="lookup_qualification">
+ <xsl:apply-templates
select="lookup_qualification"/>
</xsl:when>
<xsl:when test="task">
<xsl:apply-templates select="task"/>
</xsl:when>
- <xsl:when test="edit_task_type">
- <xsl:apply-templates select="edit_task_type"/>
+ <xsl:when test="edit_task">
+ <xsl:apply-templates select="edit_task"/>
+ </xsl:when>
+ <xsl:when test="edit_job">
+ <xsl:apply-templates select="view_task"/>
+ </xsl:when>
+ <xsl:when test="qualification">
+ <xsl:apply-templates select="qualification"/>
+ </xsl:when>
+ <xsl:when test="edit_qualification_type">
+ <xsl:apply-templates
select="edit_qualification_type"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="list"/>
@@ -71,6 +80,9 @@
<xsl:value-of select="lang_descr"/>
</td>
<td class="th_text" width="5%" align="center">
+ <xsl:value-of select="lang_qualification"/>
+ </td>
+ <td class="th_text" width="5%" align="center">
<xsl:value-of select="lang_task"/>
</td>
<td class="th_text" width="5%" align="center">
@@ -89,6 +101,7 @@
</xsl:template>
<xsl:template match="values">
+ <xsl:variable name="lang_qualification_job_text"><xsl:value-of
select="lang_qualification_job_text"/></xsl:variable>
<xsl:variable name="lang_task_job_text"><xsl:value-of
select="lang_task_job_text"/></xsl:variable>
<xsl:variable name="lang_view_job_text"><xsl:value-of
select="lang_view_job_text"/></xsl:variable>
<xsl:variable name="lang_edit_job_text"><xsl:value-of
select="lang_edit_job_text"/></xsl:variable>
@@ -116,9 +129,14 @@
<xsl:value-of select="descr"/>
</td>
<td align="center">
+ <xsl:variable
name="link_qualification"><xsl:value-of
select="link_qualification"/></xsl:variable>
+ <a href="{$link_qualification}"
onMouseover="window.status='{$lang_qualification_job_text}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of
select="text_qualification"/></a>
+ </td>
+ <td align="center">
<xsl:variable
name="link_task"><xsl:value-of select="link_task"/></xsl:variable>
<a href="{$link_task}"
onMouseover="window.status='{$lang_task_job_text}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of
select="text_task"/></a>
</td>
+
<td align="center">
<xsl:variable
name="link_add_sub"><xsl:value-of select="link_add_sub"/></xsl:variable>
<a href="{$link_add_sub}"
onMouseover="window.status='{$lang_add_sub_text}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of
select="text_add_sub"/></a>
@@ -510,8 +528,321 @@
</tr>
</xsl:template>
-<!-- lookup_task -->
- <xsl:template match="lookup_task">
+
+
+<!-- add task / edit task-->
+ <xsl:template match="edit_task">
+ <div align="left">
+ <xsl:variable name="form_action"><xsl:value-of
select="form_action"/></xsl:variable>
+ <form method="post" action="{$form_action}">
+ <table cellpadding="2" cellspacing="2" width="80%"
align="center">
+ <xsl:choose>
+ <xsl:when test="msgbox_data != ''">
+ <tr>
+ <td align="left" colspan="3">
+ <xsl:call-template
name="msgbox"/>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="value_id != ''">
+ <tr>
+ <td valign="top">
+ <xsl:value-of select="lang_id"/>
+ </td>
+ <td>
+ <xsl:value-of
select="value_id"/>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">
+ <xsl:value-of
select="lang_entry_date"/>
+ </td>
+ <td>
+ <xsl:value-of
select="value_entry_date"/>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+ <tr>
+ <td valign="top">
+ <xsl:value-of select="lang_parent"/>
+ </td>
+ <td>
+ <xsl:variable
name="lang_parent_status_text"><xsl:value-of
select="lang_parent_status_text"/></xsl:variable>
+ <select name="values[parent_id]"
class="forms" onMouseover="window.status='{$lang_parent_status_text}'; return
true;" onMouseout="window.status='';return true;">
+ <option value=""><xsl:value-of
select="lang_no_parent"/></option>
+ <xsl:apply-templates
select="parent_list"/>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">
+ <xsl:value-of select="lang_name"/>
+ </td>
+ <td>
+ <input type="text" size="60"
name="values[name]" value="{value_name}" onMouseout="window.status='';return
true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_name_status_text"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">
+ <xsl:value-of select="lang_descr"/>
+ </td>
+ <td>
+ <textarea cols="60" rows="10"
name="values[descr]" wrap="virtual" onMouseout="window.status='';return true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_descr_statustext"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ <xsl:value-of
select="value_descr"/>
+ </textarea>
+
+ </td>
+ </tr>
+
+ <tr height="50">
+ <TD colspan = "2">
+ <TABLE align = "center">
+ <TR>
+ <td valign="bottom">
+ <xsl:variable
name="lang_save"><xsl:value-of select="lang_save"/></xsl:variable>
+ <input type="submit"
name="values[save]" value="{$lang_save}" onMouseout="window.status='';return
true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_save_status_text"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ </td>
+ <td valign="bottom">
+ <xsl:variable
name="lang_apply"><xsl:value-of select="lang_apply"/></xsl:variable>
+ <input type="submit"
name="values[apply]" value="{$lang_apply}" onMouseout="window.status='';return
true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_apply_status_text"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ </td>
+ <td align="left" valign="bottom">
+ <xsl:variable
name="lang_cancel"><xsl:value-of select="lang_cancel"/></xsl:variable>
+ <input type="submit"
name="values[cancel]" value="{$lang_cancel}"
onMouseout="window.status='';return true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_cancel_status_text"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ </td>
+ </TR>
+ </TABLE>
+ </TD>
+ </tr>
+ </table>
+ </form>
+ </div>
+ </xsl:template>
+
+
+<!-- view task-->
+ <xsl:template match="view_task">
+ <div align="left">
+ <xsl:variable name="form_action"><xsl:value-of
select="done_action"/></xsl:variable>
+ <form method="post" action="{$form_action}">
+ <table cellpadding="2" cellspacing="2" width="80%"
align="center">
+ <xsl:choose>
+ <xsl:when test="msgbox_data != ''">
+ <tr>
+ <td align="left" colspan="3">
+ <xsl:call-template
name="msgbox"/>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="value_id != ''">
+ <tr>
+ <td valign="top">
+ <xsl:value-of select="lang_id"/>
+ </td>
+ <td>
+ <xsl:value-of
select="value_id"/>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">
+ <xsl:value-of
select="lang_entry_date"/>
+ </td>
+ <td>
+ <xsl:value-of
select="value_entry_date"/>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+ <tr>
+ <td valign="top">
+ <xsl:value-of select="lang_parent"/>
+ </td>
+ <td>
+ <xsl:for-each
select="parent_list[selected='selected']" >
+ <xsl:value-of select="name"/>
+ <xsl:if test="position() !=
last()">, </xsl:if>
+ </xsl:for-each>
+ </td>
+
+ </tr>
+ <tr>
+ <td valign="top">
+ <xsl:value-of select="lang_name"/>
+ </td>
+ <td>
+ <input type="text" readonly="true"
size="60" name="values[name]" value="{value_name}"></input>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">
+ <xsl:value-of select="lang_descr"/>
+ </td>
+ <td>
+ <textarea cols="60" readonly="true"
rows="10" name="values[descr]" wrap="virtual">
+ <xsl:value-of
select="value_descr"/>
+ </textarea>
+
+ </td>
+ </tr>
+
+ <tr height="50">
+ <TD colspan = "2">
+ <TABLE align = "center">
+ <TR>
+ <td align="left" valign="bottom">
+ <xsl:variable
name="lang_cancel"><xsl:value-of select="lang_cancel"/></xsl:variable>
+ <input type="submit"
name="values[cancel]" value="{$lang_cancel}"
onMouseout="window.status='';return true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_cancel_status_text"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ </td>
+ </TR>
+ </TABLE>
+ </TD>
+ </tr>
+ </table>
+ </form>
+ </div>
+ </xsl:template>
+
+
+<!-- qualification -->
+ <xsl:template match="qualification">
+ <div align="left">
+
+ <table>
+ <xsl:choose>
+ <xsl:when test="msgbox_data != ''">
+ <tr>
+ <td align="left" colspan="3">
+ <xsl:call-template
name="msgbox"/>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+ <tr>
+ <td valign="top">
+ <xsl:value-of select="lang_job_name"/>
+ <xsl:text>: </xsl:text>
+ </td>
+ <td>
+ <xsl:value-of select="value_job_name"/>
+ </td>
+ </tr>
+
+
+ <table width="100%" cellpadding="2" cellspacing="2"
align="center">
+ <xsl:apply-templates
select="table_header_qualification"/>
+ <xsl:apply-templates
select="values_qualification"/>
+ </table>
+ <table width="100%" cellpadding="2" cellspacing="2"
align="center">
+ <xsl:apply-templates select="table_add"/>
+ </table>
+
+ </table>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="table_header_qualification">
+ <xsl:variable name="sort_name"><xsl:value-of
select="sort_name"/></xsl:variable>
+ <tr class="th">
+ <td class="th_text" width="10%" align="left">
+ <a href="{$sort_name}"><xsl:value-of
select="lang_name"/></a>
+ </td>
+ <td class="th_text" width="5%" align="left">
+ <xsl:value-of select="lang_descr"/>
+ </td>
+ <td class="th_text" width="5%" align="center">
+ <xsl:value-of select="lang_view"/>
+ </td>
+ <td class="th_text" width="5%" align="center">
+ <xsl:value-of select="lang_edit"/>
+ </td>
+ <td class="th_text" width="5%" align="center">
+ <xsl:value-of select="lang_delete"/>
+ </td>
+ </tr>
+ </xsl:template>
+
+ <xsl:template match="values_qualification">
+ <xsl:variable name="lang_view_text"><xsl:value-of
select="lang_view_text"/></xsl:variable>
+ <xsl:variable name="lang_edit_text"><xsl:value-of
select="lang_edit_text"/></xsl:variable>
+ <xsl:variable name="lang_delete_text"><xsl:value-of
select="lang_delete_text"/></xsl:variable>
+ <tr>
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="@class">
+ <xsl:value-of
select="@class"/>
+ </xsl:when>
+ <xsl:when test="position() mod
2 = 0">
+
<xsl:text>row_off</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:text>row_on</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+
+ <td align="left">
+ <xsl:value-of select="name"/>
+ </td>
+ <td align="left">
+ <xsl:value-of select="descr"/>
+ </td>
+ <td align="center">
+ <xsl:variable
name="link_view"><xsl:value-of select="link_view"/></xsl:variable>
+ <a href="{$link_view}"
onMouseover="window.status='{$lang_view_text}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of
select="text_view"/></a>
+ </td>
+ <td align="center">
+ <xsl:variable
name="link_edit"><xsl:value-of select="link_edit"/></xsl:variable>
+ <a href="{$link_edit}"
onMouseover="window.status='{$lang_edit_text}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of
select="text_edit"/></a>
+ </td>
+ <td align="center">
+ <xsl:variable
name="link_delete"><xsl:value-of select="link_delete"/></xsl:variable>
+ <a href="{$link_delete}"
onMouseover="window.status='{$lang_delete_text}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of
select="text_delete"/></a>
+ </td>
+ </tr>
+ </xsl:template>
+
+<!-- lookup_qualification -->
+ <xsl:template match="lookup_qualification">
<div align="left">
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
@@ -535,10 +866,10 @@
</td>
</tr>
- <xsl:apply-templates
select="table_header_lookup_task"/>
+ <xsl:apply-templates
select="table_header_lookup_qualification"/>
<xsl:choose>
- <xsl:when test="values_lookup_task !=
''">
- <xsl:apply-templates
select="values_lookup_task"/>
+ <xsl:when
test="values_lookup_qualification != ''">
+ <xsl:apply-templates
select="values_lookup_qualification"/>
</xsl:when>
</xsl:choose>
<tr>
@@ -563,7 +894,7 @@
</div>
</xsl:template>
- <xsl:template match="table_header_lookup_task">
+ <xsl:template match="table_header_lookup_qualification">
<xsl:variable name="sort_name"><xsl:value-of
select="sort_name"/></xsl:variable>
<tr class="th">
<td class="th_text" width="30%" align="left">
@@ -581,7 +912,7 @@
</tr>
</xsl:template>
- <xsl:template match="values_lookup_task">
+ <xsl:template match="values_lookup_qualification">
<xsl:variable name="lang_view_text"><xsl:value-of
select="lang_view_text"/></xsl:variable>
<xsl:variable name="lang_edit_text"><xsl:value-of
select="lang_edit_text"/></xsl:variable>
<xsl:variable name="lang_delete_text"><xsl:value-of
select="lang_delete_text"/></xsl:variable>
@@ -616,7 +947,7 @@
<input type="hidden"
name="hidden" value="{name}"></input>
<input type="hidden"
name="hidden" value="{descr}"></input>
<xsl:variable
name="lang_select"><xsl:value-of select="lang_select"/></xsl:variable>
- <input type="button"
name="select" value="{$lang_select}" onClick="ExchangeTask(this.form);"
onMouseout="window.status='';return true;">
+ <input type="button"
name="select" value="{$lang_select}"
onClick="Exchangequalification(this.form);" onMouseout="window.status='';return
true;">
<xsl:attribute
name="onMouseover">
<xsl:text>window.status='</xsl:text>
<xsl:value-of select="lang_select_statustext"/>
@@ -629,11 +960,11 @@
</xsl:template>
-<!-- add task / edit task -->
- <xsl:template match="edit_task">
+<!-- add qualification / edit qualification -->
+ <xsl:template match="edit_qualification">
<div align="left">
<xsl:variable name="form_action"><xsl:value-of
select="form_action"/></xsl:variable>
- <form method="post" action="{$form_action}" name = "task_form">
+ <form method="post" action="{$form_action}" name =
"qualification_form">
<table cellpadding="2" cellspacing="2" width="80%"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -695,8 +1026,8 @@
</input>
</td>
<td valign="top">
- <input type="button"
value="{lang_open_popup}" onClick="tasks_popup()"></input>
- <input type="hidden"
name="values[task_type_id]" value="{value_task_type_id}"></input>
+ <input type="button"
value="{lang_open_popup}" onClick="qualifications_popup()"></input>
+ <input type="hidden"
name="values[quali_type_id]" value="{value_quali_type_id}"></input>
</td>
</tr>
</table>
@@ -750,8 +1081,8 @@
<table>
<tr>
<td>
- <select multiple="true"
size = "{task_list_size}" name="alternative_task[]" class="forms"
onMouseover="window.status=''; return true;"
onMouseout="window.status='';return true;">
-
<xsl:apply-templates select="task_list"/>
+ <select multiple="true"
size = "{qualification_list_size}" name="alternative_qualification[]"
class="forms" onMouseover="window.status=''; return true;"
onMouseout="window.status='';return true;">
+
<xsl:apply-templates select="qualification_list"/>
</select>
</td>
</tr>
@@ -800,8 +1131,8 @@
</xsl:template>
-<!-- view task / view task -->
- <xsl:template match="view_task">
+<!-- view qualification / view qualification -->
+ <xsl:template match="view_qualification">
<div align="left">
<xsl:variable name="form_action"><xsl:value-of
select="form_action"/></xsl:variable>
<form method="post" action="{$form_action}">
@@ -902,7 +1233,7 @@
<xsl:value-of
select="lang_alternative"/>
</td>
<td>
- <xsl:for-each
select="task_list[selected='selected']" >
+ <xsl:for-each
select="qualification_list[selected='selected']" >
<xsl:value-of select="name"/>
<xsl:if test="position() !=
last()">, </xsl:if>
</xsl:for-each>
@@ -929,8 +1260,8 @@
</div>
</xsl:template>
-<!-- add / edit task type -->
- <xsl:template match="edit_task_type">
+<!-- add / edit qualification type -->
+ <xsl:template match="edit_qualification_type">
<div align="left">
<xsl:variable name="form_action"><xsl:value-of
select="form_action"/></xsl:variable>
<form method="post" action="{$form_action}">
@@ -1080,7 +1411,7 @@
</xsl:choose>
</xsl:template>
- <xsl:template match="task_list">
+ <xsl:template match="qualification_list">
<xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
<xsl:choose>
<xsl:when test="selected">
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] hrm inc/class.bojob.inc.php inc/class.socategor...,
Sigurd Nes <=