diff --git a/checkin_notes b/checkin_notes index 97a0b66e98..bfd1077344 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6862,3 +6862,9 @@ Charlie 20 Aug 2008 WizardAttachProject.cpp common/ wxFlatNotebook.cpp + +David 20 Aug 2008 + - lib: fix typo + + lib/ + filesys.C diff --git a/db/bossa_schema.sql b/db/bossa_schema.sql index c1b9d29a8d..2ceda93689 100644 --- a/db/bossa_schema.sql +++ b/db/bossa_schema.sql @@ -35,6 +35,7 @@ create table bossa_job_inst ( app_id integer not null, job_id integer not null, user_id integer not null, + batch_id integer not null, finish_time integer not null, timeout integer not null, calibration tinyint not null, diff --git a/html/inc/bossa_db.inc b/html/inc/bossa_db.inc index 61387806a1..d8b690feaa 100644 --- a/html/inc/bossa_db.inc +++ b/html/inc/bossa_db.inc @@ -257,10 +257,14 @@ class BossaJobInst { } $now = time(); - $clause = "(create_time, app_id, job_id, user_id, calibration) values ($now, $app->id, $job->id, $user->id, $job->calibration)"; + $clause = "(create_time, app_id, job_id, user_id, batch_id, calibration) values ($now, $app->id, $job->id, $user->id, $job->batch_id, $job->calibration)"; $id = BossaJobInst::insert($clause); return BossaJobInst::lookup_id($id); } + function delete_aux($clause) { + $db = BossaDb::get(); + return $db->delete_aux('bossa_job_inst', $clause); + } // app-callable functions // diff --git a/html/inc/bossa_example4.inc b/html/inc/bossa_example4.inc index 2cbbfe7ee6..03bc70a0a0 100644 --- a/html/inc/bossa_example4.inc +++ b/html/inc/bossa_example4.inc @@ -56,7 +56,7 @@ function job_show($job, $inst, $user) { echo " - + $f->type $c @@ -64,7 +64,7 @@ function job_show($job, $inst, $user) { "; echo " - id&action=delete&index=$i> + id&action=delete&index=$i> "; $i++; diff --git a/html/ops/bossa_admin.php b/html/ops/bossa_admin.php index 083fa3584e..ffdcb28290 100644 --- a/html/ops/bossa_admin.php +++ b/html/ops/bossa_admin.php @@ -201,7 +201,7 @@ function show_batches($app_id) { table_header("ID", "Name", "Calibration?", "Created", "Jobs", "Completed"); foreach ($batches as $batch) { table_row( - "$batch->id id>(show jobs)", + "$batch->id | id>show jobs | id>delete instances", "$batch->name", $batch->calibration?"yes":"no", time_str($batch->create_time), @@ -257,6 +257,28 @@ function show_user() { page_tail(); } +function clear_batch_confirm($batch_id) { + page_head("Confirm delete instances"); + echo " + This will permanently delete all results from this batch. +

+ Are you sure you want to do this? +

+ Yes + "; + page_tail(); +} + +function clear_batch($batch_id) { + page_head("Deleting instances"); + if (BossaJobInst::delete_aux("batch_id=$batch_id")) { + echo "Job instances deleted."; + } else { + echo "Database error."; + } + page_tail(); +} + $user = get_logged_in_user(); $db = BossaDb::get(); @@ -320,15 +342,15 @@ case 'show_user': show_user(); exit; case 'show_batches': - $app_id = $_GET['app_id']; + $app_id = get_int('app_id'); show_batches($app_id); exit; case 'show_batch': - $batch_id = $_GET['batch_id']; + $batch_id = get_int('batch_id'); show_batch($batch_id); exit; case 'job_show_insts': - $job_id = $_GET['job_id']; + $job_id = get_int('job_id'); job_show_insts($job_id); exit; case 'hide': @@ -343,6 +365,14 @@ case 'unhide': if (!$app) error_page("no such app"); $app->update("hidden=0"); break; +case 'clear_batch_confirm': + $batch_id = get_int('batch_id'); + clear_batch_confirm($batch_id); + exit; +case 'clear_batch': + $batch_id = get_int('batch_id'); + clear_batch($batch_id); + exit; case '': show_all(); exit; diff --git a/lib/filesys.C b/lib/filesys.C index 8375e8c1c0..2b283e31c3 100644 --- a/lib/filesys.C +++ b/lib/filesys.C @@ -494,11 +494,11 @@ int boinc_copy(const char* orig, const char* newf) { #elif defined(__EMX__) char cmd[1024]; sprintf(cmd, "copy \"%s\" \"%s\"", orig, newf); - return system(cmd_esc); + return system(cmd); #else char cmd[1024], cmd_esc[1024]; sprintf(cmd, "cp \"%s\" \"%s\"", orig, newf); - return system(cmd_esc); + return system(cmd); #endif }