[turba] Solution - Sorting by firstname in Turba 1.2

Parag Godkar paragg at konark.ncst.ernet.in
Wed Apr 2 17:11:00 PST 2003


Following changes need to be done inorder to 
sort the entries in turba 1.2 by "firstname" rather
than by "lastname"-
( This will sort the entries in the "browse" view &
   "search" view of turba and "address book" in
   compose window. )  

You need to change "lastname" to "name" in the
following files -

1.  turba/browse.php , line 166
-----------------------------------------------------
Change -

 'lastname' : $columns[$prefs->getValue('sortby') - 1];

to 

 'name' : $columns[$prefs->getValue('sortby') - 1];


And I got the following ones from the post of Mr. Eduardo Pinto 
for earlier versions of Turba - 

2. turba/lib/Source.php, line 179
------------------------------------------------------
Change -

 function search($search_criteria, $sort_criteria = 'lastname', $match = null, $s
ort_direction = 0)

to 

 function search($search_criteria, $sort_criteria = 'name', $match = null, $s
ort_direction = 0)

3. turba/lib/List.php, line 122
---------------------------------------------------------
Change -

 function sort($sort = 'lastname', $low = null, $high = null, $dir = 0)

to 

 function sort($sort = 'name', $low = null, $high = null, $dir = 0)


4. turba/lib/api.php, line 39 and 95
----------------------------------------------------------
Change -

  $res = $driver->search($hash, 'lastname', TURBA_SEARCH_AND);
  $res = $driver->search($criteria, 'lastname', TURBA_SEARCH_OR);

to 

  $res = $driver->search($hash, 'name', TURBA_SEARCH_AND);
  $res = $driver->search($criteria, 'name', TURBA_SEARCH_OR);

respectively.

Regards,
Parag Godkar.







More information about the turba mailing list