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.
+------------------------------------------------------------------------+
| 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 == "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['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 "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 ="<td width=\"45%\" valign=\"top\">\n<fieldset width=\"45%\" class=\"title\"><legend><b>Data</b></legend><table>\n\n";
$contact ="<td width=\"45%\" valign=\"top\">\n<fieldset width=\"45%\" class=\"title\"><legend><b>Contact</b></legend><table>\n\n";
$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("<tr><td class=\"title\">%s</td><td>%s</td></tr>\n",
Q(rcube_label($col)),
$value);
}
$out .= "\n</table>";
# REPLACE with
$title = Q(rcube_label($col));
if($col == "notice"){
$out2 = "<td colspan=\"3\" width=\"100%\" valign=\"top\"><fieldset width=\"100%\" class=\"title\"><legend><b>$title</b></legend><table>\n";
$out2 .= sprintf("<tr><td>%s</td></tr>\n", $value);
$out2 .= "</table></fieldset></td>\n\n";
}
elseif($col == "p_tel" | $col == "p_fax" | $col == "p_mob" | $col == "w_tel" | $col == "w_fax" | $col == "w_mob"){
if(!$value == ""){
$contact .= sprintf("<tr><td>%s</td><td>%s</td></tr>\n",$title, $value);
}
}
elseif($col == "p_address"){
$p_address = "<td width=\"45%\" valign=\"top\"><fieldset width=\"45%\" class=\"title\"><legend><b>$title</b></legend><table>\n";
$p_address .= sprintf("<tr><td>%s</td></tr>\n", $value);
$p_address .= "</table></fieldset></td>\n\n";
}
elseif($col == "w_address"){
$w_address = "<td width=\"45%\" valign=\"top\"><fieldset width=\"45%\" class=\"title\"><legend><b>$title</b></legend><table>\n";
$w_address .= sprintf("<tr><td>%s</td></tr>\n", $value);
$w_address .= "</table></fieldset></td>\n\n";
}
elseif(!$value == "")
$data .= sprintf("<tr><td>%s</td><td>%s</td></tr>\n",$title, $value);
}
$data .= "</table></td>";
$contact .= "</table></td>";
$out .= "$data<td width=\"2%\">$contact\n\n";
$out .= "</tr><tr>";
$out .= "$p_address<td width=\"2%\">$w_address\n\n";
$out .= "</tr><tr>";
$out .= $out2;
$out .= "\n</tr></table>";
#
# ------[ 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