phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] addressbook/inc class.uiaddressbook.inc.php, 1.36.2.1


From: Jonathan Rivera <address@hidden>
Subject: [Phpgroupware-cvs] addressbook/inc class.uiaddressbook.inc.php, 1.36.2.15.2.25, 1.36.2.15.2.26 class.soaddressbook.inc.php, 1.14.2.3.2.15, 1.14.2.3.2.16 class.boaddressbook.inc.php, 1.21.2.2.2.15, 1.21.2.2.2.16
Date: Wed, 15 Oct 2003 17:16:33 +0000

Update of /cvsroot/phpgroupware/addressbook/inc
In directory subversions:/tmp/cvs-serv3113/addressbook/inc

Modified Files:
      Tag: Version-0_9_16-branch
        class.uiaddressbook.inc.php class.soaddressbook.inc.php 
        class.boaddressbook.inc.php 
Log Message:
BugFix #5257


Index: class.boaddressbook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.boaddressbook.inc.php,v
retrieving revision 1.21.2.2.2.15
retrieving revision 1.21.2.2.2.16
diff -C2 -d -r1.21.2.2.2.15 -r1.21.2.2.2.16
*** class.boaddressbook.inc.php 11 Oct 2003 18:01:27 -0000      1.21.2.2.2.15
--- class.boaddressbook.inc.php 15 Oct 2003 17:16:30 -0000      1.21.2.2.2.16
***************
*** 329,357 ****
                }
  
!               function add_email()
                {
!                       global $name,$referer;
! 
!                       $named = explode(' ', $name);
!                       for ($i=count($named);$i>=0;$i--) { $names[$i] = 
$named[$i]; }
!                       if ($names[2])
!                       {
!                               $fields['n_given']  = $names[0];
!                               $fields['n_middle'] = $names[1];
!                               $fields['n_family'] = $names[2];
!                       }
!                       else
!                       {
!                               $fields['n_given']  = $names[0];
!                               $fields['n_family'] = $names[1];
!                       }
!                       $fields['email']    = $add_email;
!                       $referer = urlencode($referer);
! 
!                       
$this->so->add_entry($GLOBALS['phpgw_info']['user']['account_id'],$fields,'private','','n');
!                       $ab_id = $this->get_lastid();
! 
!                       Header('Location: '
!                               . 
$GLOBALS['phpgw']->link('/index.php',"menuaction=addressbook.uiaddressbook.view&ab_id=$ab_id&referer=$referer"));
                }
  
--- 329,335 ----
                }
  
!               function add_email($name, $email)
                {
!                       return $this->so->add_contact_with_email($name, $email);
                }
  

Index: class.soaddressbook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.soaddressbook.inc.php,v
retrieving revision 1.14.2.3.2.15
retrieving revision 1.14.2.3.2.16
diff -C2 -d -r1.14.2.3.2.15 -r1.14.2.3.2.16
*** class.soaddressbook.inc.php 14 Oct 2003 23:31:31 -0000      1.14.2.3.2.15
--- class.soaddressbook.inc.php 15 Oct 2003 17:16:30 -0000      1.14.2.3.2.16
***************
*** 215,218 ****
--- 215,250 ----
                }
  
+               function add_contact_with_email($name, $email)
+               {
+                         $named = explode(' ', $name);
+                       for ($i=count($named);$i>=0;$i--)
+                         {
+                               $names[$i] = $named[$i];
+                       }
+                       if ($names[2])
+                         {
+                               $principal['per_first_name']  = $names[0];
+                                 $principal['per_middle_name'] = $names[1];
+                                 $principal['per_last_name'] = $names[2];
+                         }
+                         else
+                         {
+                                 $principal['per_first_name']  = $names[0];
+                                 $principal['per_last_name'] = $names[1];
+                         }
+ 
+                       $principal['access'] = 'private';
+                       $principal['owner'] = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       
+                       $comms[] = array('comm_descr'           => 
$this->search_comm_descr('work email'),
+                                        'comm_data'            => $email,
+                                        'comm_preferred'       => 'Y');
+ 
+                       $type = 
$this->contacts->search_contact_type($this->contacts->get_person_name());
+                       $c_id = $this->contacts->add_contact($type, $principal, 
$comms);
+ 
+                       return $c_id;
+               }
+               
                //used
                function add_person($fields)

Index: class.uiaddressbook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.uiaddressbook.inc.php,v
retrieving revision 1.36.2.15.2.25
retrieving revision 1.36.2.15.2.26
diff -C2 -d -r1.36.2.15.2.25 -r1.36.2.15.2.26
*** class.uiaddressbook.inc.php 14 Oct 2003 15:44:04 -0000      1.36.2.15.2.25
--- class.uiaddressbook.inc.php 15 Oct 2003 17:16:29 -0000      1.36.2.15.2.26
***************
*** 689,693 ****
                {
                        $person_id = get_var('ab_id');
!                       $this->view_contact($person_id, 
$this->tab_main_persons);
                }
  
--- 689,694 ----
                {
                        $person_id = get_var('ab_id');
!                       $referer = get_var('referer');
!                       $this->view_contact($person_id, 
$this->tab_main_persons, $referer);
                }
  
***************
*** 902,906 ****
                {
                        $org_id = get_var('ab_id');
!                       $this->view_contact($org_id, 
$this->tab_main_organizations);
                }
  
--- 903,908 ----
                {
                        $org_id = get_var('ab_id');
!                       $referer = get_var('referer');
!                       $this->view_contact($org_id, 
$this->tab_main_organizations, $referer);
                }
  
***************
*** 2501,2505 ****
                }
                
!               function view_contact($contact_id='', $contact_type='')
                {
                        $comms_media = array();
--- 2503,2507 ----
                }
                
!               function view_contact($contact_id='', $contact_type='', 
$referer='')
                {
                        $comms_media = array();
***************
*** 2508,2512 ****
                        $contact_type = 
$contact_type?$contact_type:$this->bo->search_contact_type_id(
                                $this->bo->get_type_contact($contact_id));
!                       
                        if($contact_type == $this->tab_main_persons)
                        {
--- 2510,2516 ----
                        $contact_type = 
$contact_type?$contact_type:$this->bo->search_contact_type_id(
                                $this->bo->get_type_contact($contact_id));
!                       $referer = ($referer=='')?get_var('referer'):$referer;
!                       $referer = urldecode($referer);
! 
                        if($contact_type == $this->tab_main_persons)
                        {
***************
*** 3085,3088 ****
--- 3089,3109 ----
                        }
                        return $my_opt;
+               }
+ 
+               function add_email()
+               {
+                       $name      = get_var('name');
+                         $referer   = get_var('referer');
+                         $email = get_var('add_email');
+                       
+                       $name = urldecode($name);
+                       $email = urldecode($email);
+                       
+                       $contact_id = $this->bo->add_email($name, $email);
+ 
+                       Header('Location: '
+                              . $GLOBALS['phpgw']->link('/index.php',
+                               
'menuaction=addressbook.uiaddressbook.view_person&ab_id=' 
+                               . $contact_id . '&referer=' . $referer));
                }
        }





reply via email to

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