JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
clients are now sorted by name
authorJason Woofenden <jason@jasonwoof.com>
Wed, 14 Oct 2009 08:27:58 +0000 (04:27 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Wed, 14 Oct 2009 08:27:58 +0000 (04:27 -0400)
people.html
people.php
su.php
tasks.php

index b46a3ae..e775865 100644 (file)
@@ -46,8 +46,9 @@
   <!--~populated_listing start~-->
   <p><a href="people.html?people_new=1">[Add a new account]</a></p>
 
-  <table cellspacing="0" cellpadding="4" border="1" summary=""><!--~listing_row start~-->
-  <tr><td class="listing"><a href="people.html?people_edit_id=~id~">~username.html~</a></td><td><a href="people.html?people_delete_id=~id~" onclick="return confirm('Permanently delete?')">[delete this account]</a></td></tr><!--~end~-->
+  <table cellspacing="0" cellpadding="4" border="1" summary="">
+    <tr><th>Name</th><th>Login</th><th>&nbsp;</th></tr><!--~listing_row start~-->
+    <tr><td class="listing"><a href="people.html?people_edit_id=~id~">~name.html~</a></td><td class="listing"><a href="people.html?people_edit_id=~id~">~username.html~</a></td><td><a href="people.html?people_delete_id=~id~" onclick="return confirm('Permanently delete?')">[delete]</a></td></tr><!--~end~-->
 
   </table>
   <!--~end~-->
index 00bd513..31b4fa0 100644 (file)
@@ -46,8 +46,8 @@ function people_tem_sets($username, $password, $name, $privs, $balance) {
 }
 
 # You may pass a "where clause" for the db query.
-function people_display_listing($where = 'order by username limit 100') {
-       $rows = db_get_rows('people', 'id,username', $where);
+function people_display_listing($where = 'order by name limit 100') {
+       $rows = db_get_rows('people', 'id,name,username', $where);
        if($rows == false || count($rows) == 0) {
                tem_show('empty_listing');
                tem_show('listings');
@@ -55,11 +55,12 @@ function people_display_listing($where = 'order by username limit 100') {
        }
 
        foreach($rows as $row) {
-               list($id, $username) = $row;
+               list($id, $name, $username) = $row;
                tem_set('id', $id);
                if($username == '') {
                        $username = '--';
                }
+               tem_set('name', $name);
                tem_set('username', $username);
                tem_show('listing_row');
        }
diff --git a/su.php b/su.php
index 2ff23ae..92b1b85 100644 (file)
--- a/su.php
+++ b/su.php
@@ -41,7 +41,7 @@ function _su_main() {
                return './';
        }
 
-       $rows = db_get_rows('people', 'id,name');
+       $rows = db_get_rows('people', 'id,name', 'order by name');
 
        if($rows) foreach($rows as $row) {
                list($id, $name) = $row;
index 423268a..58737a3 100644 (file)
--- a/tasks.php
+++ b/tasks.php
@@ -525,7 +525,7 @@ function tasks_edit_main() {
        } else {
                tem_show('new_msg');
                if(logged_in_as_contractor()) {
-                       pulldown('client_id', db_get_rows('people', 'id,name', 'where id > 1'), PULLDOWN_2D);
+                       pulldown('client_id', db_get_rows('people', 'id,name', 'where id > 1 order by name'), PULLDOWN_2D);
                        tem_set('client_id', format_int($_REQUEST['client_id']));
                        tem_show('client_row');
                }