phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] admin/inc class.uiaccounts.inc.php, 1.23.2.9.2.19, 1


From: Jonathan Rivera <address@hidden>
Subject: [Phpgroupware-cvs] admin/inc class.uiaccounts.inc.php, 1.23.2.9.2.19, 1.23.2.9.2.20 class.boaccounts.inc.php, 1.22.2.7.2.10, 1.22.2.7.2.11
Date: Fri, 17 Oct 2003 05:26:37 +0000

Update of /cvsroot/phpgroupware/admin/inc
In directory subversions:/tmp/cvs-serv28105/admin/inc

Modified Files:
      Tag: Version-0_9_16-branch
        class.uiaccounts.inc.php class.boaccounts.inc.php 
Log Message:
i fix some not reported bugs with admin and contact link


Index: class.boaccounts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.boaccounts.inc.php,v
retrieving revision 1.22.2.7.2.10
retrieving revision 1.22.2.7.2.11
diff -C2 -d -r1.22.2.7.2.10 -r1.22.2.7.2.11
*** class.boaccounts.inc.php    5 Oct 2003 05:46:47 -0000       1.22.2.7.2.10
--- class.boaccounts.inc.php    17 Oct 2003 05:26:34 -0000      1.22.2.7.2.11
***************
*** 344,349 ****
                                {
                                        //jarg-SOG S
-                                       $contacts = 
CreateObject('phpgwapi.contacts');
                                        $owner = 
$GLOBALS['phpgw']->accounts->name2id('addressmaster');
                                        $type = 
$contacts->search_contact_type('Persons');
                                        $principal = array('owner' => $owner,
--- 344,349 ----
                                {
                                        //jarg-SOG S
                                        $owner = 
$GLOBALS['phpgw']->accounts->name2id('addressmaster');
+                                       $contacts = 
CreateObject('phpgwapi.contacts');
                                        $type = 
$contacts->search_contact_type('Persons');
                                        $principal = array('owner' => $owner,
***************
*** 354,359 ****
                                        $person_id = 
$contacts->add_contact($type, $principal);
                                        $userData['person_id'] = $person_id;
!                                       //End
!  
                                        $account_id = 
$this->so->add_user($userData);
  
--- 354,358 ----
                                        $person_id = 
$contacts->add_contact($type, $principal);
                                        $userData['person_id'] = $person_id;
! 
                                        $account_id = 
$this->so->add_user($userData);
  
***************
*** 378,382 ****
                                        
//ExecMethod('admin.uiaccounts.list_users');
                                        $ui = createobject('admin.uiaccounts');
!                                       
$ui->create_edit_user($userData['account_id'],$userData);
                                        //End
                                        return False;
--- 377,381 ----
                                        
//ExecMethod('admin.uiaccounts.list_users');
                                        $ui = createobject('admin.uiaccounts');
!                                       
$ui->create_edit_user($account_id,$userData);
                                        //End
                                        return False;
***************
*** 781,784 ****
--- 780,791 ----
                */
  
+                       /* check that addressmaster record exist */
+                       if 
(!$GLOBALS['phpgw']->accounts->exists('addressmaster') && 
$_userData['account_lid'] != 'addressmaster')
+                       {
+                               $error[$totalerrors] = lang('You have not the 
addressmaster record');
+                               $totalerrors++;
+                       }
+                       
+                       
                        if ($totalerrors == 0)
                        {
***************
*** 795,815 ****
                {
                        //jarg-SOG S
-                       $contacts = CreateObject('phpgwapi.contacts');
                        $owner = 
$GLOBALS['phpgw']->accounts->name2id('addressmaster');
!                       $type = $contacts->search_contact_type('Persons');
!                       $principal = array('owner' => $owner,
!                                          'access'=> 'public',
!                                          'per_prefix' => 
$_userData['account_lid'],
!                                          'per_first_name' => 
$_userData['account_firstname'],
!                                          'per_last_name' => 
$_userData['account_lastname']);
!                       
!                       if ($_userData['person_id'] && 
$contacts->exist_contact($_userData['person_id']))
!                       {
!                               $contacts->edit_person($_userData['person_id'], 
$principal);
!                       }
!                       else
                        {
!                               $person_id = $contacts->add_contact($type, 
$principal);
!                               $_userData['person_id'] = $person_id;
                        }
  
--- 802,825 ----
                {
                        //jarg-SOG S
                        $owner = 
$GLOBALS['phpgw']->accounts->name2id('addressmaster');
!                       if($_userData['account_id'] != $owner)
                        {
!                               $contacts = CreateObject('phpgwapi.contacts');
!                               $type = 
$contacts->search_contact_type('Persons');
!                               $principal = array('owner' => $owner,
!                                                  'access'=> 'public',
!                                                  'per_prefix' => 
$_userData['account_lid'],
!                                                  'per_first_name' => 
$_userData['account_firstname'],
!                                                  'per_last_name' => 
$_userData['account_lastname']);
!                               
!                               if ($_userData['person_id'] && 
$contacts->exist_contact($_userData['person_id']))
!                               {
!                                       
$contacts->edit_person($_userData['person_id'], $principal);
!                               }
!                               else
!                               {
!                                       $person_id = 
$contacts->add_contact($type, $principal);
!                                       $_userData['person_id'] = $person_id;
!                               }
                        }
  

Index: class.uiaccounts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.uiaccounts.inc.php,v
retrieving revision 1.23.2.9.2.19
retrieving revision 1.23.2.9.2.20
diff -C2 -d -r1.23.2.9.2.19 -r1.23.2.9.2.20
*** class.uiaccounts.inc.php    5 Oct 2003 11:33:58 -0000       1.23.2.9.2.19
--- class.uiaccounts.inc.php    17 Oct 2003 05:26:34 -0000      1.23.2.9.2.20
***************
*** 614,618 ****
                                'lang_lastloginfrom' => lang('Last login from'),
                                //jarg-SOG S
!                               'lang_add_addbook' => lang('Add to 
addressbook'),
                                'lang_domain' => lang('Domain'),
                                //End
--- 614,618 ----
                                'lang_lastloginfrom' => lang('Last login from'),
                                //jarg-SOG S
!                               'lang_add_addbook' => lang('Addressbook Entry'),
                                'lang_domain' => lang('Domain'),
                                //End
***************
*** 1058,1062 ****
                                'lang_changepassword' => lang('Can change 
password'),
                                //jarg-SOG S
!                               'lang_add_addbook' => lang('Add to 
addressbook'),
                                'lang_domain' => lang('Domain'),
                                //End
--- 1058,1062 ----
                                'lang_changepassword' => lang('Can change 
password'),
                                //jarg-SOG S
!                               'lang_add_addbook' => lang('Addressbook Entry'),
                                'lang_domain' => lang('Domain'),
                                //End
***************
*** 1117,1144 ****
                */
                        //jarg-SOG S edited by skwashd
!                       if($_GET['account_id'])
                        {
!                               if($userData['person_id'])
                                {
!                                       $edit_entry =   
$GLOBALS['phpgw']->link('/index.php',
!                                                               array
!                                                               (
!                                                                       
'menuaction'    => 'addressbook.uiaddressbook.edit_person',
!                                                                       'ab_id' 
        => $userData['person_id'],
!                                                                       
'referer'       =>rawurlencode($_SERVER['HTTP_REFERER']),
!                                                               )
                                                        );
                                }
                                else
                                {
!                                       $edit_entry =   
$GLOBALS['phpgw']->link('/index.php',
!                                                               array
!                                                               (
!                                                                       
'menuaction'    => 'addressbook.uiaddressbook.add_person',
!                                                                       
'account_id'    => $userData['account_id'],
!                                                                       
'referer'       =>rawurlencode($_SERVER['HTTP_REFERER']),
!                                                               )
!                                                       );
! 
                                }
                        }
--- 1117,1157 ----
                */
                        //jarg-SOG S edited by skwashd
!                       if($_account_id)
                        {
!                               $grants = 
$GLOBALS['phpgw']->acl->get_grants('addressbook');
!                               $addressmaster = 
$GLOBALS['phpgw']->accounts->name2id('addressmaster');
!                               if (!!($grants[$addressmaster] & 
PHPGW_ACL_EDIT))
                                {
!                                       $referer = 
$GLOBALS['phpgw']->link('/index.php', 
!                                                                          
'menuaction=admin.uiaccounts.edit_user&account_id='.$_account_id);
!                                       if($userData['person_id'])
!                                       {
!                                               $edit_entry =   
$GLOBALS['phpgw']->link('/index.php',
!                                                                               
        array
!                                                                               
        (
!                                                                               
                'menuaction'    => 'addressbook.uiaddressbook.edit_person',
!                                                                               
                'ab_id'         => $userData['person_id'],
!                                                                               
                'referer'       =>rawurlencode($referer)
!                                                                               
                )
                                                        );
+                                       }
+                                       else
+                                       {
+ //                                            $edit_entry =   
$GLOBALS['phpgw']->link('/index.php',
+ //                                                                            
        array
+ //                                                                            
        (
+ //                                                                            
                'menuaction'    => 'addressbook.uiaddressbook.add_person',
+ //                                                                            
                'account_id'    => $userData['account_id'],
+ //                                                                            
                'referer'       =>rawurlencode($referer),
+ //                                                                            
                )
+ //                                                    );
+                                               $edit_entry = '';
+                                               $addressbook_message = 
lang('This account have not contact');
+                                       }
                                }
                                else
                                {
!                                       $edit_entry = '';
!                                       $addressbook_message = lang('You have 
not edit access to addressmaster records');
                                }
                        }
***************
*** 1146,1149 ****
--- 1159,1163 ----
                        {
                                $edit_entry = '';
+                               $addressbook_message = '';
                        }
                        //End
***************
*** 1163,1167 ****
                                'account_lastname'      => '<input 
name="account_lastname" value="' . $userData['account_lastname'] . '">',
                                //jarg-SOG S
!                               'add_addbook'   => $edit_entry ? '<a href="' . 
$edit_entry . '">' . lang('edit entry') . '</a>':'',
                                'person_id'     => '<input type="hidden" 
NAME="person_id" VALUE="' . $userData['person_id'] . '">',
                                //End
--- 1177,1181 ----
                                'account_lastname'      => '<input 
name="account_lastname" value="' . $userData['account_lastname'] . '">',
                                //jarg-SOG S
!                               'add_addbook'   => $edit_entry ? '<a href="' . 
$edit_entry . '">' . lang('Edit entry') . '</a>':$addressbook_message,
                                'person_id'     => '<input type="hidden" 
NAME="person_id" VALUE="' . $userData['person_id'] . '">',
                                //End





reply via email to

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