Index: openacs-4/contrib/packages/project-manager/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/admin/Attic/index.adp,v diff -u -r1.5 -r1.6 --- openacs-4/contrib/packages/project-manager/www/admin/index.adp 4 Jun 2004 18:38:23 -0000 1.5 +++ openacs-4/contrib/packages/project-manager/www/admin/index.adp 21 Jun 2004 22:40:25 -0000 1.6 @@ -113,5 +113,12 @@ setting up project-manager. + + Projects + Update all + This page allows you to update the deadlines of all the + projects in your installation. It will take a while. + + Index: openacs-4/contrib/packages/project-manager/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/admin/Attic/index.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/contrib/packages/project-manager/www/admin/index.tcl 4 Jun 2004 18:38:23 -0000 1.5 +++ openacs-4/contrib/packages/project-manager/www/admin/index.tcl 21 Jun 2004 22:40:25 -0000 1.6 @@ -50,6 +50,7 @@ set logger_link "logger" set logger_primary_link "logger-primary" set logger_sync_link "logger-sync" +set update_projects_link "update-projects" if {[empty_string_p $logger_URLs]} { set logger_warning "not set up" Index: openacs-4/contrib/packages/project-manager/www/admin/update-projects.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/admin/Attic/update-projects.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/project-manager/www/admin/update-projects.tcl 21 Jun 2004 22:40:25 -0000 1.1 @@ -0,0 +1,41 @@ +# /project-manager/www/admin/update-projects.tcl + +ad_page_contract { + page which updates the status of all projects and tasks + + @author jader@bread.com + @cvs-id $Id: update-projects.tcl,v 1.1 2004/06/21 22:40:25 jader Exp $ + @creation-date 11/24/03 +} { +} + +ns_log Debug "---------------------------------------------------" +ns_log Debug "Project manager: Updating all projects" + +# make sure user is administrator +set user_id [ad_conn user_id] + +permission::require_permission -party_id $user_id -object_id $user_id -privilege admin + +set context_id [ad_conn package_id] +set peeraddr [ad_conn peeraddr] + +ns_write "Updating projects and tasks + +Starting...

" + + +set projects_list [db_list get_projects "select item_id from cr_items where content_type = 'pm_project'"] + +foreach project $projects_list { + pm::project::compute_status $project + ns_write ". " +} + + +ns_log Notice "done with project update page (finally!)" + + +ns_write " +back to admin page" +