Index: openacs-4/packages/project-manager/lib/mail-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/mail-portlet.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/project-manager/lib/mail-portlet.tcl 4 Oct 2005 16:51:11 -0000 1.1 +++ openacs-4/packages/project-manager/lib/mail-portlet.tcl 14 Oct 2005 17:58:35 -0000 1.2 @@ -7,12 +7,17 @@ # @creation-date 2005-05-01 set default_layout_url [parameter::get -parameter DefaultPortletLayoutP] +set dotlrn_installed_p [apm_package_installed_p dotlrn] -set community_id [dotlrn_community::get_community_id] -if { ![empty_string_p $community_id] } { - set package_id [dotlrn_community::get_package_id_from_package_key \ - -package_key project-manager \ - -community_id $community_id] +if { $dotlrn_installed_p } { + set community_id [dotlrn_community::get_community_id] + if { ![empty_string_p $community_id] } { + set package_id [dotlrn_community::get_package_id_from_package_key \ + -package_key project-manager \ + -community_id $community_id] + } else { + set package_id [ad_conn package_id] + } } else { set package_id [ad_conn package_id] } Index: openacs-4/packages/project-manager/www/reports.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/reports.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/project-manager/www/reports.tcl 19 Sep 2005 20:51:13 -0000 1.1 +++ openacs-4/packages/project-manager/www/reports.tcl 14 Oct 2005 17:58:36 -0000 1.2 @@ -18,6 +18,9 @@ set optional_unset_list [list status_id] +# Check if contacts is installed +set invoices_installed_p [apm_package_installed_p invoices] + foreach optional_unset $optional_unset_list { if {[info exists $optional_unset]} { if {[empty_string_p [set $optional_unset]]} { @@ -143,13 +146,16 @@ set planned_end_date [lindex $project 2] set offer_item_id [pm::project::get_iv_offer -project_item_id $project_item_id] set offer_id [content::item::get_latest_revision -item_id $offer_item_id] - set billed_p [iv::offer::billed_p -offer_id $offer_id] - if { $billed_p } { - set amount_total [db_string get_amount_total { }] - if { $amount_total >= $min_amount } { - template::multirow append projects $title $amount_total 0 $planned_end_date - } - } + + if { $invoices_installed_p } { + set billed_p [iv::offer::billed_p -offer_id $offer_id] + if { $billed_p } { + set amount_total [db_string get_amount_total { }] + if { $amount_total >= $min_amount } { + template::multirow append projects $title $amount_total 0 $planned_end_date + } + } + } } } else { # We accumulate the amount_total and the number of billed projects to show on the list @@ -160,14 +166,17 @@ set title [lindex $project 1] set offer_item_id [pm::project::get_iv_offer -project_item_id $project_item_id] set offer_id [content::item::get_latest_revision -item_id $offer_item_id] - set billed_p [iv::offer::billed_p -offer_id $offer_id] - if { $billed_p } { - set amount_total [db_string get_amount_total { }] - if { $amount_total >= $min_amount } { - set tot_proj_amount [expr $tot_proj_amount + $amount_total] - incr projects_num - } - } + + if { $invoices_installed_p } { + set billed_p [iv::offer::billed_p -offer_id $offer_id] + if { $billed_p } { + set amount_total [db_string get_amount_total { }] + if { $amount_total >= $min_amount } { + set tot_proj_amount [expr $tot_proj_amount + $amount_total] + incr projects_num + } + } + } } template::multirow append projects "[_ project-manager.Projects]" $tot_proj_amount $projects_num "- - - - - - - - - - -" }