phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] hr/inc class.hr_ui.inc.php, 1.2 class.hr_so.inc.php,


From: skwashd
Subject: [Phpgroupware-cvs] hr/inc class.hr_ui.inc.php, 1.2 class.hr_so.inc.php, 1.2 class.hr_acl_bo.inc.php, 1.2
Date: Wed, 16 Nov 2005 10:57:00 +0100

Update of hr/inc

Modified Files:
     Branch: MAIN
            class.hr_ui.inc.php lines: +5 -3
            class.hr_so.inc.php lines: +12 -7
            class.hr_acl_bo.inc.php lines: +8 -2

Log Message:
some fixes

====================================================
Index: hr/inc/class.hr_ui.inc.php
diff -u hr/inc/class.hr_ui.inc.php:1.1 hr/inc/class.hr_ui.inc.php:1.2
--- hr/inc/class.hr_ui.inc.php:1.1      Tue Nov 15 14:09:42 2005
+++ hr/inc/class.hr_ui.inc.php  Wed Nov 16 09:57:22 2005
@@ -348,6 +348,7 @@
                function _view_user($user_id)
                {
                        $user = $this->bo->get_user($user_id);
+
                        if ( !is_array($user) || !count($user) )
                        {
                                $this->index();
@@ -384,7 +385,7 @@
                        }
                        else
                        {
-                               $this->set_var('user_images', '');
+                               $this->t->set_var('user_images', '');
                        }

                        if ( isset($user['contact']) && count($user['contact']) 
)
@@ -447,6 +448,7 @@
                        {
                                $this->t->set_var('contacts', '');
                        }
+                       unset($user['contact']);

                        if ( count($user) )
                        {
@@ -481,7 +483,7 @@
                        }
                        else
                        {
-                               $this->t->parse('can_edit', '');
+                               $this->t->set_var('edit', '');
                        }

                        $this->t->pparse('out', 'user_profile');

====================================================
Index: hr/inc/class.hr_so.inc.php
diff -u hr/inc/class.hr_so.inc.php:1.1 hr/inc/class.hr_so.inc.php:1.2
--- hr/inc/class.hr_so.inc.php:1.1      Tue Nov 15 14:09:42 2005
+++ hr/inc/class.hr_so.inc.php  Wed Nov 16 09:57:22 2005
@@ -124,15 +124,20 @@
                function get_user($user_id, $cats)
                {
                        $user = array();
-                       // We have to do it this way cos the accounts class is 
all arse about
-                       $this->accounts->account_id = $user_id;
-                       $user['account'] = $this->accounts->read_repository();
-                       $this->accounts->account_id = 
$GLOBALS['phpgw_info']['user']['account_id'];
-
-                       if ( !is_array($user['account']) || 
!count($user['account']) )
+                       if ( !$this->accounts->exists($user_id) )
                        {
                                return $user;
                        }
+
+                       $this->accounts->get_account_name($user_id, $lid, 
$fname, $lname);
+                       $user['account'] = array
+                                       (
+                                               'account_id'    => $user_id,
+                                               'firstname'     => $fname,
+                                               'lastname'      => $lname,
+                                               'fullname'      => "{$fname} 
{$lname}"
+                                       );
+                       unset($lid, $fname, $lname);

                        $sql = 'SELECT cat_id, hr_note FROM phpgw_hr_notes'
                                . ' WHERE user_id = ' . intval($user_id)

====================================================
Index: hr/inc/class.hr_acl_bo.inc.php
diff -u hr/inc/class.hr_acl_bo.inc.php:1.1 hr/inc/class.hr_acl_bo.inc.php:1.2
--- hr/inc/class.hr_acl_bo.inc.php:1.1  Tue Nov 15 14:09:42 2005
+++ hr/inc/class.hr_acl_bo.inc.php      Wed Nov 16 09:57:22 2005
@@ -156,7 +156,13 @@
                                                'name'          => 
lang('photo'),
                                                'description'   => 
lang('user\'s image')
                                        );
-                       $cats += $this->catbo->return_array('all', 
$this->start, True, $this->query, $this->sort, 'cat_name', True);
+
+                       $api_cats = $this->catbo->return_array('all', 
$this->start, True, $this->query, $this->sort, 'cat_name', True);
+                       if ( is_array($api_cats) )
+                       {
+                               $cats += $api_cats;
+                       }
+                       unset($api_cats);

                        foreach ( $cats as $cat )
                        {






reply via email to

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