Roundcube Community Forum

Third Party Contributions => Old Style Plug-Ins => Topic started by: helga on October 12, 2006, 04:33:34 AM

Title: advanced Adressbook
Post by: helga on October 12, 2006, 04:33:34 AM
hi,

sorry for my Bad English. I'm from Germany ;)

her my advanced Adressbook:

Screen + Download:
Title: Re: advanced Adressbook
Post by: BoerbooM on October 12, 2006, 08:04:00 AM
A sligt modification in this Plug-In:

- Translated it to english
- Made it like a "How To"

Code: [Select]
#
# Open: program/localization/en_GB/labels.inc
#

# Find: (line: 149)

// address boook

# After add:

$labels['firm']  = 'Organisation';
$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']  = 'Notice';

#
# Open: program/localization/nl_NL/labels.inc
#

# Find: (line: 149)

// address book

# After add:

$labels['firm']  = 'Organistatie';
$labels['position']  = 'Functie';
$labels['p_tel']  = 'Telefoon';
$labels['p_fax']  = 'Fax';
$labels['p_mob']  = 'GSM';
$labels['p_address']  = 'Adres';
$labels['w_tel']  = 'Zakelijk Telefoon';
$labels['w_fax']  = 'Zakelijk Fax';
$labels['w_mob']  = 'Zakelijk GSM';
$labels['w_address']  = 'Zakelijk Adres';
$labels['notice']  = 'Opmerkingen';

#
# Open: program/localization/de_DE/labels.inc
#

# Find: (line: 149)

// address book

# After add:

$labels['firm']  = 'Organisation';
$labels['position']  = 'Position';
$labels['p_tel']  = 'Telefon Privat';
$labels['p_fax']  = 'Fax Privat';
$labels['p_mob']  = 'Funk Privat';
$labels['p_address']  = 'Adresse Privat';
$labels['g_tel']  = 'Telefon Geschäftlich';
$labels['g_fax']  = 'Fax Geschäftlich';
$labels['g_mob']  = 'Funk Geschäftlich';
$labels['w_address']  = 'Adresse Geschäftlich';
$labels['notice']  = 'Bemerkungen';

#
# Run in PhpMyAdmin:
#

 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;

#
# Open: program/steps/addressbook/edit.inc
#

# Find: (line: 68)

 $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');

# Find: (line: 72)

  $title = rcube_label($col);

# After add:

if($col == "notice"){
$typ = "textarea";
$attrib['rows'] = "8";
$attrib['size'] = "70";
}
elseif($col == "p_address" | $col == "w_address"){
$typ = "textarea";
$attrib['rows'] = "4";
$attrib['size'] = "50";
}
else{
$typ = "text";
}

# Find: (line: 86)

  $value = rcmail_get_edit_field($col, $CONTACT_RECORD[$col], $attrib);

# Replace with:

  $value = rcmail_get_edit_field($col, $CONTACT_RECORD[$col], $attrib, $typ);

#
# Open: program/steps/addressbook/save.inc
#

# Find: (line: 31)

$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');

#
# Open: program/steps/addressbook/show.inc
#

# Find: (line: 54)

 $out = &quot;<table>\n\n&quot;;

# After add:

  $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;;

# Find: (line: 58)

 $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_adresse', 'w_tel', 'w_fax', 'w_mob', 'g_adresse', 'notice');

# Find: (line: 71)

  $out .= sprintf(&quot;<tr><td class=\&quot;title\&quot;>%s</td><td>%s</td></tr>\n&quot;, $title, $value);
  }


 $out .= &quot;\n</table>&quot;;

# Replace with:

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(!$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;;

Credits stay for: Helga!

Peace. 8)
Title: Re: advanced Adressbook
Post by: KingOfN00bz on October 20, 2006, 11:08:46 AM
Well, I'd translate the english "Mobile" with "Mobil" in german instead of "Funk":

Code: [Select]
#
# Open: program/localization/en_GB/labels.inc  
#

# Find: (line: 149)

// address boook

# After add:

$labels['firm']   = 'Organisation';
$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']   = 'Notice';

#
# Open: program/localization/nl_NL/labels.inc  
#

# Find: (line: 149)

// address book

# After add:

$labels['firm']   = 'Organistatie';
$labels['position']   = 'Functie';
$labels['p_tel']   = 'Telefoon';
$labels['p_fax']   = 'Fax';
$labels['p_mob']   = 'GSM';
$labels['p_address']   = 'Adres';
$labels['w_tel']   = 'Zakelijk Telefoon';
$labels['w_fax']   = 'Zakelijk Fax';
$labels['w_mob']   = 'Zakelijk GSM';
$labels['w_address']   = 'Zakelijk Adres';
$labels['notice']   = 'Opmerkingen';

#
# Open: program/localization/de_DE/labels.inc  
#

# Find: (line: 149)

// address book

# After add:

$labels['firm']   = 'Organisation';
$labels['position']   = 'Position';
$labels['p_tel']   = 'Telefon Privat';
$labels['p_fax']   = 'Fax Privat';
$labels['p_mob']   = 'Mobil Privat';
$labels['p_address']   = 'Adresse Privat';
$labels['g_tel']   = 'Telefon Geschäftlich';
$labels['g_fax']   = 'Fax Geschäftlich';
$labels['g_mob']   = 'Mobil Geschäftlich';
$labels['w_address']   = 'Adresse Geschäftlich';
$labels['notice']   = 'Bemerkungen';

#
# Run in PhpMyAdmin:
#

 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;

#
# Open: program/steps/addressbook/edit.inc
#

# Find: (line: 68)

 $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');

# Find: (line: 72)

  $title = rcube_label($col);

# After add:

if($col == &quot;notice&quot;){
$typ = &quot;textarea&quot;;
$attrib['rows'] = &quot;8&quot;;
$attrib['size'] = &quot;70&quot;;
}
elseif($col == &quot;p_address&quot; | $col == &quot;w_address&quot;){
$typ = &quot;textarea&quot;;
$attrib['rows'] = &quot;4&quot;;
$attrib['size'] = &quot;50&quot;;
}
else{
$typ = &quot;text&quot;;
}

# Find: (line: 86)

  $value = rcmail_get_edit_field($col, $CONTACT_RECORD[$col], $attrib);

# Replace with:

  $value = rcmail_get_edit_field($col, $CONTACT_RECORD[$col], $attrib, $typ);

#
# Open: program/steps/addressbook/save.inc
#

# Find: (line: 31)

$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');

#
# Open: program/steps/addressbook/show.inc
#

# Find: (line: 54)

 $out = &quot;<table>\n\n&quot;;

# After add:

  $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;;

# Find: (line: 58)

 $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_adresse', 'w_tel', 'w_fax', 'w_mob', 'g_adresse', 'notice');

# Find: (line: 71)

  $out .= sprintf(&quot;<tr><td class=\&quot;title\&quot;>%s</td><td>%s</td></tr>\n&quot;, $title, $value);
  }


 $out .= &quot;\n</table>&quot;;

# Replace with:

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(!$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;;
Title: Re: advanced Adressbook
Post by: Nonsense on October 30, 2006, 06:43:41 PM
Swedish

Code: [Select]
#
# Open: program/localization/se_SE/labels.inc  
#

# Find: (line: 149)

// address boook

# After add:

$labels['firm']   = 'Organisation';
$labels['position']   = 'Position';
$labels['p_tel']   = 'Telefon';
$labels['p_fax']   = 'Fax';
$labels['p_mob']   = 'Mobil';
$labels['p_address']   = 'Adress';
$labels['w_tel']   = 'Telefon arbete';
$labels['w_fax']   = 'Fax arbete';
$labels['w_mob']   = 'Mobil arbete';
$labels['w_address']   = 'Adress arbete';
$labels['notice']   = 'Anteckning';

#

#
# Run in PhpMyAdmin:
#

 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;

#
# Open: program/steps/addressbook/edit.inc
#

# Find: (line: 68)

 $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');

# Find: (line: 72)

  $title = rcube_label($col);

# After add:

if($col == &quot;notice&quot;){
$typ = &quot;textarea&quot;;
$attrib['rows'] = &quot;8&quot;;
$attrib['size'] = &quot;70&quot;;
}
elseif($col == &quot;p_address&quot; | $col == &quot;w_address&quot;){
$typ = &quot;textarea&quot;;
$attrib['rows'] = &quot;4&quot;;
$attrib['size'] = &quot;50&quot;;
}
else{
$typ = &quot;text&quot;;
}

# Find: (line: 86)

  $value = rcmail_get_edit_field($col, $CONTACT_RECORD[$col], $attrib);

# Replace with:

  $value = rcmail_get_edit_field($col, $CONTACT_RECORD[$col], $attrib, $typ);

#
# Open: program/steps/addressbook/save.inc
#

# Find: (line: 31)

$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');

#
# Open: program/steps/addressbook/show.inc
#

# Find: (line: 54)

 $out = &quot;<table>\n\n&quot;;

# After add:

  $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;;

# Find: (line: 58)

 $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_adresse', 'w_tel', 'w_fax', 'w_mob', 'g_adresse', 'notice');

# Find: (line: 71)

  $out .= sprintf(&quot;<tr><td class=\&quot;title\&quot;>%s</td><td>%s</td></tr>\n&quot;, $title, $value);
  }


 $out .= &quot;\n</table>&quot;;

# Replace with:

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(!$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;;


I like smaller boxes so I added this:

Code: [Select]
if($col == "notice"){
$typ = "textarea";
$attrib['rows'] = "2";
$attrib['size'] = "40";
}
elseif($col == "p_address" | $col == "w_address"){
$typ = "textarea";
$attrib['rows'] = "3";
$attrib['size'] = "40";
Title: Re: advanced Adressbook
Post by: seansan on December 17, 2006, 10:31:22 AM
Can we add this to the next SVN?
Title: Re: advanced Adressbook
Post by: Nonsense on December 17, 2006, 03:01:49 PM
We'll you're free to use my translation. As for the code you'll have to ask helga.
Title: Re: advanced Adressbook
Post by: helga on December 20, 2006, 09:26:13 AM
Quote from: seansan
Can we add this to the next SVN?

yes ;D
Title: Re: advanced Adressbook
Post by: andresme on December 20, 2006, 04:39:20 PM
Hello... I think I got most of what I needed to copy/paste and change and run on phpMyAdmin, but I went wrong somewhere and lost my address book I did have. So I guess what I did was blank out my entire contacts list. Which is fine for now. I can always replace that. But I just don't know where I went wrong.

Would there be a security isssue if the entire code for each file was put out there for us to just copy the entire file and paste it into our own and save? Then go to our phpMyAdmin and run... I'm not even sure how to do that part. LOL. (Yeah.. amatuer over here. But I do manage to learn enough to want to get myself into more trouble.)
Title: Re: advanced Adressbook
Post by: robin.one on January 11, 2007, 07:19:55 PM
A couple of mistakes in the English version:

program/steps/addressbook/show.inc

line 58 was:

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

should be:

$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');

This only caused the addresses to not show, no biggie but thought you should know.
Title: Re: advanced Adressbook
Post by: Pieter on February 09, 2007, 05:30:58 AM
Has this functionality been added to the latest version (in SVN) already?
Title: Re: advanced Adressbook
Post by: robin.one on February 09, 2007, 02:45:11 PM
I put this hack in SVN 445,
I plan on upgrading to a newer SVN soon to see the progress.
Title: Re: advanced Adressbook
Post by: robin.one on March 08, 2007, 07:32:25 PM
Same four original contact fields in SVN 495.
Title: Re: advanced Adressbook
Post by: Genghis Khan on April 08, 2007, 11:13:11 AM
I downloaded the latest SVN but i still see only 4 fields as before :(
I'd realy like to see this in next version!

Keep up the good work!
Title: Re: advanced Adressbook
Post by: oxygens on April 10, 2007, 06:37:28 AM
it was removed as they are working on the addressbook in a seperate branch
Title: Re: advanced Adressbook
Post by: Genghis Khan on April 16, 2007, 10:15:16 AM
Ok, so where can i find that advanced adress book and download it?
Title: Re: advanced Adressbook
Post by: keltong on May 13, 2007, 11:33:27 AM
Very cool plugin! :D
Title: Re: advanced Adressbook
Post by: phs on May 19, 2007, 09:18:21 AM
Hi helga

very useful plugin, indeed! O0
but i have one little improvement: it would be nice to store multiple email addresses per contact! if you could add this to your advanced addressbook, it would be perfect!

regards
phs
Title: Re: advanced Adressbook
Post by: CEC on May 27, 2007, 02:25:25 PM
Is this contribution consistent with the latest stable release. It's not working for me -- significant differences between instructions and what's actually in the files -- e.g., edit, show.  :-\
Title: Re: advanced Adressbook
Post by: CEC on May 31, 2007, 02:08:55 AM
Any chance of an updated version of this plugin?  :'(
Title: Re: advanced Adressbook
Post by: milko on June 08, 2007, 12:40:55 PM
Vielen Dank für den Service, Helga
Title: Re: advanced Adressbook
Post by: kevenages on June 15, 2007, 03:47:49 PM
Quote from: CEC
Is this contribution consistent with the latest stable release. It's not working for me -- significant differences between instructions and what's actually in the files -- e.g., edit, show.  :-\

I'm having the same issue, perhaps someone could do one of 2 things:

1. give updated instructions on the plugin
2. provide the files and simply allow users to overwrite the files to be updated (once backed up, of course)

Thanks, I'd really love to utilize this plugin
Title: Re: advanced Adressbook
Post by: Gus on August 15, 2007, 04:19:45 AM
Hi,

i've added these changes to the latest RC1 files, and although some of the line numbers were wrong, it all seemed fairly correct and all went OK.
However none of my new contact fields are written back my mySQL table?
I dont get any errors, and i can change the standard fields OK.
Also, i can use phpmyadmin to manually add data to the new fields, and they show OK in the show contact page. but i still cannot edit of the new fields using RC.

Any ideas?

thanks.
Title: Re: advanced Adressbook
Post by: oldschool on August 15, 2007, 03:00:36 PM
An update for RC1 would be great...!

Rgds.

Title: Re: advanced Adressbook
Post by: fritzferr on September 18, 2007, 02:35:08 PM
This thread looks like it has winded down. After review I'm not sure where it stands - did the latest RC have the advanced address book in it? When I went through the sql statements it didn't appear to be the case, but I don't know enough to be sure.

Personally, I'd love to have advance stuff in there...

FF
Title: Re: advanced Adressbook
Post by: GunFro on September 18, 2007, 03:22:23 PM
.......................
Title: Re: advanced Adressbook
Post by: dloendorf on September 20, 2007, 09:08:53 PM
This is an updated version of the advanced addressbook for RC1. Download and unzip the attached file to a temporary folder. Refer to Helga's original post for setting the language specific file. Rename the following files ../program/include/main.php to main.php.orig, ../program/include/rcube_contacts.inc to rcube_contacts.inc.orig, ../program/steps/addressbook/edit.inc to edit.inc.orig, ../program/steps/addressbook/save.inc to save.inc.orig, ../program/steps/addressbook/show.inc to show.inc.orig.

Replace the files renamed above with the files from the temporary zip folder. When you are certain the new files work correctly, you can remove the .orig files.

OK! I am not allowed to post a zip file. If you are interested in receiving a zip file, send me a message. Trying to delineate line numbers where to delete and insert is too hard. :(

David

Title: Re: advanced Adressbook
Post by: dloendorf on October 08, 2007, 12:19:56 AM
Here are the updates required for the advanced address book in rc1. These updates also include the global contact option.

The line numbers for inserts may not be exact depending on the version of rc1 you are using.

If you have any questions as to where modification should go, do not hesitate to contact me.

Remember - backup or make copies of all original files before making any modifications suggested here.

Code: [Select]
# First posted by Helga as
# [url]http://roundcubeforum.net/forum/index.php?topic=737.msg3238#msg3238[/url]
# Modified by David Loendorf for RC1 and global contact option

# -------------------------------------------------------------------------------------------------------------
#
# In file /program/include/rcube_contacts.inc
#
# Replace Line 31 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');
# Replace Line 145 with
     AND  (user_id=? OR global_contact = 1)&quot; .
# Replace Line 216
    AND  (user_id=? OR global_contact = 1)&quot;.
# Replace Line 251 with
    AND  (user_id=? OR global_contact = 1)
# Replace Line 342 with
     AND  (user_id=? OR global_contact = 1)

# -------------------------------------------------------------------------------------------------------------
#
# In file /program/include/main.inc
#
# Find the line that reads: if ($type=='checkbox')
# It should be around Line 1230
# 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')

# -------------------------------------------------------------------------------------------------------------
#
# In File /program/localization/en_US/label.inc
# Insert after line 163
$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']   = 'Notice';

# -------------------------------------------------------------------------------------------------------------
#
# In file /program/steps/addressbook/edit.inc
# Replace Line 64 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');

# Insert after line that contains: $attrib['id'] = 'rcmfd_'.$col; (should be line 67 or 68)
  if($col == &quot;global_contact&quot;)
  $value = rcmail_get_edit_field($col, $record[$col], $attrib, 'checkbox');
  else

# -------------------------------------------------------------------------------------------------------------
#
# 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

 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);
 }

# -------------------------------------------------------------------------------------------------------------
#
# In file /program/steps/addressbook/show.inc
# Replace Line 46 with
 $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');

#
# Replace Old Lines that contain the following (beginning around line 59-62)
  $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;;

# with these new lines

$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, 'Yes');
else
  $data .= sprintf(&quot;<tr><td>%s</td><td>%s</td></tr>\n&quot;,$title, 'No');
} 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;;

# -------------------------------------------------------------------------------------------------------------
#

# Database Additions for extended contact information
#
# Run in PhpMyAdmin on the database that holds the RC Contacts table. Change the table name rc_contacts to your contacts table name:
#

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

If you would also like to allow your users to modify their passwords while in RC and your ISP supports CPanel 11 make the following updates
Code: [Select]
# Support password modification using CPanel 11
#
#  Code written by Danny Herran
#  with small modification by David Loendorf
#  Original post is here [url]http://roundcubeforum.net/forum/index.php?topic=711.msg3155#msg3155[/url]
#  You can find original code at [url]http://www.ingeniarte.com/rcpasswd.php[/url]
#  All of this is included below plus the few modifications I have made.

# In file /program/js/app.js

# Replace Line 264 with
    this.enable_command('preferences', 'identities', 'save', 'folders', 'passwd', true);

# Insert after Line 274
    if (this.env.action=='passwd' || this.env.action=='save-passwd')
     {
     var input_curpasswd = rcube_find_object('_curpasswd');
     var input_newpasswd = rcube_find_object('_newpasswd');
     var input_confpasswd = rcube_find_object('_confpasswd');
     if (input_curpasswd && input_curpasswd.value=='')
       input_curpasswd.focus();
     else if (input_confpasswd)
       input_confpasswd.focus();

     this.enable_command('save-passwd', true);
     }

# Insert after old Line 932 new Line 945
    break;

   case 'passwd':
    this.goto_url('passwd');
    break;

   case 'save-passwd':
    var input_curpasswd = rcube_find_object('_curpasswd');
    var input_newpasswd = rcube_find_object('_newpasswd');
    var input_confpasswd = rcube_find_object('_confpasswd');
    if (input_curpasswd && input_curpasswd.value=='')
      {
        alert(this.get_label('nocurrentpassword'));
        input_curpasswd.focus();
      }
    else if ((input_newpasswd && input_newpasswd.value=='') && (input_confpasswd && input_confpasswd.value==''))
      {
        alert(this.get_label('nopassword'));
        input_newpasswd.focus();
      }
    else if ((input_newpasswd && input_confpasswd) && ( input_newpasswd.value != input_confpasswd.value))
      {
        alert(this.get_label('passwordinconsistency'));
        input_newpasswd.focus();
      }
    else
        this.gui_objects.editform.submit();

# -------------------------------------------------------------------------------------------------------------

# In file /program/localizations/en_US/labels.inc

# Insert before the last line

$labels['changepasswd'] = 'Change Password';
$labels['curpasswd'] = 'Current Password';
$labels['newpasswd'] = 'New Password';
$labels['confpasswd'] = 'Confirm New Password';

# -------------------------------------------------------------------------------------------------------------

# In file /program/localizations/en_US/messages.inc

# Insert after line 78
$messages['nocurrentpassword'] = "Please input current password.";
$messages['nopassword'] = "Please input new password.";
$messages['passwordinconsistency'] = "Inconsistency of password, please try again.";

# -------------------------------------------------------------------------------------------------------------

# Add File /program/steps/settings/passwd.inc that contains


/*
 -----------------------------------------------------------------------
 | program/steps/settings/passwd.inc                  |
 |                                   |
 | This file is part of the RoundCube Webmail client          |
 | Copyright (C) 2007, RoundCube Dev. - Switzerland          |
 | Licensed under the GNU GPL                     |
 |                                   |
 | PURPOSE:                              |
 |  Change IMAP user password ONLY FOR cPanel 11 installations!    |
 |                                   |
 | REQUIREMENTS:                            |
 |  PHP with cURL installed, cPanel 11                |
 |                                   |
 -----------------------------------------------------------------------
 | Author: Danny Herran  -----------------------------------------------------------------------

 $Id: passwd.inc,v 0.2 2007/06/08 11:16:03 roundcube Exp $

*/

function rcmail_save_passwd($curpasswd, $newpasswd){
 global $CONFIG, $_SESSION, $OUTPUT;

 //Basically this sends a request to dopasswdpop.html and change the password for the IMAP account
 //this is different from cPanel 10 which uses dowebmailpasswd.cgi instead

 $cpaneluser = $_SESSION['username'];
 $cpanelpass = $curpasswd;
 $data=explode('@', $_SESSION['username']);
 $domain=$data[1];
 $uname=$data[0];

 // First do a check if curl_init exists:
 if (function_exists("curl_init")) {
  $authstr = "$cpaneluser:$cpanelpass";
  $postfields="email=$uname&domain=$domain&password=$newpasswd";

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $domain.":2095/webmail/x3/mail/dopasswdpop.html");
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_USERPWD, $authstr);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);


  $cbsreturn = curl_exec($ch);
//  echo "Result: " . $cbsreturn; // Returns all the html from cPanel, uncomment to view (debugging)

  if ((strpos($cbsreturn, "successfully modified")) and (!strpos($cbsreturn, "result in failure"))) {
//We update the password for the current session
$_SESSION['password'] = encrypt_passwd($newpasswd);
   curl_close($ch);
   return true;
  } else {
   curl_close($ch);
   return false;
  }
 }
}


function rcmail_passwd_form($attrib){
 global $CONFIG, $OUTPUT;

 list($form_start, $form_end) = get_form_tags($attrib, 'save-passwd');
 unset($attrib['form']);

 if (!$attrib['id'])
  $attrib['id'] = 'rcmSavepassword';

 // allow the following attributes to be added to the tag
 $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary'));

 // return the complete edit form as table
 $out = "$form_start\n\n";

 $a_show_cols = array('curpasswd'  => array('type' => 'text'), 'newpasswd'  => array('type' => 'text'), 'confpasswd'  => array('type' => 'text'));

 // show current password field
 $field_id = 'curpasswd';
 $input_curpasswd = new passwordfield(array('name' => '_curpasswd', 'id' => $field_id, 'size' => 30));

 $out .= sprintf("
\n", $field_id, rep_specialchars_output(rcube_label('curpasswd')), $input_curpasswd->show($CONFIG['curpasswd']));

 // show new password selection
 $field_id = 'newpasswd';
 $input_newpasswd = new passwordfield(array('name' => '_newpasswd', 'id' => $field_id, 'size' => 30));

 $out .= sprintf("\n", $field_id, rep_specialchars_output(rcube_label('newpasswd')), $input_newpasswd->show($CONFIG['newpasswd']));

 // show confirm password selection
 $field_id = 'confpasswd';
 $input_confpasswd = new passwordfield(array('name' => '_confpasswd', 'id' => $field_id, 'size' => 30));

 $out .= sprintf("\n", $field_id, rep_specialchars_output(rcube_label('confpasswd')), $input_confpasswd->show($CONFIG['confpasswd']));

 $out .= "\n
%s
%s
%s
$form_end";

 return $out;
}

// Handle user request
if ($_action=='save-passwd'){

 if (!isset($_POST['_curpasswd']))
  $OUTPUT->show_message('errorsaving', 'error');
 else if (!isset($_POST['_newpasswd']))
  $OUTPUT->show_message('errorsaving', 'error');
 else if (rcmail_save_passwd(get_input_value('_curpasswd', RCUBE_INPUT_POST), get_input_value('_newpasswd', RCUBE_INPUT_POST))){
  $OUTPUT->show_message('successfullysaved', 'confirmation');
 } else
  $OUTPUT->show_message('errorsaving', 'error');

 // overwrite action variable
 rcmail_overwrite_action('passwd');

}

// add some labels to client
rcube_add_label('nocurrentpassword');
rcube_add_label('nopassword');
rcube_add_label('passwordinconsistency');
parse_template('passwd');
?>

# -------------------------------------------------------------------------------------------------------------

# In file /skins/default/includes/settingstabs.html

# Insert after Line 2


# -------------------------------------------------------------------------------------------------------------

# Add File /skins/default/templates/passwd.html that contains

[/url]
[/url]

<roundcube:object name="pagetitle" />

























# -------------------------------------------------------------------------------------------------------------
#
# In File index.php
#
# Insert after line that reads:  include_once('program/steps/settings/func.inc'); (about line 343)

 if (($_action=='passwd') or ($_action=='save-passwd'))
  include('program/steps/settings/passwd.inc');

David
Title: Re: advanced Adressbook
Post by: Rudy on October 08, 2007, 03:03:51 AM
Works like a charm. Thanks a lot! Is there any way to implement multiple E-Mail addresses for one contact in this plugin/mod?
Title: Re: advanced Adressbook
Post by: dloendorf on October 08, 2007, 08:46:01 AM
Of course, the short answer is Yes - But...

I am leaving for Europe a week from today, so will probably not have a chance to look into adding that function. Come mid-January, when I return, if someone else has not implemented it, I will be happy to make an attempt.

David
Title: Re: advanced Adressbook
Post by: Rudy on October 08, 2007, 03:23:09 PM
I just found a little typo in your instructions: :)

Code: [Select]
# Replace Line 46 with
 $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', 'g_adresse', 'notice');

Last line, there it should say "w_address" instead of "g_adresse".


Title: Re: advanced Adressbook
Post by: dloendorf on October 08, 2007, 06:14:58 PM
Thank you. Actually that was there in the original post by Helga - I just never caught it.

I have modified my original post to fix it.

David
Title: Re: advanced Adressbook
Post by: Gus on October 10, 2007, 09:24:01 AM
Thanks for that! i've been after this update for ages.

It all seems to work perfectly, however the layout of the address book panes could do with adjustment.

The 2 panes (Display Name on the left and Contact Details on the right) could do with some resizing. Currently they seem to be set to 50:50 across my screen.

Is there a way to reduce the left pane to say 25% and the right pane to 75% ?
since all my new fields are are all bunched up on the right pane.

I can post a screenshot if all this makes no sense!

cheers
Gus
Title: Re: advanced Adressbook
Post by: dloendorf on October 10, 2007, 08:11:01 PM
Please post a screen shot.

Thanks - David
Title: Re: advanced Adressbook
Post by: Gus on October 11, 2007, 03:28:18 AM
Sure, no problem.
attached image shows the left pane "Display Name" and the Right pane "Bruce...."
I would like the left pane to be half the width since it doesn't need the space,
the right pane has forced scroll bars and certain fields now take up 2 lines due to lack of width.

thanks very much!

Gus
Title: Re: advanced Adressbook
Post by: dloendorf on October 11, 2007, 06:11:07 AM
Look in the file /skins/default/templates/addressbook.html.

Modify lines 31 and 32 to suit your needs. Something like:

#addresslist { left:20px; width:250px }
#contacts-box { left:300px }

Note that #addresslist has an initial left position and width. #contacts-box only the initial left position as it uses the rest of the frame width.

David
Title: Re: advanced Adressbook
Post by: Gus on October 11, 2007, 07:31:07 AM
Perfect.
Thanks for that!
Title: Re: advanced Adressbook
Post by: mrjaguar on October 31, 2007, 03:22:01 AM
I'm trying to install this with the youds 3 column outlook hack. I'm not having any luick.. when I click on addressbook all I get is a blank screen. also using svn as of 2 nights ago.. 10-29-07.
thanks.
pat.
Title: Re: advanced Adressbook
Post by: starburst on November 09, 2007, 02:43:19 AM
French Translation

Quote
# In File /program/localization/en_US/label.inc
# Insert after line 163
$labels['global_contact']  = 'Contact Global';
$labels['firm']   = 'Société';
$labels['position']   = 'Fonction';
$labels['p_tel']   = 'Telephone';
$labels['p_fax']   = 'Fax';
$labels['p_mob']   = 'Portable';
$labels['p_address']   = 'Addresse';
$labels['w_tel']   = 'Telephone Société';
$labels['w_fax']   = 'Fax Société';
$labels['w_mob']   = 'Porable Société';
$labels['w_address']   = 'Addresse Société';
$labels['notice']   = 'Note';
Title: Re: advanced Adressbook
Post by: cheongseeker on November 12, 2007, 06:29:56 AM
I've had managed to modify the address book by following the information given here. Now I'm able to create global contact and the address book contain additional fields.

Is there a way to limit or control creating and deleting of global contact?

I would like to have only the administrator to be able to create and delete global contact. Individual user will still be able to create and delete their own contact.

Would appreciate if anyone can help in this.

Title: Re: advanced Adressbook
Post by: grabber on November 12, 2007, 07:48:54 PM
Quote from: starburst
French Translation

Quote
# In File /program/localization/en_US/label.inc
# Insert after line 163
$labels['global_contact']  = 'Contact Global';
$labels['firm']   = 'Société';
$labels['position']   = 'Fonction';
$labels['p_tel']   = 'Telephone';
$labels['p_fax']   = 'Fax';
$labels['p_mob']   = 'Portable';
$labels['p_address']   = 'Addresse';
$labels['w_tel']   = 'Telephone Société';
$labels['w_fax']   = 'Fax Société';
$labels['w_mob']   = 'Porable Société';
$labels['w_address']   = 'Addresse Société';
$labels['notice']   = 'Note';

OH MY GOD ! As a french guy, I can tell you (with my poor english, soory) that this translation is totally NOT french !!!

En fr maintenant, si c'est pour donner des informations bidons et surtout ne pas savoir écrire français, alors autant s'abstenir...
depuis quand "adresse" prend 2 "D" en français ?
pourquoi mettre des accents à "société" et pas à "téléphone" ?
il me semble qu'un "porable" doit surement vouloir dire "portable" !!!

enfin bref... vraiment énervant de voir ça... en plus d'être inutile bien entendu...
Title: Re: advanced Adressbook
Post by: DocNight on November 13, 2007, 06:55:39 AM
Hi all,

I got problems integrating the advanced addressbook into v0.1-rc2.

I tried the changes for rc1, but they won't work. In the right column I only got the edit-Button without any entries.

Thx,
Doc.
Title: Re: advanced Adressbook
Post by: Mossi on November 14, 2007, 05:25:11 AM
same problem here... At the moment I returned to the standard address book, which works just fine. If I will find the reason for the bug, I will post it here
Title: Re: advanced Adressbook
Post by: www.velder.li on January 19, 2008, 06:08:44 AM
sieht gut aus muss ich mal anschauen

danke ;-)
Title: Re: advanced Adressbook
Post by: galdo on February 13, 2008, 04:25:21 AM
Hi all together,

whats about including a picture (maybe including an upload feature) for the adress-book?

Thanks a lot, if anyone implements that!

Galdo

PS: Nice work - I like that plugin very well! :D
Title: Re: advanced Adressbook
Post by: clicktheo on February 24, 2008, 03:55:59 PM
Yeah....is this current for 0.1-RC2? Some of the changes won't work/some of the lines you say to replace can't be found!
Title: Re: advanced Adressbook
Post by: Rudy 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);
}
Title: Re: advanced Adressbook
Post by: guilichou 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...
Title: Re: advanced Adressbook
Post by: oldschool 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.

Title: Re: advanced Adressbook
Post by: Rudy 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.
Title: Re: advanced Adressbook
Post by: guilichou on March 20, 2008, 09:30:20 AM
Thanks in advance for helping us...
Title: Re: advanced Adressbook
Post by: Rudy 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=?&quot; .

# REPLACE with
    AND  (user_id=? OR global_contact = 1)&quot; .


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

# FIND (line 232)
    AND  user_id=?&quot;.

# REPLACE with
    AND  (user_id=? OR global_contact = 1)&quot;.


##################
###[ 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 == &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['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 == &quot;global_contact&quot;)
  $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 &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', '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
Title: Re: advanced Adressbook
Post by: guilichou 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...)
Title: Re: advanced Adressbook
Post by: Rudy on March 21, 2008, 04:26:37 AM
Yeah I'm pretty sure this is just a typo. I updated the instructions. Thanks! :)
Title: Re: advanced Adressbook
Post by: guilichou 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...
Title: problem I cannot edit contact
Post by: bobby5959 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
Title: found my mistake
Post by: bobby5959 on March 24, 2008, 12:50:53 PM
Its working may may thxs

I forgot a barket
Title: Re: advanced Adressbook
Post by: cornbread on March 26, 2008, 12:26:36 PM
I added this to the feature request!

http://trac.roundcube.net/ticket/1484923
Title: Re: advanced Adressbook
Post by: brewnchew 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
Title: Re: advanced Adressbook
Post by: dukhunter99 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.
Title: Re: advanced Adressbook
Post by: blove57 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
Title: Re: advanced Adressbook
Post by: oldschool on April 02, 2008, 12:27:34 PM
Thanks alot...

 :)

Title: Re: advanced Adressbook
Post by: DocNight on April 16, 2008, 03:01:44 PM
Hi all,

does anyone already made the stable 0.1.1 upgrade and tried the advanced adressbook?

regards,
DocNight.
Title: advanced Adressbook
Post by: ufoonline on June 19, 2008, 02:52:15 AM
Hello all,

Someone want to add a group support to the address book?
It well be a nice features wich fullfil the requests of a lot of peoples!

Thank you,
Best Regards
Title: advanced Adressbook
Post by: d1msumboi on June 28, 2008, 05:04:33 AM
First, I would like to thank you for this awesome hack.  However, when I add or edit a contact, the information other than the four default ones (name, email, etc) do not get written to the database.  For example, if i type in phone number or address, save it, and check my database via phpmyadmin, those values are not written.  Anyone have any idea why?  If I manually edit those values via phpmyadmin, they show up just fine.  So something is wrong with writing to the database.  thanks in advance.
Title: Version 2 Also Works
Post by: sam121212 on September 17, 2008, 07:07:30 PM
Quote from: Rudy;10975
[PLUGIN] Advanced Address Book - "updated"/checked to work with 0.1stable
Give it a try. It should work. ;)

Code: [Select]


 .......................
......................
......................................
#
# ------[ 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!
.......................................
.................
.......

#
# ------[ 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

Hey Guys its work with roundcubemail version2+ also
Title: advanced Adressbook
Post by: glen on October 20, 2008, 10:25:31 AM
I cant find this for the latest version of Roundcube.. anyone?

# FIND (line 59-64)
  $out .= sprintf("%s%s\n",
          Q(rcube_label($col)),
          $value);
  }
 
 $out .= "\n";

# REPLACE with

$title = Q(rcube_label($col));
if($col == "notice"){
$out2 = "
$title\n";
$out2 .= sprintf("\n", $value);
$out2 .= "
%s
\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("%s%s\n",$title, $value);
}
}
elseif($col == "p_address"){
$p_address = "
$title\n";
$p_address .= sprintf("\n", $value);
$p_address .= "
%s
\n\n";
}
elseif($col == "w_address"){
$w_address = "
$title\n";
$w_address .= sprintf("\n", $value);
$w_address .= "
%s
\n\n";
}
elseif(!$value == "")
  $data .= sprintf("%s%s\n",$title, $value);




  }
$data .= "";
$contact .= "";

 $out .= "$data$contact\n\n";
 $out .= "";
 $out .= "$p_address$w_address\n\n";
 $out .= "";
 $out .= $out2;
 $out .= "\n";

Title: advanced Adressbook
Post by: jonsjava on October 20, 2008, 05:19:49 PM
Quote from: glen;14751
I cant find this for the latest version of Roundcube.. anyone?

# FIND (line 59-64)
  $out .= sprintf("%s%s\n",
          Q(rcube_label($col)),
          $value);
  }
 
 $out .= "\n";

# REPLACE with

$title = Q(rcube_label($col));
if($col == "notice"){
$out2 = "
$title\n";
$out2 .= sprintf("\n", $value);
$out2 .= "
%s
\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("%s%s\n",$title, $value);
}
}
elseif($col == "p_address"){
$p_address = "
$title\n";
$p_address .= sprintf("\n", $value);
$p_address .= "
%s
\n\n";
}
elseif($col == "w_address"){
$w_address = "
$title\n";
$w_address .= sprintf("\n", $value);
$w_address .= "
%s
\n\n";
}
elseif(!$value == "")
  $data .= sprintf("%s%s\n",$title, $value);




  }
$data .= "";
$contact .= "";

 $out .= "$data$contact\n\n";
 $out .= "";
 $out .= "$p_address$w_address\n\n";
 $out .= "";
 $out .= $out2;
 $out .= "\n";



I posted a newer version at http://www.roundcubeforum.net/plug-ins/2292-global-address-book-additional-fields-additional-email-addresses-2.html
now, my version removes the Global address book, but if you want that feature, look above my post.
Title: advanced Adressbook
Post by: jonsjava on October 29, 2008, 10:54:19 AM
I posted a modified version of the latest SVN release that allows for multiple e-mail addresses on this (http://www.roundcubeforum.net/plug-ins/2292-global-address-book-additional-fields-additional-email-addresses-2.html) page.  It will autocomplete only on the primary e-mail address, though. I'm to resolve that issue now.