X-Git-Url: https://jasonwoof.com/gitweb/?p=contractor-progress.git;a=blobdiff_plain;f=tasks.php;h=e923b21b0bd02acf515121a149dd7077fffc291d;hp=04438896e2c9f2d9ed5b16272cc083c048a95f16;hb=db0666968543559bb521f3a7c15ff4c8ab2f7661;hpb=5cc6274a058be9a9cf9d7d3e1d169870cad90353 diff --git a/tasks.php b/tasks.php index 0443889..e923b21 100644 --- a/tasks.php +++ b/tasks.php @@ -46,6 +46,12 @@ function _tasks_main() { tem_show('editing'); } + if(isset($_REQUEST['tasks_new_bug'])) { + tem_show('bug_submit'); + } else { + tem_show('normal_submits'); + } + $delete_id = format_int($_REQUEST['tasks_delete_id']); unset($_REQUEST['tasks_delete_id']); if($delete_id) { @@ -62,22 +68,25 @@ function _tasks_main() { if(isset($_REQUEST['title'])) { list($title, $url, $description) = tasks_get_fields(); + # FIXME + if(isset($_REQUEST['save_draft'])) { + $state = TASK_DRAFT; + } elseif(isset($_REQUEST['save_bug'])) { + $state = TASK_BUG; + } else { + $state = TASK_NEEDS_QUOTE; + } + if("you're happy with the POSTed values") { if($edit_id) { - db_update('tasks', 'title,url,description,state', $title, $url, $description, $state, $paid = 0, 'where id=%i', $edit_id); + db_update('tasks', 'title,url,description,state', $title, $url, $description, $state, 'where id=%i', $edit_id); message('Task updated.'); } else { # new task $paid = 0; - if(isset($_REQUEST['save_draft'])) { - $state = TASK_DRAFT; - } else { - $state = TASK_NEEDS_QUOTE; - } $client_id = 4; # FIXME db_insert('tasks', 'client_id,title,url,description,state,paid', $client_id, $title, $url, $description, $state, $paid); message('Task saved.'); - return './'; } if($GLOBALS['tasks_form_recipient'] != "fixme@example.com") { $to = $GLOBALS['tasks_form_recipient']; @@ -99,8 +108,7 @@ function _tasks_main() { } } if($error !== true) { - tem_show('thankyou'); - return; + return './'; } } # otherwise, we display the form again. tasks_get_fields() has