phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] hrm/inc class.uiuser.inc.php, 1.4 class.uiplace.inc.p


From: sigurdne
Subject: [Phpgroupware-cvs] hrm/inc class.uiuser.inc.php, 1.4 class.uiplace.inc.php, 1.3 class.bouser.inc.php, 1.4 class.sojob.inc.php, 1.6 class.souser.inc.php, 1.3 class.uijob.inc.php, 1.5 class.bojob.inc.php, 1.5
Date: Wed, 23 Nov 2005 11:55:00 +0100

Update of hrm/inc

Modified Files:
     Branch: MAIN
            class.uiuser.inc.php lines: +3 -4
            class.uiplace.inc.php lines: +36 -89
            class.bouser.inc.php lines: +3 -2
            class.sojob.inc.php lines: +99 -16
            class.souser.inc.php lines: +32 -4
            class.uijob.inc.php lines: +420 -66
            class.bojob.inc.php lines: +44 -3

Log Message:
*** empty log message ***

====================================================
Index: hrm/inc/class.uiuser.inc.php
diff -u hrm/inc/class.uiuser.inc.php:1.3 hrm/inc/class.uiuser.inc.php:1.4
--- hrm/inc/class.uiuser.inc.php:1.3    Mon Nov 21 20:25:33 2005
+++ hrm/inc/class.uiuser.inc.php        Wed Nov 23 10:55:40 2005
@@ -41,7 +41,7 @@
                        $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->bo                               = 
CreateObject($this->currentapp.'.bouser',true);
+                       $this->bo                               = 
CreateObject($this->currentapp.'.bouser',False);
                        $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
                        $this->menu                             = 
CreateObject($this->currentapp.'.menu');
                        $this->menu->sub                        ='user';
@@ -570,7 +570,6 @@
                                'lang_descr_status_text'                => 
lang('Enter a description the training'),
                                'lang_done_status_text'                 => 
lang('Back to the list'),
                                'lang_save_status_text'                 => 
lang('Save the training'),
-                               'type_id'                               => 
$training['type_id'],
                                'lang_apply'                            => 
lang('apply'),
                                'lang_apply_status_text'                => 
lang('Apply the values'),

@@ -698,7 +697,7 @@
                                'lang_no'                               => 
lang('no')
                        );

-                       $appname                                        = 
lang('Trainig');
+                       $appname                                        = 
lang('Training');
                        $function_msg                                   = 
lang('delete');

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;

====================================================
Index: hrm/inc/class.uiplace.inc.php
diff -u hrm/inc/class.uiplace.inc.php:1.2 hrm/inc/class.uiplace.inc.php:1.3
--- hrm/inc/class.uiplace.inc.php:1.2   Tue Nov 22 18:20:09 2005
+++ hrm/inc/class.uiplace.inc.php       Wed Nov 23 10:55:40 2005
@@ -240,65 +240,45 @@
                                $action='add';
                        }

-
                        $link_data = array
                        (
                                'menuaction'    => 
$this->currentapp.'.uiplace.edit',
                                'place_id'      => $place_id
                        );
-//_debug_array($link_data);
-

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


                        $data = array
                        (
-                               'value_title'                           => 
$values['title'],
-                               'value_entry_date'                      => 
$values['entry_date'],
+                               'value_title'                   => 
$values['title'],
+                               'value_entry_date'              => 
$values['entry_date'],
                                'value_name'                    => 
$values['name'],
-                               'value_address'         => $values['address'],
+                               'value_address'                 => 
$values['address'],
                                'value_zip'                     => 
$values['zip'],
                                'value_town'                    => 
$values['town'],
-                               'value_remark'          => $values['remark'],
-
-
-                               'lang_entry_date'                       => 
lang('Entry date'),
-                               'lang_title'                            => 
lang('Title'),
-                               'lang_title_status_text'                => 
lang('Title of the training item'),
-                               'lang_skill'                            => 
lang('Skill'),
-                               'lang_skill_status_text'                => 
lang('Select your skill'),
-                               'skill_list'                            => 
$this->bo->select_skill_list($values['skill']),
-                               'lang_no_skill'                         => 
lang('select a skill'),
-
-                               'lang_place'                            => 
lang('place'),
-                               'lang_place_status_text'                => 
lang('Select a place'),
-                               'lang_place_status_text'                => 
lang('Enter a new place'),
-                               'lang_no_place'                                 
=> lang('select a place'),
+                               'value_remark'                  => 
$values['remark'],

+                               'lang_entry_date'               => lang('Entry 
date'),
                                'lang_name'                     => lang('name'),
-                               'lang_address'          => lang('address'),
+                               'lang_address'                  => 
lang('address'),
                                'lang_zip'                      => lang('zip'),
                                'lang_town'                     => lang('town'),
                                'lang_remark'                   => 
lang('remark'),

-                               'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'lang_id'                               => 
lang('training ID'),
-                               'lang_descr'                            => 
lang('Descr'),
-                               'lang_save'                             => 
lang('save'),
-                               'lang_cancel'                           => 
lang('cancel'),
-                               'value_id'                              => 
$place_id,
-                               'lang_id_status_text'                   => 
lang('Enter the training ID'),
-                               'lang_descr_status_text'                => 
lang('Enter a description the training'),
-                               'lang_done_status_text'                 => 
lang('Back to the list'),
-                               'lang_save_status_text'                 => 
lang('Save the training'),
-                               'type_id'                               => 
$training['type_id'],
-                               'lang_apply'                            => 
lang('apply'),
-                               'lang_apply_status_text'                => 
lang('Apply the values'),
+                               'msgbox_data'                   => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'lang_id'                       => 
lang('training ID'),
+                               'lang_save'                     => lang('save'),
+                               'lang_cancel'                   => 
lang('cancel'),
+                               'value_id'                      => $place_id,
+                               'lang_done_status_text'         => lang('Back 
to the list'),
+                               'lang_save_status_text'         => lang('Save 
the training'),
+                               'lang_apply'                    => 
lang('apply'),
+                               'lang_apply_status_text'        => lang('Apply 
the values'),
                        );

-                       $appname                                        = 
lang('Training');
+                       $appname                                        = 
lang('Place');

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

                        if ($place_id)
                        {
-                               $values = 
$this->bo->read_single_training($place_id);
-                               $function_msg = lang('view training');
+                               $values = $this->bo->read_single($place_id);
+                               $function_msg = lang('view place');
                        }
                        else
                        {
@@ -324,60 +304,27 @@

                        $data = array
                        (
-                               'value_descr'                   => 
$values['descr'],
                                'value_title'                   => 
$values['title'],
-                               'value_start_date'              => 
$values['start_date'],
-                               'value_end_date'                => 
$values['end_date'],
                                'value_entry_date'              => 
$values['entry_date'],
-                               'value_reference'               => 
$values['reference'],
+                               'value_name'                    => 
$values['name'],
+                               'value_address'                 => 
$values['address'],
+                               'value_zip'                     => 
$values['zip'],
+                               'value_town'                    => 
$values['town'],
+                               'value_remark'                  => 
$values['remark'],
+                               'lang_id'                       => lang('Place 
ID'),
+                               'lang_entry_date'               => lang('Entry 
date'),
+                               'lang_name'                     => lang('name'),
+                               'lang_address'                  => 
lang('address'),
+                               'lang_zip'                      => lang('zip'),
+                               'lang_town'                     => lang('town'),
+                               'lang_remark'                   => 
lang('remark'),

-                               'lang_start_date'                       => 
lang('start date'),
-                               'lang_end_date'                 => lang('end 
date'),
-                               'lang_start_date_title'                 => 
lang('select start date'),
-                               'lang_end_date_title'                   => 
lang('select end date'),
-                               'lang_start_date_status_text'           => 
lang('Select the start date for your training'),
-                               'lang_end_date_status_text'             => 
lang('Select the end date for your training'),
-                               'calendar_setup_start'                  => 
"Calendar.setup({inputField  : 'values[start_date]',button : 
'values[start_date]-trigger'});",
-                               'calendar_setup_end'                    => 
"Calendar.setup({inputField  : 'values[end_date]',button : 
'values[end_date]-trigger'});",
-                               'lang_reference'                        => 
lang('reference'),
-
-                               'lang_entry_date'                               
=> lang('Entry date'),
-                               'lang_title'                                    
=> lang('Title'),
-                               'lang_title_status_text'                        
=> lang('Title of the training item'),
-                               'lang_skill'                                    
=> lang('Skill'),
-                               'lang_skill_status_text'                        
=> lang('Select your skill'),
-                               'skill_list'                                    
=> $this->bo->select_skill_list($values['skill']),
-                               'lang_no_skill'                                 
=> lang('select a skill'),
-
-                               'place_list'                                    
=> $this->bo->select_place_list($values['place_id']),
-                               'lang_place'                                    
=> lang('place'),
-                               'lang_place'                            => 
lang('new place'),
-                               'lang_place_status_text'                => 
lang('Select a place'),
-                               'lang_place_status_text'        => lang('Enter 
a new place'),
-                               'lang_no_place'                                 
=> lang('select a place'),
-
-                               'form_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiplace.training&place_id='
 . $place_id),
-                               'lang_id'                               => 
lang('training ID'),
-                               'lang_descr'                                    
=> lang('Descr'),
-                               'lang_save'                                     
        => lang('save'),
-                               'lang_cancel'                                   
=> lang('cancel'),
-                               'value_id'                              => 
$place_id,
-                               'lang_id_status_text'   => lang('Enter the 
training ID'),
-                               'lang_descr_status_text'                        
=> lang('Enter a description the training'),
-                               'lang_done_status_text'                 => 
lang('Back to the list'),
-                               'lang_save_status_text'                 => 
lang('Save the training'),
-                               'type_id'                               => 
$training['type_id'],
-                               'lang_apply'                                    
=> lang('apply'),
-                               'lang_apply_status_text'                        
=> lang('Apply the values'),
-
-                               'lang_category'                         => 
lang('category'),
-                               'cat_list'                              => 
$this->bo->select_category_list('select',$values['cat_id']),
-                               'lang_no_cat'                           => 
lang('no category'),
-                               'lang_cat_status_text'                  => 
lang('Select the category the building belongs to. To do not use a category 
select NO CATEGORY'),
-                               'select_name'                           => 
'values[cat_id]',
+                               'form_action'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiplace.index'),
+                               'lang_cancel'                   => 
lang('cancel'),
+                               'value_id'                      => $place_id,
                        );

-                       $appname                                        = 
lang('Training');
+                       $appname                                        = 
lang('Place');

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

====================================================
Index: hrm/inc/class.bouser.inc.php
diff -u hrm/inc/class.bouser.inc.php:1.3 hrm/inc/class.bouser.inc.php:1.4
--- hrm/inc/class.bouser.inc.php:1.3    Mon Nov 21 20:25:33 2005
+++ hrm/inc/class.bouser.inc.php        Wed Nov 23 10:55:40 2005
@@ -160,7 +160,8 @@

                function read_training($user_id)
                {
-                       $values = $this->so->read_training($user_id);
+                       $values = 
$this->so->read_training(array('user_id'=>$user_id, 'start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
+                                                                               
        'allrows'=>$this->allrows));
                        return $values;
                }


====================================================
Index: hrm/inc/class.sojob.inc.php
diff -u hrm/inc/class.sojob.inc.php:1.5 hrm/inc/class.sojob.inc.php:1.6
--- hrm/inc/class.sojob.inc.php:1.5     Tue Nov 22 13:26:35 2005
+++ hrm/inc/class.sojob.inc.php Wed Nov 23 10:55:40 2005
@@ -26,6 +26,7 @@
                        $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');

+                       $this->left_join                = 
$this->bocommon->left_join;
                        $this->join                     = $this->bocommon->join;
                        $this->like                     = $this->bocommon->like;
                }
@@ -188,6 +189,47 @@
                        }
                }

+
+               function read_task($job_id)
+               {
+                       $sql = "SELECT * from hrm_task WHERE job_id=" . 
intval($job_id);
+
+                       $this->db->query($sql,__LINE__,__FILE__);
+
+                       while ($this->db->next_record())
+                       {
+                               $training[] = array
+                               (
+                                       'task_id'       => $this->db->f('id'),
+                                       'name'  => 
stripslashes($this->db->f('name')),
+                                       'descr' => 
stripslashes($this->db->f('descr'))
+                               );
+
+                       }
+                       return $training;
+               }
+
+
+               function read_single_task($id)
+               {
+
+                       $sql = 'SELECT * FROM hrm_task where id=' . intval($id);
+
+                       $this->db->query($sql,__LINE__,__FILE__);
+
+                       if ($this->db->next_record())
+                       {
+                               $values['id']           = $id;
+                               $values['name'] = 
stripslashes($this->db->f('name'));
+                               $values['descr']        = 
stripslashes($this->db->f('descr'));
+                               $values['job_id']       = 
$this->db->f('job_id');
+                               $values['cat_id']       = 
$this->db->f('category');
+                               $values['entry_date']   = 
$this->db->f('entry_date');
+                               $values['owner']        = $this->db->f('owner');
+                       }
+                       return $values;
+               }
+
                function add_job($values)
                {
                        $table = 'hrm_job';
@@ -356,21 +398,6 @@
                }


-               function edit($category,$type,$type_id)
-               {
-
-                       $table = $this->select_table($type,$type_id);
-
-                       $category['descr'] = 
$this->db->db_addslashes($category['descr']);
-
-                       $this->db->query("UPDATE $table set descr='" . 
$category['descr']
-                                                       . "' WHERE id='" . 
$category['id']. "'",__LINE__,__FILE__);
-
-
-                       $receipt['message'][]=array('msg'=>lang('category has 
been edited'));
-                       return $receipt;
-               }
-
                function delete_job($id)
                {
                        $this->db->transaction_begin();
@@ -421,4 +448,60 @@
                        $this->db->query($sql,__LINE__,__FILE__);
                }

+               function add_task($values)
+               {
+                       $values['descr'] = 
$this->db->db_addslashes($values['descr']);
+                       $values['name'] = 
$this->db->db_addslashes($values['name']);
+
+                       $this->db->transaction_begin();
+
+                       $task_id = $this->bocommon->next_id('hrm_task');
+
+                       $insert_values=array(
+                               $task_id,
+                               $values['job_id'],
+                               $values['name'],
+                               $values['descr'],
+                               time(),
+                               $this->account
+                               );
+
+                       $insert_values  = 
$this->bocommon->validate_db_insert($insert_values);
+
+                       $this->db->query("INSERT INTO hrm_task 
(id,job_id,name,descr,entry_date,task_owner) "
+                               . "VALUES ($insert_values)",__LINE__,__FILE__);
+
+                       $receipt['message'][]=array('msg'=>lang('task item has 
been saved'));
+
+                       $receipt['task_id']= $task_id;
+
+                       $this->db->transaction_commit();
+                       return $receipt;
+               }
+
+               function edit_task($values)
+               {
+                       $this->db->transaction_begin();
+
+                       $value_set['descr']                     = 
$this->db->db_addslashes($values['descr']);
+                       $value_set['name']                      = 
$this->db->db_addslashes($values['name']);
+
+                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
+
+                       $table='hrm_task';
+
+                       $this->db->query("UPDATE $table set $value_set WHERE 
id=" . $values['task_id'],__LINE__,__FILE__);
+
+                       $this->db->transaction_commit();
+
+                       $receipt['message'][]=array('msg'=>lang('task item has 
been edited'));
+
+                       $receipt['task_id']= $values['task_id'];
+                       return $receipt;
+               }
+
+               function delete_task($job_id,$id)
+               {
+                       $this->db->query('DELETE FROM hrm_task WHERE id='  . 
intval($id) . ' AND job_id='  . intval($job_id),__LINE__,__FILE__);
+               }
        }

====================================================
Index: hrm/inc/class.souser.inc.php
diff -u hrm/inc/class.souser.inc.php:1.2 hrm/inc/class.souser.inc.php:1.3
--- hrm/inc/class.souser.inc.php:1.2    Tue Nov 22 18:20:09 2005
+++ hrm/inc/class.souser.inc.php        Wed Nov 23 10:55:40 2005
@@ -128,11 +128,39 @@
                        return $values;
                }

-               function read_training($id)
+               function read_training($data)
                {
-                       $sql = "SELECT hrm_training.id as 
training_id,hrm_training.title as title, 
hrm_training.start_date,hrm_training.end_date,hrm_training_place.name as place 
FROM hrm_training $this->left_join hrm_training_place on 
hrm_training.place_id=hrm_training_place.id WHERE hrm_training.user_id=" . 
intval($id);
+                       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']:'');
+                       }

-                       $this->db->query($sql,__LINE__,__FILE__);
+                       $user_id = $data['user_id'];
+
+                       if ($order)
+                       {
+                               $ordermethod = " order by $order $sort";
+
+                       }
+                       else
+                       {
+                               $ordermethod = ' order by start_date asc';
+                       }
+
+                       $sql = "SELECT hrm_training.id as 
training_id,hrm_training.title as title, 
hrm_training.start_date,hrm_training.end_date,hrm_training_place.name as place 
FROM hrm_training $this->left_join hrm_training_place on 
hrm_training.place_id=hrm_training_place.id WHERE hrm_training.user_id=" . 
intval($user_id);
+
+                       $this->db->query($sql . $ordermethod 
,__LINE__,__FILE__);

                        while ($this->db->next_record())
                        {

====================================================
Index: hrm/inc/class.uijob.inc.php
diff -u hrm/inc/class.uijob.inc.php:1.4 hrm/inc/class.uijob.inc.php:1.5
--- hrm/inc/class.uijob.inc.php:1.4     Tue Nov 22 13:26:35 2005
+++ hrm/inc/class.uijob.inc.php Wed Nov 23 10:55:40 2005
@@ -29,10 +29,12 @@
                var $public_functions = array
                (
                        'index'                         => True,
-                       'view'                          => True,
+                       'view_task'                     => True,
+                       'view_job'                      => True,
                        'edit_job'                      => True,
-                       'edit'                          => True,
-                       'delete'                        => True,
+                       'edit_task'                     => True,
+                       'delete_task'                   => True,
+                       'task'                          => True,
                        'delete_job'                    => True,
                        'reset_job_type_hierarchy'      => True
                );
@@ -98,10 +100,13 @@
                                        'link_edit'                     => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.edit_job&id='
 . $entry['id']),
                                        'link_delete'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.delete_job&job_id='
 . $entry['id']),
                                        'link_view'                     => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.view_job&id='
 . $entry['id']),
+                                       'link_task'                     => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.task&job_id='
 . $entry['id']),
+                                       'lang_task_job_text'            => 
lang('Tasks for this job'),
                                        'lang_view_job_text'            => 
lang('view the job'),
                                        'lang_edit_job_text'            => 
lang('edit the job'),
                                        'lang_delete_job_text'          => 
lang('delete the job'),
                                        'lang_add_sub_text'             => 
lang('Add a new sub-job'),
+                                       'text_task'                     => 
lang('task'),
                                        'text_view'                     => 
lang('view'),
                                        'text_edit'                     => 
lang('edit'),
                                        'text_delete'                   => 
lang('delete'),
@@ -129,6 +134,7 @@
                                'lang_edit'     => lang('edit'),
                                'lang_delete'   => lang('delete'),
                                'lang_view'     => lang('view'),
+                               'lang_task'     => lang('task'),
                        );

                        $table_add[] = array
@@ -196,6 +202,144 @@
                        $this->save_sessiondata();
                }

+
+               function task()
+               {
+                       $job_id = get_var('job_id',array('POST','GET'));
+
+                       $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','hrm_task_receipt');
+                       
$GLOBALS['phpgw']->session->appsession('session_data','hrm_task_receipt','');
+
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('job'));
+
+                       if ($job_id)
+                       {
+                               $job_info = $this->bo->read_single_job($job_id);
+                               $task = $this->bo->read_task($job_id);
+                       }
+
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
+                       while (is_array($task) && list(,$entry) = each($task))
+                       {
+
+                               if($entry['start_date'])
+                               {
+                                       $entry['start_date']    = 
$GLOBALS['phpgw']->common->show_date($entry['start_date'],$dateformat);
+                               }
+                               if($entry['end_date'])
+                               {
+                                       $entry['end_date']      = 
$GLOBALS['phpgw']->common->show_date($entry['end_date'],$dateformat);
+                               }
+
+                               $content[] = array
+                               (
+                                       'name'                  => 
$entry['name'],
+                                       'place'                 => 
$entry['place'],
+                                       'start_date'            => 
$entry['start_date'],
+                                       'end_date'              => 
$entry['end_date'],
+                                       'link_edit'             => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.edit_task&job_id=$job_id&task_id="
 . $entry['task_id']),
+                                       'link_view'             => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.view_task&job_id=$job_id&task_id="
 . $entry['task_id']),
+                                       'link_delete'           => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.".uijob.delete_task&job_id=$job_id&task_id="
 . $entry['task_id']),
+                                       'lang_view_text'        => lang('view 
task item'),
+                                       'lang_edit_text'        => lang('edit 
task item'),
+                                       'lang_delete_text'      => lang('delete 
task item'),
+                                       'text_view'             => lang('view'),
+                                       'text_edit'             => lang('edit'),
+                                       'text_delete'           => 
lang('delete')
+                               );
+                       }
+
+
+                       $table_header[] = array
+                       (
+
+                               'sort_place'    => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'hrm_task_place.name',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uijob.task',
+                                                                               
                                'job_id'        =>$job_id,
+                                                                               
                                'query'         =>$this->query,
+                                                                               
                                'cat_id'        =>$this->cat_id,
+                                                                               
                                'allrows'       => $this->allrows)
+                                                                               
)),
+                               'lang_place'    => lang('place'),
+                               'sort_name'     => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'hrm_task.name',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uijob.task',
+                                                                               
                                'job_id'        =>$job_id,
+                                                                               
                                'query'         =>$this->query,
+                                                                               
                                'cat_id'        =>$this->cat_id,
+                                                                               
                                'allrows' => $this->allrows)
+                                                                               
)),
+                               'lang_name'     => lang('name'),
+                               'lang_start_date'=> lang('start date'),
+                               'lang_end_date' => lang('end date'),
+                               'lang_view'     => lang('view'),
+                               'lang_edit'     => lang('edit'),
+                               'lang_delete'   => lang('delete'),
+                       );
+
+
+
+                       $function_msg = lang('list task');
+
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uijob.edit_task',
+                               'job_id'        => $job_id
+                       );
+
+                       $table_add[] = array
+                       (
+                               'lang_add'                      => lang('add'),
+                               'lang_add_task_text'    => lang('add a task 
item'),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.edit_task&job_id='.$job_id),
+                               'lang_done'                     => lang('done'),
+                               'lang_done_task_text'   => lang('back to user 
list'),
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.index')
+                       );
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'lang_job_name'                         => 
lang('Job name'),
+                               'value_job_name'                        => 
$job_info['name'],
+                               'table_header_task'                     => 
$table_header,
+                               'values_task'                           => 
$content,
+                               'table_add'                             => 
$table_add,
+                               'user_values'                           => 
$user_values,
+                               'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.index'),
+                               'lang_id'                               => 
lang('task ID'),
+                               'lang_descr'                            => 
lang('Descr'),
+                               'lang_save'                             => 
lang('save'),
+                               'lang_cancel'                           => 
lang('cancel'),
+                               'value_id'                              => 
$job_id,
+                               'lang_id_status_text'                   => 
lang('Enter the task ID'),
+                               'lang_descr_status_text'                => 
lang('Enter a description the task'),
+                               'lang_done_status_text'                 => 
lang('Back to the list'),
+                               'lang_save_status_text'                 => 
lang('Save the task'),
+                               'type_id'                               => 
$task['type_id'],
+                               'value_descr'                           => 
$task['descr'],
+                               'lang_apply'                            => 
lang('apply'),
+                               'lang_apply_status_text'                => 
lang('Apply the values'),
+                       );
+
+                       $appname                                        = 
lang('task');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('task' => $data));
+               }
+
                function edit_job()
                {
                        $id             = get_var('id',array('POST','GET'));
@@ -284,15 +428,14 @@


                                'lang_id_statustext'    => lang('Enter the 
category ID'),
-                               'lang_descr_statustext'                 => 
lang('Enter a description the category'),
+                               'lang_descr_statustext'                 => 
lang('Enter a description the job'),
                                'lang_done_statustext'                  => 
lang('Back to the list'),
-                               'lang_save_statustext'                  => 
lang('Save the category'),
+                               'lang_save_statustext'                  => 
lang('Save the job'),
                                'type_id'                               => 
$values['type_id'],
                                'value_descr'                                   
=> $values['descr'],
                                'value_name'                                    
=> $values['name'],

                                'lang_cancel'                           => 
lang('cancel'),
-                               'lang_save_status_text'                 => 
lang('Save the training'),
                                'lang_apply'                            => 
lang('apply'),
                                'lang_apply_status_text'                => 
lang('Apply the values'),
                        );
@@ -303,119 +446,329 @@
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_job' => $data));
                }

-               function edit()
+               function view_job()
                {
-                       $type   = get_var('type',array('POST','GET'));
-                       $type_id        = 
get_var('type_id',array('POST','GET'));
-                       $id     = get_var('id',array('POST','GET'));
-                       $values                 = 
get_var('values',array('POST'));
+                       $id             = get_var('id',array('POST','GET'));
+                       $parent_id      = 
get_var('parent_id',array('POST','GET'));
+                       $values         = get_var('values',array('POST'));
+
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('job'));


+                       if ($id)
+                       {
+                               $values = $this->bo->read_single_job($id);
+                               $function_msg = lang('view job');
+                       }
+
+                       if($parent_id)
+                       {
+                               $values['parent_id'] = $parent_id;
+                       }
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uijob.edit_job',
+                               'id'    => $id
+                       );
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.index&type='.$type
 . '&type_id=' . $type_id),
+                               'lang_id'                               => 
lang('category ID'),
+                               'lang_descr'                                    
=> lang('Descr'),
+                               'lang_save'                                     
=> lang('save'),
+                               'value_id'                              => $id,
+
+                               'parent_list'                           => 
$this->bo->select_job_list($values['parent_id']),
+                               'lang_parent'                           => 
lang('parent'),
+                               'lang_parent_status_text'               => 
lang('Select this jobs parent'),
+                               'lang_no_parent'                        => 
lang('select a parent'),
+
+                               'lang_name'                             => 
lang('name'),
+                               'lang_name_status_text'                 => 
lang('name of the job-type'),
+
+
+                               'lang_id_statustext'    => lang('Enter the 
category ID'),
+                               'lang_descr_statustext'                 => 
lang('Enter a description the job'),
+                               'lang_done_statustext'                  => 
lang('Back to the list'),
+                               'lang_save_statustext'                  => 
lang('Save the job'),
+                               'type_id'                               => 
$values['type_id'],
+                               'value_descr'                                   
=> $values['descr'],
+                               'value_name'                                    
=> $values['name'],
+
+                               'lang_cancel'                           => 
lang('cancel'),
+                               'lang_apply'                            => 
lang('apply'),
+                               'lang_apply_status_text'                => 
lang('Apply the values'),
+                       );
+
+                       $appname                                        = 
lang('job');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view_job' => $data));
+               }
+
+               function edit_task()
+               {
+                       $task_id        = 
get_var('task_id',array('POST','GET'));
+                       $job_id = get_var('job_id',array('POST','GET'));
+                       $values         = get_var('values',array('POST'));
+
                        $GLOBALS['phpgw']->xslttpl->add_file(array('job'));

                        if (is_array($values))
                        {
+                               $values['place_id']= 
get_var('place_id',array('POST'));
+                               $values['job_id']= $job_id;
+
                                if ($values['save'] || $values['apply'])
                                {
-                                       if(!$id && !ctype_digit($values['id']))
+                                       if(!$values['name'])
                                        {
-                                               
$receipt['error'][]=array('msg'=>lang('Please enter an integer !'));
-                                               unset($values['id']);
+                                               
$receipt['error'][]=array('msg'=>lang('Please enter a name !'));
                                        }

-                                       if($id)
+                                       if($task_id)
                                        {
-                                               $values['id']=$id;
+                                               $values['task_id']=$task_id;
                                                $action='edit';
                                        }
-                                       else
-                                       {
-                                               $id =   $values['id'];
-                                       }

                                        if(!$receipt['error'])
                                        {
-                                               $receipt = 
$this->bo->save($values,$action,$type,$type_id);
+                                               $receipt = 
$this->bo->save_task($values,$action);
+                                               $task_id = $receipt['task_id'];

                                                if ($values['save'])
                                                {
-                                                       
$GLOBALS['phpgw']->session->appsession('session_data','hr_user_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uiuser.index');
+                                                       
$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.'.uiuser.index');
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uijob.task&job_id='
 . $job_id);
                                }
                        }

-                       if ($id)
+
+                       if ($task_id)
                        {
-                               $category = 
$this->bo->read_single($id,$type,$type_id);
-                               $function_msg = lang('edit category');
+                               if(!$receipt['error'])
+                               {
+                                       $values = 
$this->bo->read_single_task($task_id);
+                               }
+                               $function_msg = lang('edit task');
                                $action='edit';
                        }
                        else
                        {
-                               $function_msg = lang('add category');
+                               $function_msg = lang('add task');
                                $action='add';
                        }


                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uijob.edit',
-                               'id'    => $id,
-                               'type' => $type,
-                               'type_id' => $type_id
+                               'menuaction'    => 
$this->currentapp.'.uijob.edit_task',
+                               'task_id'       => $task_id,
+                               'job_id' => $job_id
                        );
 //_debug_array($link_data);

+                       $jscal = CreateObject('phpgwapi.jscalendar');   // 
before phpgw_header() !!!
+
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);

+                       $GLOBALS['phpgw_info']['flags']['java_script'] .= "\n"
+                               . '<script language ="javascript">' ."\n"
+                               . 'function modplace(form){' ."\n"
+                               . 'var val = form.place_id.value' ."\n"
+                               . 'if(val == "new_place"){' ."\n"
+                                       . 'document.all.div1.style.display = 
"block"' ."\n"
+                               . '}' ."\n"
+                               . 'else{' ."\n"
+                                       . 'document.all.div1.style.display = 
"none"' ."\n"
+                               . '}' ."\n"
+                               . '}' ."\n"
+                               . "</script>\n";
+
                        $data = array
                        (
-                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.index&type='.$type
 . '&type_id=' . $type_id),
-                               'lang_id'                               => 
lang('category ID'),
-                               'lang_descr'                                    
=> lang('Descr'),
-                               'lang_save'                                     
        => lang('save'),
-                               'lang_done'                                     
        => lang('done'),
-                               'value_id'                              => $id,
-                               'lang_id_statustext'    => lang('Enter the 
category ID'),
-                               'lang_descr_statustext'                 => 
lang('Enter a description the category'),
-                               'lang_done_statustext'                  => 
lang('Back to the list'),
-                               'lang_save_statustext'                  => 
lang('Save the category'),
-                               'type_id'                               => 
$category['type_id'],
-                               'value_descr'                                   
=> $category['descr']
+                               'value_descr'                           => 
$values['descr'],
+                               'value_name'                            => 
$values['name'],
+                               'value_start_date'                      => 
$values['start_date'],
+                               'value_end_date'                        => 
$values['end_date'],
+                               'value_entry_date'                      => 
$values['entry_date'],
+                               'value_reference'                       => 
$values['reference'],
+                               'value_new_place_name'                  => 
$values['new_place_name'],
+                               'value_new_place_address'               => 
$values['new_place_address'],
+                               'value_new_place_zip'                   => 
$values['new_place_zip'],
+                               'value_new_place_town'                  => 
$values['new_place_town'],
+                               'value_new_place_remark'                => 
$values['new_place_remark'],
+
+                               'date_img'                              => 
$GLOBALS['phpgw']->common->image('phpgwapi','cal'),
+                               'lang_start_date'                       => 
lang('start date'),
+                               'lang_end_date'                         => 
lang('end date'),
+                               'lang_start_date_title'                 => 
lang('select start date'),
+                               'lang_end_date_title'                   => 
lang('select end date'),
+                               'lang_start_date_status_text'           => 
lang('Select the start date for your task'),
+                               'lang_end_date_status_text'             => 
lang('Select the end date for your task'),
+                               'calendar_setup_start'                  => 
"Calendar.setup({inputField  : 'values[start_date]',button : 
'values[start_date]-trigger'});",
+                               'calendar_setup_end'                    => 
"Calendar.setup({inputField  : 'values[end_date]',button : 
'values[end_date]-trigger'});",
+                               'lang_reference'                        => 
lang('reference'),
+
+                               'lang_entry_date'                       => 
lang('Entry date'),
+                               'lang_name'                             => 
lang('name'),
+                               'lang_name_status_text'         => lang('name 
of the task item'),
+                               'lang_skill'                            => 
lang('Skill'),
+                               'lang_skill_status_text'                => 
lang('Select your skill'),
+//                             'skill_list'                            => 
$this->bo->select_skill_list($values['skill']),
+                               'lang_no_skill'                         => 
lang('select a skill'),
+
+//                             'place_list'                            => 
$this->bo->select_place_list($values['place_id']),
+                               'lang_place'                            => 
lang('place'),
+                               'lang_new_place'                        => 
lang('new place'),
+                               'lang_place_status_text'                => 
lang('Select a place'),
+                               'lang_new_place_status_text'            => 
lang('Enter a new place'),
+                               'lang_no_place'                                 
=> lang('select a place'),
+
+                               'lang_new_place_name'                   => 
lang('name'),
+                               'lang_new_place_address'                => 
lang('address'),
+                               'lang_new_place_zip'                    => 
lang('zip'),
+                               'lang_new_place_town'                   => 
lang('town'),
+                               'lang_new_place_remark'                 => 
lang('remark'),
+
+                               'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'lang_id'                               => 
lang('task ID'),
+                               'lang_descr'                            => 
lang('Descr'),
+                               'lang_save'                             => 
lang('save'),
+                               'lang_cancel'                           => 
lang('cancel'),
+                               'value_id'                              => 
$task_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'),
+                               'lang_apply'                            => 
lang('apply'),
+                               'lang_apply_status_text'                => 
lang('Apply the values'),
+
+                               'lang_category'                         => 
lang('category'),
+//                             'cat_list'                              => 
$this->bo->select_category_list('select',$values['cat_id']),
+                               'lang_no_cat'                           => 
lang('no category'),
+                               'lang_cat_status_text'                  => 
lang('Select the category the building belongs to. To do not use a category 
select NO CATEGORY'),
+                               'select_name'                           => 
'values[cat_id]',
                        );

-                       $appname                                        = 
lang('HRM');
+                       $job_info = $this->bo->read_single_job($job_id);
+
+                       $appname                                        = 
lang('task') .' ' . $job_info['name'];

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

-               function delete()
+               function view_task()
                {
-                       $type   = get_var('type',array('POST','GET'));
-                       $type_id        = 
get_var('type_id',array('POST','GET'));
-                       $id             = get_var('id',array('POST','GET'));
+                       $task_id        = 
get_var('task_id',array('POST','GET'));
+                       $job_id = get_var('job_id',array('POST','GET'));
+                       $values         = get_var('values',array('POST'));
+
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('job'));
+
+                       $values = $this->bo->read_single_task($task_id);
+                       $function_msg = lang('view task');
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uijob.task',
+                               'job_id' => $job_id
+                       );
+
+                       $data = array
+                       (
+                               'value_descr'                           => 
$values['descr'],
+                               'value_name'                            => 
$values['name'],
+                               'value_start_date'                      => 
$values['start_date'],
+                               'value_end_date'                        => 
$values['end_date'],
+                               'value_entry_date'                      => 
$values['entry_date'],
+                               'value_reference'                       => 
$values['reference'],
+                               'value_new_place_name'                  => 
$values['new_place_name'],
+                               'value_new_place_address'               => 
$values['new_place_address'],
+                               'value_new_place_zip'                   => 
$values['new_place_zip'],
+                               'value_new_place_town'                  => 
$values['new_place_town'],
+                               'value_new_place_remark'                => 
$values['new_place_remark'],
+
+
+                               'lang_entry_date'                       => 
lang('Entry date'),
+                               'lang_name'                             => 
lang('name'),
+                               'lang_name_status_text'         => lang('name 
of the task item'),
+                               'lang_skill'                            => 
lang('Skill'),
+                               'lang_skill_status_text'                => 
lang('Select your skill'),
+//                             'skill_list'                            => 
$this->bo->select_skill_list($values['skill']),
+                               'lang_no_skill'                         => 
lang('select a skill'),
+
+//                             'place_list'                            => 
$this->bo->select_place_list($values['place_id']),
+                               'lang_place'                            => 
lang('place'),
+                               'lang_new_place'                        => 
lang('new place'),
+                               'lang_place_status_text'                => 
lang('Select a place'),
+                               'lang_new_place_status_text'            => 
lang('Enter a new place'),
+                               'lang_no_place'                                 
=> lang('select a place'),
+
+                               'lang_new_place_name'                   => 
lang('name'),
+                               'lang_new_place_address'                => 
lang('address'),
+                               'lang_new_place_zip'                    => 
lang('zip'),
+                               'lang_new_place_town'                   => 
lang('town'),
+                               'lang_new_place_remark'                 => 
lang('remark'),
+
+                               'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'lang_id'                               => 
lang('task ID'),
+                               'lang_descr'                            => 
lang('Descr'),
+                               'lang_save'                             => 
lang('save'),
+                               'lang_cancel'                           => 
lang('cancel'),
+                               'value_id'                              => 
$task_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'),
+                               'lang_apply'                            => 
lang('apply'),
+                               'lang_apply_status_text'                => 
lang('Apply the values'),
+
+                               'lang_category'                         => 
lang('category'),
+//                             'cat_list'                              => 
$this->bo->select_category_list('select',$values['cat_id']),
+                               'lang_no_cat'                           => 
lang('no category'),
+                               'lang_cat_status_text'                  => 
lang('Select the category the building belongs to. To do not use a category 
select NO CATEGORY'),
+                               'select_name'                           => 
'values[cat_id]',
+                       );
+
+                       $job_info = $this->bo->read_single_job($job_id);
+
+                       $appname                                        = 
lang('task') .' ' . $job_info['name'];
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view_task' => $data));
+               }
+
+
+               function delete_job()
+               {
+                       $job_id = get_var('job_id',array('POST','GET'));
                        $confirm                = 
get_var('confirm',array('POST'));

                        $link_data = array
                        (
                                'menuaction' => 
$this->currentapp.'.uijob.index',
-                               'type' => $type,
-                               'type_id' => $type_id
+                               'job_id' => $job_id
                        );

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

@@ -424,7 +777,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.delete&id='
 . $id.'&type='.$type . '&type_id=' . $type_id),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.delete_job&job_id='
 . $job_id),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                              => 
lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -432,27 +785,28 @@
                                'lang_no'                               => 
lang('no')
                        );

-                       $appname                                        = 
lang('HRM');
+                       $appname                                        = 
lang('job');
                        $function_msg                                   = 
lang('delete');

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

-               function delete_job()
+               function delete_task()
                {
+                       $task_id                = 
get_var('task_id',array('POST','GET'));
                        $job_id = get_var('job_id',array('POST','GET'));
                        $confirm                = 
get_var('confirm',array('POST'));

                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uijob.index',
+                               'menuaction' => $this->currentapp.'.uijob.task',
                                'job_id' => $job_id
                        );

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

@@ -461,15 +815,15 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.delete_job&job_id='
 . $job_id),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.delete_task&job_id='
 . $job_id .'&task_id='. $task_id),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                              => 
lang('yes'),
-                               'lang_yes_statustext'   => lang('Delete the 
entry'),
-                               'lang_no_statustext'    => lang('Back to the 
list'),
+                               'lang_yes_categorytext' => lang('Delete the 
entry'),
+                               'lang_no_categorytext'  => lang('Back to the 
list'),
                                'lang_no'                               => 
lang('no')
                        );

-                       $appname                                        = 
lang('job');
+                       $appname                                        = 
lang('task');
                        $function_msg                                   = 
lang('delete');

                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;

====================================================
Index: hrm/inc/class.bojob.inc.php
diff -u hrm/inc/class.bojob.inc.php:1.4 hrm/inc/class.bojob.inc.php:1.5
--- hrm/inc/class.bojob.inc.php:1.4     Tue Nov 22 13:26:35 2005
+++ hrm/inc/class.bojob.inc.php Wed Nov 23 10:55:40 2005
@@ -143,6 +143,25 @@
                        return $this->so->read_single_job($id);
                }

+               function read_task($job_id)
+               {
+                       $values = $this->so->read_task($job_id);
+                       return $values;
+               }
+
+               function read_single_task($id)
+               {
+                       $values =$this->so->read_single_task($id);
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       if($values['entry_date'])
+                       {
+                               $values['entry_date']   = 
$GLOBALS['phpgw']->common->show_date($values['entry_date'],$dateformat);
+                       }
+
+                       return $values;
+               }
+
+
                function save_job($values,$action='')
                {
                        if ($action=='edit')
@@ -165,9 +184,31 @@
                        return $receipt;
                }

-               function delete($id,$type,$type_id)
+               function save_task($values,$action='')
+               {
+                       if ($action=='edit')
+                       {
+                               if ($values['task_id'] != '')
+                               {
+
+                                       $receipt = 
$this->so->edit_task($values);
+                               }
+                               else
+                               {
+                                       
$receipt['error'][]=array('msg'=>lang('Error'));
+                               }
+                       }
+                       else
+                       {
+                               $receipt = $this->so->add_task($values);
+                       }
+
+                       return $receipt;
+               }
+
+               function delete_task($job_id,$id)
                {
-                       $this->so->delete($id,$type,$type_id);
+                       $this->so->delete_task($job_id,$id);
                }

                function delete_job($id)






reply via email to

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