Hello lacri,
would it be possible for you to create a patch for the changes
you have described in your "port to 0.2 stable / 0.2.1 " posting ?
It would be much easier to apply :-)
Thanks for your great work !!!
kind regards
Andreas
i have add the birtday field to Addressbook Birtday must DD.MM.YYYY onfocus field will blank i have add onfocus to allowed inputfield parameters when Birtday is empty show DD.MM.YYYY on editpage and addpage.
and i have optimized the fieldset html output on show add and editpage for an better display and formating.
view attached diffCode:ALTER TABLE `contacts` ADD `birth` VARCHAR( 10 ) NOT NULL ;
Last edited by lacri; 02-01-2011 at 09:29 AM.
Hello lacri,
would it be possible for you to create a patch for the changes
you have described in your "port to 0.2 stable / 0.2.1 " posting ?
It would be much easier to apply :-)
Thanks for your great work !!!
kind regards
Andreas
i commit a patch at next monday,
the weekend is time for my kids![]()
here is the patch
not forgett
Code:# Database Additions for contact multiple emails # 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 `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; ALTER TABLE `contacts` ADD `email2` VARCHAR(128) NOT NULL ; ALTER TABLE `contacts` ADD `email3` VARCHAR(128) NOT NULL ; ALTER TABLE `contacts` ADD `email4` VARCHAR(128) NOT NULL ; ALTER TABLE `contacts` ADD `birth` VARCHAR(10) NOT NULL ;
Last edited by lacri; 02-01-2011 at 09:29 AM.
Based on work of lacri
I remove global contact from database, we use ldap for this
part 1
Add /etc/ldap/schema/mozillaorgperson.schema (debian)
and include it on /etc/ldap/slapd.conf
modifie /program/config/main.inc.phpCode:# # mozillaOrgPerson schema v. 0.6.3 # # req. core # req. cosine # req. inetorgperson # attribute defs attributetype ( 1.3.6.1.4.1.13769.2.1.1 NAME ( 'mozillaNickname' ) SUP name ) attributetype ( 1.3.6.1.4.1.13769.2.1.2 NAME ( 'mozillaUseHtmlMail' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13769.2.1.3 NAME 'mozillaSecondEmail' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} ) attributetype ( 1.3.6.1.4.1.13769.2.1.4 NAME 'mozillaHomeLocalityName' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} ) attributetype ( 1.3.6.1.4.1.13769.2.1.5 NAME 'mozillaPostalAddress2' EQUALITY caseIgnoreListMatch SUBSTR caseIgnoreListSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 ) attributetype ( 1.3.6.1.4.1.13769.2.1.6 NAME 'mozillaHomePostalAddress2' EQUALITY caseIgnoreListMatch SUBSTR caseIgnoreListSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 ) attributetype ( 1.3.6.1.4.1.13769.2.1.7 NAME ( 'mozillaHomeState' ) SUP name ) attributetype ( 1.3.6.1.4.1.13769.2.1.8 NAME 'mozillaHomePostalCode' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{40} ) attributetype ( 1.3.6.1.4.1.13769.2.1.9 NAME ( 'mozillaHomeCountryName' ) SUP name SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13769.2.1.10 NAME ( 'mozillaHomeFriendlyCountryName' ) EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) attributetype ( 1.3.6.1.4.1.13769.2.1.11 NAME ( 'mozillaHomeUrl' ) EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} ) attributetype ( 1.3.6.1.4.1.13769.2.1.12 NAME ( 'mozillaWorkUrl' ) EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} ) # un-comment for all LDAP server NOT supporting SYNTAX 2.16.840.1.113730.3.7.1 attributetype ( 1.3.6.1.4.1.13769.2.1.13 NAME ( 'nsAIMid' ) DESC 'AOL Instant Messenger (AIM) Identity' EQUALITY telephoneNumberMatch SUBSTR telephoneNumberSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 ) attributetype ( 1.3.6.1.4.1.13769.2.1.14 NAME ( 'mozillaHomeStreet' ) EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} ) # un-comment for Netscape 6.x and all other LDAP server supporting SYNTAX 2.16.840.1.113730.3.7.1 # attributeTypes ( 2.16.840.1.113730.3.1.2013 # NAME ( 'nsAIMid' ) # DESC 'AOL Instant Messenger (AIM) Identity' # SYNTAX 2.16.840.1.113730.3.7.1 ) attributetype ( 1.3.6.1.4.1.13769.2.1.96 NAME ( 'mozillaCustom1' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13769.2.1.97 NAME ( 'mozillaCustom2' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13769.2.1.98 NAME ( 'mozillaCustom3' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13769.2.1.99 NAME ( 'mozillaCustom4' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) # defined in "A Summary of the X.500(96) User Schema for use with LDAPv3" - RFC 2256 # # attributetype ( 2.5.4.6 NAME ( 'c' 'countryName' ) # DESC 'RFC2256: ISO-3166 country 2-letter code' # SUP name SINGLE-VALUE ) # defined in "The COSINE and Internet X.500 Schema" - RFC 1274 # # attributetype ( 0.9.2342.19200300.100.1.43 # NAME ( 'co' 'friendlyCountryName' ) # DESC 'RFC1274: friendly country name' # EQUALITY caseIgnoreMatch # SUBSTR caseIgnoreSubstringsMatch # SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) # objectClass defs objectclass ( 1.3.6.1.4.1.13769.2.2.1 NAME 'mozillaOrgPerson' SUP top AUXILIARY MAY ( sn $ givenName $ cn $ mozillaNickname $ title $ telephoneNumber $ facsimileTelephoneNumber $ mobile $ pager $ homePhone $ street $ postalCode $ mozillaPostalAddress2 $ mozillaHomeStreet $ mozillaHomePostalAddress2 $ l $ mozillaHomeLocalityName $ st $ mozillaHomeState $ mozillaHomePostalCode $ c $ mozillaHomeCountryName $ co $ mozillaHomeFriendlyCountryName $ ou $ o $ mail $ mozillaSecondEmail $ mozillaUseHtmlMail $ nsAIMid $ mozillaHomeUrl $ mozillaWorkUrl $ description $ mozillaCustom1 $ mozillaCustom2 $ mozillaCustom3 $ mozillaCustom4 ) ) # not part of the official Mozilla schema but read by Mozilla: 'departmentNumber' and 'postOfficeBox' #
and add this on your $rcmail_config['ldap_public']['XXX'] section
modiefie /program/include/main.incPHP Code:'writable' => true, // Indicates if we can write to the LDAP directory or not.
// If writable is true then these fields need to be populated:
// LDAP_Object_Classes, required_fields, LDAP_rdn
'LDAP_Object_Classes' => array("top", "inetOrgPerson", "mozillaOrgPerson"), // To create a new contact these are the object classes to specify (or any oth
'required_fields' => array("cn", "sn", "mail"), // The required fields needed to build a new contact as required by the object classes (can includ
'LDAP_rdn' => 'mail', // The RDN field that is used for new entries, this field needs to be one of the search_fields, the base of base_dn is appended
'ldap_version' => 3, // using LDAPv3
'search_fields' => array('mail', 'cn','mozillaSecondEmail' ), // fields to search in
// identity block
'name_field' => 'cn',
'surname_field' => 'sn',
'firstname_field' => 'givenName',
'email_field' => 'mail',
'email2_field' => 'mozillaSecondEmail',
// telephone block
'w_tel_field' => 'telephoneNumber',
'p_tel_field' => 'homePhone',
'w_fax_field' => 'facsimileTelephoneNumber',
'w_mob_field' => 'mobile',
// business data block
'company_field' => 'o',
'w_address_field' => 'street',
'w_postcode_field' => 'postalCode',
'w_city_field' => 'l',
'w_url_field' => 'mozillaWorkUrl',
// personel data block
'p_address_field' => 'mozillaHomeStreet',
'p_postcode_field' => 'mozillaHomePostalCode',
'p_city_field' => 'mozillaHomeLocalityName',
'p_url_field' => 'mozillaHomeUrl',
// description block
'desc_field' => 'description',
'sort' => 'cn', // The field to sort the listing by.
'scope' => 'sub', // search mode: sub|base|list
'filter' => '', // used for basic listing (if not empty) and will be &'d with search queries. example: status=act
'fuzzy_search' => true); // server allows wildcard search
search for
and replace withPHP Code:if ($type=='checkbox')
{
$attrib['value'] = '1';
$input = new html_checkbox($attrib);
modifie /program/include/rcube_contacts.phpPHP Code:if($col == "desc")
{
$attrib['rows'] = "5";
$attrib['size'] = "60";
$attrib['cols'] = "60";
$input = new html_textarea($attrib);
}
else if ($type=='checkbox')
{
$attrib['value'] = '1';
$input = new html_checkbox($attrib);
search for
and replace withPHP Code:var $table_cols = array('name', 'email', 'firstname', 'surname');
modifie /program/localization/fr_FR/labels.incPHP Code:var $table_cols = array('name', 'firstname', 'surname', 'email', 'email2', 'w_tel', 'p_tel', 'w_fax', 'w_mob', 'company', 'w_address', 'w_postcode', 'w_city', 'w_url', 'p_address', 'p_postcode', 'p_city', 'p_url', 'desc');
add the lines
PHP Code:/* ========================
Extended Adress Book
======================== */
// identity block
$labels['namelegend'] = $labels['surnamelegend'] = 'Identité';
// mail block
$labels['emaillegend'] = $labels['email2legend'] = 'E-mail';
$labels['email2'] = 'Adresse alternative ';
// telephone block
$labels['w_tellegend'] = $labels['w_moblegend'] = 'Numéros de téléphone';
$labels['w_tel'] = 'Travail ';
$labels['p_tel'] = 'Domicile';
$labels['w_fax'] = 'Fax';
$labels['w_mob'] = 'Portable';
// business block
$labels['companylegend'] = $labels['w_urllegend'] = 'Professionnel';
$labels['company'] = 'Société';
$labels['w_address'] = 'Adresse';
$labels['w_postcode'] = 'Code postal';
$labels['w_city'] = 'Ville';
$labels['w_url'] = 'Page Web';
// home block
$labels['p_addresslegend'] = $labels['p_urllegend'] = 'Personnel';
$labels['p_address'] = 'Adresse';
$labels['p_postcode'] = 'Code postal';
$labels['p_city'] = 'Ville';
$labels['p_url'] = 'Page Web';
// description block
$labels['desc'] = ' ';
$labels['desclegend'] = 'Remarques';
part 2
modifie /program/include/rcube_ldap.php
search for
and replace withPHP Code:// The field does exist, add it to the entry.
$newentry[$fld] = $val;
modiefie /program/steps/addressbook/copy.incPHP Code:// The field does exist, add it to the entry.
// correct bug ldap_add() - null values in fields produce an "value #0 invalid per syntax" error on openldap 2.4
if ($val != "" ) $newentry[$fld] = $val;
search for
and replace withPHP Code:$success = $TARGET->insert($CONTACTS->search($CONTACTS->primary_key, $cid), true);
modiefie /program/steps/addressbook/edit.incPHP Code:$ids = explode( ',', $cid );
foreach ( $ids as $id )
{
$record = $CONTACTS->search( $CONTACTS->primary_key, $id );
$success[$id] = $TARGET->insert( $record->records[0], true );
}
search for
and replace withPHP Code:$out = "$form_start<table>\n\n";
search forPHP Code:$out = "$form_start\n\n";
and replace withPHP Code:$a_show_cols = array('name', 'firstname', 'surname', 'email');
search forPHP Code:$a_show_cols = array('name', 'firstname', 'surname', 'email', 'email2', 'w_tel', 'p_tel', 'w_fax', 'w_mob', 'company', 'w_address', 'w_postcode', 'w_city'
, 'w_url', 'p_address', 'p_postcode', 'p_city', 'p_url', 'desc');
and add afterPHP Code:foreach ($a_show_cols as $col)
{
search forPHP Code:if($col=='name' or $col=='email' or $col=='w_tel' or $col=='company' or $col=='p_address' or $col=='desc')
$out .= "<div class='contactdetails-block'><fieldset><legend>".Q(rcube_label($col.'legend'))."</legend><table>";
and replace withPHP Code:Q(rcube_label($col)),
$value);
}
search forPHP Code:Q(rcube_label($col)),
$value);
if($col=='surname' or $col=='email2' or $col=='w_mob' or $col=='w_url' or $col=='p_url' or $col=='desc')
$out .= "</fieldset></table></div>";
}
and replace withPHP Code:$out .= "\n</table>$form_end";
modiefie /program/steps/addressbook/save.incPHP Code:$out .= "\n$form_end";
search for
and replace withPHP Code:$a_save_cols = array('name', 'firstname', 'surname', 'email');
modiefie /program/steps/addressbook/show.incPHP Code:$a_save_cols = array('name', 'firstname', 'surname', 'email', 'email2', 'w_tel', 'p_tel', 'w_fax', 'w_mob', 'company', 'w_address', 'w_postcode', 'w_city', 'w_url', 'p_address', 'p_postcode', 'p_city', 'p_url', 'desc');
search for
and replace withPHP Code:$a_show_cols = array('name', 'firstname', 'surname', 'email');
search forPHP Code:$a_show_cols = array('name', 'firstname', 'surname', 'email', 'email2', 'w_tel', 'p_tel', 'w_fax', 'w_mob', 'company', 'w_address', 'w_postcode', 'w_city', 'w_url', 'p_address', 'p_postcode', 'p_city', 'p_url', 'desc');
and replace withPHP Code:if ($col == 'email' && !empty($record[$col])) {
add just afterPHP Code:if($col=='name' or $col=='email' or $col=='w_tel' or $col=='company' or $col=='p_address' or $col=='desc')
$table = new html_table(array('cols' => 2));
if (($col=='email' || $col=='email2') && !empty($record[$col])) {
PHP Code:'class' => $microformats[$col],
), Q($record[$col]));
}
PHP Code:else if (($col=='w_url' || $col=='p_url') && !empty($record[$col])) {
$value = html::a(array(
'href' => $record[$col],
'target' => '_blank',
'class' => $microformats[$col],
), Q($record[$col]));
}
search for
and replace withPHP Code:}
return $table->show($attrib + array('class' => 'vcard'));
PHP Code:
if ($table->size() and ($col=='surname' or $col=='email2' or $col=='w_mob' or $col=='w_url' or $col=='p_url' or $col=='desc'))
$out .= html::tag('div', array('class' => 'contactdetails-block'),html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label($col.'legend'))) . $table->show($attrib array('class' => 'vcard'))));
}
return $out;
modiefie how lacri has :
- /program/steps/mail/autocomplete.inc
- /skins/default/addresses.css
- /skins/default/templates/editcontact.html
- /skins/default/templates/showcontact.html
execute on your db this sql script
Now, when you add a contact in roundcube, all field are present in yourPHP Code:ALTER TABLE `contacts` ADD `email2` VARCHAR(128) NOT NULL ;
ALTER TABLE `contacts` ADD `w_tel` VARCHAR(20) NOT NULL ;
ALTER TABLE `contacts` ADD `p_tel` VARCHAR(30) 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 `company` VARCHAR(50) NOT NULL ;
ALTER TABLE `contacts` ADD `w_address` TEXT NOT NULL;
ALTER TABLE `contacts` ADD `w_postcode` VARCHAR(10) NOT NULL;
ALTER TABLE `contacts` ADD `w_city` VARCHAR(15) NOT NULL;
ALTER TABLE `contacts` ADD `w_url` VARCHAR(64) NOT NULL;
ALTER TABLE `contacts` ADD `p_address` TEXT NOT NULL;
ALTER TABLE `contacts` ADD `p_postcode` VARCHAR(10) NOT NULL;
ALTER TABLE `contacts` ADD `p_city` VARCHAR(15) NOT NULL;
ALTER TABLE `contacts` ADD `p_url` VARCHAR(64) NOT NULL;
ALTER TABLE `contacts` ADD `desc` TEXT NOT NULL;
thunderbird add book like screenshots
Hi lacri,
thank you very much for the patch :-)
kind regards
Andreas
Hi,
How can I apply the patch *.diff?
Thanks
Dan
Enybody using global adresbook on version 0.3 ?
Hi,
Please I'm sorry for my dumb question..
Can anyone tell me what for this global addressbook plugin..
thanks..
There are currently 1 users browsing this thread. (0 members and 1 guests)