Hi, your problem is more or less that mssql does not support such a thing as
an
order by column<>’’
seems to be located in addressbook/inc/class.uicontacts.inc.php
Line 803 and the following
switch($query[‘order’]) // “xxx<>’’ DESC” sorts contacts with empty
order-criteria
always at the end
{ // we don’t exclude them, as the total would otherwise depend on the
order-criteria
case ‘org_name’:
$order = “org_name<>’’ DESC,org_name $sort,n_family $sort,n_given $sort”;
break;
default:
$query[‘order’] = ‘n_family’;
case ‘n_family’:
$order = “n_family<>’’ DESC,n_family $sort,n_given $sort,org_name $sort”;
break;
case ‘n_given’:
$order = “n_given<>’’ DESC,n_given $sort,n_family $sort,org_name $sort”;
break;
case ‘n_fileas’:
$order = “n_fileas<>’’ DESC,n_fileas $sort”;
break;
case ‘adr_one_postalcode’:
$order = “adr_one_postalcode<>’’ DESC,adr_one_postalcode $sort,org_name
$sort,n_family $sort,n_given $sort”;
break;
case ‘contact_modified’:
case ‘contact_created’:
$order = “$query[order] IS NULL,$query[order] $sort,org_name $sort,n_family
$sort,n_given $sort”;
break;
}
The method used here is probably not supported by mssql
If you accept the loss of the feature that entrys with empty ordercriteria
are sorted to
the end of the list, you can replace the section with:
switch($query[‘order’]) // “xxx<>’’ DESC” sorts contacts with empty
order-criteria
always at the end
{ // we don’t exclude them, as the total would otherwise depend on the
order-criteria
case ‘org_name’:
$order = “org_name DESC,org_name $sort,n_family $sort,n_given $sort”;
break;
default:
$query[‘order’] = ‘n_family’;
case ‘n_family’:
$order = “n_family DESC,n_family $sort,n_given $sort,org_name $sort”;
break;
case ‘n_given’:
$order = “n_given DESC,n_given $sort,n_family $sort,org_name $sort”;
break;
case ‘n_fileas’:
$order = “n_fileas DESC,n_fileas $sort”;
break;
case ‘adr_one_postalcode’:
$order = “adr_one_postalcode DESC,adr_one_postalcode $sort,org_name
$sort,n_family $sort,n_given $sort”;
break;
case ‘contact_modified’:
case ‘contact_created’:
$order = “$query[order] ,$query[order] $sort,org_name $sort,n_family
$sort,n_given $sort”;
break;
}
Regards
Klaus