Index: openacs-4/packages/project-manager/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/index.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/project-manager/www/index.tcl 19 Feb 2007 15:54:15 -0000 1.18 +++ openacs-4/packages/project-manager/www/index.tcl 20 Feb 2007 07:53:38 -0000 1.19 @@ -2,8 +2,7 @@ ad_page_contract { - @author rhs@mit.edu - @author mbryzek@mit.edu + @author malte.sussdorff@cognovis.de @creation-date 2000-09-18 @cvs-id $Id$ @@ -76,4 +75,21 @@ } } } -set project_ids $logger_projects \ No newline at end of file + +if {$logger_projects eq ""} { + if {[apm_package_ids_from_key -package_key "logger"] eq ""} { + # No instance of logger installed, redirect to subsite admin + ad_returnredirect -message "You need to install logger first" "../admin/applications" + ad_script_abort + } + if {[application_link::get_linked -from_package_id $package_id -to_package_key "logger"] eq ""} { + # There is no link between PM and logger, redirect to admin linking + ad_returnredirect -message "Please setup the link between project manager and logger" -html "admin/linking?return_url=[ad_return_url]" + ad_script_abort + } + + # It seems we just did not setup a project yet, go directly to add project then + ad_returnredirect -message "You can start by adding a new project" "add-edit" +} else { + set project_ids $logger_projects +} \ No newline at end of file Index: openacs-4/packages/project-manager/www/admin/linking.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/admin/linking.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/project-manager/www/admin/linking.tcl 26 May 2005 09:34:30 -0000 1.1 +++ openacs-4/packages/project-manager/www/admin/linking.tcl 20 Feb 2007 07:53:39 -0000 1.2 @@ -7,6 +7,7 @@ @cvs-id $Id$ } { {keys:array,optional} + {return_url "."} } set title "[_ project-manager.Link_instances]" @@ -40,7 +41,7 @@ ad_form -extend -name linking -form [list [list keys.$key\:text(select) [list label $package_pretty_name] [list options $options_list] [list value $current_link]]] } -ad_form -extend -name linking -on_request { +ad_form -extend -name linking -export {return_url} -on_request { } -on_submit { db_transaction { application_link::delete_links -package_id $this_package_id @@ -54,7 +55,7 @@ } } } -after_submit { - ad_returnredirect . + ad_returnredirect $return_url ad_script_abort }