"fix for bug #316: addressbook does not support mssql properly

MsSQL seems not to like != for not equal, using now <>"
This commit is contained in:
Ralf Becker 2007-06-03 08:42:59 +00:00
parent 65b18f32a5
commit dbb52e5ca7

View File

@ -781,24 +781,24 @@ class uicontacts extends bocontacts
} }
// translate the select order to the really used over all 3 columns // translate the select order to the really used over all 3 columns
$sort = $query['sort']; $sort = $query['sort'];
switch($query['order']) // "xxx!='' DESC" sorts contacts with empty order-criteria always at the end 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 { // we don't exclude them, as the total would otherwise depend on the order-criteria
case 'org_name': case 'org_name':
$order = "org_name!='' DESC,org_name $sort,n_family $sort,n_given $sort"; $order = "org_name<>'' DESC,org_name $sort,n_family $sort,n_given $sort";
break; break;
default: default:
$query['order'] = 'n_family'; $query['order'] = 'n_family';
case 'n_family': case 'n_family':
$order = "n_family!='' DESC,n_family $sort,n_given $sort,org_name $sort"; $order = "n_family<>'' DESC,n_family $sort,n_given $sort,org_name $sort";
break; break;
case 'n_given': case 'n_given':
$order = "n_given!='' DESC,n_given $sort,n_family $sort,org_name $sort"; $order = "n_given<>'' DESC,n_given $sort,n_family $sort,org_name $sort";
break; break;
case 'n_fileas': case 'n_fileas':
$order = "n_fileas!='' DESC,n_fileas $sort"; $order = "n_fileas<>'' DESC,n_fileas $sort";
break; break;
case 'adr_one_postalcode': case 'adr_one_postalcode':
$order = "adr_one_postalcode!='' DESC,adr_one_postalcode $sort,org_name $sort,n_family $sort,n_given $sort"; $order = "adr_one_postalcode<>'' DESC,adr_one_postalcode $sort,org_name $sort,n_family $sort,n_given $sort";
break; break;
case 'contact_modified': case 'contact_modified':
case 'contact_created': case 'contact_created':