phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: addressbook/inc class.boXport.inc.php,1.7,1.8 cl


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: addressbook/inc class.boXport.inc.php,1.7,1.8 class.boaddressbook.inc.php,1.21,1.22 class.soaddressbook.inc.php,1.14,1.15 class.uiXport.inc.php,1.10,1.11 class.uiaddressbook.inc.php,1.36,1.37 class.uifields.inc.php,1.3,1.4 class.uivcard.inc.php,1.5,1.6
Date: Wed, 16 Jan 2002 22:52:58 -0500

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

Modified Files:
        class.boXport.inc.php class.boaddressbook.inc.php 
        class.soaddressbook.inc.php class.uiXport.inc.php 
        class.uiaddressbook.inc.php class.uifields.inc.php 
        class.uivcard.inc.php 
Log Message:
Fix email link; Formatting;



Index: class.boXport.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.boXport.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.boXport.inc.php       30 Dec 2001 11:59:32 -0000      1.7
--- class.boXport.inc.php       17 Jan 2002 03:52:55 -0000      1.8
***************
*** 76,80 ****
                {
                        $data = 
$GLOBALS['phpgw']->session->appsession('session_data','addressbook');
!                       if($this->debug) { echo '<br>Read:'; 
_debug_array($data); }
  
                        $this->start  = $data['start'];
--- 76,83 ----
                {
                        $data = 
$GLOBALS['phpgw']->session->appsession('session_data','addressbook');
!                       if($this->debug)
!                       {
!                               echo '<br>Read:'; _debug_array($data);
!                       }
  
                        $this->start  = $data['start'];
***************
*** 91,95 ****
                        include (PHPGW_APP_INC . '/import/' . $conv_type);
  
!                       if ($private == '') { $private = 'public'; }
                        $row = 0;
                        $buffer = array();
--- 94,101 ----
                        include (PHPGW_APP_INC . '/import/' . $conv_type);
  
!                       if($private == '')
!                       {
!                               $private = 'public';
!                       }
                        $row = 0;
                        $buffer = array();
***************
*** 98,108 ****
                        $buffer = $contacts->import_start_file($buffer);
                        $fp = fopen($tsvfile,'r');
!                       if ($contacts->type == 'csv')
                        {
!                               while ($data = fgetcsv($fp,8000,','))
                                {
                                        $num = count($data);
                                        $row++;
!                                       if ($row == 1)
                                        {
                                                $header = $data;
--- 104,114 ----
                        $buffer = $contacts->import_start_file($buffer);
                        $fp = fopen($tsvfile,'r');
!                       if($contacts->type == 'csv')
                        {
!                               while($data = fgetcsv($fp,8000,','))
                                {
                                        $num = count($data);
                                        $row++;
!                                       if($row == 1)
                                        {
                                                $header = $data;
***************
*** 117,124 ****
                                        {
                                                $buffer = 
$contacts->import_start_record($buffer);
!                                               for ($c=0; $c<$num; $c++ )
                                                {
                                                        //Send name/value pairs 
along with the buffer
!                                                       if 
($contacts->import[$header[$c]] != '' && $data[$c] != '')
                                                        {
                                                                $buffer = 
$contacts->import_new_attrib($buffer, $contacts->import[$header[$c]],$data[$c]);
--- 123,130 ----
                                        {
                                                $buffer = 
$contacts->import_start_record($buffer);
!                                               for($c=0; $c<$num; $c++)
                                                {
                                                        //Send name/value pairs 
along with the buffer
!                                                       
if($contacts->import[$header[$c]] != '' && $data[$c] != '')
                                                        {
                                                                $buffer = 
$contacts->import_new_attrib($buffer, $contacts->import[$header[$c]],$data[$c]);
***************
*** 129,139 ****
                                }
                        }
!                       elseif ($contacts->type == 'ldif')
                        {
!                               while ($data = fgets($fp,8000))
                                {
                                        $url = "";
                                        list($name,$value,$extra) = split(':', 
$data);
!                                       if (substr($name,0,2) == 'dn')
                                        {
                                                $buffer = 
$contacts->import_start_record($buffer);
--- 135,145 ----
                                }
                        }
!                       elseif($contacts->type == 'ldif')
                        {
!                               while($data = fgets($fp,8000))
                                {
                                        $url = "";
                                        list($name,$value,$extra) = split(':', 
$data);
!                                       if(substr($name,0,2) == 'dn')
                                        {
                                                $buffer = 
$contacts->import_start_record($buffer);
***************
*** 141,145 ****
                                        
                                        $test = trim($value);
!                                       if ($name && !empty($test) && $extra)
                                        {
                                                // Probable url string
--- 147,151 ----
                                        
                                        $test = trim($value);
!                                       if($name && !empty($test) && $extra)
                                        {
                                                // Probable url string
***************
*** 147,151 ****
                                                $value = $extra;
                                        }
!                                       elseif ($name && empty($test) && $extra)
                                        {
                                                // Probable multiline encoding
--- 153,157 ----
                                                $value = $extra;
                                        }
!                                       elseif($name && empty($test) && $extra)
                                        {
                                                // Probable multiline encoding
***************
*** 155,167 ****
                                        }
  
!                                       if ($name && $value)
                                        {
                                                $test = split(',mail=',$value);
!                                               if ($test[1])
                                                {
                                                        $name = "mail";
                                                        $value = $test[1];
                                                }
!                                               if ($url)
                                                {
                                                        $name = "homeurl";
--- 161,173 ----
                                        }
  
!                                       if($name && $value)
                                        {
                                                $test = split(',mail=',$value);
!                                               if($test[1])
                                                {
                                                        $name = "mail";
                                                        $value = $test[1];
                                                }
!                                               if($url)
                                                {
                                                        $name = "homeurl";
***************
*** 182,195 ****
                        else
                        {
!                               while ($data = fgets($fp,8000))
                                {
                                        $data = trim($data);
                                        // RB 2001/05/07 added for Lotus 
Organizer
!                                       while (substr($data,-1) == '=')
                                        {
                                                // '=' at end-of-line --> line 
to be continued with next line
                                                $data = substr($data,0,-1) . 
trim(fgets($fp,8000));
                                        }
!                                       if 
(strstr($data,';ENCODING=QUOTED-PRINTABLE'))
                                        {
                                                // RB 2001/05/07 added for 
Lotus Organizer
--- 188,201 ----
                        else
                        {
!                               while($data = fgets($fp,8000))
                                {
                                        $data = trim($data);
                                        // RB 2001/05/07 added for Lotus 
Organizer
!                                       while(substr($data,-1) == '=')
                                        {
                                                // '=' at end-of-line --> line 
to be continued with next line
                                                $data = substr($data,0,-1) . 
trim(fgets($fp,8000));
                                        }
!                                       
if(strstr($data,';ENCODING=QUOTED-PRINTABLE'))
                                        {
                                                // RB 2001/05/07 added for 
Lotus Organizer
***************
*** 198,211 ****
                                        list($name,$value) = explode(':', 
$data,2); // RB 2001/05/09 to allow ':' in Values (not only in URL's)
  
!                                       if (strtolower(substr($name,0,5)) == 
'begin')
                                        {
                                                $buffer = 
$contacts->import_start_record($buffer);
                                        }
!                                       if ($name && $value)
                                        {
                                                reset($contacts->import);
!                                               while ( list($fname,$fvalue) = 
each($contacts->import) )
                                                {
!                                                       if ( 
strstr(strtolower($name), $contacts->import[$fname]) )
                                                        {
                                                                $buffer = 
$contacts->import_new_attrib($buffer,$name,$value);
--- 204,217 ----
                                        list($name,$value) = explode(':', 
$data,2); // RB 2001/05/09 to allow ':' in Values (not only in URL's)
  
!                                       if(strtolower(substr($name,0,5)) == 
'begin')
                                        {
                                                $buffer = 
$contacts->import_start_record($buffer);
                                        }
!                                       if($name && $value)
                                        {
                                                reset($contacts->import);
!                                               while(list($fname,$fvalue) = 
each($contacts->import))
                                                {
!                                                       
if(strstr(strtolower($name), $contacts->import[$fname]))
                                                        {
                                                                $buffer = 
$contacts->import_new_attrib($buffer,$name,$value);
***************
*** 228,239 ****
                {
                        include (PHPGW_APP_INC . '/export/' . $conv_type);
!                       $buffer=array();
                        $contacts = new export_conv;
  
                        // Read in user custom fields, if any
                        $customfields = array();
!                       while (list($col,$descr) = 
@each($GLOBALS['phpgw_info']['user']['preferences']['addressbook']))
                        {
!                       if ( substr($col,0,6) == 'extra_' )
                                {
                                        $field = ereg_replace('extra_','',$col);
--- 234,245 ----
                {
                        include (PHPGW_APP_INC . '/export/' . $conv_type);
!                       $buffer   = array();
                        $contacts = new export_conv;
  
                        // Read in user custom fields, if any
                        $customfields = array();
!                       while(list($col,$descr) = 
@each($GLOBALS['phpgw_info']['user']['preferences']['addressbook']))
                        {
!                       if(substr($col,0,6) == 'extra_')
                                {
                                        $field = ereg_replace('extra_','',$col);
***************
*** 247,256 ****
                                'address3' => 'address3'
                        );
!                       if ($contacts->type != 'vcard')
                        {
                                $contacts->qfields = 
$contacts->stock_contact_fields;# + $extrafields;# + $customfields;
                        }
  
!                       if (!empty($cat_id))
                        {
                                $buffer = 
$contacts->export_start_file($buffer,$cat_id);
--- 253,262 ----
                                'address3' => 'address3'
                        );
!                       if($contacts->type != 'vcard')
                        {
                                $contacts->qfields = 
$contacts->stock_contact_fields;# + $extrafields;# + $customfields;
                        }
  
!                       if(!empty($cat_id))
                        {
                                $buffer = 
$contacts->export_start_file($buffer,$cat_id);
***************
*** 261,268 ****
                        }
  
!                       for ($i=0;$i<count($contacts->ids);$i++)
                        {
                                $buffer = 
$contacts->export_start_record($buffer);
!                               while( list($name,$value) = 
each($contacts->currentrecord) )
                                {
                                        $buffer = 
$contacts->export_new_attrib($buffer,$name,$value);
--- 267,274 ----
                        }
  
!                       for($i=0;$i<count($contacts->ids);$i++)
                        {
                                $buffer = 
$contacts->export_start_record($buffer);
!                               while(list($name,$value) = 
each($contacts->currentrecord))
                                {
                                        $buffer = 
$contacts->export_new_attrib($buffer,$name,$value);

Index: class.boaddressbook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.boaddressbook.inc.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** class.boaddressbook.inc.php 23 Dec 2001 17:28:14 -0000      1.21
--- class.boaddressbook.inc.php 17 Jan 2002 03:52:55 -0000      1.22
***************
*** 126,130 ****
                        }
  
!                       if($this->debug) { $this->_debug_sqsof(); }
                }
  
--- 126,133 ----
                        }
  
!                       if($this->debug)
!                       {
!                               $this->_debug_sqsof();
!                       }
                }
  
***************
*** 151,155 ****
                          this function to fill the server dispatch map using a 
string.
                        */
!                       if (is_array($_type))
                        {
                                $_type = $_type['type'] ? $_type['type'] : 
$_type[0];
--- 154,158 ----
                          this function to fill the server dispatch map using a 
string.
                        */
!                       if(is_array($_type))
                        {
                                $_type = $_type['type'] ? $_type['type'] : 
$_type[0];
***************
*** 203,209 ****
                function save_sessiondata($data)
                {
!                       if ($this->use_session)
                        {
!                               if($this->debug) { echo '<br>Save:'; 
_debug_array($data); }
                                
$GLOBALS['phpgw']->session->appsession('session_data','addressbook',$data);
                        }
--- 206,215 ----
                function save_sessiondata($data)
                {
!                       if($this->use_session)
                        {
!                               if($this->debug)
!                               {
!                                       echo '<br>Save:'; _debug_array($data);
!                               }
                                
$GLOBALS['phpgw']->session->appsession('session_data','addressbook',$data);
                        }
***************
*** 213,217 ****
                {
                        $data = 
$GLOBALS['phpgw']->session->appsession('session_data','addressbook');
!                       if($this->debug) { echo '<br>Read:'; 
_debug_array($data); }
  
                        $this->start  = $data['start'];
--- 219,226 ----
                {
                        $data = 
$GLOBALS['phpgw']->session->appsession('session_data','addressbook');
!                       if($this->debug)
!                       {
!                               echo '<br>Read:'; _debug_array($data);
!                       }
  
                        $this->start  = $data['start'];
***************
*** 227,231 ****
                function strip_html($dirty = '')
                {
!                       if ($dirty == '')
                        {
                                $dirty = array();
--- 236,240 ----
                function strip_html($dirty = '')
                {
!                       if($dirty == '')
                        {
                                $dirty = array();
***************
*** 235,239 ****
                                if(gettype($dirty[$i]) == 'array')
                                {
!                                       while (list($name,$value) = 
@each($dirty[$i]))
                                        {
                                                $cleaned[$i][$name] = 
$GLOBALS['phpgw']->strip_html($dirty[$i][$name]);
--- 244,248 ----
                                if(gettype($dirty[$i]) == 'array')
                                {
!                                       while(list($name,$value) = 
@each($dirty[$i]))
                                        {
                                                $cleaned[$i][$name] = 
$GLOBALS['phpgw']->strip_html($dirty[$i][$name]);
***************
*** 252,256 ****
                        $entries = $this->so->read_entries($data);
                        $this->total = $this->so->contacts->total_records;
!                       if($this->debug) { echo '<br>Total records="' . 
$this->total . '"'; }
                        return $this->strip_html($entries);
                }
--- 261,268 ----
                        $entries = $this->so->read_entries($data);
                        $this->total = $this->so->contacts->total_records;
!                       if($this->debug)
!                       {
!                               echo '<br>Total records="' . $this->total . '"';
!                       }
                        return $this->strip_html($entries);
                }
***************
*** 314,319 ****
  
                        $named = explode(' ', $name);
!                       for ($i=count($named);$i>=0;$i--) { $names[$i] = 
$named[$i]; }
!                       if ($names[2])
                        {
                                $fields['n_given']  = $names[0];
--- 326,334 ----
  
                        $named = explode(' ', $name);
!                       for($i=count($named);$i>=0;$i--)
!                       {
!                               $names[$i] = $named[$i];
!                       }
!                       if($names[2])
                        {
                                $fields['n_given']  = $names[0];
***************
*** 359,369 ****
                {
                        $GLOBALS['phpgw']->preferences->read_repository();
!                       if (is_array($prefs))
                        {
                                /* _debug_array($prefs);exit; */
!                               while (list($pref,$x) = each($qfields))
                                {
                                        /* echo '<br>checking: ' . $pref . '=' 
. $prefs[$pref]; */
!                                       if ($prefs[$pref] == 'on')
                                        {
                                                
$GLOBALS['phpgw']->preferences->add('addressbook',$pref,'addressbook_on');
--- 374,384 ----
                {
                        $GLOBALS['phpgw']->preferences->read_repository();
!                       if(is_array($prefs))
                        {
                                /* _debug_array($prefs);exit; */
!                               while(list($pref,$x) = each($qfields))
                                {
                                        /* echo '<br>checking: ' . $pref . '=' 
. $prefs[$pref]; */
!                                       if($prefs[$pref] == 'on')
                                        {
                                                
$GLOBALS['phpgw']->preferences->add('addressbook',$pref,'addressbook_on');
***************
*** 379,383 ****
                        {
                                
$GLOBALS['phpgw']->preferences->delete('addressbook','mainscreen_showbirthdays');
!                               if ($other['mainscreen_showbirthdays'])
                                {
                                        
$GLOBALS['phpgw']->preferences->add('addressbook','mainscreen_showbirthdays',True);
--- 394,398 ----
                        {
                                
$GLOBALS['phpgw']->preferences->delete('addressbook','mainscreen_showbirthdays');
!                               if($other['mainscreen_showbirthdays'])
                                {
                                        
$GLOBALS['phpgw']->preferences->add('addressbook','mainscreen_showbirthdays',True);
***************
*** 385,389 ****
  
                                
$GLOBALS['phpgw']->preferences->delete('addressbook','default_filter');
!                               if ($other['default_filter'])
                                {
                                        
$GLOBALS['phpgw']->preferences->add('addressbook','default_filter',True);
--- 400,404 ----
  
                                
$GLOBALS['phpgw']->preferences->delete('addressbook','default_filter');
!                               if($other['default_filter'])
                                {
                                        
$GLOBALS['phpgw']->preferences->add('addressbook','default_filter',True);
***************
*** 391,395 ****
  
                                
$GLOBALS['phpgw']->preferences->delete('addressbook','autosave_category');
!                               if ($other['autosave_category'])
                                {
                                        
$GLOBALS['phpgw']->preferences->add('addressbook','autosave_category',True);
--- 406,410 ----
  
                                
$GLOBALS['phpgw']->preferences->delete('addressbook','autosave_category');
!                               if($other['autosave_category'])
                                {
                                        
$GLOBALS['phpgw']->preferences->add('addressbook','autosave_category',True);

Index: class.soaddressbook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.soaddressbook.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** class.soaddressbook.inc.php 9 Sep 2001 22:55:43 -0000       1.14
--- class.soaddressbook.inc.php 17 Jan 2002 03:52:55 -0000      1.15
***************
*** 72,76 ****
                function read_entry($id,$fields)
                {
!                       if ($this->rights & PHPGW_ACL_READ)
                        {
                                return 
$this->contacts->read_single_entry($id,$fields);
--- 72,76 ----
                function read_entry($id,$fields)
                {
!                       if($this->rights & PHPGW_ACL_READ)
                        {
                                return 
$this->contacts->read_single_entry($id,$fields);
***************
*** 85,89 ****
                function read_last_entry($fields)
                {
!                       if ($this->rights & PHPGW_ACL_READ)
                        {
                                return 
$this->contacts->read_last_entry($fields);
--- 85,89 ----
                function read_last_entry($fields)
                {
!                       if($this->rights & PHPGW_ACL_READ)
                        {
                                return 
$this->contacts->read_last_entry($fields);
***************
*** 103,107 ****
                                $fields['tid'] = 'n';
                        }
!                       if ($this->rights & PHPGW_ACL_ADD)
                        {
                                $ab_id  = $fields['ab_id'];
--- 103,107 ----
                                $fields['tid'] = 'n';
                        }
!                       if($this->rights & PHPGW_ACL_ADD)
                        {
                                $ab_id  = $fields['ab_id'];
***************
*** 130,134 ****
                function update_entry($fields)
                {
!                       if ($this->rights & PHPGW_ACL_EDIT)
                        {
                                $ab_id  = $fields['ab_id'];
--- 130,134 ----
                function update_entry($fields)
                {
!                       if($this->rights & PHPGW_ACL_EDIT)
                        {
                                $ab_id  = $fields['ab_id'];
***************
*** 149,153 ****
                function delete_entry($data)
                {
!                       if ($this->rights & PHPGW_ACL_DELETE)
                        {
                                $this->contacts->delete($data['id']);
--- 149,153 ----
                function delete_entry($data)
                {
!                       if($this->rights & PHPGW_ACL_DELETE)
                        {
                                $this->contacts->delete($data['id']);

Index: class.uiXport.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.uiXport.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** class.uiXport.inc.php       15 Jan 2002 16:38:49 -0000      1.10
--- class.uiXport.inc.php       17 Jan 2002 03:52:55 -0000      1.11
***************
*** 50,54 ****
                function 
cat_option($cat_id='',$notall=False,$java=True,$multiple=False)
                {
!                       if ($java)
                        {
                                $jselect = ' onChange="this.form.submit();"';
--- 50,54 ----
                function 
cat_option($cat_id='',$notall=False,$java=True,$multiple=False)
                {
!                       if($java)
                        {
                                $jselect = ' onChange="this.form.submit();"';
***************
*** 56,63 ****
                        /* Setup all and none first */
                        $cats_link  = "\n" .'<select 
name="fcat_id'.($multiple?'[]':'').'"' .$jselect . ($multiple ? 'multiple 
size="3"' : '') . ">\n";
!                       if (!$notall)
                        {
                                $cats_link .= '<option value=""';
!                               if ($cat_id=='all')
                                {
                                        $cats_link .= ' selected';
--- 56,63 ----
                        /* Setup all and none first */
                        $cats_link  = "\n" .'<select 
name="fcat_id'.($multiple?'[]':'').'"' .$jselect . ($multiple ? 'multiple 
size="3"' : '') . ">\n";
!                       if(!$notall)
                        {
                                $cats_link .= '<option value=""';
!                               if($cat_id=='all')
                                {
                                        $cats_link .= ' selected';
***************
*** 76,84 ****
                        global 
$convert,$download,$tsvfile,$private,$conv_type,$fcat_id;
  
!                       if ($convert)
                        {
                                $buffer = 
$this->bo->import($tsvfile,$conv_type,$private,$fcat_id);
  
!                               if ($download == '')
                                {
                                        if($conv_type == 'Debug LDAP' || 
$conv_type == 'Debug SQL' )
--- 76,84 ----
                        global 
$convert,$download,$tsvfile,$private,$conv_type,$fcat_id;
  
!                       if($convert)
                        {
                                $buffer = 
$this->bo->import($tsvfile,$conv_type,$private,$fcat_id);
  
!                               if($download == '')
                                {
                                        if($conv_type == 'Debug LDAP' || 
$conv_type == 'Debug SQL' )
***************
*** 116,122 ****
                                $dir_handle = opendir(PHPGW_APP_INC . SEP . 
'import');
                                $i=0; $myfilearray = '';
!                               while ($file = readdir($dir_handle))
                                {
!                                       if ((substr($file, 0, 1) != '.') && 
is_file(PHPGW_APP_INC . SEP . 'import' . SEP . $file) )
                                        {
                                                $myfilearray[$i] = $file;
--- 116,122 ----
                                $dir_handle = opendir(PHPGW_APP_INC . SEP . 
'import');
                                $i=0; $myfilearray = '';
!                               while($file = readdir($dir_handle))
                                {
!                                       if((substr($file, 0, 1) != '.') && 
is_file(PHPGW_APP_INC . SEP . 'import' . SEP . $file) )
                                        {
                                                $myfilearray[$i] = $file;
***************
*** 126,130 ****
                                closedir($dir_handle);
                                sort($myfilearray);
!                               for ($i=0;$i<count($myfilearray);$i++)
                                {
                                        $fname = ereg_replace('_',' 
',$myfilearray[$i]);
--- 126,130 ----
                                closedir($dir_handle);
                                sort($myfilearray);
!                               for($i=0;$i<count($myfilearray);$i++)
                                {
                                        $fname = ereg_replace('_',' 
',$myfilearray[$i]);
***************
*** 167,175 ****
                        global 
$convert,$tsvfilename,$cat_id,$download,$conv_type;
  
!                       if ($convert)
                        {
                                $buffer = $this->bo->export($conv_type,$cat_id);
  
!                               if ($conv_type == 'none')
                                {
                                        
$GLOBALS['phpgw_info']['flags']['noheader'] = False;
--- 167,175 ----
                        global 
$convert,$tsvfilename,$cat_id,$download,$conv_type;
  
!                       if($convert)
                        {
                                $buffer = $this->bo->export($conv_type,$cat_id);
  
!                               if($conv_type == 'none')
                                {
                                        
$GLOBALS['phpgw_info']['flags']['noheader'] = False;
***************
*** 183,187 ****
                                }
  
!                               if ( ($download == 'on') || ($o->type == 'pdb') 
)
                                {
                                        // filename, default 
application/octet-stream, length of file, default nocache True
--- 183,187 ----
                                }
  
!                               if(($download == 'on') || ($o->type == 'pdb'))
                                {
                                        // filename, default 
application/octet-stream, length of file, default nocache True
***************
*** 209,215 ****
                                $dir_handle = opendir(PHPGW_APP_INC. SEP . 
'export');
                                $i=0; $myfilearray = '';
!                               while ($file = readdir($dir_handle))
                                {
!                                       if ((substr($file, 0, 1) != '.') && 
is_file(PHPGW_APP_INC . SEP . 'export' . SEP . $file) )
                                        {
                                                $myfilearray[$i] = $file;
--- 209,215 ----
                                $dir_handle = opendir(PHPGW_APP_INC. SEP . 
'export');
                                $i=0; $myfilearray = '';
!                               while($file = readdir($dir_handle))
                                {
!                                       if((substr($file, 0, 1) != '.') && 
is_file(PHPGW_APP_INC . SEP . 'export' . SEP . $file) )
                                        {
                                                $myfilearray[$i] = $file;
***************
*** 219,223 ****
                                closedir($dir_handle);
                                sort($myfilearray);
!                               for ($i=0;$i<count($myfilearray);$i++)
                                {
                                        $fname = ereg_replace('_',' 
',$myfilearray[$i]);
--- 219,223 ----
                                closedir($dir_handle);
                                sort($myfilearray);
!                               for($i=0;$i<count($myfilearray);$i++)
                                {
                                        $fname = ereg_replace('_',' 
',$myfilearray[$i]);

Index: class.uiaddressbook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.uiaddressbook.inc.php,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -r1.36 -r1.37
*** class.uiaddressbook.inc.php 4 Jan 2002 00:25:16 -0000       1.36
--- class.uiaddressbook.inc.php 17 Jan 2002 03:52:55 -0000      1.37
***************
*** 76,80 ****
                        $this->filter   = $this->bo->filter;
                        $this->cat_id   = $this->bo->cat_id;
!                       if($this->debug) { $this->_debug_sqsof(); }
                }
  
--- 76,83 ----
                        $this->filter   = $this->bo->filter;
                        $this->cat_id   = $this->bo->cat_id;
!                       if($this->debug)
!                       {
[...1316 lines suppressed...]
                                
$this->template->set_var('hcountry',$GLOBALS['phpgw']->country->form_select($hcountry,'entry[hcountry]'));
--- 1678,1682 ----
                        $this->template->set_var('hzip',$hzip);
                        $this->template->set_var('lang_hcountry',lang('Home 
Country'));
!                       if($countrylist)
                        {
                                
$this->template->set_var('hcountry',$GLOBALS['phpgw']->country->form_select($hcountry,'entry[hcountry]'));
***************
*** 1671,1675 ****
                        $this->template->set_var('lang_cats',lang('Category'));
                        $this->template->set_var('cats_link',$cats_link);
!                       if ($customfields)
                        {
                                
$this->template->set_var('lang_custom',lang('Custom Fields').':');
--- 1702,1706 ----
                        $this->template->set_var('lang_cats',lang('Category'));
                        $this->template->set_var('cats_link',$cats_link);
!                       if($customfields)
                        {
                                
$this->template->set_var('lang_custom',lang('Custom Fields').':');

Index: class.uifields.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.uifields.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.uifields.inc.php      1 Jan 2002 19:03:26 -0000       1.3
--- class.uifields.inc.php      17 Jan 2002 03:52:56 -0000      1.4
***************
*** 67,76 ****
                        
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/admin/index.php'));
  
!                       if (!$start)
                        {
                                $start = 0;
                        }
  
!                       if (!$sort)
                        {
                                $sort = 'ASC';
--- 67,76 ----
                        
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/admin/index.php'));
  
!                       if(!$start)
                        {
                                $start = 0;
                        }
  
!                       if(!$sort)
                        {
                                $sort = 'ASC';
***************
*** 93,97 ****
                        
$GLOBALS['phpgw']->template->set_var('lang_delete',lang('Delete'));
  
!                       for ($i=0;$i<count($fields);$i++)
                        {
                                $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
--- 93,97 ----
                        
$GLOBALS['phpgw']->template->set_var('lang_delete',lang('Delete'));
  
!                       for($i=0;$i<count($fields);$i++)
                        {
                                $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
***************
*** 137,145 ****
                        
$GLOBALS['phpgw']->template->set_block('form','edit','edithandle');
  
!                       if ($GLOBALS['HTTP_POST_VARS']['submit'])
                        {
                                $errorcount = 0;
  
!                               if (!$field_name)
                                {
                                        $error[$errorcount++] = lang('Please 
enter a name for that field !');
--- 137,145 ----
                        
$GLOBALS['phpgw']->template->set_block('form','edit','edithandle');
  
!                       if($GLOBALS['HTTP_POST_VARS']['submit'])
                        {
                                $errorcount = 0;
  
!                               if(!$field_name)
                                {
                                        $error[$errorcount++] = lang('Please 
enter a name for that field !');
***************
*** 147,156 ****
  
                                $fields = 
$this->read_custom_fields($start,$limit,$field_name);
!                               if ($fields[0]['name'])
                                {
                                        $error[$errorcount++] = lang('That 
field name has been used already !');
                                }
  
!                               if (! $error)
                                {
                                        $field_name = addslashes($field_name);
--- 147,156 ----
  
                                $fields = 
$this->read_custom_fields($start,$limit,$field_name);
!                               if($fields[0]['name'])
                                {
                                        $error[$errorcount++] = lang('That 
field name has been used already !');
                                }
  
!                               if(!$error)
                                {
                                        $field_name = addslashes($field_name);
***************
*** 162,174 ****
                        echo parse_navbar();
  
!                       if ($errorcount)
                        {
                                
$GLOBALS['phpgw']->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
                        }
!                       if (($submit) && (! $error) && (! $errorcount))
                        {
                                
$GLOBALS['phpgw']->template->set_var('message',lang('Field x has been added !', 
$field_name));
                        }
!                       if ((! $submit) && (! $error) && (! $errorcount))
                        {
                                
$GLOBALS['phpgw']->template->set_var('message','');
--- 162,174 ----
                        echo parse_navbar();
  
!                       if($errorcount)
                        {
                                
$GLOBALS['phpgw']->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
                        }
!                       if(($submit) && (! $error) && (! $errorcount))
                        {
                                
$GLOBALS['phpgw']->template->set_var('message',lang('Field x has been added !', 
$field_name));
                        }
!                       if((! $submit) && (! $error) && (! $errorcount))
                        {
                                
$GLOBALS['phpgw']->template->set_var('message','');
***************
*** 203,207 ****
                                $GLOBALS['phpgw']->common->phpgw_footer();
                                $GLOBALS['phpgw']->common->phpgw_exit();
- 
                        }
  
--- 203,206 ----
***************
*** 213,217 ****
                        $submit     = $GLOBALS['HTTP_POST_VARS']['submit'];
  
!                       if (!$field)
                        {
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',"menuaction=addressbook.uifields.index&sort=$sort&query=$query&start=$start"));
--- 212,216 ----
                        $submit     = $GLOBALS['HTTP_POST_VARS']['submit'];
  
!                       if(!$field)
                        {
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',"menuaction=addressbook.uifields.index&sort=$sort&query=$query&start=$start"));
***************
*** 227,238 ****
                                . '<input type="hidden" name="field" value="' . 
$field . '">' . "\n";
  
!                       if ($submit)
                        {
                                $errorcount = 0;
!                               if (!$field_name) { $error[$errorcount++] = 
lang('Please enter a name for that field!'); }
  
                                $field_name = addslashes($field_name);
  
!                               if (! $error)
                                {
                                        
$this->save_custom_field($field,$field_name);
--- 226,240 ----
                                . '<input type="hidden" name="field" value="' . 
$field . '">' . "\n";
  
!                       if($submit)
                        {
                                $errorcount = 0;
!                               if(!$field_name)
!                               {
!                                       $error[$errorcount++] = lang('Please 
enter a name for that field!');
!                               }
  
                                $field_name = addslashes($field_name);
  
!                               if(!$error)
                                {
                                        
$this->save_custom_field($field,$field_name);
***************
*** 243,260 ****
                        echo parse_navbar();
  
!                       if ($errorcount)
                        {
                                
$GLOBALS['phpgw']->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
                        }
!                       if (($submit) && (! $error) && (! $errorcount))
                        {
                                
$GLOBALS['phpgw']->template->set_var('message',lang('Field x has been updated 
!', $field_name));
                        }
!                       if ((! $submit) && (! $error) && (! $errorcount))
                        {
                                
$GLOBALS['phpgw']->template->set_var('message','');
                        }
  
!                       if ($submit)
                        {
                                $field = $field_name;
--- 245,262 ----
                        echo parse_navbar();
  
!                       if($errorcount)
                        {
                                
$GLOBALS['phpgw']->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
                        }
!                       if(($submit) && (! $error) && (! $errorcount))
                        {
                                
$GLOBALS['phpgw']->template->set_var('message',lang('Field x has been updated 
!', $field_name));
                        }
!                       if((!$submit) && (! $error) && (! $errorcount))
                        {
                                
$GLOBALS['phpgw']->template->set_var('message','');
                        }
  
!                       if($submit)
                        {
                                $field = $field_name;
***************
*** 295,304 ****
                        $sort     = $GLOBALS['HTTP_POST_VARS']['sort']  ? 
$GLOBALS['HTTP_POST_VARS']['sort']  : $GLOBALS['HTTP_GET_VARS']['sort'];
  
!                       if (!$field)
                        {
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifields.index'));
                        }
  
!                       if ($GLOBALS['HTTP_POST_VARS']['confirm'])
                        {
                                $this->save_custom_field($field);
--- 297,306 ----
                        $sort     = $GLOBALS['HTTP_POST_VARS']['sort']  ? 
$GLOBALS['HTTP_POST_VARS']['sort']  : $GLOBALS['HTTP_GET_VARS']['sort'];
  
!                       if(!$field)
                        {
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifields.index'));
                        }
  
!                       if($GLOBALS['HTTP_POST_VARS']['confirm'])
                        {
                                $this->save_custom_field($field);
***************
*** 344,350 ****
                        $fields = array();
                        
@reset($GLOBALS['phpgw_info']['user']['preferences']['addressbook']);
!                       while (list($col,$descr) = 
@each($GLOBALS['phpgw_info']['user']['preferences']['addressbook']))
                        {
!                               if ( substr($col,0,6) == 'extra_' )
                                {
                                        $fields[$j]['name'] = 
ereg_replace('extra_','',$col);
--- 346,352 ----
                        $fields = array();
                        
@reset($GLOBALS['phpgw_info']['user']['preferences']['addressbook']);
!                       while(list($col,$descr) = 
@each($GLOBALS['phpgw_info']['user']['preferences']['addressbook']))
                        {
!                               if(substr($col,0,6) == 'extra_')
                                {
                                        $fields[$j]['name'] = 
ereg_replace('extra_','',$col);
***************
*** 352,356 ****
                                        $fields[$j]['id'] = $i;
  
!                                       if ($query && ($fields[$j]['name'] != 
$query))
                                        {
                                                unset($fields[$j]['name']);
--- 354,358 ----
                                        $fields[$j]['id'] = $i;
  
!                                       if($query && ($fields[$j]['name'] != 
$query))
                                        {
                                                unset($fields[$j]['name']);
***************
*** 372,376 ****
                {
                        
$GLOBALS['phpgw']->preferences->read_repository($GLOBALS['phpgw_info']['user']['account_id']);
!                       if ($old)
                        {
                                
$GLOBALS['phpgw']->preferences->delete("addressbook","extra_".$old);
--- 374,378 ----
                {
                        
$GLOBALS['phpgw']->preferences->read_repository($GLOBALS['phpgw_info']['user']['account_id']);
!                       if($old)
                        {
                                
$GLOBALS['phpgw']->preferences->delete("addressbook","extra_".$old);

Index: class.uivcard.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.uivcard.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.uivcard.inc.php       9 Aug 2001 00:19:28 -0000       1.5
--- class.uivcard.inc.php       17 Jan 2002 03:52:56 -0000      1.6
***************
*** 27,31 ****
                );
  
!               var $extrafields = array(
                        'ophone'   => 'ophone',
                        'address2' => 'address2',
--- 27,31 ----
                );
  
!               var $extrafields = array(
                        'ophone'   => 'ophone',
                        'address2' => 'address2',
***************
*** 35,41 ****
                function uivcard()
                {
!                       global $phpgw;
! 
!                       $this->template = $phpgw->template;
                        $this->contacts = CreateObject('phpgwapi.contacts');
                        $this->browser  = CreateObject('phpgwapi.browser');
--- 35,39 ----
                function uivcard()
                {
!                       $this->template = $GLOBALS['phpgw']->template;
                        $this->contacts = CreateObject('phpgwapi.contacts');
                        $this->browser  = CreateObject('phpgwapi.browser');
***************
*** 46,57 ****
                function in()
                {
!                       global $phpgw,$phpgw_info,$action;
  
!                       $phpgw->common->phpgw_header();
                        echo parse_navbar();
  
!                       echo '<body bgcolor="' . 
$phpgw_info['theme']['bg_color'] . '">';
    
!                       if ($action == 'GetFile')
                        {
                                echo '<b><center>' . lang('You must select a 
vcard. (*.vcf)') . '</b></center><br><br>';
--- 44,55 ----
                function in()
                {
!                       $action = $GLOBALS['HTTP_POST_VARS']['action'];
  
!                       $GLOBALS['phpgw']->common->phpgw_header();
                        echo parse_navbar();
  
!                       echo '<body bgcolor="' . 
$GLOBALS['phpgw_info']['theme']['bg_color'] . '">';
    
!                       if($action == 'GetFile')
                        {
                                echo '<b><center>' . lang('You must select a 
vcard. (*.vcf)') . '</b></center><br><br>';
***************
*** 61,65 ****
  
                        $this->template->set_var('vcard_header','<p>&nbsp;<b>' 
. lang('Address book - VCard in') . '</b><hr><p>');
!                       
$this->template->set_var('action_url',$phpgw->link('/index.php','menuaction=addressbook.boaddressbook.add_vcard'));
                        $this->template->set_var('lang_access',lang('Access'));
                        $this->template->set_var('lang_groups',lang('Which 
groups'));
--- 59,63 ----
  
                        $this->template->set_var('vcard_header','<p>&nbsp;<b>' 
. lang('Address book - VCard in') . '</b><hr><p>');
!                       
$this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.boaddressbook.add_vcard'));
                        $this->template->set_var('lang_access',lang('Access'));
                        $this->template->set_var('lang_groups',lang('Which 
groups'));
***************
*** 69,89 ****
                        $this->template->pparse('out','vcardin');
  
!                       $phpgw->common->phpgw_footer();
                }
  
                function out()
                {
!                       global $phpgw,$phpgw_info,$ab_id,$nolname,$nofname;
  
!                       if ($nolname || $nofname)
                        {
!                               $phpgw->common->phpgw_header();
                                echo parse_navbar();
                        }
  
!                       if (!$ab_id)
                        {
!                               Header('Location: ' . 
$phpgw->link('/addressbook/index.php'));
!                               $phpgw->common->phpgw_exit();
                        }
  
--- 67,87 ----
                        $this->template->pparse('out','vcardin');
  
!                       $GLOBALS['phpgw']->common->phpgw_footer();
                }
  
                function out()
                {
!                       global $ab_id,$nolname,$nofname;
  
!                       if($nolname || $nofname)
                        {
!                               $GLOBALS['phpgw']->common->phpgw_header();
                                echo parse_navbar();
                        }
  
!                       if(!$ab_id)
                        {
!                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/addressbook/index.php'));
!                               $GLOBALS['phpgw']->common->phpgw_exit();
                        }
  
***************
*** 92,102 ****
                        $perms = 
$this->contacts->check_perms($this->contacts->grants[$check[0]['owner']],PHPGW_ACL_READ);
  
!                       if ( (!$perms) && ($check[0]['owner'] != 
$phpgw_info['user']['account_id']) )
                        {
!                               Header("Location: " . 
$phpgw->link('/index.php','menuaction=addressbook.uiaddressbook.get_list'));
!                               $phpgw->common->phpgw_exit();
                        }
  
!                       $extrafields = array('address2' => 'address2');
                        $qfields = $this->contacts->stock_contact_fields + 
$extrafields;
  
--- 90,100 ----
                        $perms = 
$this->contacts->check_perms($this->contacts->grants[$check[0]['owner']],PHPGW_ACL_READ);
  
!                       if((!$perms) && ($check[0]['owner'] != 
$GLOBALS['phpgw_info']['user']['account_id']))
                        {
!                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.get_list'));
!                               $GLOBALS['phpgw']->common->phpgw_exit();
                        }
  
!                       $extrafields = array('address2' => 'address2');
                        $qfields = $this->contacts->stock_contact_fields + 
$extrafields;
  
***************
*** 125,133 ****
                                {
                                        /* Run away here. */
!                                       Header('Location: ' . 
$phpgw->link('/index.php',"menuaction=addressbook.uivcard.out&nolname=1&ab_id=$ab_id"));
                                }
                                if($firstname == '')
                                {
!                                       Header('Location: ' . 
$phpgw->link('/index.php',"menuaction=addressbook.uivcard.out&nofname=1&ab_id=$ab_id"));
                                }
  
--- 123,131 ----
                                {
                                        /* Run away here. */
!                                       Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uivcard.out&nolname=1&ab_id='
 . $ab_id));
                                }
                                if($firstname == '')
                                {
!                                       Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uivcard.out&nofname=1&ab_id='
 . $ab_id));
                                }
  
***************
*** 135,149 ****
                                {
                                        $fn =  explode('@',$email);
!                                       $filename = sprintf("%s.vcf", $fn[0]);
                                }
                                elseif ($hemail)
                                {
                                        $fn =  explode('@',$hemail);
!                                       $filename = sprintf("%s.vcf", $fn[0]);
                                }
                                else
                                {
                                        $fn = strtolower($firstname);
!                                       $filename = sprintf("%s.vcf", $fn);
                                }
  
--- 133,147 ----
                                {
                                        $fn =  explode('@',$email);
!                                       $filename = sprintf('%s.vcf', $fn[0]);
                                }
                                elseif ($hemail)
                                {
                                        $fn =  explode('@',$hemail);
!                                       $filename = sprintf('%s.vcf', $fn[0]);
                                }
                                else
                                {
                                        $fn = strtolower($firstname);
!                                       $filename = sprintf('%s.vcf', $fn);
                                }
  
***************
*** 152,160 ****
                                // check that each $fields exists in the export 
array and
                                // set a new array to equal the translation and 
original value
!                               while( list($name,$value) = each($fields) )
                                {
!                                       if ($myexport[$name] && ($value != "") )
                                        {
!                                               //echo 
'<br>'.$name."=".$fields[$name]."\n";
                                                $buffer[$myexport[$name]] = 
$value;
                                        }
--- 150,158 ----
                                // check that each $fields exists in the export 
array and
                                // set a new array to equal the translation and 
original value
!                               while(list($name,$value) = each($fields))
                                {
!                                       if($myexport[$name] && ($value != ''))
                                        {
!                                               //echo 
'<br>'.$name.'='.$fields[$name]."\n";
                                                $buffer[$myexport[$name]] = 
$value;
                                        }
***************
*** 162,171 ****
  
                                // create a vcard from this translated array
!                           $entry = $this->vcard->out($buffer);
                                // print it using browser class for headers
                                // filename, mimetype, no length, default 
nocache True
                                
$this->browser->content_header($filename,'text/x-vcard');
                                echo $entry;
!                               $phpgw->common->exit;
                        } /* !nolname && !nofname */
  
--- 160,169 ----
  
                                // create a vcard from this translated array
!                               $entry = $this->vcard->out($buffer);
                                // print it using browser class for headers
                                // filename, mimetype, no length, default 
nocache True
                                
$this->browser->content_header($filename,'text/x-vcard');
                                echo $entry;
!                               $GLOBALS['phpgw']->common->exit;
                        } /* !nolname && !nofname */
  
***************
*** 175,180 ****
                                echo lang("This person's first name was not in 
the address book.") .'<br>';
                                echo lang('Vcards require a first name entry.') 
. '<br><br>';
!                               echo '<a href="' . 
$phpgw->link('/addressbook/index.php',
!                                       
"order=$order&start=$start&filter=$filter&query=$query&sort=$sort&cat_id=$cat_id")
 . '">' . lang('OK') . '</a>';
                                echo '</center>';
                        }
--- 173,177 ----
                                echo lang("This person's first name was not in 
the address book.") .'<br>';
                                echo lang('Vcards require a first name entry.') 
. '<br><br>';
!                               echo '<a href="' . 
$GLOBALS['phpgw']->link('/addressbook/index.php') . '">' . lang('OK') . '</a>';
                                echo '</center>';
                        }
***************
*** 185,190 ****
                                echo lang("This person's last name was not in 
the address book.") . '<br>';
                                echo lang('Vcards require a last name entry.') 
. '<br><br>';
!                               echo '<a href="' . 
$phpgw->link('/addressbook/index.php',
!                                       
"order=$order&start=$start&filter=$filter&query=$query&sort=$sort&cat_id=$cat_id")
 . '">' . lang('OK') . '</a>';
                                echo '</center>';
                        }
--- 182,186 ----
                                echo lang("This person's last name was not in 
the address book.") . '<br>';
                                echo lang('Vcards require a last name entry.') 
. '<br><br>';
!                               echo '<a href="' . 
$GLOBALS['phpgw']->link('/addressbook/index.php') . '">' . lang('OK') . '</a>';
                                echo '</center>';
                        }
***************
*** 192,196 ****
                        if($nolname || $nofname)
                        {
!                               $phpgw->common->phpgw_footer();
                        }
                }
--- 188,192 ----
                        if($nolname || $nofname)
                        {
!                               $GLOBALS['phpgw']->common->phpgw_footer();
                        }
                }




reply via email to

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