From fa236b27bfc3bc87902f0a92d0d017b9f2d444be Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Tue, 31 Mar 2009 19:07:15 -0400 Subject: [PATCH] fixed bugs: 1) admin couldn't edit tasks, 2) price field was never filled --- people.html | 4 ++-- people.php | 2 +- tasks.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/people.html b/people.html index ed8d520..b46a3ae 100644 --- a/people.html +++ b/people.html @@ -2,7 +2,7 @@ - people entry + Account Administration @@ -41,7 +41,7 @@ -

people Listing

+

Account Administration

[Add a new account]

diff --git a/people.php b/people.php index 60e3121..00bd513 100644 --- a/people.php +++ b/people.php @@ -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) { diff --git a/tasks.php b/tasks.php index 44ff813..6d382bc 100644 --- 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: -- 1.7.10.4