Index: openacs-4/packages/imsld/www/imsld-finish-resource.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/imsld-finish-resource.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/imsld/www/imsld-finish-resource.tcl 20 Sep 2006 15:04:05 -0000 1.9 +++ openacs-4/packages/imsld/www/imsld-finish-resource.tcl 21 Dec 2006 15:20:47 -0000 1.10 @@ -5,7 +5,6 @@ file_url resource_item_id run_id - resource_id:optional owner_user_id:optional } @@ -23,7 +22,38 @@ }] } { imsld::grant_permissions -resources_activities_list $resource_id -user_id [ad_conn user_id] imsld::finish_resource -resource_id $resource_id -run_id $run_id +} else { + # mark the resource as finished just for monitoring purposes + db_1row context_info { + select imsld_id + from imsld_runs + where run_id = :run_id + } + set user_id [ad_conn user_id] + set resource_id [content::item::get_live_revision -item_id $resource_item_id] + db_dml insert_completed_resource { + insert into imsld_status_user ( + imsld_id, + run_id, + related_id, + user_id, + type, + status_date, + status + ) + ( + select :imsld_id, + :run_id, + :resource_id, + :user_id, + 'resource', + now(), + 'finished' + where not exists (select 1 from imsld_status_user where run_id = :run_id and user_id = :user_id and related_id = :resource_id and status = 'finished') + ) + } } + if { ![regexp {http://} $file_url] } { ad_returnredirect "[export_vars -base "$file_url" -url { file_url run_id resource_id resource_item_id owner_user_id }]" }