Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Commit

Permalink
Usability: Sort contacts alphabetically by 'name' - Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bbs2web committed Feb 27, 2014
1 parent 87c966e commit addd871
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/www/client/ajax/contacts_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
include("../src/prepend.inc.php");


$sql = "SELECT clid FROM contacts LEFT JOIN contacts_data ON contacts.clid = contacts_data.contactid WHERE userid='{$_SESSION['userid']}' AND contacts_data.field = 'name'";
$sql = "SELECT clid FROM contacts WHERE userid='{$_SESSION['userid']}'";

if ($req_id)
{
Expand Down Expand Up @@ -31,7 +31,7 @@

// $sort = $req_sort ? mysql_escape_string($req_sort) : "module_name";
// $dir = $req_dir ? mysql_escape_string($req_dir) : "ASC";
$sql .= " ORDER BY tld ASC, contacts_data.value, module_name ASC";
$sql .= " ORDER BY tld ASC, module_name ASC, (SELECT value FROM contacts_data WHERE contacts_data.contactid = contacts.clid AND contacts_data.field = 'name') ASC, (SELECT value FROM contacts_data WHERE contacts_data.contactid = contacts.clid AND contacts_data.field = 'organization') ASC";



Expand Down
6 changes: 3 additions & 3 deletions app/www/client/complete_transfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@
if ($contact_count < 25)
{
$smarty_contact["exists"] = $db->GetAll("
SELECT clid FROM contacts LEFT JOIN contacts_data ON contacts.clid = contacts_data.contactid
WHERE userid=? AND contacts_data.field = 'name' AND
SELECT clid FROM contacts
WHERE userid=? AND
(TLD = ? OR (module_name=? AND section_name=? AND target_index=?)) AND
groupname=? ORDER BY contacts_data.value ASC, contacts.clid ASC
groupname=? ORDER BY (SELECT value FROM contacts_data WHERE contacts_data.contactid = contacts.clid AND contacts_data.field = 'name') ASC, (SELECT value FROM contacts_data WHERE contacts_data.contactid = contacts.clid AND contacts_data.field = 'organization') ASC, clid ASC
", array (
$_SESSION['userid'],
//
Expand Down

0 comments on commit addd871

Please sign in to comment.