Keep Field Order

This commit is contained in:
Jörg Lehrke 2009-07-19 20:05:06 +00:00
parent 81afb6f8e9
commit 367d2b5ad6

View File

@ -969,10 +969,10 @@ class addressbook_vcal extends addressbook_bo
'TEL;CELL;WORK' => array('tel_cell'), 'TEL;CELL;WORK' => array('tel_cell'),
'TEL;CELL;HOME' => array('tel_cell_private'), 'TEL;CELL;HOME' => array('tel_cell_private'),
'TEL;CAR' => array('tel_car'), 'TEL;CAR' => array('tel_car'),
'TEL;OTHER' => array('tel_other'), 'TEL;OTHER;VOICE' => array('tel_other'),
'TEL;WORK' => array('tel_work'), 'TEL;VOICE;WORK' => array('tel_work'),
'TEL;FAX;WORK' => array('tel_fax'), 'TEL;FAX;WORK' => array('tel_fax'),
'TEL;HOME' => array('tel_home'), 'TEL;HOME;VOICE' => array('tel_home'),
'TEL;FAX;HOME' => array('tel_fax_home'), 'TEL;FAX;HOME' => array('tel_fax_home'),
'TEL;PAGER' => array('tel_pager'), 'TEL;PAGER' => array('tel_pager'),
'TITLE' => array('title'), 'TITLE' => array('title'),
@ -1154,11 +1154,13 @@ class addressbook_vcal extends addressbook_bo
switch($rowName) switch($rowName)
{ {
case 'ADR': case 'ADR':
if (!isset($rowNames[$rowName . ';WORK'])) if (!isset($rowNames[$rowName . ';WORK'])
&& !isset($finalRowNames[$rowName . ';WORK']))
{ {
$finalRowNames[$rowName . ';WORK'] = $vcardKey; $finalRowNames[$rowName . ';WORK'] = $vcardKey;
} }
elseif (!isset($rowNames[$rowName . ';HOME'])) elseif (!isset($rowNames[$rowName . ';HOME'])
&& !isset($finalRowNames[$rowName . ';HOME']))
{ {
$finalRowNames[$rowName . ';HOME'] = $vcardKey; $finalRowNames[$rowName . ';HOME'] = $vcardKey;
} }
@ -1175,34 +1177,49 @@ class addressbook_vcal extends addressbook_bo
$finalRowNames['TEL;FAX;HOME'] = $vcardKey; $finalRowNames['TEL;FAX;HOME'] = $vcardKey;
} }
break; break;
case 'TEL;VOICE;WORK': case 'TEL;WORK':
$finalRowNames['TEL;WORK'] = $vcardKey; if (!isset($rowNames['TEL;VOICE;WORK'])
&& !isset($finalRowNames['TEL;VOICE;WORK']))
{
$finalRowNames['TEL;VOICE;WORK'] = $vcardKey;
}
break; break;
case 'TEL;HOME;VOICE': case 'TEL;HOME':
$finalRowNames['TEL;HOME'] = $vcardKey; if (!isset($rowNames['TEL;HOME;VOICE'])
&& !isset($finalRowNames['TEL;HOME;VOICE']))
{
$finalRowNames['TEL;HOME;VOICE'] = $vcardKey;
}
break; break;
case 'TEL;OTHER;VOICE': case 'TEL;OTHER':
$finalRowNames['TEL;OTHER'] = $vcardKey; if (!isset($rowNames['TEL;OTHER;VOICE'])
&& !isset($finalRowNames['TEL;OTHER;VOICE']))
{
$finalRowNames['TEL;OTHER;VOICE'] = $vcardKey;
}
break; break;
case 'TEL;CAR;VOICE': case 'TEL;CAR;VOICE':
case 'TEL;CAR;CELL': case 'TEL;CAR;CELL':
case 'TEL;CAR;CELL;VOICE': case 'TEL;CAR;CELL;VOICE':
if (!isset($finalRowNames['TEL;CAR']))
{
$finalRowNames['TEL;CAR'] = $vcardKey; $finalRowNames['TEL;CAR'] = $vcardKey;
}
break; break;
case 'TEL;X-egw-Ref1': case 'TEL;X-egw-Ref1':
if (!isset($rowNames['TEL;VOICE;WORK']) if (!isset($rowNames['TEL;VOICE;WORK'])
&& !isset($rowNames['TEL;WORK']) && !isset($rowNames['TEL;WORK'])
&& !isset($finalRowNames['TEL;WORK'])) && !isset($finalRowNames['TEL;VOICE;WORK']))
{ {
$finalRowNames['TEL;WORK'] = $vcardKey; $finalRowNames['TEL;VOICE;WORK'] = $vcardKey;
break; break;
} }
case 'TEL;X-egw-Ref2': case 'TEL;X-egw-Ref2':
if (!isset($rowNames['TEL;HOME;VOICE']) if (!isset($rowNames['TEL;HOME;VOICE'])
&& !isset($rowNames['TEL;HOME']) && !isset($rowNames['TEL;HOME'])
&& !isset($finalRowNames['TEL;HOME'])) && !isset($finalRowNames['TEL;HOME;VOICE']))
{ {
$finalRowNames['TEL;HOME'] = $vcardKey; $finalRowNames['TEL;HOME;VOICE'] = $vcardKey;
} }
break; break;
case 'TEL;CELL;X-egw-Ref1': case 'TEL;CELL;X-egw-Ref1':