mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 15:18:58 +01:00
Patch from Bjorn Padding to silence JS error when addressbook is in LDAP
This commit is contained in:
parent
fe92979bc1
commit
596f252eb7
@ -123,12 +123,14 @@ class addressbook_ldap
|
|||||||
'mozillaabpersonalpha' => array(
|
'mozillaabpersonalpha' => array(
|
||||||
'adr_one_street2' => 'mozillaworkstreet2',
|
'adr_one_street2' => 'mozillaworkstreet2',
|
||||||
'adr_one_countryname' => 'c', // 2 letter country code
|
'adr_one_countryname' => 'c', // 2 letter country code
|
||||||
|
'adr_one_countrycode' => 'c', // 2 letter country code
|
||||||
'adr_two_street' => 'mozillahomestreet',
|
'adr_two_street' => 'mozillahomestreet',
|
||||||
'adr_two_street2' => 'mozillahomestreet2',
|
'adr_two_street2' => 'mozillahomestreet2',
|
||||||
'adr_two_locality' => 'mozillahomelocalityname',
|
'adr_two_locality' => 'mozillahomelocalityname',
|
||||||
'adr_two_region' => 'mozillahomestate',
|
'adr_two_region' => 'mozillahomestate',
|
||||||
'adr_two_postalcode' => 'mozillahomepostalcode',
|
'adr_two_postalcode' => 'mozillahomepostalcode',
|
||||||
'adr_two_countryname' => 'mozillahomecountryname',
|
'adr_two_countryname' => 'mozillahomecountryname',
|
||||||
|
'adr_two_countrycode' => 'mozillahomecountryname',
|
||||||
'email_home' => 'mozillasecondemail',
|
'email_home' => 'mozillasecondemail',
|
||||||
'url_home' => 'mozillahomeurl',
|
'url_home' => 'mozillahomeurl',
|
||||||
),
|
),
|
||||||
@ -1113,9 +1115,17 @@ class addressbook_ldap
|
|||||||
*/
|
*/
|
||||||
function _egw2mozillaabpersonalpha(&$ldapContact,$data,$isUpdate)
|
function _egw2mozillaabpersonalpha(&$ldapContact,$data,$isUpdate)
|
||||||
{
|
{
|
||||||
if ($data['adr_one_countryname'])
|
if ($data['adr_one_countrycode'])
|
||||||
|
{
|
||||||
|
$ldapContact['c'] = $data['adr_one_countrycode'];
|
||||||
|
}
|
||||||
|
elseif ($data['adr_one_countryname'])
|
||||||
{
|
{
|
||||||
$ldapContact['c'] = ExecMethod('phpgwapi.country.country_code',$data['adr_one_countryname']);
|
$ldapContact['c'] = ExecMethod('phpgwapi.country.country_code',$data['adr_one_countryname']);
|
||||||
|
if ($ldapContact['c'] && strlen($ldapContact['c']) > 2) // Bad countryname when "custom" selected!
|
||||||
|
{
|
||||||
|
$ldapContact['c'] = array(); // should return error...
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elseif ($isUpdate)
|
elseif ($isUpdate)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user