Index: trunk/bin/module_maker/list_template.cli.php
===================================================================
--- trunk/bin/module_maker/list_template.cli.php	(revision 295)
+++ trunk/bin/module_maker/list_template.cli.php	(revision 316)
@@ -54,6 +54,18 @@
         // Human readable.
         $field = $col[0];
+        $type = preg_replace('/^(\w+).*$/', '\\1', $col[1]);
         $title = ucfirst(str_replace('_', ' ', $field));
-        $type = preg_replace('/^(\w+).*$/', '\\1', $col[1]);
+
+        switch ($field) {
+        case 'added_by_user_id' :
+        case 'modified_by_user_id' :
+            $title = "by";
+            break;
+
+        case 'added_datetime' :
+        case 'modified_datetime' :
+            $title = str_replace(' datetime', '', $title);
+            break;
+        }
 
         // Get primary key.
@@ -136,8 +148,14 @@
 if (!isset($op) || 'headerrows' == $op) {
     foreach ($headers as $field=>$title) {
+        if (preg_match('/(_date|_datetime|_time|price|value|quantity)/', $field)) {
+            $ordering = 'DESC';
+        } else {
+            $ordering = 'ASC';
+        }
+
         if ($field == $primary_key) {
-            echo "        <th><\x3fphp echo \$so->printSortHeader('$db_tbl.$field', _(\"ID\"), 'ASC'); \x3f></th>\n";
+            echo "        <th><\x3fphp echo \$so->printSortHeader('$db_tbl.$field', _(\"ID\"), 'DESC'); \x3f></th>\n";
         } else {
-            echo "        <th><\x3fphp echo \$so->printSortHeader('$db_tbl.$field', _(\"$title\"), 'ASC'); \x3f></th>\n";
+            echo "        <th><\x3fphp echo \$so->printSortHeader('$db_tbl.$field', _(\"$title\"), '$ordering'); \x3f></th>\n";
         }
     }
@@ -149,6 +167,6 @@
     <\x3fphp for (\$i = 0; \$i <= \$page->last_item - \$page->first_item && \$page->total_items > 0; \$i++) { \x3f>
     <tr>
-        <td class="sc-nowrap"><a title="<\x3fphp printf(_("Edit %s"), oTxt(\$list[\$i]['__///__'])) \x3f>" href="<\x3fphp echo \$app->oHREF(\$_SERVER['PHP_SELF'] . '?op=edit&$primary_key=' . \$list[\$i]['$primary_key']); \x3f>"><img src="/admin/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0" /></a> &nbsp;</td>
-        <td class="sc-nowrap"><a title="<\x3fphp printf(_("Versions of %s"), oTxt(\$list[\$i]['__///__'])) \x3f>" href="<\x3fphp echo \$app->oHREF("/admin/versions.php?record_table=$db_tbl&record_key=$primary_key&boomerang=true&record_val=" . \$list[\$i]['$primary_key']); \x3f>"><img src="/admin/_widgets/subcategory.gif" alt="" width="18" height="14" border="0" /></a> &nbsp;</td>
+        <td class="sc-nowrap"><a title="<\x3fphp printf(_("Edit %s"), oTxt(\$list[\$i]['__///__'])) \x3f>" href="<\x3fphp echo \$app->oHREF(\$_SERVER['PHP_SELF'] . '?op=edit&$primary_key=' . \$list[\$i]['$primary_key']); \x3f>"><img src="/admin/i/pen.gif" alt="Edit" width="12" height="12" border="0" /></a> &nbsp;</td>
+        <td class="sc-nowrap"><a title="<\x3fphp printf(_("Versions of %s"), oTxt(\$list[\$i]['__///__'])) \x3f>" href="<\x3fphp echo \$app->oHREF("/admin/versions.php?record_table=$db_tbl&record_key=$primary_key&boomerang=true&record_val=" . \$list[\$i]['$primary_key']); \x3f>"><img src="/admin/i/multiple.png" alt="" width="12" height="12" border="0" /></a> &nbsp;</td>
 
 E_O_F;
@@ -164,5 +182,5 @@
 
 echo isset($op) ? '' : <<<E_O_F
-        <td class="sc-nowrap" align="right"><a title="<\x3fphp printf(_("Delete %s"), oTxt(\$list[\$i]['__///__'])) \x3f>" href="<\x3fphp echo \$app->oHREF(\$_SERVER['PHP_SELF'] . "?op=del&$primary_key=" . \$list[\$i]['$primary_key']); \x3f>" onclick"javascript:return confirm('<\x3fphp printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt(\$list[\$i]['__///__'])) \x3f>');"><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0" /></a> &nbsp;</td>
+        <td class="sc-nowrap" align="right"><a title="<\x3fphp printf(_("Delete %s"), oTxt(\$list[\$i]['__///__'])) \x3f>" href="<\x3fphp echo \$app->oHREF(\$_SERVER['PHP_SELF'] . "?op=del&$primary_key=" . \$list[\$i]['$primary_key']); \x3f>" onclick"javascript:return confirm('<\x3fphp printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt(\$list[\$i]['__///__'])) \x3f>');"><img src="/admin/i/trash.gif" alt="Delete" width="10" height="10" border="0" /></a> &nbsp;</td>
     </tr>
     <\x3fphp } \x3f>
Index: trunk/bin/module_maker/module.cli.php
===================================================================
--- trunk/bin/module_maker/module.cli.php	(revision 295)
+++ trunk/bin/module_maker/module.cli.php	(revision 316)
@@ -118,14 +118,14 @@
 // Ensure essential directories exist.
 if (!is_dir("$admin_dir")) {
-    die(basename($_SERVER['argv'][0]) . " Error: $admin_dir directory not found.\n");
+    die(basename($_SERVER['argv'][0]) . " Error: admin_dir '$admin_dir' directory not found.\n");
 }
 if (!is_dir("$admin_tpl_dir")) {
-    die(basename($_SERVER['argv'][0]) . " Error: $admin_tpl_dir directory not found.\n");
+    die(basename($_SERVER['argv'][0]) . " Error: admin_tpl_dir '$admin_tpl_dir' directory not found.\n");
 }
 if (!is_dir("$public_dir")) {
-    die(basename($_SERVER['argv'][0]) . " Error: $public_dir directory not found.\n");
+    die(basename($_SERVER['argv'][0]) . " Error: public_dir '$public_dir' directory not found.\n");
 }
 if (!is_dir("$public_tpl_dir")) {
-    die(basename($_SERVER['argv'][0]) . " Error: $public_tpl_dir directory not found.\n");
+    die(basename($_SERVER['argv'][0]) . " Error: public_tpl_dir '$public_tpl_dir' directory not found.\n");
 }
 
@@ -174,4 +174,8 @@
         $type = preg_replace('/^(\w+).*$/', '\\1', $col[1]);
         $default = $col[4];
+        
+        if (mb_strpos($default, '0000') !== false || '0' == $default) {
+            $default = '';
+        }
 
         // Get primary key.
Index: trunk/bin/module_maker/skel/adm_list.ihtml
===================================================================
--- trunk/bin/module_maker/skel/adm_list.ihtml	(revision 295)
+++ trunk/bin/module_maker/skel/adm_list.ihtml	(revision 316)
@@ -26,8 +26,8 @@
     <?php for ($i = 0; $i <= $page->last_item - $page->first_item && $page->total_items > 0; $i++) { ?>
     <tr>
-        <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Edit %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="/admin/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0" /></a> &nbsp;</td>
-        <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF('/admin/versions.php?record_table=%DB_TBL%&record_key=%PRIMARY_KEY%&boomerang=true&record_val=' . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="/admin/_widgets/subcategory.gif" alt="" width="18" height="14" border="0" /></a> &nbsp;</td>
+        <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Edit %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="/admin/i/pen.gif" alt="Edit" width="12" height="12" border="0" /></a> &nbsp;</td>
+        <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF('/admin/versions.php?record_table=%DB_TBL%&record_key=%PRIMARY_KEY%&boomerang=true&record_val=' . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="/admin/i/multiple.png" alt="" width="12" height="12" border="0" /></a> &nbsp;</td>
 %ADM_LIST_ROWS%
-        <td class="sc-padleft sc-nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . "?op=del&%PRIMARY_KEY%=" . $list[$i]['%PRIMARY_KEY%']); ?>" onclick"javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['__///__'])) ?>');"><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0" /></a> &nbsp;</td>
+        <td class="sc-padleft sc-nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . "?op=del&%PRIMARY_KEY%=" . $list[$i]['%PRIMARY_KEY%']); ?>" onclick"javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['__///__'])) ?>');"><img src="/admin/i/trash.gif" alt="Delete" width="10" height="10" border="0" /></a> &nbsp;</td>
     </tr>
     <?php } ?>
