JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fixed bugs: 1) admin couldn't edit tasks, 2) price field was never filled
authorJason Woofenden <jason283@herkamire.com>
Tue, 31 Mar 2009 23:07:15 +0000 (19:07 -0400)
committerJason Woofenden <jason283@herkamire.com>
Tue, 31 Mar 2009 23:07:15 +0000 (19:07 -0400)
people.html
people.php
tasks.php

index ed8d520..b46a3ae 100644 (file)
@@ -2,7 +2,7 @@
 
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-  <title>people entry</title>
+  <title>Account Administration</title>
   <link rel="stylesheet" href="style.css" type="text/css" />
 </head>
 
@@ -41,7 +41,7 @@
   </form>
 <!--~end~-->
 <!--~listings start~-->
-  <h2>people Listing</h2>
+  <h2>Account Administration</h2>
 
   <!--~populated_listing start~-->
   <p><a href="people.html?people_new=1">[Add a new account]</a></p>
index 60e3121..00bd513 100644 (file)
@@ -123,7 +123,7 @@ function _people_main() {
                                db_update('people', PEOPLE_DB_FIELDS, $username, $password_hash, $name, $privs, $balance, 'where id=%i', $edit_id);
                                message('Entry updated.');
                        } else {
-                               db_insert('people', PEOPLE_DB_FIELDS, $username, $password_hash, $name, $privs, $balance);
+                               db_insert('people', PEOPLE_DB_FIELDS . ',tiny_agreement', $username, $password_hash, $name, $privs, $balance, 1000);
                                message('Entry saved.');
                        }
                        if($error !== true) {
index 44ff813..6d382bc 100644 (file)
--- a/tasks.php
+++ b/tasks.php
@@ -426,7 +426,7 @@ function tasks_edit_main() {
                        }
                }
 
-               if(!logged_in_as_contractor() || $_REQUEST['client_id']) { # if you change this change the one above
+               if(!logged_in_as_contractor() || $edit_id || $_REQUEST['client_id']) { # if you change this change the one above
                        if($edit_id) {
                                $tables = 'title,url,description,state';
                                $values = array($title, $url, $description, $state);
@@ -495,7 +495,7 @@ function tasks_edit_main() {
                # fix their entry in whatever way you require.
        } elseif($edit_id) {
                # we've recieved an edit id, but no data. So we grab the values to be edited from the database
-               list($title, $url, $description, $state, $paid) = db_get_row('tasks', 'title,url,description,state,price', 'where id=%i', $edit_id);
+               list($title, $url, $description, $state, $price) = db_get_row('tasks', 'title,url,description,state,price', 'where id=%i', $edit_id);
                tasks_tem_sets($title, $url, $description, $price);
        } else {
                # form not submitted, you can set default values like so: