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


From: Dave Hall
Subject: [Phpgroupware-cvs] addressbook/inc class.uiaddressbook.inc.php
Date: Fri, 21 Jul 2006 13:12:21 +0000

CVSROOT:        /cvsroot/phpgroupware
Module name:    addressbook
Changes by:     Dave Hall <skwashd>     06/07/21 13:12:21

Modified files:
        inc            : class.uiaddressbook.inc.php 

Log message:
        merge in 16 usability fix

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/addressbook/inc/class.uiaddressbook.inc.php?cvsroot=phpgroupware&r1=1.63&r2=1.64

Patches:
Index: class.uiaddressbook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.uiaddressbook.inc.php,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -b -r1.63 -r1.64
--- class.uiaddressbook.inc.php 3 Apr 2006 03:36:38 -0000       1.63
+++ class.uiaddressbook.inc.php 21 Jul 2006 13:12:21 -0000      1.64
@@ -12,7 +12,7 @@
   *  option) any later version.                                              *
   \**************************************************************************/
 
-  /* $Id: class.uiaddressbook.inc.php,v 1.63 2006/04/03 03:36:38 skwashd Exp $ 
*/
+  /* $Id: class.uiaddressbook.inc.php,v 1.64 2006/07/21 13:12:21 skwashd Exp $ 
*/
 
 
        class uiaddressbook
@@ -95,7 +95,7 @@
                        $this->nextmatchs             = 
CreateObject('phpgwapi.nextmatchs');
                        $this->custom_fields          = 
CreateObject('addressbook.uifields');
                        $this->bo                     = 
CreateObject('addressbook.boaddressbook');
-                       $this->template               = 
&$GLOBALS['phpgw']->template;
+                       $this->template               
=&$GLOBALS['phpgw']->template;
                        $this->cat                    = 
CreateObject('phpgwapi.categories');
                        $this->company                = 
CreateObject('phpgwapi.categories','addressbook_company');
                        $this->prefs                  = 
$GLOBALS['phpgw_info']['user']['preferences']['addressbook'];
@@ -546,9 +546,7 @@
                {
                        $contact_id = get_var('ab_id');
                        $new_contact_id = $this->bo->copy_contact($contact_id);
-                       Header('Location: '
-                              . $GLOBALS['phpgw']->link('/index.php',
-                                                        
'menuaction=addressbook.uiaddressbook.edit_person&ab_id='.$new_contact_id));
+                       $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'addressbook.uiaddressbook.edit_person', 'ab_id' => 
$new_contact_id));
                }
 
                /*************************************************************\
@@ -600,15 +598,16 @@
                                $fields['owner'] = 
$GLOBALS['phpgw_info']['user']['account_id'];
                                
                                $ab_id = $this->bo->add_person($fields);
-                               Header('Location: '
-                                      . $GLOBALS['phpgw']->link('/index.php',
-                                                                
'menuaction=addressbook.uiaddressbook.view_person&ab_id='
-                                                                .$ab_id 
.'&referer='.$this->referer));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array
+                               (
+                                       'menuaction'    => 
'addressbook.uiaddressbook.view_person',
+                                       'ab_id'         => $ab_id,
+                                       'referer'       => $this->referer
+                               ));
                                $GLOBALS['phpgw']->common->phpgw_exit();
                                break;
                        case 'cancel':
-                               Header('Location: '
-                                      . $GLOBALS['phpgw']->link('/index.php', 
$this->form_index));
+                                      
$GLOBALS['phpgw']->redirect_link('/index.php', $this->form_index);
                                break;
                        case 'delete':
                                break;
@@ -678,22 +677,22 @@
 
                                $this->bo->edit_person($this->contact_id, 
$fields);
                                
-                               Header('Location: '
-                                      . $GLOBALS['phpgw']->link('/index.php',
-                                                                
'menuaction=addressbook.uiaddressbook.view_person&ab_id='
-                                                                
.$this->contact_id .'&referer='.$this->referer));
-                               $GLOBALS['phpgw']->common->phpgw_exit();
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array
+                               (
+                                       'menuaction'    => 
'addressbook.uiaddressbook.view_person',
+                                       'ab_id'         => $this->contact_id,
+                                       'referer'       => $this->referer
+                               ));
                                break;
                        case 'cancel':
-                               Header('Location: '
-                                      . $GLOBALS['phpgw']->link('/index.php', 
$this->form_index));
-                               $GLOBALS['phpgw']->common->phpgw_exit();
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
$this->form_index);
                                break;
                        case 'delete':
-                               Header('Location: '
-                                      . $GLOBALS['phpgw']->link('/index.php',
-                                               
'menuaction=addressbook.uiaddressbook.delete_person&ab_id='.$this->contact_id));
-                               $GLOBALS['phpgw']->common->phpgw_exit();
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array
+                               (
+                                       'menuaction'    => 
'addressbook.uiaddressbook.delete_person',
+                                       'ab_id'         => $this->contact_id
+                               ));
                                //$this->delete_person($this->contact_id);
                                break;
                        case 'clear':
@@ -709,7 +708,7 @@
                        $this->owner = 
$this->entry['owner']?$this->entry['owner']:$this->owner;
                        if(!$this->bo->check_edit($this->contact_id, 
$this->owner))
                        {
-                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php', $this->form_index));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
$this->form_index);
                                $GLOBALS['phpgw']->common->phpgw_exit();
                        }
 
@@ -760,9 +759,11 @@
                {
                        $contact_id = get_var('ab_id');
                        $new_contact_id = $this->bo->copy_contact($contact_id);
-                       Header('Location: '
-                              . $GLOBALS['phpgw']->link('/index.php',
-                                                        
'menuaction=addressbook.uiaddressbook.edit_person&ab_id='.$new_contact_id));
+                       $GLOBALS['phpgw']->redirect_link('/index.php', array
+                       (
+                               'menuaction'    => 
'addressbook.uiaddressbook.edit_person',
+                               'ab_id'         => $new_contact_id
+                       ));
                }
 
                /*************************************************************\
@@ -813,14 +814,14 @@
                                
                                $fields['tab_person_data']['owner'] = 
$GLOBALS['phpgw_info']['user']['account_id'];
                                $ab_id = $this->bo->add_org($fields);
-                               Header('Location: '
-                                      . $GLOBALS['phpgw']->link('/index.php',
-                                                                
'menuaction=addressbook.uiaddressbook.view_org&ab_id='.$ab_id));
-                               $GLOBALS['phpgw']->common->phpgw_exit();
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array
+                               (
+                                       'menuaction'    => 
'addressbook.uiaddressbook.view_org',
+                                       'ab_id'         => $ab_id
+                               ));
                                break;
                        case 'cancel':
-                               Header('Location: '
-                                      . $GLOBALS['phpgw']->link('/index.php', 
$this->form_index));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
$this->form_index);
                                break;
                        case 'delete':
                                break;
@@ -889,22 +890,21 @@
 
                                $this->bo->edit_org($this->contact_id, $fields);
 
-                               Header('Location: '
-                                      . $GLOBALS['phpgw']->link('/index.php',
-                                                                
'menuaction=addressbook.uiaddressbook.view_org&ab_id='.$this->contact_id));
-                               $GLOBALS['phpgw']->common->phpgw_exit();
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array
+                               (
+                                       'menuaction'    => 
'addressbook.uiaddressbook.view_org',
+                                       'ab_id'         => $this->contact_id
+                               ));
                                break;
                        case 'cancel':
-                               Header('Location: '
-                                      . $GLOBALS['phpgw']->link('/index.php', 
$this->form_index));
-                               $GLOBALS['phpgw']->common->phpgw_exit();
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
$this->form_index);
                                break;
                        case 'delete':
-                               Header('Location: '
-                                      . $GLOBALS['phpgw']->link('/index.php',
-                                                                
'menuaction=addressbook.uiaddressbook.delete_org&ab_id='.$this->contact_id));
-                               $GLOBALS['phpgw']->common->phpgw_exit();
-                               //his->delete_person($this->contact_id);
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array
+                               (
+                                       'menuaction'    => 
'addressbook.uiaddressbook.delete_org',
+                                       'ab_id'         => $this->contact_id
+                               ));
                                break;
                        case 'clear':
                                $this->entry = '';
@@ -920,8 +920,7 @@
                        $this->owner = 
$this->entry['owner']?$this->entry['owner']:$this->owner;
                        if(!$this->bo->check_edit($this->contact_id, 
$this->owner))
                        {
-                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php', $this->form_index));
-                               $GLOBALS['phpgw']->common->phpgw_exit();
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
$this->form_index);
                        }
 
                        //start to draw the add window
@@ -972,9 +971,11 @@
                {
                        $contact_id = get_var('ab_id');
                        $new_contact_id = $this->bo->copy_contact($contact_id);
-                       Header('Location: '
-                              . $GLOBALS['phpgw']->link('/index.php',
-                                                        
'menuaction=addressbook.uiaddressbook.edit_org&ab_id='.$new_contact_id));
+                       $GLOBALS['phpgw']->redirect_link('/index.php', array
+                       (
+                               'menuaction'    => 
'addressbook.uiaddressbook.edit_org',
+                               'ab_id'         => $new_contact_id
+                       ));
                }
 
                /*************************************************************\
@@ -1189,10 +1190,10 @@
                */
                function person_form($fields)
                {
-                       $userformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       $userformat =& 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
                        if($userformat != $this->bo->bday_internformat)
                        {
-                               $datetime = CreateObject("phpgwapi.datetime");
+                               $datetime = CreateObject('phpgwapi.datetime');
                                $fields['per_birthday'] = 
$datetime->convertDate($fields['per_birthday'], $this->bo->bday_internformat, 
$userformat);
                        }
                        $bday = 
$this->jscal->input('entry[per_birthday]',$fields['per_birthday']);
@@ -1208,17 +1209,19 @@
 
                        $this->form_start();                    
                        $this->template->set_var('lang_general_data', 
lang('General Data'));
-
-                       $this->set_form_fields(array(1  => array('Prefix', 
'entry[per_prefix]', $fields['per_prefix']),
-                                                    2  => array('Email', 
'entry[email]', $fields['email']),
-                                                    3  => array('First Name', 
'entry[per_first_name]', $fields['per_first_name']),
-                                                    4  => array('Phone', 
'entry[wphone]', $fields['wphone']),
-                                                    5  => array('Last Name', 
'entry[per_last_name]', $fields['per_last_name']),
-                                                    6  => array('Title', 
'entry[per_title]', $fields['per_title']),
-                                                    7  => array('Middle Name', 
'entry[per_middle_name]', $fields['per_middle_name']),
-                                                    8  => array('Department', 
'entry[per_department]', $fields['per_department']),
+                       $this->set_form_fields(array
+                       (
+                               1       => array('Prefix', 'entry[per_prefix]', 
$fields['per_prefix']),
+                               2       => array('First Name', 
'entry[per_first_name]', $fields['per_first_name']),
+                               3       => array('Middle Name', 
'entry[per_middle_name]', $fields['per_middle_name']),
+                               4       => array('Last Name', 
'entry[per_last_name]', $fields['per_last_name']),
+                               5       => array('Title', 'entry[per_title]', 
$fields['per_title']),
+                               6       => array('Department', 
'entry[per_department]', $fields['per_department']),
+                               7       => array('Email', 'entry[email]', 
$fields['email']),
+                               8       => array('Phone', 'entry[wphone]', 
$fields['wphone']),
                                                     9  => array('Private', 
$access_check, 'special'),
-                                                    10 => array('Birthday', 
$bday, 'special')));
+                               10      => array('Birthday', $bday, 'special')
+                       ));
 
                        $this->form_end();
                        return $this->template->fp('out', 
'tab_body_general_data');
@@ -1316,20 +1319,17 @@
                        $this->template->set_var('current_action_name', 
'entry[tmp_data][addr][action]');
                        $this->template->set_var('current_action', 
$fields[tmp_data][addr]['action']);
 
-                       $this->set_form_fields(array(1 => array('Address 1', 
'entry[tmp_data][addr][addr_add1]', 
-                                                               
$fields['tmp_data']['addr']['addr_add1']),
-                                                    2 => array('State', 
'entry[tmp_data][addr][addr_state]', 
-                                                               
$fields[tmp_data]['addr']['addr_state']),
-                                                    3 => array('Address 2', 
'entry[tmp_data][addr][addr_add2]', 
-                                                               
$fields[tmp_data]['addr']['addr_add2']),
-                                                    4 => array('Postal Code', 
'entry[tmp_data][addr][addr_postal_code]', 
-                                                               
$fields[tmp_data]['addr']['addr_postal_code']),
-                                                    5 => array('City', 
'entry[tmp_data][addr][addr_city]', 
-                                                               
$fields[tmp_data]['addr']['addr_city']),
-                                                    6 => array('Country', 
'entry[tmp_data][addr][addr_country]', 
-                                                               
$fields[tmp_data]['addr']['addr_country']),
+                       $this->set_form_fields(array
+                       (
+                               1 => array('Address 1', 
'entry[tmp_data][addr][addr_add1]', $fields['tmp_data']['addr']['addr_add1']),
+                               2 => array('Address 2', 
'entry[tmp_data][addr][addr_add2]', $fields[tmp_data]['addr']['addr_add2']),
+                               3 => array('City', 
'entry[tmp_data][addr][addr_city]', $fields[tmp_data]['addr']['addr_city']),
+                               4 => array('State', 
'entry[tmp_data][addr][addr_state]', $fields[tmp_data]['addr']['addr_state']),
+                               5 => array('Postal Code', 
'entry[tmp_data][addr][addr_postal_code]', 
$fields[tmp_data]['addr']['addr_postal_code']),
+                               6 => array('Country', 
'entry[tmp_data][addr][addr_country]', 
$fields[tmp_data]['addr']['addr_country']),
                                                     7 => array(lang('Type'), 
$addresstype, 'special'),
-                                                    8 => array('', 
$addr_preferred, 'special')));
+                               8 => array('', $addr_preferred, 'special')
+                       ));
                        
                        $types_data = array('data1' => array('type'  => 'data',
                                                             'field' => 
'addr_description'),
@@ -2656,9 +2656,11 @@
                        
                        if(!$this->bo->check_delete($contact_id, $owner))
                        {
-                               Header('Location: '
-                                      . $GLOBALS['phpgw']->link('/index.php',
-                                                                
'menuaction=addressbook.uiaddressbook.index&section='.$contact_type));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array
+                               (
+                                       'menuaction'    => 
'addressbook.uiaddressbook.index',
+                                       'section'       => $contact_type
+                               ));
                        }
                        //LEX: Calling the  delete_addressbook hook to make
                        //shure we are allowed to delete this contacts by the 
@@ -2671,7 +2673,6 @@
 
                        if(!$this->bo->can_delete_hooks($response))
                        {
-
                                $GLOBALS['phpgw']->common->phpgw_header();
                                echo parse_navbar();
                                (count($this->bo->negative_responses) >1) ? 
$plur='s' : $plur='';
@@ -2725,9 +2726,11 @@
                         else
                         {
                                $this->bo->delete($contact_id, $contact_type);
-                               Header('Location: '
-                                      . $GLOBALS['phpgw']->link('/index.php',
-                                               
'menuaction=addressbook.uiaddressbook.index&section='.$contact_type));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array
+                               (
+                                       'menuaction'    => 
'addressbook.uiaddressbook.index',
+                                       'section'       => $contact_type
+                               ));
                         }
 
                }
@@ -2774,9 +2777,11 @@
 
                        if(!$this->bo->check_read($contact_id, $owner))
                        {
-                               Header('Location: '
-                                      . $GLOBALS['phpgw']->link('/index.php',
-                                                                
'menuaction=addressbook.uiaddressbook.index&section='.$contact_type));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array
+                               (
+                                       'menuaction'    => 
'addressbook.uiaddressbook.index',
+                                       'section'       => $contact_type
+                               ));
                        }
 
                        foreach($cats as $key => $cat_id)
@@ -3368,10 +3373,12 @@
                        
                        $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));
+                       $GLOBALS['phpgw']->redirect_link('/index.php', array
+                       (
+                               'menuaction'    => 
'addressbook.uiaddressbook.view_person',
+                               'ab_id'         => $contact_id,
+                               'referer'       => $referer
+                       ));
                }
        }
 ?>




reply via email to

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