phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] hrm inc/class.bojob.inc.php inc/class.sojob.inc...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] hrm inc/class.bojob.inc.php inc/class.sojob.inc...
Date: Fri, 01 Sep 2006 12:08:28 +0000

CVSROOT:        /sources/phpgroupware
Module name:    hrm
Changes by:     Sigurd Nes <sigurdne>   06/09/01 12:08:27

Modified files:
        inc            : class.bojob.inc.php class.sojob.inc.php 
                         class.uijob.inc.php class.uiuser.inc.php 
        setup          : phpgw_no.lang setup.inc.php 
                         tables_current.inc.php tables_update.inc.php 
        templates/base : job.xsl 

Log message:
        added pdf-print and sorting of tasks and qualification-items

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/hrm/inc/class.bojob.inc.php?cvsroot=phpgroupware&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/hrm/inc/class.sojob.inc.php?cvsroot=phpgroupware&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/hrm/inc/class.uijob.inc.php?cvsroot=phpgroupware&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/hrm/inc/class.uiuser.inc.php?cvsroot=phpgroupware&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/hrm/setup/phpgw_no.lang?cvsroot=phpgroupware&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/hrm/setup/setup.inc.php?cvsroot=phpgroupware&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/hrm/setup/tables_current.inc.php?cvsroot=phpgroupware&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/hrm/setup/tables_update.inc.php?cvsroot=phpgroupware&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/hrm/templates/base/job.xsl?cvsroot=phpgroupware&r1=1.17&r2=1.18

Patches:
Index: inc/class.bojob.inc.php
===================================================================
RCS file: /sources/phpgroupware/hrm/inc/class.bojob.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- inc/class.bojob.inc.php     21 Apr 2006 12:57:27 -0000      1.14
+++ inc/class.bojob.inc.php     1 Sep 2006 12:08:27 -0000       1.15
@@ -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.14 2006/04/21 12:57:27 sigurdne 
Exp $
+       * @version $Id: class.bojob.inc.php,v 1.15 2006/09/01 12:08:27 sigurdne 
Exp $
        */
 
        /**
@@ -412,4 +412,10 @@
                        $qualification_list = 
$this->so->select_qualification_list($job_id,$quali_id);
                        return $qualification_list;
                }
+               
+               function resort_value($data)
+               {
+                       $this->so->resort_value($data);
+               }
+
        }

Index: inc/class.sojob.inc.php
===================================================================
RCS file: /sources/phpgroupware/hrm/inc/class.sojob.inc.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- inc/class.sojob.inc.php     24 Aug 2006 12:46:49 -0000      1.21
+++ inc/class.sojob.inc.php     1 Sep 2006 12:08:27 -0000       1.22
@@ -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.21 2006/08/24 12:46:49 sigurdne 
Exp $
+       * @version $Id: class.sojob.inc.php,v 1.22 2006/09/01 12:08:27 sigurdne 
Exp $
        */
 
        /**
@@ -262,7 +262,7 @@
                        }
                        else
                        {
-                               $ordermethod = ' order by name asc';
+                               $ordermethod = ' order by value_sort asc';
                        }
 
                        $groupmethod = ' GROUP BY phpgw_hrm_quali.category';
@@ -286,6 +286,7 @@
                        $this->db->query($sql . $parent_select . $querymethod . 
$ordermethod,__LINE__,__FILE__);
                        $this->total_records = $this->db->num_rows();
 
+                       $value_sort = 1;
                        while ($this->db->next_record())
                        {
                                $qualifications[] = array
@@ -296,8 +297,10 @@
                                        'descr' => 
stripslashes($this->db->f('descr')),
                                        'remark'        => 
stripslashes($this->db->f('remark')),
                                        'category'      => 
stripslashes($this->db->f('category')),
-                                       'parent'=> 0
+                                       'parent'=> 0,
+                                       'value_sort'    => $value_sort,
                                );
+                               $value_sort ++;
                        }
 
                        $num_qualifications = count($qualifications);
@@ -311,6 +314,7 @@
 
                                $subqualifications = array();
                                $j = 0;
+                               $value_sort = 1;
                                while ($this->db->next_record())
                                {
                                        $subqualifications[$j]['quali_id']      
    = (int)$this->db->f('quali_id');
@@ -318,7 +322,9 @@
                                        $subqualifications[$j]['parent']      = 
(int)$this->db->f('quali_parent');
                                        $subqualifications[$j]['name']        = 
$this->db->f('name');
                                        $subqualifications[$j]['descr'] = 
$this->db->f('descr');
+                                       $subqualifications[$j]['value_sort']    
= $value_sort;
                                        $j++;
+                                       $value_sort ++;
                                }
 
                                $num_subqualifications = 
count($subqualifications);
@@ -483,7 +489,7 @@
                        }
                        else
                        {
-                               $ordermethod = ' order by name asc';
+                               $ordermethod = ' order by value_sort asc';
                        }
 
                        $sql = "SELECT * from phpgw_hrm_task  WHERE job_id=" . 
intval($job_id);
@@ -507,6 +513,7 @@
                        $this->db->query($sql . $parent_select . $querymethod . 
$ordermethod,__LINE__,__FILE__);
                        $this->total_records = $this->db->num_rows();
 
+                       $value_sort = 1;
                        while ($this->db->next_record())
                        {
                                $tasks[] = array
@@ -515,8 +522,10 @@
                                        'level' => 0,
                                        'name'  => 
stripslashes($this->db->f('name')),
                                        'descr' => 
stripslashes($this->db->f('descr')),
-                                       'parent'=> 0
+                                       'parent'=> 0,
+                                       'value_sort'=> $value_sort
                                );
+                               $value_sort++;
                        }
 
                        $num_tasks = count($tasks);
@@ -530,6 +539,7 @@
 
                                $subtasks = array();
                                $j = 0;
+                               $value_sort = 1;
                                while ($this->db->next_record())
                                {
                                        $subtasks[$j]['id']          = 
(int)$this->db->f('id');
@@ -537,7 +547,10 @@
                                        $subtasks[$j]['parent']      = 
(int)$this->db->f('task_parent');
                                        $subtasks[$j]['name']        = 
$this->db->f('name');
                                        $subtasks[$j]['descr'] = 
$this->db->f('descr');
+                                       $subtasks[$j]['value_sort'] = 
$value_sort;
+                                       
                                        $j++;
+                                       $value_sort ++;
                                }
 
                                $num_subtasks = count($subtasks);
@@ -797,9 +810,14 @@
                {
                        $table = 'phpgw_hrm_task';
 
+                       $this->db->query("SELECT max(value_sort) as value_sort 
FROM $table WHERE job_id = " . (int)$values['job_id'],__LINE__,__FILE__);
+                       $this->db->next_record();
+                       $value_sort     = (int)$this->db->f('value_sort') +1;
+
+
                        if($values['parent_id'])
                        {
-                               $this->db->query("SELECT task_level FROM $table 
 where id=" . intval($values['parent_id']),__LINE__,__FILE__);
+                               $this->db->query("SELECT task_level, 
max(value_sort) as value_sort FROM $table  where id=" . 
intval($values['parent_id']),__LINE__,__FILE__);
                                $this->db->next_record();
                                $level  = (int)$this->db->f('task_level') +1;
                        }
@@ -818,13 +836,14 @@
                                intval($values['parent_id']),
                                $level,
                                time(),
-                               $this->account
+                               $this->account,
+                               $value_sort
                                );
 
                        $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) "
+                       $this->db->query("INSERT INTO $table 
(job_id,name,descr,task_parent,task_level,entry_date,owner,value_sort) "
                                . "VALUES ($insert_values)",__LINE__,__FILE__);
 
                        $receipt['message'][]=array('msg'=>lang('task has been 
saved'));
@@ -1067,6 +1086,10 @@
                {
                        $value['remark'] = 
$this->db->db_addslashes($values['remark']);
                        
+                       $this->db->query("SELECT  max(value_sort) as value_sort 
FROM phpgw_hrm_quali WHERE job_id = " . 
(int)$values['job_id'],__LINE__,__FILE__);
+                       $this->db->next_record();
+                       $value_sort     = (int)$this->db->f('value_sort') +1;
+
                        $this->db->transaction_begin();
 
                        $insert_values=array(
@@ -1077,12 +1100,13 @@
                                $values['experience_id'],
                                time(),
                                $this->account,
-                               $value['remark']
+                               $value['remark'],
+                               $value_sort
                                );
 
                        $insert_values  = 
$this->bocommon->validate_db_insert($insert_values);
 
-                       $this->db->query("INSERT INTO phpgw_hrm_quali 
(job_id,quali_type_id,category,skill_id,experience_id,entry_date,quali_owner,remark)
 "
+                       $this->db->query("INSERT INTO phpgw_hrm_quali 
(job_id,quali_type_id,category,skill_id,experience_id,entry_date,quali_owner,remark,value_sort)
 "
                                . "VALUES ($insert_values)",__LINE__,__FILE__);
 
                        $quali_id = 
$this->db->get_last_insert_id('phpgw_hrm_quali','id');
@@ -1187,4 +1211,65 @@
                        $this->db->query('DELETE FROM phpgw_hrm_quali WHERE 
id='  . intval($id) . ' AND job_id='  . intval($job_id),__LINE__,__FILE__);
                        $this->db->transaction_commit();
                }
+               
+               function resort_value($data)
+               {
+                       if(is_array($data))
+                       {
+                               $resort = 
(isset($data['resort'])?$data['resort']:'up');
+                               $job_id = 
(isset($data['job_id'])?$data['job_id']:'');
+                               $id = (isset($data['id'])?$data['id']:'');
+                               $type = (isset($data['type'])?$data['type']:'');
+                       }
+
+                       switch($type)
+                       {
+                               case 'task':
+                                       $table = 'phpgw_hrm_task';
+                                       break;
+                               case 'qualification':
+                                       $table = 'phpgw_hrm_quali';
+                                       break;
+                       }
+
+                       if(!$table)
+                       {
+                               return;
+                       }
+
+                       $sql = "SELECT value_sort FROM $table where 
job_id=$job_id AND id=$id";
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       $this->db->next_record();
+                       $value_sort     = $this->db->f('value_sort');
+                       $sql2 = "SELECT max(value_sort) as max_sort FROM $table 
where job_id=$job_id";
+                       $this->db->query($sql2,__LINE__,__FILE__);
+                       $this->db->next_record();
+                       $max_sort       = $this->db->f('max_sort');
+
+                       switch($resort)
+                       {
+                               case 'up':
+                                       if($value_sort>1)
+                                       {
+                                               $sql = "UPDATE $table set 
value_sort=$value_sort WHERE job_id=$job_id AND value_sort =" . ($value_sort-1);
+                                               
$this->db->query($sql,__LINE__,__FILE__);
+                                               $sql = "UPDATE $table set 
value_sort=" . ($value_sort-1) ." WHERE job_id=$job_id AND id=$id";
+                                               
$this->db->query($sql,__LINE__,__FILE__);
+                                       }
+                                       break;
+                               case 'down':
+                                       if($max_sort > $value_sort)
+                                       {
+                                               $sql = "UPDATE $table set 
value_sort=$value_sort WHERE job_id=$job_id AND value_sort =" . ($value_sort+1);
+                                               
$this->db->query($sql,__LINE__,__FILE__);
+                                               $sql = "UPDATE $table set 
value_sort=" . ($value_sort+1) ." WHERE job_id=$job_id AND id=$id";
+                                               
$this->db->query($sql,__LINE__,__FILE__);
+                                       }
+                                       break;
+                               default:
+                                       return;
+                                       break;
+                       }
+               }
+               
        }

Index: inc/class.uijob.inc.php
===================================================================
RCS file: /sources/phpgroupware/hrm/inc/class.uijob.inc.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- inc/class.uijob.inc.php     24 Aug 2006 12:46:49 -0000      1.23
+++ inc/class.uijob.inc.php     1 Sep 2006 12:08:27 -0000       1.24
@@ -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.23 2006/08/24 12:46:49 sigurdne 
Exp $
+       * @version $Id: class.uijob.inc.php,v 1.24 2006/09/01 12:08:27 sigurdne 
Exp $
        */
 
        /**
@@ -43,7 +43,8 @@
                        'delete_task'                   => True,
                        'lookup_qualification'          => True,
                        'edit_qualification_type'       => True,
-                       'hierarchy'                     => True
+                       'hierarchy'                     => True,
+                       'print_pdf'                     => True
                );
 
                function uijob()
@@ -109,6 +110,7 @@
 
                                $content[] = array
                                (
+                                       'id'                                    
=> $entry['id'],
                                        'name'                                  
=> $entry['name'],
                                        'descr'                                 
=> $entry['descr'],
                                        'task_count'                    => 
$entry['task_count'],
@@ -156,6 +158,7 @@
                                'lang_view'     => lang('view'),
                                'lang_qualification'    => 
lang('qualification'),
                                'lang_task'     => lang('task'),
+                               'lang_print'    => lang('print')
                        );
 
                        $table_add[] = array
@@ -211,7 +214,12 @@
                                'lang_search'                                   
=> lang('search'),
                                'table_header'                                  
=> $table_header,
                                'values'                                        
=> $content,
-                               'table_add_job'                                 
=> $table_add
+                               'table_add_job'                                 
=> $table_add,
+                               'lang_select_all'                               
=> lang('Select All'),
+                               'img_check'                                     
=> $GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
+                               'check_source'                                  
=> './'.$this->currentapp.'/inc/check.js',
+                               'lang_print'                                    
=> lang('print'),
+                               'print_action'                                  
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.print_pdf'),
                        );
 
                        $appname                                        = 
lang('job');
@@ -222,6 +230,105 @@
                        $this->save_sessiondata();
                }
 
+               function print_pdf()
+               {
+                       if(!$this->acl->check('.job', PHPGW_ACL_READ))
+                       {
+                               $this->bocommon->no_access($links);
+                               return;
+                       }
+                       $GLOBALS['phpgw_info']['flags'][noheader] = True;
+                       $GLOBALS['phpgw_info']['flags'][nofooter] = True;
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = False;
+                       
+                       $pdf    = CreateObject('phpgwapi.pdf');
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       $date = 
$GLOBALS['phpgw']->common->show_date('',$dateformat);
+                       
+                       $values = get_var('values',array('POST','GET'));
+                       
+                       // don't want any warnings turning up in the pdf code 
if the server is set to 'anal' mode.
+                       //error_reporting(7);
+                       //error_reporting(E_ALL);
+                       set_time_limit(1800);
+                       $pdf -> ezSetMargins(50,70,100,50);
+                       $pdf->selectFont(PHPGW_API_INC . 
'/pdf/fonts/Helvetica.afm');
+
+                       // put a line top and bottom on all the pages
+                       $all = $pdf->openObject();
+                       $pdf->saveState();
+                       $pdf->setStrokeColor(0,0,0,1);
+
+//                     $pdf->line(20,760,578,760);
+//                     $pdf->line(200,40,200,822);
+                       
+                       $pdf->addText(220,770,16,'Stillings beskrivelse');
+                       $pdf->addText(300,34,6,$date);
+
+                       $pdf->restoreState();
+                       $pdf->closeObject();
+                       // note that object can be told to appear on just odd 
or even pages by changing 'all' to 'odd'
+                       // or 'even'.
+                       $pdf->addObject($all,'all');
+                       $pdf->ezStartPageNumbers(500,28,10,'right','{PAGENUM} ' 
. lang('of') . ' {TOTALPAGENUM}',1);
+
+                       $pdf->ezSetDy(-50);
+
+                       $i = 0;
+               
+                       while (is_array($values) && list(,$job_id) = 
each($values['select']))
+                       {
+                               if($i > 0)
+                               {
+                                       $pdf->ezNewPage();
+                               }
+                               $job_info = $this->bo->read_single_job($job_id);
+                               $qualification = 
$this->bo->read_qualification($job_id);
+                               $task = $this->bo->read_task($job_id);
+                               $i++;
+                       
+                               $pdf->ezSetY(720);
+                               $pdf->ezText($job_info['name'],14);
+                               $pdf->ezSetDy(-10);
+                               $pdf->ezText(lang('tasks') . ':',12);
+                               $pdf->ezSetDy(-5);
+                               $j = 1;
+                               while (is_array($task) && list(,$entry) = 
each($task))
+                               {
+                                       if($entry['descr'])
+                                       {
+                                               $pdf->ezText($j . ' ' . 
$entry['name'] . ': ',12,array('left' => 10));
+                                               
$pdf->ezText($entry['descr'],12,array('left' => 30));
+                                       }
+                                       else
+                                       {
+                                               $pdf->ezText($j . ' ' . 
$entry['name'],12,array('left' => 10));
+                                       }
+                                       $j++;
+                               }       
+                               $pdf->ezSetDy(-10);
+                               
+                               $pdf->ezText(lang('qualification') . ':',12);
+                               $pdf->ezSetDy(-5);
+                               $j = 1;
+                               while (is_array($qualification) && 
list(,$entry) = each($qualification))
+                               {
+                                       if($entry['descr'])
+                                       {
+                                               $pdf->ezText($j . ' ' . 
$entry['name'] . ': ',12,array('left' => 10));
+                                               
$pdf->ezText($entry['descr'],12,array('left' => 30));
+                                       }
+                                       else
+                                       {
+                                               $pdf->ezText($j . ' ' . 
$entry['name'],12,array('left' => 10));
+                                       }
+                                       $j++;
+                               }       
+                       }
+                       
+                       $document = $pdf->ezOutput();
+                       $pdf->print_pdf($document,'job');  
+               }
 
                function qualification()
                {
@@ -232,6 +339,13 @@
                        }
 
                        $job_id = get_var('job_id',array('POST','GET'));
+                       $id     = get_var('id',array('POST','GET'));
+                       $resort = get_var('resort',array('POST','GET'));
+
+                       if($resort)
+                       {
+                               
$this->bo->resort_value(array('resort'=>$resort,'job_id' => $job_id,'id' => 
$id,'type'=>'qualification'));
+                       }
 
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','hrm_quali_receipt');
                        
$GLOBALS['phpgw']->session->appsession('session_data','hrm_quali_receipt','');
@@ -249,17 +363,14 @@
                        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
                                (
+                                       'sorting'               => 
$entry['value_sort'],
+                                       'link_up'               => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.qualification&resort=up&id='
 . $entry['quali_id'].'&job_id=' . $job_id . '&allrows=' . $this->allrows),
+                                       'link_down'             => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.qualification&resort=down&id='
 . $entry['quali_id'].'&job_id=' . $job_id . '&allrows=' . $this->allrows),
+                                       'text_up'               => lang('up'),
+                                       'text_down'             => lang('down'),
+
                                        'id'                    => 
$entry['quali_id'],
                                        'name'                  => 
$entry['name'],
                                        'descr'                 => 
$entry['descr'],
@@ -292,6 +403,19 @@
                                                                                
                                'cat_id'        =>$this->cat_id,
                                                                                
                                'allrows' => $this->allrows)
                                                                                
)),
+                               'sort_sorting'  => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   => 'value_sort',
+                                                                               
        '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_remark'=> lang('remark'),
@@ -299,6 +423,7 @@
                                'lang_view'     => lang('view'),
                                'lang_edit'     => lang('edit'),
                                'lang_delete'   => lang('delete'),
+                               'lang_sorting'  => lang('sorting')
                        );
 
 
@@ -365,6 +490,13 @@
                        }
 
                        $job_id = get_var('job_id',array('POST','GET'));
+                       $id     = get_var('id',array('POST','GET'));
+                       $resort = get_var('resort',array('POST','GET'));
+
+                       if($resort)
+                       {
+                               
$this->bo->resort_value(array('resort'=>$resort,'job_id' => $job_id,'id' => 
$id,'type'=>'task'));
+                       }
 
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','hrm_task_receipt');
                        
$GLOBALS['phpgw']->session->appsession('session_data','hrm_task_receipt','');
@@ -382,17 +514,14 @@
                        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
                                (
+                                       'sorting'               => 
$entry['value_sort'],
+                                       'link_up'               => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.task&resort=up&id='
 . $entry['id'].'&job_id=' . $job_id . '&allrows=' . $this->allrows),
+                                       'link_down'             => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uijob.task&resort=down&id='
 . $entry['id'].'&job_id=' . $job_id . '&allrows=' . $this->allrows),
+                                       'text_up'               => lang('up'),
+                                       'text_down'             => lang('down'),
+
                                        'id'                    => $entry['id'],
                                        'name'                  => 
$entry['name'],
                                        'descr'                 => 
$entry['descr'],
@@ -423,11 +552,24 @@
                                                                                
                                'cat_id'        =>$this->cat_id,
                                                                                
                                'allrows' => $this->allrows)
                                                                                
)),
+                               'sort_sorting'  => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   => 'value_sort',
+                                                                               
        'order' => $this->order,
+                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uijob.task',
+                                                                               
                                'job_id'        =>$job_id,
+                                                                               
                                'query'         =>$this->query,
+                                                                               
                                'cat_id'        =>$this->cat_id,
+                                                                               
                                'allrows' => $this->allrows)
+                                                                               
)),
+
                                'lang_name'     => lang('name'),
                                'lang_descr'=> lang('descr'),
                                'lang_view'     => lang('view'),
                                'lang_edit'     => lang('edit'),
                                'lang_delete'   => lang('delete'),
+                               'lang_sorting'  => lang('sorting')
                        );
 
                        $function_msg = lang('list task');

Index: inc/class.uiuser.inc.php
===================================================================
RCS file: /sources/phpgroupware/hrm/inc/class.uiuser.inc.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- inc/class.uiuser.inc.php    3 Jul 2006 11:45:46 -0000       1.24
+++ inc/class.uiuser.inc.php    1 Sep 2006 12:08:27 -0000       1.25
@@ -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.uiuser.inc.php,v 1.24 2006/07/03 11:45:46 
sigurdne Exp $
+       * @version $Id: class.uiuser.inc.php,v 1.25 2006/09/01 12:08:27 
sigurdne Exp $
        */
 
        /**
@@ -842,8 +842,6 @@
                        $GLOBALS['phpgw_info']['flags'][nofooter] = True;
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = False;
 
-                       $voucher_id = get_var('voucher_id',array('POST','GET'));
-
                        if($user_id)
                        {
                                $user_values = $this->get_user_data($user_id);

Index: setup/phpgw_no.lang
===================================================================
RCS file: /sources/phpgroupware/hrm/setup/phpgw_no.lang,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- setup/phpgw_no.lang 30 Aug 2006 08:01:04 -0000      1.7
+++ setup/phpgw_no.lang 1 Sep 2006 12:08:27 -0000       1.8
@@ -31,6 +31,7 @@
 Skill  hrm     no      Erfaringsnivå
 start date     hrm     no      startdato
 task   hrm     no      oppgave
+tasks  hrm     no      oppgaver
 qualification  hrm     no      kvalifikasjon
 title  hrm     no      tittel
 town   hrm     no      poststed

Index: setup/setup.inc.php
===================================================================
RCS file: /sources/phpgroupware/hrm/setup/setup.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- setup/setup.inc.php 20 Jun 2006 11:33:37 -0000      1.10
+++ setup/setup.inc.php 1 Sep 2006 12:08:27 -0000       1.11
@@ -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.10 2006/06/20 11:33:37 sigurdne Exp $
+       * @version $Id: setup.inc.php,v 1.11 2006/09/01 12:08:27 sigurdne Exp $
        */
 
        $setup_info['hrm']['name']      = 'hrm';
        $setup_info['hrm']['title']     = 'Human resource management';
-       $setup_info['hrm']['version']   = '0.9.17.004';
+       $setup_info['hrm']['version']   = '0.9.17.005';
        $setup_info['hrm']['app_order'] = 20;
        $setup_info['hrm']['enable']    = 1;
        $setup_info['hrm']['globals_checked']    = True;

Index: setup/tables_current.inc.php
===================================================================
RCS file: /sources/phpgroupware/hrm/setup/tables_current.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- setup/tables_current.inc.php        3 Jul 2006 11:25:26 -0000       1.17
+++ setup/tables_current.inc.php        1 Sep 2006 12:08:27 -0000       1.18
@@ -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.17 2006/07/03 11:25:26 
sigurdne Exp $
+       * @version $Id: tables_current.inc.php,v 1.18 2006/09/01 12:08:27 
sigurdne Exp $
        */
 
        $phpgw_baseline = array(
@@ -59,6 +59,7 @@
                                '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),
+                               'value_sort' => array('type' => 
'int','precision' => '4','nullable' => True),
                        ),
                        'pk' => array('id'),
                        'fk' => array(),
@@ -94,6 +95,7 @@
                                'entry_date' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'quali_owner' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'remark' => array('type' => 'text','nullable' 
=> True),
+                               'value_sort' => array('type' => 
'int','precision' => '4','nullable' => True),
                        ),
                        'pk' => array('id'),
                        'fk' => array(),

Index: setup/tables_update.inc.php
===================================================================
RCS file: /sources/phpgroupware/hrm/setup/tables_update.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- setup/tables_update.inc.php 20 Jun 2006 11:33:37 -0000      1.5
+++ setup/tables_update.inc.php 1 Sep 2006 12:08:27 -0000       1.6
@@ -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.5 2006/06/20 11:33:37 
sigurdne Exp $
+       * @version $Id: tables_update.inc.php,v 1.6 2006/09/01 12:08:27 
sigurdne Exp $
        */
 
        /**
@@ -136,3 +136,17 @@
                return $GLOBALS['setup_info']['hrm']['currentver'];
        }
 
+       /**
+       * Update hrm version from 0.9.17.004 to 0.9.17.005
+       */
+
+       $test[] = '0.9.17.004';
+       function hrm_upgrade0_9_17_004()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_hrm_quali','value_sort',array('type'
 => 'int','precision' => '4', 'nullable' => True));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_hrm_task','value_sort',array('type'
 => 'int','precision' => '4', 'nullable' => True));
+               $GLOBALS['setup_info']['hrm']['currentver'] = '0.9.17.005';
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+               return $GLOBALS['setup_info']['hrm']['currentver'];
+       }

Index: templates/base/job.xsl
===================================================================
RCS file: /sources/phpgroupware/hrm/templates/base/job.xsl,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- templates/base/job.xsl      24 Aug 2006 12:46:49 -0000      1.17
+++ templates/base/job.xsl      1 Sep 2006 12:08:27 -0000       1.18
@@ -1,4 +1,4 @@
-<!-- $Id: job.xsl,v 1.17 2006/08/24 12:46:49 sigurdne Exp $ -->
+<!-- $Id: job.xsl,v 1.18 2006/09/01 12:08:27 sigurdne Exp $ -->
 
        <xsl:template name="app_data">
                <xsl:choose>
@@ -39,6 +39,8 @@
        </xsl:template>
        
        <xsl:template match="list">             
+                       <xsl:variable name="check_source"><xsl:value-of 
select="check_source"/></xsl:variable>
+                       <SCRIPT LANGUAGE="JavaScript" 
SRC="{$check_source}"></SCRIPT>
                <xsl:call-template name="menu"/> 
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
@@ -63,9 +65,44 @@
                                </td>
                        </tr>
                </table>
+
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                                <xsl:apply-templates select="table_header"/>
+                       <xsl:choose>
+                               <xsl:when test="values != ''">
+                               <xsl:variable name="print_action"><xsl:value-of 
select="print_action"/></xsl:variable>
+                               <form name = "form" method="post" 
action="{$print_action}">
                                <xsl:apply-templates select="values"/>
+                               <tr>
+                                       <td></td>
+                                       <td></td>
+                                       <td></td>
+                                       <td></td>
+                                       <td></td>
+                                       <td></td>
+                                       <td></td>
+                                       <td></td>
+                                       <td align="center">
+                                               <xsl:variable 
name="img_check"><xsl:value-of select="img_check"/></xsl:variable>
+                                                <a 
href="javascript:check_all_checkbox('values[select]')"><img src="{$img_check}" 
border="0" height="16" width="21" alt="{lang_select_all}"/></a>
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td>
+                                               <xsl:variable 
name="lang_print"><xsl:value-of select="lang_print"/></xsl:variable>
+                                               <input type="submit" 
name="print" value="{$lang_print}" onMouseout="window.status='';return true;">
+                                                       <xsl:attribute 
name="onMouseover">
+                                                               
<xsl:text>window.status='</xsl:text>
+                                                                       
<xsl:value-of select="lang_print_statustext"/>
+                                                               <xsl:text>'; 
return true;</xsl:text>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </td>
+                               </tr>
+                               </form>
+                               </xsl:when>
+                       </xsl:choose>
+
                                <xsl:apply-templates select="table_add_job"/>
                </table>
        </xsl:template>
@@ -97,6 +134,9 @@
                        <td class="th_text" width="5%" align="center">
                                <xsl:value-of select="lang_delete"/>
                        </td>
+                       <td class="th_text" width="5%" align="center">
+                               <xsl:value-of select="lang_print"/>
+                       </td>
                </tr>
        </xsl:template>
 
@@ -159,6 +199,16 @@
                                        <xsl:variable 
name="link_delete"><xsl:value-of select="link_delete"/></xsl:variable>
                                        <a href="{$link_delete}" 
onMouseover="window.status='{$lang_delete_job_text}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of 
select="text_delete"/></a>
                                </td>
+                               <td align="center">
+                                       <input type="checkbox" 
name="values[select][]" value="{id}"  onMouseout="window.status='';return 
true;">
+                                               <xsl:attribute 
name="onMouseover">
+                                                       
<xsl:text>window.status='</xsl:text>
+                                                               <xsl:value-of 
select="lang_select_statustext"/>
+                                                       <xsl:text>'; return 
true;</xsl:text>
+                                               </xsl:attribute>
+                                       </input>
+                               </td>
+
                        </tr>
        </xsl:template>
 
@@ -216,7 +266,7 @@
                                                <input type="submit" name="add" 
value="{$lang_done}" onMouseout="window.status='';return true;">
                                                        <xsl:attribute 
name="onMouseover">
                                                                
<xsl:text>window.status='</xsl:text>
-                                                                       
<xsl:value-of select="lang_add_statustext"/>
+                                                                       
<xsl:value-of select="lang_done_statustext"/>
                                                                <xsl:text>'; 
return true;</xsl:text>
                                                        </xsl:attribute>
                                                </input>
@@ -474,6 +524,7 @@
        </xsl:template>
        
        <xsl:template match="table_header_task">
+               <xsl:variable name="sort_sorting"><xsl:value-of 
select="sort_sorting"/></xsl:variable>
                <xsl:variable name="sort_name"><xsl:value-of 
select="sort_name"/></xsl:variable>
                <tr class="th">
                        <td class="th_text" width="10%" align="left">
@@ -483,6 +534,9 @@
                                <xsl:value-of select="lang_descr"/>
                        </td>
                        <td class="th_text" width="5%" align="center">
+                               <a href="{$sort_sorting}"><xsl:value-of 
select="lang_sorting"/></a>
+                       </td>
+                       <td class="th_text" width="5%" align="center">
                                <xsl:value-of select="lang_view"/>
                        </td>
                        <td class="th_text" width="5%" align="center">
@@ -495,6 +549,8 @@
        </xsl:template>
 
        <xsl:template match="values_task">
+               <xsl:variable name="lang_up_text"><xsl:value-of 
select="lang_up_text"/></xsl:variable>
+               <xsl:variable name="lang_down_text"><xsl:value-of 
select="lang_down_text"/></xsl:variable>
                <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>
@@ -519,6 +575,25 @@
                                <td align="left">
                                        <xsl:value-of select="descr"/>
                                </td>
+                               <td>
+                                       <table align="left">
+                                               <tr>
+                                                       <td>
+                                                               <xsl:value-of 
select="sorting"/>
+                                                       </td>
+
+                                                       <td align="left">
+                                                               <xsl:variable 
name="link_up"><xsl:value-of select="link_up"/></xsl:variable>
+                                                               <a 
href="{$link_up}" onMouseover="window.status='{$lang_up_text}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of select="text_up"/></a>
+                                                               <xsl:text> | 
</xsl:text>
+                                                               <xsl:variable 
name="link_down"><xsl:value-of select="link_down"/></xsl:variable>
+                                                               <a 
href="{$link_down}" onMouseover="window.status='{$lang_down_text}';return 
true;" onMouseout="window.status='';return true;"><xsl:value-of 
select="text_down"/></a>
+                                                       </td>
+
+                                               </tr>
+                                       </table>
+                               </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>
@@ -787,6 +862,7 @@
        </xsl:template>
        
        <xsl:template match="table_header_qualification">
+               <xsl:variable name="sort_sorting"><xsl:value-of 
select="sort_sorting"/></xsl:variable>
                <xsl:variable name="sort_name"><xsl:value-of 
select="sort_name"/></xsl:variable>
                <tr class="th">
                        <td class="th_text" width="5%" align="left">
@@ -802,6 +878,9 @@
                                <xsl:value-of select="lang_remark"/>
                        </td>
                        <td class="th_text" width="5%" align="center">
+                               <a href="{$sort_sorting}"><xsl:value-of 
select="lang_sorting"/></a>
+                       </td>
+                       <td class="th_text" width="5%" align="center">
                                <xsl:value-of select="lang_view"/>
                        </td>
                        <td class="th_text" width="5%" align="center">
@@ -814,6 +893,8 @@
        </xsl:template>
 
        <xsl:template match="values_qualification">
+               <xsl:variable name="lang_up_text"><xsl:value-of 
select="lang_up_text"/></xsl:variable>
+               <xsl:variable name="lang_down_text"><xsl:value-of 
select="lang_down_text"/></xsl:variable>
                <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>
@@ -843,6 +924,24 @@
                                <td align="left">
                                        <xsl:value-of select="remark"/>
                                </td>
+                               <td>
+                                       <table align="left">
+                                               <tr>
+                                                       <td>
+                                                               <xsl:value-of 
select="sorting"/>
+                                                       </td>
+
+                                                       <td align="left">
+                                                               <xsl:variable 
name="link_up"><xsl:value-of select="link_up"/></xsl:variable>
+                                                               <a 
href="{$link_up}" onMouseover="window.status='{$lang_up_text}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of select="text_up"/></a>
+                                                               <xsl:text> | 
</xsl:text>
+                                                               <xsl:variable 
name="link_down"><xsl:value-of select="link_down"/></xsl:variable>
+                                                               <a 
href="{$link_down}" onMouseover="window.status='{$lang_down_text}';return 
true;" onMouseout="window.status='';return true;"><xsl:value-of 
select="text_down"/></a>
+                                                       </td>
+
+                                               </tr>
+                                       </table>
+                               </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>




reply via email to

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