Index: openacs-4/packages/invoices-portlet/lib/invoice-list.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices-portlet/lib/invoice-list.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/invoices-portlet/lib/invoice-list.tcl 31 Aug 2005 17:05:21 -0000 1.1
+++ openacs-4/packages/invoices-portlet/lib/invoice-list.tcl 9 Sep 2005 16:28:23 -0000 1.2
@@ -8,15 +8,10 @@
set page_size "25"
}
-if {![info exists package_id]} {
- set package_id [ad_conn package_id]
-}
-
if {![info exists base_url]} {
set base_url [apm_package_url_from_id $package_id]
}
-
foreach optional_param {organization_id row_list} {
if {![info exists $optional_param]} {
set $optional_param {}
@@ -27,22 +22,14 @@
set pm_base_url [apm_package_url_from_id [dotlrn_community::get_package_id_from_package_key -package_key "project-manager" -community_id $dotlrn_club_id]]
-#set package_id [ad_conn package_id]
+# Using the the same instance of invoices
+set package_id [apm_package_id_from_key invoices]
+
set community_id [dotlrn_community::get_community_id]
set date_format [lc_get formbuilder_date_format]
set timestamp_format "$date_format [lc_get formbuilder_time_format]"
-if { ![empty_string_p $community_id] } {
-
- set base_url [apm_package_key_from_id \
- [dotlrn_community::get_package_id_from_package_key \
- -package_key "invoices" \
- -community_id $community_id]]
-} else {
- set base_url "/invoices"
-}
-
set actions [list "[_ invoices.iv_invoice_New]" [export_vars -base ${base_url}/invoice-add {organization_id}] "[_ invoices.iv_invoice_New2]" "[_ invoices.iv_invoice_credit_New]" [export_vars -base ${base_url}/invoice-credit {organization_id}] "[_ invoices.iv_invoice_credit_New2]" "[_ invoices.iv_offer_2]" [export_vars -base ${base_url}/offer-list {organization_id}] "[_ invoices.iv_offer_2]" "[_ invoices.projects]" $pm_base_url "[_ invoices.projects]"]
template::list::create \
@@ -56,7 +43,7 @@
}
title {
label {[_ invoices.iv_invoice_1]}
- link_url_eval {[export_vars -base "invoice-ae" {invoice_id {mode display}}]}
+ link_url_eval {[export_vars -base "${base_url}/invoice-ae" {invoice_id {mode display}}]}
}
description {
label {[_ invoices.iv_invoice_Description]}
@@ -80,12 +67,14 @@
label {[_ invoices.iv_invoice_due_date]}
}
action {
- display_template {#invoices.Edit# #invoices.Cancel# #invoices.Delete#}
+ display_template {#invoices.Edit# #invoices.Cancel# #invoices.Delete#
+ }
}
} -actions $actions -sub_class narrow \
-page_size_variable_p 1 \
-page_size $page_size \
-page_flush_p 0 \
+ -pass_properties {base_url $base_url} \
-page_query_name iv_invoice_paginated \
-filters {organization_id {}} \
-formats {
@@ -106,9 +95,9 @@
db_multirow -extend {creator_link edit_link cancel_link delete_link} iv_invoice iv_invoice {} {
# Ugly hack. We should find out which contact package is linked
set creator_link "/contacts/$creation_user"
- set edit_link [export_vars -base "${base_url}invoice-ae" {invoice_id}]
- set cancel_link [export_vars -base "${base_url}invoice-cancellation" {organization_id {parent_id $invoice_rev_id}}]
- set delete_link [export_vars -base "${base_url}invoice-delete" {invoice_id}]
+ set edit_link [export_vars -base "${base_url}/invoice-ae" {invoice_id}]
+ set cancel_link [export_vars -base "${base_url}/invoice-cancellation" {organization_id {parent_id $invoice_rev_id}}]
+ set delete_link [export_vars -base "${base_url}/invoice-delete" {invoice_id}]
if {[empty_string_p $total_amount]} {
set total_amount 0
}