Author Topic: advanced Adressbook  (Read 50369 times)

Offline Rudy

  • Jr. Member
  • **
  • Posts: 17
Re: advanced Adressbook
« Reply #45 on: March 10, 2008, 07:07:47 AM »
Could someone capable of doing so please update this great mod/plugin to work with 0.1stable?

//EDIT: Ok, everything seems to be working except the global contact feature: You can set a contact as global but you can't undo and save it.

Quote
# -------------------------------------------------------------------------------------------------------------
#
# In file /program/steps/addressbook/save.inc
# Replace line 40 with
$a_save_cols = array('name', 'firstname', 'surname', 'email', 'global_contact', 'firm', 'position', 'p_tel', 'p_fax', 'p_mob', 'p_address', 'w_tel', 'w_fax', 'w_mob', 'w_address', 'notice');

# Replace Line 48 with

Code: [Select]
if($col == 'global_contact'){
if(isset($_POST[$fname])){
$a_record[$col] = 1;
}else{
$a_record[$col] = 0;
}
 } else if (isset($_POST[$fname])){
  $a_record[$col] = get_input_value($fname, RCUBE_INPUT_POST);
 }

#


I don't know what line that is in 0.1stable. I replaced the following code (line ~48-50) but than you can't cahnge the "global contact" setting:
Code: [Select]
 if (isset($_POST[$fname]))
  $a_record[$col] = get_input_value($fname, RCUBE_INPUT_POST);
}

//EDIT2: Never mind, I'm such an idiot. Just replace line 48 and it will work like a charm. :D
It should look like this:
Code: [Select]
// read POST values into hash array
foreach ($a_save_cols as $col)
{
 $fname = '_'.$col;
 if($col == 'global_contact'){
if(isset($_POST[$fname])){
$a_record[$col] = 1;
}else{
$a_record[$col] = 0;
}
 } else if (isset($_POST[$fname])){
  $a_record[$col] = get_input_value($fname, RCUBE_INPUT_POST);
 }
  $a_record[$col] = get_input_value($fname, RCUBE_INPUT_POST);
}

Offline guilichou

  • Jr. Member
  • **
  • Posts: 19
Re: advanced Adressbook
« Reply #46 on: March 18, 2008, 03:23:42 AM »
Hi Rudy,

I gathered all the lastest infos of this post in order to implement this plugin to rc0.1stable but it doesn't work properly...
Could you tell me what modification you have made in order to make the plugin work?

In the attachement file, are the modifications that I did... but here are all the problems I have:
- When I click directly on a new person to create, I have all the labels, that I can save (saved correctly in the DataBase).
- When I click on a person on my list of contacts, the whole RoundCube freezes without displaying the correct infos. From there on, I cannot do anything... Cannot go back to my mailbox nor preferences nor quit. I simply have to close the Firefox tab and open a new one...

If ever anyone could tell me what is wrong in the attached file or give in this post a new how-to of this advanced address book?
Hope to have an answers...
Thank you for any help...

Offline oldschool

  • Sr. Member
  • ****
  • Posts: 406
Re: advanced Adressbook
« Reply #47 on: March 18, 2008, 12:08:21 PM »
Hi!

The 0.1 is out and we have a release to work with.
Could anyone make a working release of this great plugin, please?
Rudy?
:)


Rgds.


Offline Rudy

  • Jr. Member
  • **
  • Posts: 17
Re: advanced Adressbook
« Reply #48 on: March 20, 2008, 08:59:24 AM »
I'll post my code or better the instructions sometime today as I'm still busy doing other stuff right now.

Offline guilichou

  • Jr. Member
  • **
  • Posts: 19
Re: advanced Adressbook
« Reply #49 on: March 20, 2008, 09:30:20 AM »
Thanks in advance for helping us...

Offline Rudy

  • Jr. Member
  • **
  • Posts: 17
Re: advanced Adressbook
« Reply #50 on: March 20, 2008, 05:33:51 PM »
[PLUGIN] Advanced Address Book - "updated"/checked to work with 0.1stable
Give it a try. It should work. ;)

Code: [Select]

 +------------------------------------------------------------------------+
 | ADVANCED ADDRESSBOOK plugin for RoundCube 0.1stable          |
 |                                    |
 | Use this plugin at your own risk!! BACK UP YOUR FILES AND DATABASE  |
 | BEFORE SAVING CHANGES!! You've been warned!!             |
 |                                    |
 | PURPOSE:                               |
 | Adds additional fields to RC's addressbook and global contact feature! |
 |                                    |
 +------------------------------------------------------------------------+
 | Author: Helga                             |
 | => [url]http://roundcubeforum.net/forum/index.php?topic=737.msg3238#msg3238[/url] |
 |                                    |
 | Modified by David Loendorf for RC1 and global contact option     |
 | Modified/updated by Rudy for 0.1stable                |
 +------------------------------------------------------------------------+
 


#
# ------[ 1 . 0 ]----------------------------------------------------------------------------------------------------
#

##################
###[ STEP 1.1 ]###

# OPEN
/program/include/rcube_contacts.inc

# FIND (line 37)
    var $table_cols = array('name', 'email', 'firstname', 'surname');

# REPLACE with
    var $table_cols = array('name', 'firstname', 'surname', 'email', 'global_contact', 'firm', 'position', 'p_tel', 'p_fax', 'p_mob', 'p_address', 'w_tel', 'w_fax', 'w_mob', 'w_address', 'notice');


##################
###[ STEP 1.2 ]###

# FIND (line 159)
    AND  user_id=?" .

# REPLACE with
    AND  (user_id=? OR global_contact = 1)" .


##################
###[ STEP 1.2 ]###

# FIND (line 232)
    AND  user_id=?".

# REPLACE with
    AND  (user_id=? OR global_contact = 1)".


##################
###[ STEP 1.3 ]###

# FIND (line 267)
    AND  user_id=?  
 
# REPLACE with
    AND  (user_id=? OR global_contact = 1)


##################
###[ STEP 1.4 ]###

# FIND (line 358)
    AND  user_id=?
   
# REPLACE with
    AND  (user_id=? OR global_contact = 1)

#
# ------[ CLOSE & SAVE ]---------------------------------------------------------------------------------------------
#


#
# ------[ 2 . 0 ]----------------------------------------------------------------------------------------------------
#

##################
###[ STEP 2.1 ]###

# OPEN
/program/include/main.inc

# FIND (line1327)
 if ($type=='checkbox')

# REPLACE with
 if($col == "notice")
  {
$attrib['rows'] = "8";
$attrib['size'] = "40";
$attrib['cols'] = "40";
$input = new textarea($attrib);
}
 elseif($col == "p_address" | $col == "w_address")
 {
$attrib['rows'] = "4";
$attrib['size'] = "40";
$attrib['cols'] = "40";
$input = new textarea($attrib);
}
 else if ($type=='checkbox')

#
# ------[ CLOSE & SAVE ]---------------------------------------------------------------------------------------------
#


#
# ------[ 3 . 0 ]----------------------------------------------------------------------------------------------------
#

# NOTE: You have to add (or translate) the following changes to all language files you want to use! Below you'll find the
# English and German translations.

##################
###[ STEP 3.1 ]###

# OPEN (English localization file)
/program/localization/en_US/label.inc

# FIND the line which contains
$labels['email']

# ADD BELOW
$labels['global_contact'] = 'Global Contact?';
$labels['firm']  = 'Organization:';
$labels['position']  = 'Position:';
$labels['p_tel']  = 'Telephone:';
$labels['p_fax']  = 'Fax:';
$labels['p_mob']  = 'Mobile:';
$labels['p_address']  = 'Address:';
$labels['w_tel']  = 'Business Telephone:';
$labels['w_fax']  = 'Business Fax:';
$labels['w_mob']  = 'Business Mobile:';
$labels['w_address']  = 'Business Address:';
$labels['notice']  = 'Notes:';


##################
###[ STEP 3.2 ]###
# SKIP this step if you don't need the german localization.

# OPEN(German localization file)
/program/localization/de_DE/label.inc

# FIND the line which contains
$labels['email']

# ADD BELOW
$labels['global_contact'] = 'Globaler Kontakt?';
$labels['firm']  = 'Organisation:';
$labels['position']  = 'Position:';
$labels['p_tel']  = 'Telefon:';
$labels['p_fax']  = 'Fax:';
$labels['p_mob']  = 'Mobil:';
$labels['p_address']  = 'Adresse Privat:';
$labels['w_tel']  = 'Telefon Geschäftlich:';
$labels['w_fax']  = 'Fax Geschäftlich:';
$labels['w_mob']  = 'Mobil Geschäftlich:';
$labels['w_address']  = 'Adresse Geschäftlich:';
$labels['notice']  = 'Bemerkung:';

#
# ------[ CLOSE & SAVE ]---------------------------------------------------------------------------------------------
#


#
# ------[ 4 . 0 ]----------------------------------------------------------------------------------------------------
#

##################
###[ STEP 4.1 ]###

# OPEN
/program/steps/addressbook/edit.inc

# FIND (line 64)
 $a_show_cols = array('name', 'firstname', 'surname', 'email');

# REPLACE with
 $a_show_cols = array('name', 'firstname', 'surname', 'global_contact', 'email', 'firm', 'position', 'p_tel', 'p_fax', 'p_mob', 'p_address', 'w_tel', 'w_fax', 'w_mob', 'w_address', 'notice');

##################
###[ STEP 4.2 ]###

# FIND (line 67)
  $attrib['id'] = 'rcmfd_'.$col;

# ADD BELOW
  if($col == "global_contact")
  $value = rcmail_get_edit_field($col, $record[$col], $attrib, 'checkbox');
  else

#
# ------[ CLOSE & SAVE ]---------------------------------------------------------------------------------------------
#


#
# ------[ 5 . 0 ]----------------------------------------------------------------------------------------------------
#

##################
###[ STEP 5.1 ]###

# OPEN
/program/steps/addressbook/save.inc

# FIND (line 40)
 $a_save_cols = array('name', 'firstname', 'surname', 'email');

# REPLACE with
 $a_save_cols = array('name', 'firstname', 'surname', 'email', 'global_contact', 'firm', 'position', 'p_tel', 'p_fax', 'p_mob', 'p_address', 'w_tel', 'w_fax', 'w_mob', 'w_address', 'notice');


##################
###[ STEP 5.2 ]###

# FIND (line 48)
 if (isset($_POST[$fname]))
  $a_record[$col] = get_input_value($fname, RCUBE_INPUT_POST);

# REPLACE WITH

 if($col == 'global_contact'){
if(isset($_POST[$fname])){
$a_record[$col] = 1;
}else{
$a_record[$col] = 0;
}
 } else if (isset($_POST[$fname])){
  $a_record[$col] = get_input_value($fname, RCUBE_INPUT_POST);
 }

#
# ------[ CLOSE & SAVE ]---------------------------------------------------------------------------------------------
#


#
# ------[ 6 . 0 ]----------------------------------------------------------------------------------------------------
#

##################
###[ STEP 6.1 ]###

# OPEN
/program/steps/addressbook/show.inc

# FIND (line 46)
 $a_show_cols = array('name', 'firstname', 'surname', 'email');

# REPLACE with (NOTE: Unfortunately the two labels "Data" and "Contact" are not yet included in the roundcube localization
# file. If someone could help me out on this one I would really appreciate it. As it is for now just translate these two
# labels into your default language.
 $data =&quot;<td width=\&quot;45%\&quot; valign=\&quot;top\&quot;>\n<fieldset width=\&quot;45%\&quot; class=\&quot;title\&quot;><legend><b>Data</b></legend><table>\n\n&quot;;
 $contact =&quot;<td width=\&quot;45%\&quot; valign=\&quot;top\&quot;>\n<fieldset width=\&quot;45%\&quot; class=\&quot;title\&quot;><legend><b>Contact</b></legend><table>\n\n&quot;;

 $a_show_cols = array('name', 'firstname', 'surname', 'email', 'global_contact', 'firm', 'position', 'p_tel', 'p_fax', 'p_mob', 'p_address', 'w_tel', 'w_fax', 'w_mob', 'w_address', 'notice');


# FIND (line 59-64)
  $out .= sprintf(&quot;<tr><td class=\&quot;title\&quot;>%s</td><td>%s</td></tr>\n&quot;,
          Q(rcube_label($col)),
          $value);
  }
 
 $out .= &quot;\n</table>&quot;;

# REPLACE with

$title = Q(rcube_label($col));
if($col == &quot;notice&quot;){
$out2 = &quot;<td colspan=\&quot;3\&quot; width=\&quot;100%\&quot; valign=\&quot;top\&quot;><fieldset width=\&quot;100%\&quot; class=\&quot;title\&quot;><legend><b>$title</b></legend><table>\n&quot;;
$out2 .= sprintf(&quot;<tr><td>%s</td></tr>\n&quot;, $value);
$out2 .= &quot;</table></fieldset></td>\n\n&quot;;
}
elseif($col == &quot;p_tel&quot; | $col == &quot;p_fax&quot; | $col == &quot;p_mob&quot; | $col == &quot;w_tel&quot; | $col == &quot;w_fax&quot; | $col == &quot;w_mob&quot;){
if(!$value == &quot;&quot;){
  $contact .= sprintf(&quot;<tr><td>%s</td><td>%s</td></tr>\n&quot;,$title, $value);
}
}
elseif($col == &quot;p_address&quot;){
$p_address = &quot;<td width=\&quot;45%\&quot; valign=\&quot;top\&quot;><fieldset width=\&quot;45%\&quot; class=\&quot;title\&quot;><legend><b>$title</b></legend><table>\n&quot;;
$p_address .= sprintf(&quot;<tr><td>%s</td></tr>\n&quot;, $value);
$p_address .= &quot;</table></fieldset></td>\n\n&quot;;
}
elseif($col == &quot;w_address&quot;){
$w_address = &quot;<td width=\&quot;45%\&quot; valign=\&quot;top\&quot;><fieldset width=\&quot;45%\&quot; class=\&quot;title\&quot;><legend><b>$title</b></legend><table>\n&quot;;
$w_address .= sprintf(&quot;<tr><td>%s</td></tr>\n&quot;, $value);
$w_address .= &quot;</table></fieldset></td>\n\n&quot;;
}
else{
if($col == &quot;global_contact&quot;){
if($value == 1)
  $data .= sprintf(&quot;<tr><td>%s</td><td>%s</td></tr>\n&quot;,$title, '&#38;#10004;');
else
  $data .= sprintf(&quot;<tr><td>%s</td><td>%s</td></tr>\n&quot;,$title, '&#38;#10008;');
} else if(!$value == &quot;&quot;)
  $data .= sprintf(&quot;<tr><td>%s</td><td>%s</td></tr>\n&quot;,$title, $value);
}



  }
$data .= &quot;</table></td>&quot;;
$contact .= &quot;</table></td>&quot;;

 $out .= &quot;$data<td width=\&quot;2%\&quot;>$contact\n\n&quot;;
 $out .= &quot;</tr><tr>&quot;;
 $out .= &quot;$p_address<td width=\&quot;2%\&quot;>$w_address\n\n&quot;;
 $out .= &quot;</tr><tr>&quot;;
 $out .= $out2;
 $out .= &quot;\n</tr></table>&quot;;

#
# ------[ CLOSE & SAVE ]---------------------------------------------------------------------------------------------
#


#
# ------[ 7 . 0 ]----------------------------------------------------------------------------------------------------
#
# MySQL Database Update
#
# Run this code in phpMyAdmin on the database that holds the RoundCube contacts table. If you changed the contact table
# name to something different you need to adjust the following code!

# RUN this SQL code:

 ALTER TABLE `contacts` ADD `global_contact` TINYINT(1) NOT NULL default '0';
 ALTER TABLE `contacts` ADD `firm` VARCHAR(128) NOT NULL ;
 ALTER TABLE `contacts` ADD `position` VARCHAR(50) NOT NULL ;
 ALTER TABLE `contacts` ADD `p_tel` VARCHAR(30) NOT NULL ;
 ALTER TABLE `contacts` ADD `p_fax` VARCHAR(30) NOT NULL ;
 ALTER TABLE `contacts` ADD `p_mob` VARCHAR(20) NOT NULL ;
 ALTER TABLE `contacts` ADD `p_address` TEXT NOT NULL;
 ALTER TABLE `contacts` ADD `w_tel` VARCHAR(20) NOT NULL ;
 ALTER TABLE `contacts` ADD `w_fax` VARCHAR(20) NOT NULL ;
 ALTER TABLE `contacts` ADD `w_mob` VARCHAR(20) NOT NULL ;
 ALTER TABLE `contacts` ADD `w_address` TEXT NOT NULL;
 ALTER TABLE `contacts` ADD `notice` TEXT NOT NULL;

#
# ------[ THE END =) ]----------------------------------------------------------------------------------------------
#

That's it! You're all set. Have fun and enjoy. Thank you Helga for this essential plugin and many thanks to David Loendor
for updating it to RC1. :D

Offline guilichou

  • Jr. Member
  • **
  • Posts: 19
Re: advanced Adressbook
« Reply #51 on: March 21, 2008, 01:46:55 AM »
It works!!!!!! Thank you so much!

Nevertheless, I have a little question about this part:
Code: [Select]
###[ STEP 5.2 ]###

# FIND (line 48)
 if (isset($_POST[$fname]))

# REPLACE WITH

 if($col == 'global_contact'){
  if(isset($_POST[$fname])){
   $a_record[$col] = 1;
  }else{
   $a_record[$col] = 0;
  }
 }  else if (isset($_POST[$fname])){
  $a_record[$col] = get_input_value($fname, RCUBE_INPUT_POST);
 }

Do you replace only the first line?
Code: [Select]
(original code)
 if (isset($_POST[$fname]))
  $a_record[$col] = get_input_value($fname, RCUBE_INPUT_POST);

I replaced both, everything seems to work, but I was wondering if that was correct. Or else in certain  cases, the system will apply twice the line:
Code: [Select]
$a_record[$col] = get_input_value($fname, RCUBE_INPUT_POST);right?
(I might be wrong...)

Offline Rudy

  • Jr. Member
  • **
  • Posts: 17
Re: advanced Adressbook
« Reply #52 on: March 21, 2008, 04:26:37 AM »
Yeah I'm pretty sure this is just a typo. I updated the instructions. Thanks! :)

Offline guilichou

  • Jr. Member
  • **
  • Posts: 19
Re: advanced Adressbook
« Reply #53 on: March 22, 2008, 06:00:11 AM »
Can anyone explain me how to suppress the "Global Contact" option???
I tried to suppress everything concerning the global_contact but it doesn't seem to work...
I've got it not the be listed in others contacts lists and not to be shown in the contact info, but I can't succeed in getting rid of it in the creation or modification page.

I want to get rid of it because I don't really see the need of it, specialy when anyone can suppress it...

Offline bobby5959

  • Jr. Member
  • **
  • Posts: 10
problem I cannot edit contact
« Reply #54 on: March 24, 2008, 10:58:05 AM »
I ve a problem

I was doing exact all

then i wantet to create a contact, its working, its even in the database, but its not possible to edit this, bcs its not on the screen adn I cannot edit

if I open a mail and press add mailadress to adressbook, its working, but I cannot edit the contactinfo, but its even in the database.

Does anyone know where th problem might be?

Thxs

Bobby

Offline bobby5959

  • Jr. Member
  • **
  • Posts: 10
found my mistake
« Reply #55 on: March 24, 2008, 12:50:53 PM »
Its working may may thxs

I forgot a barket

Offline cornbread

  • Newbie
  • *
  • Posts: 5
Re: advanced Adressbook
« Reply #56 on: March 26, 2008, 12:26:36 PM »
I added this to the feature request!

http://trac.roundcube.net/ticket/1484923

Offline brewnchew

  • Newbie
  • *
  • Posts: 9
Re: advanced Adressbook
« Reply #57 on: March 30, 2008, 10:33:59 AM »
If anyone can assist I would really like a function for the address book. Has anyone worked on a function to tie together email addresses to make a distribution list? I would like to make a single 'entry' for a group of addresses that I regularly email. I can update and make small changes but I lack the knowledge to complete this task.

Thank you for any assistance

Offline dukhunter99

  • Jr. Member
  • **
  • Posts: 27
Re: advanced Adressbook
« Reply #58 on: March 31, 2008, 09:05:25 PM »
I'm with Brewchew - What if you had an address book that had check boxes and you can select (check) multiple recipients.

Offline blove57

  • Jr. Member
  • **
  • Posts: 18
Re: advanced Adressbook
« Reply #59 on: April 01, 2008, 08:53:54 PM »
HELGA YOU ARE AWESOME!! Thanks a mil. And thanks to Rudy for updating it. I took out the global contact feature because I didn't want different domains sharing contacts. I think somebody asked for the global contact feature to be taken out, so I'm posting it here in case anybody wanted it.

Code: [Select]

 +------------------------------------------------------------------------+
 | ADVANCED ADDRESS BOOK plugin for RoundCube 0.1stable           |
 |                                    |
 | Use this plugin at your own risk!! BACK UP YOUR FILES AND DATABASE   |
 | BEFORE SAVING CHANGES!! You've been warned!!             |
 |                                    |
 | PURPOSE:                                |
 | Adds additional fields to RC's addressbook and global contact feature! |
 |                                    |
 +------------------------------------------------------------------------+
 | Author: Helga                             |
 | => [url]http://roundcubeforum.net/forum/index.php?topic=737.msg3238#msg3238[/url] |
 |                                    |
 | Modified by David Loendorf for RC1 and global contact option      |
 | Modified/updated by Rudy for 0.1stable                 |
 +------------------------------------------------------------------------+
 


#
# ------[  1 . 0  ]----------------------------------------------------------------------------------------------------
#

##################
###[ STEP 1.1 ]###

# OPEN
/program/include/rcube_contacts.inc

# FIND (line 37)
     var $table_cols = array('name', 'email', 'firstname', 'surname');

# REPLACE with
     var $table_cols = array('name', 'firstname', 'surname', 'email', 'firm', 'position', 'p_tel', 'p_fax', 'p_mob', 'p_address', 'w_tel', 'w_fax', 'w_mob', 'w_address', 'notice');


#
# ------[  CLOSE & SAVE  ]---------------------------------------------------------------------------------------------
#


#
# ------[  2 . 0  ]----------------------------------------------------------------------------------------------------
#

##################
###[ STEP 2.1 ]###

# OPEN
/program/include/main.inc

# FIND (line1327)
 if ($type=='checkbox')

# REPLACE with
 if($col == &quot;notice&quot;)
  {
$attrib['rows'] = &quot;8&quot;;
$attrib['size'] = &quot;40&quot;;
$attrib['cols'] = &quot;40&quot;;
$input = new textarea($attrib);
}
 elseif($col == &quot;p_address&quot; | $col == &quot;w_address&quot;)
  {
$attrib['rows'] = &quot;4&quot;;
$attrib['size'] = &quot;40&quot;;
$attrib['cols'] = &quot;40&quot;;
$input = new textarea($attrib);
}
 else if ($type=='checkbox')

#
# ------[  CLOSE & SAVE  ]---------------------------------------------------------------------------------------------
#


#
# ------[  3 . 0  ]----------------------------------------------------------------------------------------------------
#

# NOTE: You have to add (or translate) the following changes to all language files you want to use! Below you'll find the
# English and German translations.

##################
###[ STEP 3.1 ]###

# OPEN (English localization file)
/program/localization/en_US/label.inc

# FIND the line which contains
$labels['email']

# ADD BELOW
$labels['firm']   = 'Organization:';
$labels['position']   = 'Position:';
$labels['p_tel']   = 'Telephone:';
$labels['p_fax']   = 'Fax:';
$labels['p_mob']   = 'Mobile:';
$labels['p_address']   = 'Address:';
$labels['w_tel']   = 'Business Telephone:';
$labels['w_fax']   = 'Business Fax:';
$labels['w_mob']   = 'Business Mobile:';
$labels['w_address']   = 'Business Address:';
$labels['notice']   = 'Notes:';


#
# ------[  CLOSE & SAVE  ]---------------------------------------------------------------------------------------------
#


#
# ------[  4 . 0  ]----------------------------------------------------------------------------------------------------
#

##################
###[ STEP 4.1 ]###

# OPEN
/program/steps/addressbook/edit.inc

# FIND (line 64)
 $a_show_cols = array('name', 'firstname', 'surname', 'email');

# REPLACE with
 $a_show_cols = array('name', 'firstname', 'surname', 'email', 'firm', 'position', 'p_tel', 'p_fax', 'p_mob', 'p_address', 'w_tel', 'w_fax', 'w_mob', 'w_address', 'notice');


#
# ------[  CLOSE & SAVE  ]---------------------------------------------------------------------------------------------
#


#
# ------[  5 . 0  ]----------------------------------------------------------------------------------------------------
#

##################
###[ STEP 5.1 ]###

# OPEN
/program/steps/addressbook/save.inc

# FIND (line 40)
 $a_save_cols = array('name', 'firstname', 'surname', 'email');

# REPLACE with
 $a_save_cols = array('name', 'firstname', 'surname', 'email', 'firm', 'position', 'p_tel', 'p_fax', 'p_mob', 'p_address', 'w_tel', 'w_fax', 'w_mob', 'w_address', 'notice');


#
# ------[  CLOSE & SAVE  ]---------------------------------------------------------------------------------------------
#


#
# ------[  6 . 0  ]----------------------------------------------------------------------------------------------------
#

##################
###[ STEP 6.1 ]###

# OPEN
/program/steps/addressbook/show.inc

# FIND (line 46)
 $a_show_cols = array('name', 'firstname', 'surname', 'email');

# REPLACE with (NOTE: Unfortunately the two labels &quot;Data&quot; and &quot;Contact&quot; are not yet included in the roundcube localization
# file. If someone could help me out on this one I would really appreciate it. As it is for now just translate these two
# labels into your default language.
 $data =&quot;<td width=\&quot;45%\&quot; valign=\&quot;top\&quot;>\n<fieldset width=\&quot;45%\&quot; class=\&quot;title\&quot;><legend><b>Data</b></legend><table>\n\n&quot;;
 $contact =&quot;<td width=\&quot;45%\&quot; valign=\&quot;top\&quot;>\n<fieldset width=\&quot;45%\&quot; class=\&quot;title\&quot;><legend><b>Contact</b></legend><table>\n\n&quot;;

 $a_show_cols = array('name', 'firstname', 'surname', 'email', 'firm', 'position', 'p_tel', 'p_fax', 'p_mob', 'p_address', 'w_tel', 'w_fax', 'w_mob', 'w_address', 'notice');


# FIND (line 59-64)
  $out .= sprintf(&quot;<tr><td class=\&quot;title\&quot;>%s</td><td>%s</td></tr>\n&quot;,
          Q(rcube_label($col)),
          $value);
  }
 
 $out .= &quot;\n</table>&quot;;

# REPLACE with

$title = Q(rcube_label($col));
if($col == &quot;notice&quot;){
$out2 = &quot;<td colspan=\&quot;3\&quot; width=\&quot;100%\&quot; valign=\&quot;top\&quot;><fieldset width=\&quot;100%\&quot; class=\&quot;title\&quot;><legend><b>$title</b></legend><table>\n&quot;;
$out2 .= sprintf(&quot;<tr><td>%s</td></tr>\n&quot;, $value);
$out2 .= &quot;</table></fieldset></td>\n\n&quot;;
}
elseif($col == &quot;p_tel&quot; | $col == &quot;p_fax&quot; | $col == &quot;p_mob&quot; | $col == &quot;w_tel&quot; | $col == &quot;w_fax&quot; | $col == &quot;w_mob&quot;){
if(!$value == &quot;&quot;){
  $contact .= sprintf(&quot;<tr><td>%s</td><td>%s</td></tr>\n&quot;,$title, $value);
}
}
elseif($col == &quot;p_address&quot;){
$p_address = &quot;<td width=\&quot;45%\&quot; valign=\&quot;top\&quot;><fieldset width=\&quot;45%\&quot; class=\&quot;title\&quot;><legend><b>$title</b></legend><table>\n&quot;;
$p_address .= sprintf(&quot;<tr><td>%s</td></tr>\n&quot;, $value);
$p_address .= &quot;</table></fieldset></td>\n\n&quot;;
}
elseif($col == &quot;w_address&quot;){
$w_address = &quot;<td width=\&quot;45%\&quot; valign=\&quot;top\&quot;><fieldset width=\&quot;45%\&quot; class=\&quot;title\&quot;><legend><b>$title</b></legend><table>\n&quot;;
$w_address .= sprintf(&quot;<tr><td>%s</td></tr>\n&quot;, $value);
$w_address .= &quot;</table></fieldset></td>\n\n&quot;;
}
elseif(!$value == &quot;&quot;)
  $data .= sprintf(&quot;<tr><td>%s</td><td>%s</td></tr>\n&quot;,$title, $value);




  }
$data .= &quot;</table></td>&quot;;
$contact .= &quot;</table></td>&quot;;

 $out .= &quot;$data<td width=\&quot;2%\&quot;>$contact\n\n&quot;;
 $out .= &quot;</tr><tr>&quot;;
 $out .= &quot;$p_address<td width=\&quot;2%\&quot;>$w_address\n\n&quot;;
 $out .= &quot;</tr><tr>&quot;;
 $out .= $out2;
 $out .= &quot;\n</tr></table>&quot;;

#
# ------[  CLOSE & SAVE  ]---------------------------------------------------------------------------------------------
#


#
# ------[  7 . 0  ]----------------------------------------------------------------------------------------------------
#
# MySQL Database Update
#
# Run this code in phpMyAdmin on the database that holds the RoundCube contacts table. If you changed the contact table
# name to something different you need to adjust the following code!

# RUN this SQL code:

 ALTER TABLE `contacts` ADD `firm` VARCHAR(128) NOT NULL ;
 ALTER TABLE `contacts` ADD `position` VARCHAR(50) NOT NULL ;
 ALTER TABLE `contacts` ADD `p_tel` VARCHAR(30) NOT NULL ;
 ALTER TABLE `contacts` ADD `p_fax` VARCHAR(30) NOT NULL ;
 ALTER TABLE `contacts` ADD `p_mob` VARCHAR(20) NOT NULL ;
 ALTER TABLE `contacts` ADD `p_address` TEXT NOT NULL;
 ALTER TABLE `contacts` ADD `w_tel` VARCHAR(20) NOT NULL ;
 ALTER TABLE `contacts` ADD `w_fax` VARCHAR(20) NOT NULL ;
 ALTER TABLE `contacts` ADD `w_mob` VARCHAR(20) NOT NULL ;
 ALTER TABLE `contacts` ADD `w_address` TEXT NOT NULL;
 ALTER TABLE `contacts` ADD `notice` TEXT NOT NULL;

#
# ------[  THE END =)  ]----------------------------------------------------------------------------------------------
#

That's it! You're all set. Have fun and enjoy. Thank you Helga for this essential plugin and many thanks to David Loendor
for updating it to RC1. :D